/** * @return static */ public function getCategory() { return $this->hasOne(Category::className(), ['id' => 'category_id'])->via('menuItemContent'); }
public function getCategories() { return $this->hasMany(Category::className(), ['mid' => 'mid'])->where('type=:type', [':type' => Category::TYPE])->viaTable(Relationship::tableName(), ['cid' => 'cid']); }
public function getChildren() { return $this->hasMany(Category::className(), ['parent_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getCategory() { return $this->hasOne(Category::className(), ['id' => 'category_id']); }
/** * @return array */ public function actions() { return ['update-cat' => ['class' => crudActionUpdate::className(), 'modelClass' => Category::className(), 'view' => 'update-cat', 'onAfterAction' => [$this, 'afterSaveCategory']], 'delete-cat' => ['class' => crudActionDelete::className(), 'modelClass' => Category::className(), 'onAfterAction' => [$this, 'afterDeleteCategory']], 'insert-product' => ['class' => crudActionCreate::className(), 'modelClass' => Product::className(), 'attributes' => ['parents' => (array) Yii::$app->getRequest()->get('cat_id')], 'view' => 'update-product', 'onAfterAction' => [$this, 'afterSaveProduct']], 'update-product' => ['class' => crudActionUpdate::className(), 'modelClass' => Product::className(), 'view' => 'update-product', 'onAfterAction' => [$this, 'afterSaveProduct']], 'delete-product' => ['class' => crudActionDelete::className(), 'modelClass' => Product::className(), 'onAfterAction' => [$this, 'afterDeleteProduct']]]; }
/** * @return \yii\db\ActiveQuery */ public function getCategories() { return $this->hasMany(Category::className(), ['parent_id' => 'cgid']); }
/** * @return \yii\db\ActiveQuery */ public function getCategories() { return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable('page_category', ['page_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getCategory() { return $this->hasMany(Category::className(), ['Id' => 'categoryId'])->via('resMaps'); }
/** * @return \yii\db\ActiveQuery */ public function getNestedCategories() { return $this->hasMany(Category::className(), ['parent_id' => 'id'])->from(['subcategory' => 'category']); }
public function actions() { return ['sort' => ['class' => SortableGridAction::className(), 'modelName' => Category::className()]]; }
public function getCategory() { return $this->hasOne(Category::className(), ["cid" => "cid"]); }
public function getCategories() { return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(CategoryVia::tableName(), ['blog_id' => 'id']); }
public function actions() { return ['toggle' => ['class' => ToggleAction::className(), 'modelClass' => Category::className()]]; }