store\components\behaviors\DCategoryTreeBehavior::getAssocList PHP Метод

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

..)
public getAssocList ( mixed $parent ) : array
$parent mixed number, object or array of numbers
Результат array
    public function getAssocList($parent = 0)
    {
        $this->cached();
        $items = $this->getFullAssocData([$this->primaryKeyAttribute, $this->titleAttribute, $this->parentAttribute], $parent);
        $associated = [];
        foreach ($items as $item) {
            $associated[$item[$this->primaryKeyAttribute]] = $item;
        }
        $items = $associated;
        $result = [];
        foreach ($items as $item) {
            $titles = [$item[$this->titleAttribute]];
            $temp = $item;
            while (isset($items[(int) $temp[$this->parentAttribute]])) {
                $titles[] = $items[(int) $temp[$this->parentAttribute]][$this->titleAttribute];
                $temp = $items[(int) $temp[$this->parentAttribute]];
            }
            $result[$item[$this->primaryKeyAttribute]] = implode(' - ', array_reverse($titles));
        }
        return $result;
    }