/**
  * @return \yii\db\ActiveQuery
  */
 public function getDepartments()
 {
     return $this->hasMany(Departments::className(), ['companies_company_id' => 'company_id']);
 }
Exemple #2
0
 public function getDepart()
 {
     return $this->hasOne(Departments::className(), ['id' => 'department_id']);
 }
Exemple #3
0
 public function getDeptool()
 {
     // ความสัมพันธ์จาก tools ไปหา departments
     return $this->hasOne(Departments::className(), ['id' => 'department_id']);
 }
Exemple #4
0
 public function getDepartments()
 {
     return $this->hasOne(Departments::className(), ['id' => 'iddepartment'])->viaTable(Expenses::tableName(), ['id' => 'idexpense']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDepartments()
 {
     return $this->hasMany(Departments::className(), ['branches_branch_id' => 'branch_id']);
 }