_withChecksum = true; // Default to true but not mandatory $this->_withChecksumInText = true; } /** * Activate/deactivate the automatic generation * of the checksum character * added to the barcode text * @param boolean $value * @return Zend_Barcode_Object */ public function setWithChecksum($value) { // Checksum is mandatory with Itf14 return $this; } /** * Activate/deactivate the automatic generation * of the checksum character * added to the barcode text * @param boolean $value * @return Zend_Barcode_Object * @throw Zend_Barcode_Object_Exception */ public function setWithChecksumInText($value) { return $this; } /** * Retrieve text to encode * @return string */ public function getText() { $text = $this->_getTextWithChecksum(); if (strlen($text) < 14) { $text = str_repeat('0', 14 - strlen($text)) . $text; } return $text; } /** * Retrieve text to display * @return string */ public function getTextToDisplay() { return $this->getText(); } /** * Check allowed characters * @param string $value * @return string * @throw Zend_Barcode_Object_Exception */ public function validateText($value) { $this->_validateText($value, array('automaticPrepend' => 0, 'substituteChecksumCharacter' => 0)); } }