private function linkFiles() { if (ProgramFile::find()->where(['id_program' => $this->model->id])->exists()) { return Html::a('Документы', ['/file/main/program', 'id' => $this->model->id], ['class' => 'linkedFiles']); } else { return ''; } }
protected function getIdFaculty($id, $parent = false) { if ($parent) { $model = Program::findOne($id); return $model->id_faculty; } else { $model = ProgramFile::find()->where(['id_file' => $id])->one(); return $this->getIdFaculty($model->id_program, true); } }