public function checkTopicName($locale, $title)
{
$topicTranslation = $this->getTopicRepository()->createQueryBuilder('t')->select('count(t)')->join('t.translations', 'tt')->where('tt.locale = :locale')->andWhere('tt.content = :title')->andWhere("tt.field = 'title'")->setParameters(array('title' => $title, 'locale' => $locale))->getQuery()->getSingleScalarResult();
if ((int) $topicTranslation > 0) {
return true;
}
return false;
}