Example #1
0
 /**
  * @return static
  */
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'category_id'])->via('menuItemContent');
 }
Example #2
0
 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['mid' => 'mid'])->where('type=:type', [':type' => Category::TYPE])->viaTable(Relationship::tableName(), ['cid' => 'cid']);
 }
Example #3
0
 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']]];
 }
Example #6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['parent_id' => 'cgid']);
 }
Example #7
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable('page_category', ['page_id' => 'id']);
 }
Example #8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategory()
 {
     return $this->hasMany(Category::className(), ['Id' => 'categoryId'])->via('resMaps');
 }
Example #9
0
 /**
  * @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()]];
 }
Example #11
0
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ["cid" => "cid"]);
 }
Example #12
0
 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()]];
 }