Esempio n. 1
0
 /**
  * @return $this
  */
 public function getWorkplace()
 {
     return $this->hasMany(Workplaces::className(), ['id' => 'workplace_id'])->viaTable('wp_owners', ['employee_id' => 'id']);
 }
Esempio n. 2
0
 /**
  * Связываем таблицу устройств с таблицей рабочих мест
  * @return \yii\db\ActiveQuery
  */
 public function getWorkplace()
 {
     return $this->hasOne(Workplaces::className(), ['id' => 'workplace_id']);
 }