コード例 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDeptNo()
 {
     return $this->hasOne(\giiant\sakila\models\Departments::className(), ['dept_no' => 'dept_no']);
 }
コード例 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDeptNos0()
 {
     return $this->hasMany(\giiant\sakila\models\Departments::className(), ['dept_no' => 'dept_no'])->viaTable('dept_manager', ['emp_no' => 'emp_no']);
 }