Newscoop\NewscoopBundle\Entity\Repository\TopicRepository::getReadablePath PHP Method

getReadablePath() public method

Gets topic's path.
public getReadablePath ( Topic $topic, $locale = null ) : string
$topic Newscoop\NewscoopBundle\Entity\Topic Topic
return string Path of the topic
    public function getReadablePath(Topic $topic, $locale = null)
    {
        $pathQuery = $this->getPathQuery($topic);
        if (!$locale) {
            $locale = $this->getTranslatableTopicLocale($topic);
        }
        $this->setTranslatableHint($pathQuery, $locale);
        $path = $pathQuery->getArrayResult();
        $pathStr = '';
        foreach ($path as $element) {
            $pathStr = $pathStr . ' / ' . $element['title'];
        }
        return $pathStr;
    }