public function isAttached($topicId, $attachedCount = false)
{
$topic = $this->em->getRepository('Newscoop\\Entity\\ArticleTopic')->getTheOccurrenceOfTheTopic($topicId)->getSingleScalarResult();
$count = (int) $topic;
if ($attachedCount) {
if ($count > 0) {
return array($count, true);
}
return array($count, false);
}
if ($count > 0) {
return true;
}
return false;
}