当前位置: 首页>>代码示例>>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;未经允许,请勿转载。