src/ngrest/base/NgRestModel.php
protected function generateNgRestRelations()
    {
        $relations = [];
        // generate relations
        foreach ($this->ngRestRelations() as $key => $item) {
            /** @var $item \luya\admin\ngrest\base\NgRestRelationInterface */
            if (!$item instanceof NgRestRelation) {
                if (!isset($item['class'])) {
                    $item['class'] = 'luya\admin\ngrest\base\NgRestRelation';
                }
                $item = Yii::createObject($item);
            }
            $item->setModelClass($this->className());
            $item->setArrayIndex($key);
            
            $relations[$key] = $item;
        }

        return $relations;
    }
protected function generateNgRestRelations()
    {
        $relations = [];
        // generate relations
        foreach ($this->ngRestRelations() as $key => $item) {
            /** @var $item \luya\admin\ngrest\base\NgRestRelationInterface */
            if (!$item instanceof NgRestRelation) {
                if (!isset($item['class'])) {
                    $item['class'] = 'luya\admin\ngrest\base\NgRestRelation';
                }
                $item = Yii::createObject($item);
            }
            $item->setModelClass($this->className());
            $item->setArrayIndex($key);
            
            $relations[$key] = $item;
        }

        return $relations;
    }
protected function generateNgRestRelations ( ) { $ relations = [ ] ; // generate relations foreach ( $ this -> ngRestRelations ( ) as $ key => $ item ) { /** @var $item \luya\admin\ngrest\base\NgRestRelationInterface */ if ( ! $ item instanceof NgRestRelation ) { if ( ! isset ( $ item [ 'class' ] ) ) { $ item [ 'class' ] = 'luya\admin\ngrest\base\NgRestRelation' ; } $ item = Yii :: createObject ( $ item ) ; } $ item -> setModelClass ( $ this -> className ( ) ) ; $ item -> setArrayIndex ( $ key ) ; $ relations [ $ key ] = $ item ; } return $ relations ; }
Generate an array with NgRestRelation objects

@return array
@since 2.0.0
Generate an array with NgRestRelation objects