/**
  * @return ActiveQuery
  * @throws ErrorException
  */
 public function getNavItemsChild()
 {
     if (!$this instanceof ActiveRecord) {
         throw new ErrorException(__CLASS__ . ' is not instance of yii\\db\\ActiveRecord.');
     }
     /** @var ActiveRecord $this */
     /** @var ActiveQuery $query */
     $query = $this->hasMany(ItemChild::className(), ['nav_id' => 'id'])->via('nav');
     return $query->where(['parent_name' => 'root']);
 }
Ejemplo n.º 2
0
 public function getChildItemsJunctions()
 {
     return $this->hasMany(ItemChild::className(), ['parent_name' => 'name']);
 }
Ejemplo n.º 3
0
 public function getItemsJunctions()
 {
     return $this->hasMany(ItemChild::className(), ['nav_id' => 'id']);
 }