/** * @return ActiveQuery */ public function getPervaya_rabota_fiz_lica_v_briop_rel() { $query = parent::getRaboty_fiz_lica_rel()->where(['organizaciya' => Organizaciya::ID_BRIOP]); $query->multiple = false; return $query; }
/** * @param FizLico $model * @param mixed $key * @param int $index * @return string */ public function renderDataCellContent($model, $key, $index) { foreach ($model->getRaboty_fiz_lica_rel()->each() as $rabota) { $raboty[] = $this->renderRabota($rabota); } return isset($raboty) ? Html::ul($raboty, ['class' => 'raboty', 'encode' => false]) : $this->grid->emptyCell; }
private function rukovoditeliKursov() { if ($this->_rukovoditeliKursov === null) { $data = FizLico::find()->joinWith('polzovateli_rel')->orderBy('familiya, imya, otchestvo')->groupBy('fiz_lico.id')->where(Yii::$app->db->quoteValue(Rol::RUKOVODITEL_KURSOV) . ' = any ([[roli]])')->asArray()->all(); $this->_rukovoditeliKursov = ArrayHelper::map($data, 'id', function ($fizLico) { return Yii::$app->formatter->asFizLico($fizLico); }); } return $this->_rukovoditeliKursov; }
/** * @return ActiveQuery */ public function getFiz_lico_rel() { return $this->hasOne(FizLico::className(), ['id' => 'fiz_lico'])->inverseOf('raboty_fiz_lica_rel'); }
public function init() { parent::init(); $this->modules = ['raspisanie' => RaspisanieModule::className(), 'potok' => PotokModule::className()]; $this->activeRelationMap = [\app\records\FizLico::className() => FizLico::className(), \app\records\Kurs::className() => Kurs::className(), \app\records\RabotaFizLica::className() => RabotaFizLica::className()]; }
/** * @return ActiveQuery */ public function getPrepodavatel_rel() { return $this->hasOne(FizLico::className(), ['id' => 'prepodavatel']); }
/** * @return ActiveQuery */ public function getFiz_lica_rel() { return $this->hasMany(FizLico::className(), ['id' => 'fiz_lico'])->viaTable('kurs_fiz_lica', ['kurs' => 'id']); }
/** * @param $kurs * @return ActiveQuery */ public static function findForKurs($kurs) { return parent::find()->select(['fiz_lico.*', 'kurs' => 'kurs_fiz_lica.kurs', 'status' => 'kurs_fiz_lica.status', 'iup' => 'kurs_fiz_lica.iup'])->with('raboty_fiz_lica_rel')->joinWith('kursy_fiz_lica_rel', false)->where(['kurs_fiz_lica.kurs' => $kurs]); }
public function rules() { return [['kategorii_slushatelej', 'required'], ['kategorii_slushatelej', 'each', 'rule' => ['integer', 'min' => 1]], ['kategorii_slushatelej_input', 'filter', 'filter' => $this->emptyRemover()], ['kategorii_slushatelej_input', 'each', 'rule' => [SqueezeLineFilter::className()]], ['kategorii_slushatelej_input', 'each', 'rule' => [NazvanieValidator::className()]], ['nazvanie', 'required'], ['nazvanie', SqueezeLineFilter::className()], ['nazvanie', NazvanieValidator::className()], ['annotaciya', SqueezeTextFilter::className()], ['annotaciya', 'default'], ['raschitano_chasov', 'required'], ['raschitano_chasov', ChasyObucheniyaValidator::className()], ['formy_obucheniya_widget', 'each', 'rule' => [Enum2Validator::className(), 'enum' => FormaObucheniya::className()]], ['formy_obucheniya_widget', 'default'], ['ochnoe_nachalo', DateValidator::className(), 'timestampAttribute' => 'ochnoe_nachalo'], ['ochnoe_konec', DateValidator::className(), 'timestampAttribute' => 'ochnoe_konec'], ['zaochnoe_nachalo', DateValidator::className(), 'timestampAttribute' => 'zaochnoe_nachalo'], ['zaochnoe_konec', DateValidator::className(), 'timestampAttribute' => 'zaochnoe_konec'], [['ochnoe_nachalo', 'ochnoe_konec', 'zaochnoe_nachalo', 'zaochnoe_konec'], 'default'], ['raschitano_slushatelej', 'integer', 'min' => 0], ['raschitano_slushatelej', 'default'], ['rukovoditel', 'exist', 'targetClass' => FizLico::className(), 'targetAttribute' => 'id'], ['rukovoditel', 'default'], ['finansirovanie', 'required'], ['finansirovanie', Enum2Validator::className(), 'enum' => TipFinansirovaniya::className()], ['tip', 'required'], ['tip', Enum2Validator::className(), 'enum' => TipKursa::className()], ['plan_prospekt_god', 'required'], ['plan_prospekt_god', 'in', 'range' => ['2015-01-01', '2016-01-01', '2017-01-01', '2018-01-01']], ['iup', 'boolean'], ['iup', 'default', 'value' => false]]; }