Properties

$revisionEnabled

$revisionEnabled : boolean

Type

boolean

$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

$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

Methods

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.

setDependencies()

setDependencies(\Pimple\Container  $container) : void

Dependencies

Parameters

\Pimple\Container $container

DI Container.

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

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

modelFactory()

modelFactory() : \Charcoal\Factory\FactoryInterface

Returns

\Charcoal\Factory\FactoryInterface —

The model factory.

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