Newscoop\NewscoopBundle\Services\TopicService::isFollowed PHP Метод

isFollowed() публичный Метод

If $attachedCount is set to yes, returns an array with the number of topics attached to articles, else returns boolean. By default set to false.
public isFollowed ( string | integer $topicId ) : boolean | array
$topicId string | integer Topic id
Результат boolean | array
    public function isFollowed($topicId)
    {
        $topic = $this->em->getRepository('Newscoop\\Entity\\UserTopic')->getTheOccurrenceOfTheUserTopic($topicId)->getSingleScalarResult();
        $count = (int) $topic;
        if ($count > 0) {
            return true;
        }
        return false;
    }