Exemple #1
0
 /**
  * @return $this
  */
 public function getOwner()
 {
     $res = $this->hasMany(Employees::className(), ['id' => 'employee_id'])->viaTable('wp_owners', ['workplace_id' => 'id']);
     //var_dump($res);
     return $res;
 }
Exemple #2
0
 public function getEmployee()
 {
     return $this->hasOne(Employees::className(), ['id' => 'id_employee']);
 }
Exemple #3
0
 public function getEmployee()
 {
     return $this->hasOne(Employees::className(), ['id' => 'employee_id'])->viaTable('wp_owners', ['workplace_id' => 'workplace_id']);
 }
Exemple #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEmployees()
 {
     return $this->hasMany(Employees::className(), ['office_id' => 'office_id']);
 }