PHP Class Webiny\Component\Entity\Attribute\ArrayAttribute

Inheritance: extends AbstractAttribute, implements IteratorAggregate, implements ArrayAccess
ファイルを表示 Open project: Webiny/Framework Class Usage Examples

Protected Properties

Property Type Description
$keyValidationMessages
$keyValidators

Public Methods

Method Description
__construct ( $name = null, AbstractEntity $parent = null )
_set ( $name, $value )
append ( mixed $value ) Append value to array
get ( string $key, mixed $default = null ) : mixed Get value or return $default if there is no element set.
getDbValue ( )
getIterator ( ) : Traversable (PHP 5 >= 5.0.0)
Retrieve an external iterator
getKeyValidationMessages ( ) : array Get key validation messages
getKeyValidators ( ) : mixed Get key validators
getValue ( $params = [], $processCallbacks = true )
offsetExists ( mixed $offset ) : boolean (PHP 5 >= 5.0.0)
Whether a offset exists
offsetGet ( mixed $offset ) : mixed (PHP 5 >= 5.0.0)
Offset to retrieve
offsetSet ( mixed $offset, mixed $value ) : void (PHP 5 >= 5.0.0)
Offset to set
offsetUnset ( mixed $offset ) : void (PHP 5 >= 5.0.0)
Offset to unset
prepend ( mixed $value ) Prepend value to array
set ( string $key, mixed $value ) Set value for given key (can be nested key, using dotted notation)
setDefaultValue ( $defaultValue = null )
setKeyValidationMessages ( $messages ) Set key validation messages
setKeyValidators ( array $validators ) Set key validators
setValue ( $value = null, $fromDb = false )
toArray ( $params = [] )

Protected Methods

Method Description
convertToArray ( $source )
validate ( &$value ) Perform validation against given value

Private Methods

Method Description
validateNestedKeys ( mixed $data )

Method Details

__construct() public method

public __construct ( $name = null, AbstractEntity $parent = null )
$parent Webiny\Component\Entity\AbstractEntity

_set() public method

public _set ( $name, $value )

append() public method

Append value to array
public append ( mixed $value )
$value mixed

convertToArray() protected method

protected convertToArray ( $source )

get() public method

You can also access deeper values by using dotted key notation: level1.level2.level3.key
public get ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
return mixed Array value or default value

getDbValue() public method

public getDbValue ( )

getIterator() public method

(PHP 5 >= 5.0.0)
Retrieve an external iterator
public getIterator ( ) : Traversable
return Traversable An instance of an object implementing Iterator or Traversable

getKeyValidationMessages() public method

Get key validation messages
public getKeyValidationMessages ( ) : array
return array

getKeyValidators() public method

Get key validators
public getKeyValidators ( ) : mixed
return mixed

getValue() public method

public getValue ( $params = [], $processCallbacks = true )

offsetExists() public method

(PHP 5 >= 5.0.0)
Whether a offset exists
public offsetExists ( mixed $offset ) : boolean
$offset mixed

An offset to check for.

return boolean true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

offsetGet() public method

(PHP 5 >= 5.0.0)
Offset to retrieve
public offsetGet ( mixed $offset ) : mixed
$offset mixed

The offset to retrieve.

return mixed Can return all value types.

offsetSet() public method

(PHP 5 >= 5.0.0)
Offset to set
public offsetSet ( mixed $offset, mixed $value ) : void
$offset mixed

The offset to assign the value to.

$value mixed

The value to set.

return void

offsetUnset() public method

(PHP 5 >= 5.0.0)
Offset to unset
public offsetUnset ( mixed $offset ) : void
$offset mixed

The offset to unset.

return void

prepend() public method

Prepend value to array
public prepend ( mixed $value )
$value mixed

set() public method

Set value for given key (can be nested key, using dotted notation)
public set ( string $key, mixed $value )
$key string
$value mixed

setDefaultValue() public method

public setDefaultValue ( $defaultValue = null )

setKeyValidationMessages() public method

Set key validation messages
public setKeyValidationMessages ( $messages )
$messages

setKeyValidators() public method

Set key validators
public setKeyValidators ( array $validators )
$validators array

setValue() public method

public setValue ( $value = null, $fromDb = false )

toArray() public method

public toArray ( $params = [] )

validate() protected method

Perform validation against given value
protected validate ( &$value )
$value

Property Details

$keyValidationMessages protected_oe property

protected $keyValidationMessages

$keyValidators protected_oe property

protected $keyValidators