本文整理汇总了PHP中common\models\Category::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::className方法的具体用法?PHP Category::className怎么用?PHP Category::className使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\Category
的用法示例。
在下文中一共展示了Category::className方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCategory
/**
* @return static
*/
public function getCategory()
{
return $this->hasOne(Category::className(), ['id' => 'category_id'])->via('menuItemContent');
}
示例2: getCategories
public function getCategories()
{
return $this->hasMany(Category::className(), ['mid' => 'mid'])->where('type=:type', [':type' => Category::TYPE])->viaTable(Relationship::tableName(), ['cid' => 'cid']);
}
示例3: getChildren
public function getChildren()
{
return $this->hasMany(Category::className(), ['parent_id' => 'id']);
}
示例4: getCategory
/**
* @return \yii\db\ActiveQuery
*/
public function getCategory()
{
return $this->hasOne(Category::className(), ['id' => 'category_id']);
}
示例5: actions
/**
* @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']]];
}
示例6: getCategories
/**
* @return \yii\db\ActiveQuery
*/
public function getCategories()
{
return $this->hasMany(Category::className(), ['parent_id' => 'cgid']);
}
示例7: getCategories
/**
* @return \yii\db\ActiveQuery
*/
public function getCategories()
{
return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable('page_category', ['page_id' => 'id']);
}
示例8: getCategory
/**
* @return \yii\db\ActiveQuery
*/
public function getCategory()
{
return $this->hasMany(Category::className(), ['Id' => 'categoryId'])->via('resMaps');
}
示例9: getNestedCategories
/**
* @return \yii\db\ActiveQuery
*/
public function getNestedCategories()
{
return $this->hasMany(Category::className(), ['parent_id' => 'id'])->from(['subcategory' => 'category']);
}
示例10: actions
public function actions()
{
return ['sort' => ['class' => SortableGridAction::className(), 'modelName' => Category::className()]];
}
示例11: getCategory
public function getCategory()
{
return $this->hasOne(Category::className(), ["cid" => "cid"]);
}
示例12: getCategories
public function getCategories()
{
return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(CategoryVia::tableName(), ['blog_id' => 'id']);
}
示例13: actions
public function actions()
{
return ['toggle' => ['class' => ToggleAction::className(), 'modelClass' => Category::className()]];
}