Properties

$text

$text : 

Type

$format

$format : 

Type

$textStyle

$textStyle : 

Type

$inlineTextStyles

$inlineTextStyles : 

Type

$role

$role : 

Type

$identifier

$identifier : 

Type

$layout

$layout : 

Type

$style

$style : 

Type

$anchor

$anchor : 

Type

$animation

$animation : 

Type

$behavior

$behavior : 

Type

Methods

__construct()

__construct(mixed  $text, mixed  $identifier = NULL) 

Implements __construct().

Parameters

mixed $text

Text.

mixed $identifier

Identifier.

getText()

getText() 

Getter for text.

setText()

setText(mixed  $value) : $this

Setter for text.

Parameters

mixed $value

Text.

Returns

$this

getFormat()

getFormat() 

Getter for format.

setFormat()

setFormat(mixed  $value = 'none') : $this

Setter for format.

Parameters

mixed $value

Format.

Returns

$this

getInlineTextStyles()

getInlineTextStyles() 

Getter for inlineTextStyles.

getRole()

getRole() 

Getter for role.

setRole()

setRole(string  $value) : $this

Setter for role.

Parameters

string $value

One of "heading" or "heading1" through "heading6", defaults to "heading".

Returns

$this

getIdentifier()

getIdentifier() 

Getter for identifier.

setIdentifier()

setIdentifier(mixed  $identifier) : $this

Setter for identifier.

Parameters

mixed $identifier

Identifier.

Returns

$this

getStyle()

getStyle() 

Getter for style.

getAnchor()

getAnchor() 

Getter for anchor.

getAnimation()

getAnimation() 

Getter for animation.

getBehavior()

getBehavior() 

Getter for behavior.

jsonSerialize()

jsonSerialize() 

Implements JsonSerializable::jsonSerialize().

__toString()

__toString() 

Implements __toString().

json()

json() : boolean|string

Generates json representation.

Returns

boolean|string —

JSON string, or FALSE on error.

triggerError()

triggerError(string  $message, integer  $message_type = E_USER_NOTICE) 

Error handler.

Parameters

string $message

Message.

integer $message_type

Matching E_USER_ERROR|E_USER_WARNING|E_USER_NOTICE|E_USER_DEPRECATED.

optional()

optional() 

Define optional properties.

validateFormat()

validateFormat(  $value) 

Validates the format attribute.

Parameters

$value

isSupportedUnit()

isSupportedUnit(mixed  $value) : boolean

Helper function to determine if a value is suffixed by a supported unit.

Parameters

mixed $value

Value.

Returns

boolean —

Result.

isUnitInterval()

isUnitInterval(float|integer  $value) : boolean

Helper function to determine if a value is a unit interval.

A unit interval is the closed interval [0,1], that is, the set of all real numbers that are greater than or equal to 0 and less than or equal to 1.

Parameters

float|integer $value

Value.

Returns

boolean —

Result.

isHexColor()

isHexColor(string  $value) : boolean

Helper to validate color hex code.

Valid codes are hexadecimal numbers of length 3, 6 or 8 (with opacity), prefixed with "#".

Parameters

string $value

Value.

Returns

boolean —

Result.

validateRole()

validateRole(  $value) 

Validates the role attribute.

Parameters

$value