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