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;
    }