/** * @return \yii\db\ActiveQuery */ public function getStore() { return $this->hasOne(Store::className(), ['id' => 'store_id']); }
/** * @return \yii\db\ActiveQuery */ public function getStores() { return $this->hasMany(Store::className(), ['school_id' => 'id'])->where(['<>', 'status', Store::STATUS_DISABLED])->orderBy('name ASC'); }