PHP Class Art4\JsonApiClient\Utils\DataContainer

Inheritance: implements Art4\JsonApiClient\Utils\DataContainerInterface
Afficher le fichier Open project: art4/json-api-client

Protected Properties

Свойство Type Description
$allowed_keys array
$data array

Méthodes publiques

Méthode Description
__construct ( array $allowed_keys = [] )
asArray ( boolean $fullArray = false ) : array Convert this object in an array
get ( mixed $key ) : mixed Get a value by a key
getKeys ( ) : array Returns the keys of all setted values
has ( mixed $key ) : boolean Check if a value exists
set ( string $key, mixed $value ) : self Set a value

Méthodes protégées

Méthode Description
getValue ( string $key ) : mixed Get a value by the key
objectTransform ( $val ) : mixed Transforms objects to arrays
parseKey ( string | AccessKey $key ) : AccessKey Parse a dot.notated.key to an object

Method Details

__construct() public méthode

public __construct ( array $allowed_keys = [] )
$allowed_keys array Keys of allowed values

asArray() public méthode

Convert this object in an array
public asArray ( boolean $fullArray = false ) : array
$fullArray boolean If true, objects are transformed into arrays recursively
Résultat array

get() public méthode

Get a value by a key
public get ( mixed $key ) : mixed
$key mixed The key
Résultat mixed

getKeys() public méthode

Returns the keys of all setted values
public getKeys ( ) : array
Résultat array Keys of all setted values

getValue() protected méthode

Get a value by the key
protected getValue ( string $key ) : mixed
$key string The key of the value
Résultat mixed The value

has() public méthode

Check if a value exists
public has ( mixed $key ) : boolean
$key mixed The key
Résultat boolean

objectTransform() protected méthode

Transforms objects to arrays
protected objectTransform ( $val ) : mixed
$val
Résultat mixed

parseKey() protected méthode

Parse a dot.notated.key to an object
protected parseKey ( string | AccessKey $key ) : AccessKey
$key string | AccessKey The key
Résultat AccessKey The parsed key

set() public méthode

Set a value
public set ( string $key, mixed $value ) : self
$key string The Key
$value mixed The Value
Résultat self

Property Details

$allowed_keys protected_oe property

protected array $allowed_keys
Résultat array

$data protected_oe property

protected array $data
Résultat array