Newscoop\NewscoopBundle\Services\TopicService::getTopicBy PHP 메소드

getTopicBy() 공개 메소드

$string parameter value can be: "test", 20, "test:en".
public getTopicBy ( string $string, string | null $locale = null ) : Topic | null
$string string Topic search phrase
$locale string | null Locale
리턴 Newscoop\NewscoopBundle\Entity\Topic | null
    public function getTopicBy($string, $locale = null)
    {
        $topic = $this->getTopicRepository()->getTopicByIdOrName($string, $locale)->getOneOrNullResult();
        if (!$topic) {
            $topic = $this->getTopicByFullName($string);
            if (!$topic) {
                return;
            }
        }
        return $topic;
    }