예제 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'category_id']);
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getParent()
 {
     return $this->hasOne(Category::className(), ['id' => 'parent_id']);
 }
예제 #3
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['category_id', 'filter_type', 'input_type'], 'integer'], [['category_id'], 'exist', 'skipOnError' => true, 'targetClass' => Category::className(), 'targetAttribute' => ['category_id' => 'id']], [['filter_type'], 'exist', 'skipOnError' => true, 'targetClass' => FilterType::className(), 'targetAttribute' => ['filter_type' => 'id']], [['input_type'], 'exist', 'skipOnError' => true, 'targetClass' => FilterInputType::className(), 'targetAttribute' => ['input_type' => 'id']]];
 }