/** * @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']); }
public function getChildItemsJunctions() { return $this->hasMany(ItemChild::className(), ['parent_name' => 'name']); }
public function getItemsJunctions() { return $this->hasMany(ItemChild::className(), ['nav_id' => 'id']); }