private function _initQuantity($config) { $q = self::_fetchIntValue($config, "quantity", self::DEFAULT_QUANTITY); if (!is_int($q) || $q < 1) { throw new \InvalidArgumentException('quantity must be a positive integer'); } $this->_quantity = $q; }