StateBehaviorTrait

Trait which supports state behavior

since

4.0.0

Methods

getState

Method to get state variables.

getState(string $property = null, mixed $default = null) : mixed
since

4.0.0

Arguments

$property

stringOptional parameter name

$default

mixedOptional default value

Response

mixedThe property where specified, the state object where omitted

populateState

Method to auto-populate the state.

populateState() : void

This method should only be called once per instantiation and is designed to be called on the first call to the getState() method unless the configuration flag to ignore the request is set.

note

Calling getState in this method will result in recursion.

since

4.0.0

setState

Method to set state variables.

setState(string $property, mixed $value = null) : mixed
since

4.0.0

Arguments

$property

stringThe name of the property

$value

mixedThe value of the property to set or null

Response

mixedThe previous value of the property or null if not set

Properties

__state_set

Indicates if the internal state has been set

since

4.0.0

Type(s)

boolean

state

A state object

since

4.0.0

Type(s)

\Joomla\CMS\Object\CMSObject