Esempio n. 1
0
 /**
  * Overrides parent checkLength
  *
  * @param string $value Value
  * @return boolean
  */
 public function checkLength($value)
 {
     if (strlen($value) == 7) {
         $this->setCheck(false);
     } else {
         $this->setCheck(true);
     }
     return parent::checkLength($value);
 }
Esempio n. 2
0
 /**
  * Validates the checksum
  *
  * @param  string $value The barcode to check the checksum for
  * @return boolean
  */
 public function checksum($value)
 {
     if (strlen($value) == 8) {
         $this->_checksum = '_issn';
     } else {
         $this->_checksum = '_gtin';
     }
     return parent::checksum($value);
 }
Esempio n. 3
0
 /**
  * @throws Exception\EmptyHeadersException
  * @throws Exception\InvalidArgumentTypeException
  * @throws Exception\InvalidFontFamilyException
  * @throws Exception\InvalidPageOrientationException
  * @throws Exception\InvalidPageSizeException
  * @throws Exception\OutputPathNotWritableException
  * @throws Exception\TemplateNotSetException
  */
 public function validateOutput()
 {
     parent::validateOutput();
     $template = $this->config->getTemplate();
     if (empty($template)) {
         throw new Exception\TemplateNotSetException();
     }
     $extraSettings = $this->config->getExtraSettings();
     if (isset($extraSettings['pageOrientation']) && !in_array($extraSettings['pageOrientation'], $this->getAvailablePageOrientation())) {
         throw new Exception\InvalidPageOrientationException();
     }
     if (isset($extraSettings['pageSize']) && !in_array($extraSettings['pageSize'], $this->getAvailablePageSize())) {
         throw new Exception\InvalidPageSizeException();
     }
     if (isset($extraSettings['fontFamily']) && !in_array($extraSettings['fontFamily'], $this->getAvailableFontFamily())) {
         throw new Exception\InvalidFontFamilyException();
     }
 }
Esempio n. 4
0
 public function setOptions(array $options = array())
 {
     parent::setOptions($options);
     foreach ($this->_config as $name => $value) {
         switch ($name) {
             case 'in':
                 if (preg_match('/^[a-z0-9]+$/', $value)) {
                     $this->reservationNumber = $value;
                 }
                 break;
             case 'au':
                 if (preg_match('/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/', $value)) {
                     $this->referenceId = $value;
                 }
                 break;
         }
     }
 }
Esempio n. 5
0
 public function setOptions(array $options = array())
 {
     parent::setOptions($options);
     foreach ($this->_config as $name => $value) {
         switch ($name) {
             case 'x_fp_sequence':
                 $this->reservationnumber = $value;
                 break;
             case 'x_trans_id':
                 $this->referenceid = $value;
                 break;
             case 'x_login':
                 $this->merchantcode = $value;
                 break;
             case 'x_amount':
                 $this->amount = $value;
                 break;
         }
     }
 }
Esempio n. 6
0
 /**
  * Get datetime
  *
  * @return object MongoDate
  */
 public function dateTime($format = null)
 {
     // MongoDB only supports timestamps for now, not direct DateTime objects
     $format = parent::dateTime($format)->format('U');
     return new \MongoDate($format);
 }
Esempio n. 7
0
 public function setOptions(array $options = array())
 {
     parent::setOptions($options);
 }
Esempio n. 8
0
 /**
  * Allows start and stop tag within checked chars
  *
  * @param  string $value The barcode to check for allowed characters
  * @return boolean
  */
 public function checkChars($value)
 {
     if ($value[0] == '(') {
         $value = substr($value, 1);
         if ($value[strlen($value) - 1] == ')') {
             $value = substr($value, 0, -1);
         } else {
             return false;
         }
     }
     return parent::checkChars($value);
 }