Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Validator / Barcode / Upce.php
bloba2ea65d5e1d148c6fe3866860ef9c7feb8a9128a
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Validator\Barcode;
12 class Upce extends AbstractAdapter
14 /**
15 * Constructor for this barcode adapter
17 public function __construct()
19 $this->setLength(array(6, 7, 8));
20 $this->setCharacters('0123456789');
21 $this->setChecksum('gtin');
24 /**
25 * Overrides parent checkLength
27 * @param string $value Value
28 * @return bool
30 public function hasValidLength($value)
32 if (strlen($value) != 8) {
33 $this->useChecksum(false);
34 } else {
35 $this->useChecksum(true);
38 return parent::hasValidLength($value);