예제 #1
0
파일: Page.php 프로젝트: msports/mmwebfonts
 /**
  * @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;
 }
예제 #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__);
         }
     }
 }
예제 #3
0
 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__);
     }
 }
예제 #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;
 }
예제 #5
0
파일: Item.php 프로젝트: xamiro-dev/xamiro
 public function validate()
 {
     if ($this->sku === null) {
         Tracker::_raiseError('Items need to have a sku/product code defined.', __METHOD__);
     }
 }
예제 #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;
 }
예제 #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__);
     }
 }
예제 #8
0
 public function validate()
 {
     if (!$this->items) {
         Tracker::_raiseError('Transactions need to consist of at least one item.', __METHOD__);
     }
 }