PHP Class Vimeo\ABLincoln\Namespaces\AbstractNamespace

Datei anzeigen Open project: vimeo/ablincoln

Public Methods

Method Description
__construct ( mixed $inputs ) Set up attributes needed for experiment
addExperiment ( string $name, string $exp_class, integer $num_segments ) Map a new experiment to a given number of segments in the namespace
get ( string $name, string $default ) : the Get the value of a given experiment parameter - triggers exposure log
inExperiment ( ) : boolean In-experiment accessor
logEvent ( string $eventType, array $extras = null ) Log an arbitrary event
logExposure ( array $extras = null ) Logs exposure to treatment
removeExperiment ( string $name ) Remove a given experiment from the namespace and free its associated segments
setAutoExposureLogging ( boolean $value ) Disables / enables auto exposure logging (enabled by default)

Method Details

__construct() public method

Set up attributes needed for experiment
public __construct ( mixed $inputs )
$inputs mixed input value or array to determine parameter assignments, e.g. userid

addExperiment() abstract public method

Map a new experiment to a given number of segments in the namespace
abstract public addExperiment ( string $name, string $exp_class, integer $num_segments )
$name string name to give the new experiment
$exp_class string string version of experiment class to instantiate
$num_segments integer number of segments to allocate to experiment

get() abstract public method

Get the value of a given experiment parameter - triggers exposure log
abstract public get ( string $name, string $default ) : the
$name string parameter to get the value of
$default string optional value to return if parameter undefined
return the value of the given parameter

inExperiment() abstract public method

In-experiment accessor
abstract public inExperiment ( ) : boolean
return boolean true if primary unit mapped to an experiment, false otherwise

logEvent() abstract public method

Log an arbitrary event
abstract public logEvent ( string $eventType, array $extras = null )
$eventType string name of event to kig]
$extras array optional extra data to include in log

logExposure() abstract public method

Logs exposure to treatment
abstract public logExposure ( array $extras = null )
$extras array optional extra data to include in exposure log

removeExperiment() abstract public method

Remove a given experiment from the namespace and free its associated segments
abstract public removeExperiment ( string $name )
$name string previously defined name of experiment to remove

setAutoExposureLogging() abstract public method

Disables / enables auto exposure logging (enabled by default)
abstract public setAutoExposureLogging ( boolean $value )
$value boolean true to enable, false to disable