Exemple #1
0
 /**
  * @param string $path
  */
 public function setPath($path)
 {
     if ($path && $path[0] != '/') {
         Tracker::_raiseError('The page path should always start with a slash ("/").', __METHOD__);
     }
     $this->path = $path;
 }
Exemple #2
0
 /**
  * @param array $properties
  */
 public function __construct(array $properties = array())
 {
     foreach ($properties as $property => $value) {
         // PHP doesn't care about case in method names
         $setterMethod = 'set' . $property;
         if (method_exists($this, $setterMethod)) {
             $this->{$setterMethod}($value);
         } else {
             return Tracker::_raiseError('There is no setting "' . $property . '".', __METHOD__);
         }
     }
 }
 public function validate()
 {
     if ($this->network === null || $this->action === null) {
         Tracker::_raiseError('Social interactions need to have at least the "network" and "action" attributes defined.', __METHOD__);
     }
 }
Exemple #4
0
 /**
  * @param int $loadTime
  */
 public function setLoadTime($loadTime)
 {
     if ((int) $loadTime != (double) $loadTime) {
         return Tracker::_raiseError('Page load time must be specified in integer milliseconds.', __METHOD__);
     }
     $this->loadTime = (int) $loadTime;
 }
Exemple #5
0
 public function validate()
 {
     if ($this->sku === null) {
         Tracker::_raiseError('Items need to have a sku/product code defined.', __METHOD__);
     }
 }
Exemple #6
0
 /**
  * @param int $sitespeedSampleRate
  */
 public function setSitespeedSampleRate($sitespeedSampleRate)
 {
     if ((int) $sitespeedSampleRate != (double) $sitespeedSampleRate || $sitespeedSampleRate < 0 || $sitespeedSampleRate > 100) {
         return Tracker::_raiseError('For consistency with ga.js, sample rates must be specified as a number between 0 and 100.', __METHOD__);
     }
     $this->sitespeedSampleRate = (int) $sitespeedSampleRate;
 }
Exemple #7
0
 public function validate()
 {
     if ($this->category === null || $this->action === null) {
         Tracker::_raiseError('Events need at least to have a category and action defined.', __METHOD__);
     }
 }
 public function validate()
 {
     if (!$this->items) {
         Tracker::_raiseError('Transactions need to consist of at least one item.', __METHOD__);
     }
 }