WithCategories
Definitions of methods for objects that contain categories
Tags
Table of Contents
- addCategory() : $this
- Add one or more category to object
- category() : Category
- Creates a new category and adds it to the object
- getCategories() : array<string|int, Category>
- Get all categories
- queryCategories() : ContainerQuery
- Get categories container query
Methods
addCategory()
Add one or more category to object
public
addCategory(Category ...$categories) : $this
Parameters
- $categories : Category
-
Category objects
Return values
$this —category()
Creates a new category and adds it to the object
public
category([string $name = '' ][, string|int|null $id = null ]) : Category
Parameters
- $name : string = ''
-
New category name
- $id : string|int|null = null
-
Id of the new category - if omitted -> it is generated automatically as unique string
Return values
Category —New category
getCategories()
Get all categories
public
getCategories() : array<string|int, Category>
Return values
array<string|int, Category> —queryCategories()
Get categories container query
public
queryCategories() : ContainerQuery