PHP Class Vinelab\Minion\Dictionary

Author: Abed Halawi ([email protected])
Show file Open project: vinelab/minion Class Usage Examples

Public Methods

Method Description
__construct ( array $attributes )
__get ( string $attribute ) : mixed Override the magic __get to reach the attribtues of this dictionary.
__isset ( string $attribute ) : boolean Override to support calling isset() on attributes of this dictionary.
make ( mixed $attributes ) : Dictionary Get a new dictionary with the given attributes.
toArray ( ) : array Get the array representation of this dictionary.
toKeyValue ( array $values ) : array Transform the given array of values into a key-value pair recursively.

Method Details

__construct() public method

public __construct ( array $attributes )
$attributes array

__get() public method

Override the magic __get to reach the attribtues of this dictionary.
public __get ( string $attribute ) : mixed
$attribute string
return mixed

__isset() public method

Override to support calling isset() on attributes of this dictionary.
public __isset ( string $attribute ) : boolean
$attribute string
return boolean

make() public static method

Get a new dictionary with the given attributes.
public static make ( mixed $attributes ) : Dictionary
$attributes mixed
return Dictionary

toArray() public method

Get the array representation of this dictionary.
public toArray ( ) : array
return array

toKeyValue() public method

Transform the given array of values into a key-value pair recursively.
public toKeyValue ( array $values ) : array
$values array
return array