PHP Class Vimeo\ABLincoln\Assignment

Show file Open project: vimeo/ablincoln Class Usage Examples

Public Methods

Method Description
__construct ( string $experiment_salt, $overrides = [] ) Store the given experiment salt for future use
__get ( string $name ) : mixed Get the value of a key in the Assignment object if it exists
__isset ( string $name ) : boolean Check if a given key is set in the Assignment object
__set ( string $name, mixed $value ) Set the value of a key in the object using the parameter name as salt
__unset ( string $name ) Unset the value at a given key
asArray ( ) : array Get the array representation of this Assignment
evaluate ( mixed $value ) Evaluate a given parameter and return its value. Currently just directly returns the given argument but can be modified with more complex behavior
getOverrides ( ) : array Get an array of all Assignment parameter overrides
setOverrides ( array $overrides ) Set overrides for the Assignment parameters

Method Details

__construct() public method

Store the given experiment salt for future use
public __construct ( string $experiment_salt, $overrides = [] )
$experiment_salt string the experiment salt to store

__get() public method

Get the value of a key in the Assignment object if it exists
public __get ( string $name ) : mixed
$name string key to obtain the value of
return mixed value of given key if it exists, null otherwise

__isset() public method

Check if a given key is set in the Assignment object
public __isset ( string $name ) : boolean
$name string key to check for in the object
return boolean true if key set, false otherwise

__set() public method

Set the value of a key in the object using the parameter name as salt
public __set ( string $name, mixed $value )
$name string key to set the value of
$value mixed value to set at the given index

__unset() public method

Unset the value at a given key
public __unset ( string $name )
$name string key to unset the value of

asArray() public method

Get the array representation of this Assignment
public asArray ( ) : array
return array the Assignment's array representation

evaluate() public method

Evaluate a given parameter and return its value. Currently just directly returns the given argument but can be modified with more complex behavior
public evaluate ( mixed $value )
$value mixed the parameter to evaluate

getOverrides() public method

Get an array of all Assignment parameter overrides
public getOverrides ( ) : array
return array the override array

setOverrides() public method

Set overrides for the Assignment parameters
public setOverrides ( array $overrides )
$overrides array parameter name/value pairs to use as overrides