Exemplo n.º 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSubdistrict()
 {
     return $this->hasOne(Subdistrict::className(), ['id' => 'subdistrict_id']);
 }
Exemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSubdistricts()
 {
     return $this->hasMany(Subdistrict::className(), ['district_id' => 'id'])->andFilterWhere(['like', 'recordStatus', Subdistrict::RECORDSTATUS_USED]);
 }
 /**
  * Provide data for Depdrop options
  * @param type $selected
  *
  * @return mixed
  */
 public function actionDepdropOptions($selected = 0)
 {
     echo \common\helpers\DepdropHelper::getOptionData(['modelClass' => Subdistrict::className(), 'parents' => ['district_id' => function ($value) {
         return $value > 0 ? $value : "";
     }], 'filter' => ['recordStatus' => Subdistrict::RECORDSTATUS_USED], 'selected' => $selected]);
 }
Exemplo n.º 4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSubdistricts()
 {
     return $this->hasMany(Subdistrict::className(), ['district_id' => 'id'])->andFilterWhere(['like', 'status', Subdistrict::STATUS_ACTIVE]);
 }