Example #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['parent' => 'id']);
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'category_id']);
 }
Example #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAccountantCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'accountant_category_id']);
 }