Newscoop\Services\UserTopicService::findTopic PHP Method

findTopic() public method

Find topic
public findTopic ( integer $id ) : Newscoop\NewscoopBundle\Entity\Topic
$id integer
return Newscoop\NewscoopBundle\Entity\Topic
    public function findTopic($id)
    {
        $topic = $this->em->getRepository('Newscoop\\NewscoopBundle\\Entity\\Topic')->findOneBy(array('id' => $id));
        if (!$topic) {
            return;
        }
        return $topic;
    }