예제 #1
0
 /**
  * Relations
  */
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'cid'])->where(['status' => Category::STATUS_ACTIVE]);
 }
예제 #2
0
 /**
  * Relations
  */
 public function getParent()
 {
     return $this->hasOne(Category::className(), ['id' => 'pid'])->where(['status' => self::STATUS_ACTIVE]);
 }