/**
  * Overrides parent checkLength
  *
  * @param string $value Value
  * @return boolean
  */
 public function checkLength($value)
 {
     if (strlen($value) != 8) {
         $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
 /**
  * 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);
 }