/** * Sets the packaging unit for a specific distributor. * * For example, some distributors only sell resistors in packs of 100, so you can't order just one. We use the * packagingUnit to calculate how many pieces will be delivered once ordered. So if your stock level falls below * the minimum (example: you would need to order 10 resistors), we suggest that you only order one resistor pack * instead of 10. * * @param int $packagingUnit The amount of items in one package * @throws \PartKeepr\Part\OutOfRangeException When the packaging unit is less than 1 */ public function setPackagingUnit($packagingUnit) { $packagingUnit = intval($packagingUnit); if ($packagingUnit < 1) { $exception = new OutOfRangeException(PartKeepr::i18n("Packaging Unit is out of range")); $exception->setDetail(PartKeepr::i18n("The packaging unit must be 1 or higher")); throw $exception; } $this->packagingUnit = $packagingUnit; }
/** * Exception constructor * @staticvar string $message Exception message, generated once for all future exception of this type * @param \Exception $previous Exception that caused this exception, if any */ public function __construct(\Exception $previous = null) { static $message = ''; if (empty($message)) { $message = sprintf('Exceeded memory capability of %d items', PHP_INT_MAX); } parent::__construct($message, 0, $previous); }
/** * Builds a new exception * * @param mixed $name Name of the intended aggregator that failed * * @access public */ public function __construct($name) { parent::__construct('Aggregator named "' . htmlentities($name) . '" not found in current aggregator container'); }
public function __construct($message = 'Index not found in array/collection', $code = 0, $previous = NULL) { parent::__construct($message, $code, $previous); }
/** * Builds a new exception * * @param mixed $name Name of the intended sorter that failed * * @access public */ public function __construct($name) { parent::__construct('Sorter named "' . htmlentities($name) . '" is already present in current sorter container'); }
public function __construct($message = "", $code = 0, $previous = null) { parent::__construct($message, $code, $previous); //todo: generate error code. }
/** * Builds a new exception * * @param mixed $name Name of the intended join predicate that failed * * @access public */ public function __construct($name) { parent::__construct('Join predicate named "' . htmlentities($name) . '" not found in current join predicate container'); }
/** * Builds a new exception * * @param mixed $name Name of the intended join predicate that failed * * @access public */ public function __construct($name) { parent::__construct('Join predicate named "' . htmlentities($name) . '" is already present in current join predicate container'); }
/** * Builds a new exception * * @param mixed $name Name of the intended datasource that failed * * @access public */ public function __construct($name) { parent::__construct('Datasource named "' . htmlentities($name) . '" not found in current datasource container'); }
/** * Builds a new exception * * @param mixed $name Name of the intended filter that failed * * @access public */ public function __construct($name) { parent::__construct('Filter named "' . htmlentities($name) . '" not found in current filter container'); }
/** * Builds a new exception * * @param mixed $name Name of the intended transformer that failed * * @access public */ public function __construct($name) { parent::__construct('Transformer named "' . htmlentities($name) . '" not found in current transformer container'); }
/** * Builds a new exception * * @param mixed $name Name of the intended datasource that failed * * @access public */ public function __construct($name) { parent::__construct('Datasource named "' . htmlentities($name) . '" is already present in current datasource container'); }
/** * Конструктор * */ public function __construct($message, $code, $file, $line) { $this->file = $file; $this->line = $line; parent::__construct($message, $code); }
/** * Builds a new exception * * @param mixed $name Name of the intended aggregator that failed * * @access public */ public function __construct($name) { parent::__construct('Aggregator named "' . htmlentities($name) . '" is already present in current aggregator container'); }
/** * Builds a new exception * * @param mixed $name Name of the group that failed * * @access public */ public function __construct($name) { parent::__construct('Group value "' . htmlentities($name) . '" is already present in current group container'); }
/** * Builds a new exception * * @param mixed $name Name of the intended group value that failed * * @access public */ public function __construct($name) { parent::__construct('Group value "' . htmlentities($name) . '" not found in current group container'); }