private function createTreeArray()
    {
        $tree = [];

        foreach($this->models as $model) {
            $tree[] = [
                'id' => $model->{$this->id},
                'parent_id' => $model->{$this->parent_id},
                'model' => $model,
            ];
        }

        return $tree;
    }
private function createTreeArray()
    {
        $tree = [];

        foreach($this->models as $model) {
            $tree[] = [
                'id' => $model->{$this->id},
                'parent_id' => $model->{$this->parent_id},
                'model' => $model,
            ];
        }

        return $tree;
    }
private function createTreeArray ( ) { $ tree = [ ] ; foreach ( $ this -> models as $ model ) { $ tree [ ] = [ 'id' => $ model -> { $ this -> id } , 'parent_id' => $ model -> { $ this -> parent_id } , 'model' => $ model , ] ; } return $ tree ; }
Create tree array from models.
@return array tree array
Create tree array from models .