CategoryHandler
class CategoryHandler
Class CategoryHandler
Traits
Trait NodePositionTrait
Properties
protected CategoryRepository | $cates | CategoryRepository instance | |
protected CategoryItemRepository | $items | CategoryItemRepository instance |
Methods
bool
from NodePositionTrait
int
from NodePositionTrait
createCate(array $attributes)
Create category
bool
void
bool
bool
cates()
Get CategoryRepository instance
items()
Get CategoryItemRepository instance
Details
in NodePositionTrait at line 36
protected bool
linkHierarchy(Node $item, Node $parent)
Linked parent and child relation
in NodePositionTrait at line 69
protected int
unlinkHierarchy(Node $item, Node $parent)
unlinked parent and child relation
in NodePositionTrait at line 95
void
setOrder(Node $item, int|null $position = null)
Set item ordering value
at line 60
__construct(CategoryRepository $cates, CategoryItemRepository $items)
CategoryHandler constructor.
at line 74
Category
create(array $attributes)
Create category
at line 85
Category
createCate(array $attributes)
Create category
at line 124
bool
remove(Category $category)
Remove category
at line 135
bool
deleteCate(Category $category)
Delete category
at line 151
CategoryItem
createItem(Category $category, array $attributes)
Create a new category item, alias for itemCreate
at line 169
protected void
setHierarchy(CategoryItem $item)
Set hierarchy information for new item
at line 188
CategoryItem
putItem(CategoryItem $item, array $data = array())
Modify item information
at line 200
CategoryItem
updateItem(CategoryItem $item, array $data = array())
Modify item information
at line 218
bool
removeItem(CategoryItem $item, bool $force = true)
Remove single item or all descendant
at line 230
bool
deleteItem(CategoryItem $item, bool $force = true)
Delete single item or all descendant
at line 252
CategoryItem
moveTo(CategoryItem $item, CategoryItem $parent = null)
Move to another parent CategoryItem
at line 286
CategoryRepository
cates()
Get CategoryRepository instance
at line 296
CategoryItemRepository
items()
Get CategoryItemRepository instance