store\components\behaviors\DCategoryTreeBehavior::getFullTitle PHP Method

getFullTitle() public method

Constructs full title for current model
public getFullTitle ( $inverse = false, string $separator = ' - ' ) : string
$separator string
return string
    public function getFullTitle($inverse = false, $separator = ' - ')
    {
        $titles = [$this->getOwner()->{$this->titleAttribute}];
        $item = $this->getOwner();
        $i = 50;
        while ($i-- && $this->cached($item)->{$this->parentRelation}) {
            $titles[] = $item->{$this->parentRelation}->{$this->titleAttribute};
            $item = $item->{$this->parentRelation};
        }
        return implode($inverse ? $titles : array_reverse($titles), $separator);
    }