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

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

Returns a topic object identified by the full name in the format topic_name:language_code.
public getTopicByFullName ( string $fullName ) : Topic | null
$fullName string Topic's full name
Результат Newscoop\NewscoopBundle\Entity\Topic | null object
    public function getTopicByFullName($fullName)
    {
        $extractedData = $this->extractNameAndLanguage($fullName);
        if (empty($extractedData)) {
            return;
        }
        $name = $extractedData['name'];
        $languageCode = $extractedData['locale'];
        $topicTranslation = $this->em->getRepository('Newscoop\\NewscoopBundle\\Entity\\TopicTranslation')->findOneBy(array('content' => $name, 'locale' => $languageCode, 'field' => 'title'));
        if (!$topicTranslation) {
            return;
        }
        return $topicTranslation->getObject();
    }