本文整理汇总了PHP中Tracker::_raiseError方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker::_raiseError方法的具体用法?PHP Tracker::_raiseError怎么用?PHP Tracker::_raiseError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracker
的用法示例。
在下文中一共展示了Tracker::_raiseError方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setPath
/**
* @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: __construct
/**
* @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: validate
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: setLoadTime
/**
* @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: validate
public function validate()
{
if ($this->sku === null) {
Tracker::_raiseError('Items need to have a sku/product code defined.', __METHOD__);
}
}
示例6: setSitespeedSampleRate
/**
* @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: validate
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: validate
public function validate()
{
if (!$this->items) {
Tracker::_raiseError('Transactions need to consist of at least one item.', __METHOD__);
}
}