本文整理汇总了PHP中app\models\Category::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::className方法的具体用法?PHP Category::className怎么用?PHP Category::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Category
的用法示例。
在下文中一共展示了Category::className方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPath
public function getPath()
{
$result = [];
$query = $this->hasOne(Category::className(), ['id' => 'category_id']);
$category = $query->one();
while ($category) {
$result[] = $category;
$category = $category->category;
}
return $result;
}
示例2: getParent
/**
* @return \yii\db\ActiveQuery
*/
public function getParent()
{
return $this->hasOne(Category::className(), ['id_categoria' => 'parent_id']);
}
示例3: getCategory
public function getCategory()
{
return $this->hasOne(Category::className(), ["cid" => "cid"]);
}
示例4: getCategories
public function getCategories()
{
return $this->hasOne(Category::className(), ['id' => 'category']);
}
示例5: getCategory
/**
* @return CategoryQuery
*/
public function getCategory()
{
return $this->hasOne(Category::className(), ['CategoryID' => 'CategoryID'])->inverseOf('products');
}
示例6: getChildren
/**
* @return \yii\db\ActiveQuery
*/
public function getChildren()
{
return $this->hasMany(Category::className(), ['parent_id' => 'id']);
}
示例7: getCategories
public function getCategories()
{
return $this->hasMany(Category::className(), ['category_id' => 'id']);
}
示例8: getBookCategory
/**
* @return \yii\db\ActiveQuery
*/
public function getBookCategory()
{
return $this->hasOne(Category::className(), ['id' => 'categoryId']);
}
示例9: getCategories
public function getCategories()
{
return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable('post_category', ['post_id' => 'id']);
}
示例10: getCategory
/**
* @return \yii\db\ActiveQuery
*/
public function getCategory()
{
return $this->hasOne(Category::className(), ['id' => 'Category_id']);
}
示例11: getCategory
public function getCategory()
{
return $this->hasOne(Category::className(), ['id' => 'category_id'])->via('advert');
}
示例12: getCategories
/**
* @return $this
*/
public function getCategories()
{
return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(BooksCategories::tableName(), ['book_id' => 'id']);
}
示例13: getCategoryItem
/**
* @return \yii\db\ActiveQuery
*/
public function getCategoryItem()
{
return $this->hasOne(Category::className(), ['ID' => 'category']);
}