Пример #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTmTchr()
 {
     return $this->hasOne(Teacher::className(), ['tchr_id' => 'tm_tchr_id']);
 }
Пример #2
0
 public function getUserTeacher()
 {
     return $this->hasOne(Teacher::className(), ['tchr_id' => 'usr_type_id']);
 }
Пример #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTeacherStudents()
 {
     return $this->hasMany(Teacher::className(), ['id' => 'teacher_id'])->viaTable('{{%teacher_student}}', ['student_id' => 'id']);
 }
Пример #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTeacher()
 {
     return $this->hasOne(Teacher::className(), ['id' => 'teacher_id']);
 }
Пример #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTmTchrs()
 {
     return $this->hasMany(Teacher::className(), ['tchr_id' => 'tm_tchr_id'])->viaTable('teacher_matrix', ['tm_crs_id' => 'crs_id']);
 }
Пример #6
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['student_id', 'teacher_id'], 'required'], [['student_id', 'teacher_id'], 'integer'], ['student_id', 'exist', 'targetClass' => Student::className(), 'targetAttribute' => 'id', 'message' => 'Ученик с таким id не найден'], ['teacher_id', 'exist', 'targetClass' => Teacher::className(), 'targetAttribute' => 'id', 'message' => 'Учитель с таким id не найден']];
 }