예제 #1
0
 public function getMemberships()
 {
     return $this->hasMany(Membership::className(), ['merchant_brand_fk' => '_id']);
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMemberships()
 {
     return $this->hasMany(Membership::className(), ['command_id' => 'id']);
 }
예제 #3
0
 /**
  * @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;
     }
 }