|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00025 require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; 00026 00033 class Zend_Validate_Barcode_Upce extends Zend_Validate_Barcode_AdapterAbstract 00034 { 00039 protected $_length = array(6, 7, 8); 00040 00045 protected $_characters = '0123456789'; 00046 00051 protected $_checksum = '_gtin'; 00052 00059 public function checkLength($value) 00060 { 00061 if (strlen($value) != 8) { 00062 $this->setCheck(false); 00063 } else { 00064 $this->setCheck(true); 00065 } 00066 00067 return parent::checkLength($value); 00068 } 00069 }