Skip to content

Latest commit

 

History

History
98 lines (38 loc) · 2.34 KB

InnoCraft-Experiments-Variations-CallableVariation.md

File metadata and controls

98 lines (38 loc) · 2.34 KB

InnoCraft\Experiments\Variations\CallableVariation

Methods

getCallable

callable InnoCraft\Experiments\Variations\CallableVariation::getCallable()

Returns a callable if the option was passed.

  • Visibility: public

run

void InnoCraft\Experiments\Variations\VariationInterface::run()

Runs / executes the given variation. Depending on the variation type a different action may be executed.

For example a redirect or calling a callable.

__construct

mixed InnoCraft\Experiments\Variations\StandardVariation::__construct(array $variation)

Arguments

  • $variation array - <p>eg array('name' => 'blueColor', 'percentage' => 50). A name has to be given and can be also an ID, eg "4". Percentage is optional. If given, it defines how much traffic this variation should get. For example defining 50 means, this variation will be activated in 50% of overall experiment activations.</p>

getName

string InnoCraft\Experiments\Variations\VariationInterface::getName()

Get the name of the variation.

getPercentage

string InnoCraft\Experiments\Variations\VariationInterface::getPercentage()

Get the percentage allocated to this variation. Only returns a percentage if a fixed percentage was allocated to this variation. If no percentage is allocated, it will use the default percentage of a variation which depends on the number of set variations within an experiment.