public function getOneByUserAndPublication($userId, $publicationId) { $subscription = $this->em->getRepository('Newscoop\\Subscription\\Subscription')->findOneBy(array('user' => $userId, 'publication' => $publicationId)); return $subscription; }