/**
  * @return \yii\db\ActiveQuery
  */
 public function getContract()
 {
     if ($this->getContractType() == self::CONTRACT_TYPE) {
         return $this->hasOne(Contract::className(), ['id' => 'contract_id']);
     } elseif ($this->getContractType() == self::MEMBERSHIP_TYPE) {
         return $this->hasOne(Membership::className(), ['id' => 'contract_id']);
     } else {
         return null;
     }
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getContracts()
 {
     return $this->hasMany(Contract::className(), ['command_from_id' => 'id']);
 }
Beispiel #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getContracts()
 {
     return $this->hasMany(Contract::className(), ['season_id' => 'id']);
 }