當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Validate_Barcode::getMessages方法代碼示例

本文整理匯總了PHP中Zend_Validate_Barcode::getMessages方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Validate_Barcode::getMessages方法的具體用法?PHP Zend_Validate_Barcode::getMessages怎麽用?PHP Zend_Validate_Barcode::getMessages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Validate_Barcode的用法示例。


在下文中一共展示了Zend_Validate_Barcode::getMessages方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testInvalidChecksumAdapter

 public function testInvalidChecksumAdapter()
 {
     // require_once dirname(__FILE__) . "/_files/MyBarcode1.php";
     $barcode = new Zend_Validate_Barcode('MyBarcode1');
     $this->assertFalse($barcode->isValid('0000000'));
     $this->assertTrue(array_key_exists('barcodeFailed', $barcode->getMessages()));
     $this->assertFalse($barcode->getAdapter()->checksum('0000000'));
 }
開發者ID:netvlies,項目名稱:zf,代碼行數:8,代碼來源:BarcodeTest.php

示例2: _validateText

 /**
  * Particular validation for Upce barcode objects
  * (to suppress checksum character substitution)
  *
  * @param string $value
  * @param array  $options
  * @throws Zend_Barcode_Object_Exception
  */
 protected function _validateText($value, $options = array())
 {
     $validator = new Zend_Validate_Barcode(array('adapter' => 'upce', 'checksum' => false));
     $value = $this->_addLeadingZeros($value, true);
     if (!$validator->isValid($value)) {
         $message = implode("\n", $validator->getMessages());
         /**
          * @see Zend_Barcode_Object_Exception
          */
         throw new Zend_Barcode_Object_Exception($message);
     }
 }
開發者ID:NerdGZ,項目名稱:icingaweb2,代碼行數:20,代碼來源:Upce.php

示例3: testArrayLengthMessage

 /**
  * @group ZF-10116
  */
 public function testArrayLengthMessage()
 {
     $barcode = new Zend_Validate_Barcode('ean8');
     $this->assertFalse($barcode->isValid('123'));
     $message = $barcode->getMessages();
     $this->assertTrue(array_key_exists('barcodeInvalidLength', $message));
     $this->assertContains("length of 7/8 characters", $message['barcodeInvalidLength']);
 }
開發者ID:ThorstenSuckow,項目名稱:conjoon,代碼行數:11,代碼來源:BarcodeTest.php

示例4: _validateText

 /**
  * Standard validation for most of barcode objects
  * @param string $value
  * @param array  $options
  */
 protected function _validateText($value, $options = array())
 {
     $validatorName = isset($options['validator']) ? $options['validator'] : $this->getType();
     $validator = new Zend_Validate_Barcode(array('adapter' => $validatorName, 'checksum' => false));
     $checksumCharacter = '';
     $withChecksum = false;
     if ($this->_mandatoryChecksum) {
         $checksumCharacter = $this->_substituteChecksumCharacter;
         $withChecksum = true;
     }
     $value = $this->_addLeadingZeros($value, $withChecksum) . $checksumCharacter;
     if (!$validator->isValid($value)) {
         $message = implode("\n", $validator->getMessages());
         /**
          * @see Zend_Barcode_Object_Exception
          */
         require_once 'Zend/Barcode/Object/Exception.php';
         throw new Zend_Barcode_Object_Exception($message);
     }
 }
開發者ID:vicfryzel,項目名稱:zf,代碼行數:25,代碼來源:ObjectAbstract.php

示例5: _validateText

 /**
  * Particular validation for Ean8 barcode objects
  * (to suppress checksum character substitution)
  * @param string $value
  * @param array  $options
  */
 protected function _validateText($value, $options = array())
 {
     $validator = new Zend_Validate_Barcode(array('adapter' => 'ean8', 'checksum' => false));
     $value = $this->_addLeadingZeros($value, true);
     if (!$validator->isValid($value)) {
         $message = implode("\n", $validator->getMessages());
         /**
          * @see Zend_Barcode_Object_Exception
          */
         require_once PHP_LIBRARY_PATH . 'Zend/Barcode/Object/Exception.php';
         throw new Zend_Barcode_Object_Exception($message);
     }
 }
開發者ID:netixx,項目名稱:Stock,代碼行數:19,代碼來源:Ean8.php


注:本文中的Zend_Validate_Barcode::getMessages方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。