PHP Класс Vimeo\ABLincoln\Namespaces\SimpleNamespace

Наследование: extends AbstractNamespace
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$inputs
$name
$num_segments
$primary_unit

Открытые методы

Метод Описание
__construct ( array $inputs ) Set up attributes needed for the namespace
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 = null ) : the Get the value of a given experiment parameter - triggers exposure log
inExperiment ( ) : boolean In-experiment accessor
logEvent ( $event_type, array $extras = null ) Log an arbitrary event
logExposure ( array $extras = null ) Logs exposure to treatment
primaryUnit ( ) : array Get the primary unit that will be mapped to segments
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)
setPrimaryUnit ( mixed $value ) Set the primary unit that will be used to map to segments
setup ( ) Set namespace attributes for run. Developers extending this class should set the following variables: this->name = 'sample namespace'; this->primary_unit = 'userid'; this->num_segments = 10000;
setupExperiments ( ) Setup experiments segments will be assigned to: $this->addExperiment('first experiment', Exp1, 100);

Защищенные методы

Метод Описание
_requiresDefaultExperiment ( ) Checks if primary unit segment is assigned to a default experiment, and if not assigns it to one
_requiresExperiment ( ) Checks if primary unit segment is assigned to an experiment, and if not assigns it to one

Приватные методы

Метод Описание
_assignDefaultExperiment ( ) Assigns the primary unit value(s) and associated segment to a new default experiment used if segment not assigned to a real one
_assignExperiment ( ) Assigns the primary unit value(s) and associated segment to a new experiment and updates the experiment name/salt accordingly
_defaultGet ( string $name, string $default = null ) : the Get the value of a given default experiment parameter. Called on get() if primary unit value(s) not mapped to a real experiment
_getSegment ( ) : integer Use the primary unit value(s) to obtain a segment and associated experiment

Описание методов

__construct() публичный Метод

Set up attributes needed for the namespace
public __construct ( array $inputs )
$inputs array data to determine parameter assignments, e.g. userid

_requiresDefaultExperiment() защищенный Метод

Checks if primary unit segment is assigned to a default experiment, and if not assigns it to one

_requiresExperiment() защищенный Метод

Checks if primary unit segment is assigned to an experiment, and if not assigns it to one
protected _requiresExperiment ( )

addExperiment() публичный Метод

Map a new experiment to a given number of segments in the namespace
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() публичный Метод

Get the value of a given experiment parameter - triggers exposure log
public get ( string $name, string $default = null ) : the
$name string parameter to get the value of
$default string optional value to return if parameter undefined
Результат the value of the given parameter

inExperiment() публичный Метод

In-experiment accessor
public inExperiment ( ) : boolean
Результат boolean true if primary unit mapped to an experiment, false otherwise

logEvent() публичный Метод

Log an arbitrary event
public logEvent ( $event_type, array $extras = null )
$extras array optional extra data to include in log

logExposure() публичный Метод

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

primaryUnit() публичный Метод

Get the primary unit that will be mapped to segments
public primaryUnit ( ) : array
Результат array array containing value(s) used for unit assignment

removeExperiment() публичный Метод

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

setAutoExposureLogging() публичный Метод

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

setPrimaryUnit() публичный Метод

Set the primary unit that will be used to map to segments
public setPrimaryUnit ( mixed $value )
$value mixed value or array used for unit assignment to segments

setup() абстрактный публичный Метод

Set namespace attributes for run. Developers extending this class should set the following variables: this->name = 'sample namespace'; this->primary_unit = 'userid'; this->num_segments = 10000;
abstract public setup ( )

setupExperiments() абстрактный публичный Метод

Setup experiments segments will be assigned to: $this->addExperiment('first experiment', Exp1, 100);
abstract public setupExperiments ( )

Описание свойств

$inputs защищенное свойство

protected $inputs

$name защищенное свойство

protected $name

$num_segments защищенное свойство

protected $num_segments

$primary_unit защищенное свойство

protected $primary_unit