コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
ファイル: Issn.php プロジェクト: madberry/WhiteLabelTransfer
 /**
  * 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);
 }
コード例 #3
0
ファイル: Royalmail.php プロジェクト: test3metizsoft/test
 /**
  * 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);
 }