Properties

$revisionEnabled

$revisionEnabled : boolean

Type

boolean

$categoryItemType

$categoryItemType : string

Type

string

$categoryItems

$categoryItems : \Charcoal\Object\Collection

Type

\Charcoal\Object\Collection

$active

$active : boolean

Objects are active by default

Type

boolean

$position

$position : integer

The position is used for ordering lists

Type

integer

$created

$created : \DateTime

Object creation date (set automatically on save)

Type

\DateTime

$createdBy

$createdBy : mixed

Type

mixed

$lastModified

$lastModified : \DateTime

Object last modified date (set automatically on save and update)

Type

\DateTime

$lastModifiedBy

$lastModifiedBy : mixed

Type

mixed

$modelFactory

$modelFactory : \Charcoal\Factory\FactoryInterface

Type

\Charcoal\Factory\FactoryInterface

$objectRevisionClass

$objectRevisionClass : string

The class name of the object revision model.

Must be a fully-qualified PHP namespace and an implementation of \Charcoal\Object\ObjectRevisionInterface. Used by the model factory.

Type

string

$name

$name : \Charcoal\Translation\TranslationString|null

Type

\Charcoal\Translation\TranslationString|null

Methods

setCategoryItemType()

setCategoryItemType(string  $type) : \Charcoal\Object\CategoryInterface

Parameters

string $type

The category item type.

Throws

\InvalidArgumentException

If the type argument is not a string.

Returns

\Charcoal\Object\CategoryInterface

Chainable

categoryItemType()

categoryItemType() : string

Throws

\Exception

If no item type was previously set.

Returns

string

numCategoryItems()

numCategoryItems() : integer

Returns

integer

hasCategoryItems()

hasCategoryItems() : boolean

Returns

boolean

categoryItems()

categoryItems() : \Charcoal\Object\Collection

Returns

\Charcoal\Object\Collection —

A list of CategorizableInterface objects

loadCategoryItems()

loadCategoryItems() : array

Returns

array

setDependencies()

setDependencies(\Pimple\Container  $container) : void

Dependencies

Parameters

\Pimple\Container $container

DI Container.

modelFactory()

modelFactory() : \Charcoal\Factory\FactoryInterface

Retrieve the object model factory.

Returns

\Charcoal\Factory\FactoryInterface

setActive()

setActive(boolean  $active) : \Charcoal\Object\Content

Parameters

boolean $active

The active flag.

Returns

\Charcoal\Object\Content

Chainable

active()

active() : boolean

Returns

boolean

setPosition()

setPosition(integer  $position) : \Charcoal\Object\Content

Parameters

integer $position

The position (for ordering purpose).

Throws

\InvalidArgumentException

If the position is not an integer (or numeric integer string).

Returns

\Charcoal\Object\Content

Chainable

position()

position() : integer

Returns

integer

setCreated()

setCreated(\DateTimeInterface|string|null  $created) : \Charcoal\Object\Content

Parameters

\DateTimeInterface|string|null $created

The date/time at object's creation.

Throws

\InvalidArgumentException

If the date/time is invalid.

Returns

\Charcoal\Object\Content

Chainable

created()

created() : \DateTimeInterface|null

Returns

\DateTimeInterface|null

setCreatedBy()

setCreatedBy(mixed  $createdBy) : \Charcoal\Object\Content

Parameters

mixed $createdBy

The creator of the content object.

Returns

\Charcoal\Object\Content

Chainable

createdBy()

createdBy() : mixed

Returns

mixed

setLastModified()

setLastModified(\DateTimeInterface|string|null  $lastModified) : \Charcoal\Object\Content

Parameters

\DateTimeInterface|string|null $lastModified

The last modified date/time.

Throws

\InvalidArgumentException

If the date/time is invalid.

Returns

\Charcoal\Object\Content

Chainable

lastModified()

lastModified() : \DateTimeInterface

Returns

\DateTimeInterface

setLastModifiedBy()

setLastModifiedBy(mixed  $lastModifiedBy) : \Charcoal\Object\Content

Parameters

mixed $lastModifiedBy

The last modification's username.

Returns

\Charcoal\Object\Content

Chainable

lastModifiedBy()

lastModifiedBy() : mixed

Returns

mixed

preSave()

preSave() : boolean

StorableTrait > preSavƒe(): Called automatically before saving the object to source.

For content object, set the created and lastModified properties automatically

Returns

boolean

preUpdate()

preUpdate(array  $properties = null) : boolean

StorableTrait > preUpdate(): Called automatically before updating the object to source.

For content object, set the lastModified property automatically.

Parameters

array $properties

The properties (ident) set for update.

Returns

boolean

setRevisionEnabled()

setRevisionEnabled(boolean  $enabled) : \Charcoal\Object\RevisionableInterface

Parameters

boolean $enabled

The (revision) enabled flag.

Returns

\Charcoal\Object\RevisionableInterface

Chainable

revisionEnabled()

revisionEnabled() : boolean

Returns

boolean

objectRevisionClass()

objectRevisionClass() : string

Retrieve the class name of the object revision model.

Returns

string

revisionNum()

revisionNum(integer  $revNum) : \Charcoal\Object\ObjectRevision

Parameters

integer $revNum

The revision number.

Returns

\Charcoal\Object\ObjectRevision

allRevisions()

allRevisions(callable  $callback = null) : array

Retrieves all revisions for the current objet

Parameters

callable $callback

Optional object callback.

Returns

array

revertToRevision()

revertToRevision(integer  $revNum) : boolean

Parameters

integer $revNum

The revision number to revert to.

Throws

\InvalidArgumentException

If revision number is invalid.

Returns

boolean —

Success / Failure.

setName()

setName(mixed  $name) : \Charcoal\User\Acl\NewsCategory

Parameters

mixed $name

The news category name (localized).

Returns

\Charcoal\User\Acl\NewsCategory —

Chainable

name()

name() : \Charcoal\Translation\TranslationString|null

Returns

\Charcoal\Translation\TranslationString|null

setModelFactory()

setModelFactory(\Charcoal\Factory\FactoryInterface  $factory) : \Charcoal\Object\AdminScript

Parameters

\Charcoal\Factory\FactoryInterface $factory

The factory used to create models.

Returns

\Charcoal\Object\AdminScript —

Chainable

setObjectRevisionClass()

setObjectRevisionClass(string  $className) : \Charcoal\Object\AbstractPropertyDisplay

Set the class name of the object revision model.

Parameters

string $className

The class name of the object revision model.

Throws

\InvalidArgumentException

If the class name is not a string.

Returns

\Charcoal\Object\AbstractPropertyDisplay —

Chainable