Skip to content

Latest commit

 

History

History
303 lines (174 loc) · 3.97 KB

Experiment.md

File metadata and controls

303 lines (174 loc) · 3.97 KB

Experiment

This class is in charge of managing your experiment, including configuring the name, identifier, optionally limiting the percentual amount of visitors to include, defining and handling their control and variant groups, and returning your results.

Name Description
getID Get experiment ID
setID Set experiment ID
getName Get experiment name
setName Set experiment name
getGroups Get both groups
getGroup Get a specific group
setGroup Define a group
getControl Get the control
setControl Define the control
getVariation Get the variation
setVariation Define the variation
getAllocation Get experiment allocation
setAllocation Set experiment allocation
getResult Return a Result instance from the current experiment

Experiment::getID

Description

public getID (void)

Get experiment ID

Parameters

This function has no parameters.

Return Values

mixed|null


Experiment::setID

Description

public setID (mixed $id)

Set experiment ID

Parameters

  • (mixed) $id

Return Values

self


Experiment::getName

Description

public getName (void)

Get experiment name

Parameters

This function has no parameters.

Return Values

string|null


Experiment::setName

Description

public setName (string $name)

Set experiment name

Parameters

  • (string) $name

Return Values

self


Experiment::getGroups

Description

public getGroups (void)

Get both groups

Parameters

This function has no parameters.

Return Values

array


Experiment::getGroup

Description

public getGroup (int|string $key)

Get a specific group

Parameters

  • (int|string) $key

Return Values

Group


Experiment::setGroup

Description

public setGroup (int|string $key, Group|array|object $group)

Define a group

Parameters

  • (int|string) $key
  • (Group|array|object) $group

Return Values

self


Experiment::getControl

Description

public getControl (void)

Get the control

Parameters

This function has no parameters.

Return Values

Group


Experiment::setControl

Description

public setControl (Group|array|object $group)

Define the control

Parameters

  • (Group|array|object) $group

Return Values

self


Experiment::getVariation

Description

public getVariation (void)

Get the variation

Parameters

This function has no parameters.

Return Values

Group


Experiment::setVariation

Description

public setVariation (Group|array|object $group)

Define the variation

Parameters

  • (Group|array|object) $group

Return Values

self


Experiment::getAllocation

Description

public getAllocation (void)

Get experiment allocation

This is the percentual chance that a new user will be included in the experiment

Parameters

This function has no parameters.

Return Values

int


Experiment::setAllocation

Description

public setAllocation (int|string $percent)

Set experiment allocation

This is the percentual chance that a new user will be included in the experiment

Parameters

  • (int|string) $percent

Return Values

self


Experiment::getResult

Description

public getResult (void)

Return a Result instance from the current experiment

Parameters

This function has no parameters.

Return Values

Result