public function __call($methodName, array $methodArguments)
{
$methodName = $this->fixTypos($methodName);
if (preg_match('/^set(Product|Promotion)ActionTo(\\w+)/', $methodName, $matches)) {
return $this->setParameterActionTo($matches[1], $matches[2]);
}
if (preg_match('/^(set)(\\w+)/', $methodName, $matches)) {
return $this->setParameter($methodName, $methodArguments);
}
if (preg_match('/^(add)(\\w+)/', $methodName, $matches)) {
return $this->addItem($methodName, $methodArguments);
}
if (preg_match('/^(send)(\\w+)/', $methodName, $matches)) {
return $this->sendHit($methodName);
}
// Get Parameters
if (preg_match('/^(get)(\\w+)/', $methodName, $matches)) {
return $this->getParameter($methodName, $methodArguments);
}
throw new \BadMethodCallException('Method ' . $methodName . ' not defined for Analytics class');
}