120], [['name'], 'unique'], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => Yii::t('app', 'Identifier'), 'name' => Yii::t('regions', 'Region'), 'icount' => Yii::t('items', 'Total items count'), 'ccount' => Yii::t('items', 'Total items checked'), ]; } /** * Выполнение запроса для [[Locations]]. * * @return \yii\db\ActiveQuery */ public function getLocations() { return $this->hasMany(Locations::className(), [ 'region_id' => 'id' ]); } /** * Выполнение запроса для [[Items]]. * * @return \yii\db\ActiveQuery */ public function getMoving() { return $this->getLocations()->select(Moving::tableName() . '.*')->joinWith('moving'); } public function getItems() { return $this->getMoving()->select(Items::tableName() . '.*')->joinWith('items'); } }