Properties

$type

$type : string

Type

string

$displayType

$displayType : string

Type

string

$displayId

$displayId : string

Type

string

$displayClass

$displayClass : string

Type

string

$displayOptions

$displayOptions : mixed

Type

mixed

$lang

$lang : string

Type

string

$ident

$ident : string

Type

string

$multiple

$multiple : boolean

Type

boolean

$propertyData

$propertyData : array

Type

array

$propertyVal

$propertyVal : mixed

Type

mixed

$property

$property : \Charcoal\Property\PropertyInterface

Type

\Charcoal\Property\PropertyInterface

Methods

__construct()

__construct(array|\Charcoal\Admin\Property\ArrayAccess  $data = null) 

Parameters

array|\Charcoal\Admin\Property\ArrayAccess $data

Optional. Dependencies.

setDependencies()

setDependencies(\Pimple\Container  $container) : void

Inject dependencies from a DI Container.

Parameters

\Pimple\Container $container

A dependencies container instance.

setData()

setData(array  $data) : \Charcoal\Admin\Property\Display

This function takes an array and fill the model object with its value.

This method either calls a setter for each key (set_{$key}()) or sets a public member.

For example, calling with setData(['properties'=>$properties]) would call setProperties($properties), becasue setProperties() exists.

But calling with setData(['foobar'=>$foo]) would set the $foobar member on the metadata object, because the method set_foobar() does not exist.

Parameters

array $data

The display data.

Returns

\Charcoal\Admin\Property\Display —

Chainable

propertyVal()

propertyVal() : mixed

Returns

mixed

lang()

lang() : string

Get the input language

Returns

string

setIdent()

setIdent(string  $ident) : \Charcoal\Admin\Property\Widget

Parameters

string $ident

Display identifier.

Throws

\InvalidArgumentException

If the ident is not a string.

Returns

\Charcoal\Admin\Property\Widget —

Chainable

ident()

ident() : string

Returns

string

setMultiple()

setMultiple(boolean  $multiple) : \Charcoal\Admin\Property\Widget

Parameters

boolean $multiple

Multiple flag.

Returns

\Charcoal\Admin\Property\Widget —

(Chainable)

multiple()

multiple() : boolean

Returns

boolean

setDisplayId()

setDisplayId(string  $displayId) : \Charcoal\Admin\Property\Display

Parameters

string $displayId

HTML id attribute.

Returns

\Charcoal\Admin\Property\Display —

Chainable

displayId()

displayId() : string

Get the display ID.

If none was previously set, than a unique random one will be generated.

Returns

string

setDisplayClass()

setDisplayClass(string  $displayClass) : \Charcoal\Admin\Property\AbstractPropertyDisplay

Parameters

string $displayClass

The display class attribute.

Throws

\InvalidArgumentException

If the class is not a string.

Returns

\Charcoal\Admin\Property\AbstractPropertyDisplay

Chainable

displayClass()

displayClass() : string

Returns

string

setDisplayName()

setDisplayName(string  $displayName) : \Charcoal\Admin\Property\AbstractPropertyInput

Set the display name.

Used for the HTML "name" attribute.

Parameters

string $displayName

HTML id attribute.

Returns

\Charcoal\Admin\Property\AbstractPropertyInput

Chainable

displayName()

displayName() : string

Retrieve the display name.

The input name should always be the property's ident.

Returns

string

displayVal()

displayVal() : string

Returns

string

setDisplayType()

setDisplayType(string  $displayType) : \Charcoal\Admin\Property\AbstractPropertyDisplay

Parameters

string $displayType

The display type.

Throws

\InvalidArgumentException

If provided argument is not of type 'string'.

Returns

\Charcoal\Admin\Property\AbstractPropertyDisplay

Chainable

displayType()

displayType() : string

Returns

string

propertyIdent()

propertyIdent() : string

Returns

string

setProperty()

setProperty(\Charcoal\Property\PropertyInterface  $p) : \Charcoal\Admin\Property\AbstractPropertyDisplay

Parameters

\Charcoal\Property\PropertyInterface $p

The property.

Returns

\Charcoal\Admin\Property\AbstractPropertyDisplay

Chainable

property()

property() : \Charcoal\Property\PropertyInterface

Returns

\Charcoal\Property\PropertyInterface

p()

p() : \Charcoal\Property\PropertyInterface

Alias of {@see self::property()}

Returns

\Charcoal\Property\PropertyInterface

createMetadata()

createMetadata(array  $data = null) : \Charcoal\Property\PropertyMetadata

Parameters

array $data

Optional. Metadata data.

Returns

\Charcoal\Property\PropertyMetadata

getter()

getter(string  $key) : string

Allow an object to define how the key getter are called.

Parameters

string $key

The key to get the getter from.

Returns

string —

The getter method name, for a given key.

setter()

setter(string  $key) : string

Allow an object to define how the key setter are called.

Parameters

string $key

The key to get the setter from.

Returns

string —

The setter method name, for a given key.

camelize()

camelize(string  $str) : string

Transform a snake_case string to camelCase.

Parameters

string $str

The snake_case string to camelize.

Returns

string —

The camelCase string.