示例#1
0
 /**
  * @establish a relationship with client or website model
  */
 public function getCow()
 {
     if ($this->belong_to == 1) {
         return $this->hasOne(Client::className(), ['id' => 'clients_or_webs_id']);
     } elseif ($this->belong_to == 2) {
         return $this->hasOne(Website::className(), ['id' => 'clients_or_webs_id']);
     }
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getClient()
 {
     return $this->hasOne(Client::className(), ['id' => 'client_id']);
 }
示例#3
0
文件: Event.php 项目: Sywooch/arenda
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdClient()
 {
     return $this->hasOne(Client::className(), ['id' => 'id_client']);
 }
示例#4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getClients()
 {
     return $this->hasMany(Client::className(), ['client_type_id' => 'id']);
 }
示例#5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getClients()
 {
     return $this->hasMany(Client::className(), ['discipline_id' => 'id']);
 }
示例#6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getClients()
 {
     return $this->hasMany(Client::className(), ['iddirection' => 'id']);
 }
示例#7
0
 public function getClient()
 {
     // GroupClient has_one Group via Group.id -> groups_id
     return $this->hasOne(Client::className(), ['id' => 'clients_id']);
 }