/** * @param boolean $includeRegion Include or not Buryatia in resulting set * @return EntityQuery */ public static function findBurRajon($includeRegion = false) { $burRegionId = ZnachenieIdentifikatora::get()->regionBuryatia; $where = ['and', ['roditel_urovnya_regiona' => $burRegionId], ['or', ['uroven' => UrovenAdresnogoObjekta::asSql(UrovenAdresnogoObjekta::RAJON)], ['uroven' => UrovenAdresnogoObjekta::asSql(UrovenAdresnogoObjekta::GOROD)]]]; $query = static::find()->commonOnly()->where($where); return $includeRegion ? $query->orWhere(['id' => $burRegionId]) : $query; }
public function setDefaultsIfEmpty() { if (array_filter($this->getAttributes())) { return; } $ids = ZnachenieIdentifikatora::get(); $this->rabotaOrgAdres = $ids->gorodUlanUde; $this->rabotaOrgVedomstvo = $ids->vedomstvoMinobrnauki; $this->rabotaDolzhnostId = $ids->dolzhnostUchitel; $this->rabotaEtapObrazovaniya = EtapObrazovaniya::OSNOVNOE_OBSCHEE_OBRAZOVANIE; }
public function getZnachenieIdentifikatoraDolzhnostiUchitelRel() { return $this->hasOne(ZnachenieIdentifikatora::className(), ['dolzhnost_uchitel' => 'id'])->inverseOf('dolzhnostUchitelRel'); }