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

getPath() public method

Constructs full path for current model
public getPath ( string $separator = '/' ) : string
$separator string
return string
    public function getPath($separator = '/')
    {
        $uri = [$this->getOwner()->{$this->aliasAttribute}];
        $category = $this->getOwner();
        $i = 10;
        while ($i-- && $this->cached($category)->{$this->parentRelation}) {
            $uri[] = $category->{$this->parentRelation}->{$this->aliasAttribute};
            $category = $category->{$this->parentRelation};
        }
        return implode(array_reverse($uri), $separator);
    }