示例#1
0
 public function getCategory()
 {
     $data = $this->hasMany(EventCategory::className(), ['Id' => 'categoryId'])->via('eventMap');
     $ret = [];
     foreach ($data as $model) {
         $ret[] = $model->Id;
     }
     return $ret;
 }
示例#2
0
 public function getCategory()
 {
     if (isset($this->_categoty)) {
         return $this->_categoty;
     } else {
         return $this->hasMany(EventCategory::className(), ['Id' => 'categoryId'])->via('eventMap');
     }
 }
示例#3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategory()
 {
     return $this->hasOne(EventCategory::className(), ['Id' => 'categoryId']);
 }