/** * Get the corresponding nav item type for this type object */ public function getNavItem() { return $this->hasOne(NavItem::className(), ['nav_item_type_id' => 'id'])->where(['nav_item_type' => static::getNummericType()]); }
/** * Return all nav items related to this object. * * @return \yii\db\ActiveQuery */ public function getNavItems() { return $this->hasMany(NavItem::className(), ['nav_id' => 'id']); }