\Charcoal\ObjectCategorizableMultipleTrait

Defines objects that can be associated to one or more categories.

Basic implementation of \Charcoal\Object\CategorizableMultipleInterface.

Summary

Methods
Properties
Constants
setCategoryType()
categoryType()
setCategories()
categories()
No public properties found
No constants found
No protected methods found
$categories
N/A
No private methods found
$categoryType
N/A

Properties

$categories

$categories : \Charcoal\Object\(mixed|array<mixed,\Charcoal\Object\CategoryInterface)>|\Charcoal\Object\Traversable

One or more categories the object belongs to.

Type

\Charcoal\Object\(mixed|array<mixed,\Charcoal\Object\CategoryInterface)>|\Charcoal\Object\Traversable

$categoryType

$categoryType : string

The type of category the object can belong to.

Type

string

Methods

setCategoryType()

setCategoryType(string  $type) : \Charcoal\Object\CategorizableMultipleInterface

Set the type of category the object can belong to.

Parameters

string $type

The category type.

Throws

\InvalidArgumentException

If the type argument is not a string.

Returns

\Charcoal\Object\CategorizableMultipleInterface

Chainable

categoryType()

categoryType() : string

Retrieve the type of category the object can belong to.

Returns

string

setCategories()

setCategories(array|\Charcoal\Object\Traversable  $categories) : \Charcoal\Object\CategorizableMultipleInterface

Set the categories the object belongs to.

Parameters

array|\Charcoal\Object\Traversable $categories

The object's categories.

Returns

\Charcoal\Object\CategorizableMultipleInterface

Chainable

categories()

categories() : array|\Charcoal\Object\Traversable

Retrieve the categories the object belongs to.

Returns

array|\Charcoal\Object\Traversable