private function unsubscribeShow($showId) { $show = $this->dm->getRepository('AppBundle:AbstractShow')->find($showId); if (!$show) { return 'Сериал не найден'; } if (!$this->user->getSubscribedShows()->contains($show)) { return 'Вы не подписаны на этот сериал'; } else { $this->user->removeSubscribedShow($show); $this->dm->flush(); return 'Вы отписались от сериала ' . $show->getTitle(); } }