File indexing completed on 2024-12-22 05:36:29

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_Barcode
0017  * @subpackage Object
0018  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0019  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0020  * @version    $Id$
0021  */
0022 
0023 /** @see Zend_Barcode_Object_ObjectAbstract */
0024 // require_once 'Zend/Barcode/Object/ObjectAbstract.php';
0025 
0026 /**
0027  * Class for generate Barcode
0028  *
0029  * @category   Zend
0030  * @package    Zend_Barcode
0031  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0032  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0033  */
0034 class Zend_Barcode_Object_Error extends Zend_Barcode_Object_ObjectAbstract
0035 {
0036     /**
0037      * All texts are accepted
0038      * @param string $value
0039      * @return boolean
0040      */
0041     public function validateText($value)
0042     {
0043         return true;
0044     }
0045 
0046     /**
0047      * Height is forced
0048      *
0049      * @param bool $recalculate
0050      * @return integer
0051      */
0052     public function getHeight($recalculate = false)
0053     {
0054         return 40;
0055     }
0056 
0057     /**
0058      * Width is forced
0059      *
0060      * @param bool $recalculate
0061      * @return integer
0062      */
0063     public function getWidth($recalculate = false)
0064     {
0065         return 400;
0066     }
0067 
0068     /**
0069      * Reset precedent instructions
0070      * and draw the error message
0071      * @return array
0072      */
0073     public function draw()
0074     {
0075         $this->_instructions = array();
0076         $this->_addText('ERROR:', 10, array(5 , 18), $this->_font, 0, 'left');
0077         $this->_addText($this->_text, 10, array(5 , 32), $this->_font, 0, 'left');
0078         return $this->_instructions;
0079     }
0080 
0081     /**
0082      * For compatibility reason
0083      * @return void
0084      */
0085     protected function _prepareBarcode()
0086     {
0087     }
0088 
0089     /**
0090      * For compatibility reason
0091      * @return void
0092      */
0093     protected function _checkParams()
0094     {
0095     }
0096 
0097     /**
0098      * For compatibility reason
0099      * @return void
0100      */
0101     protected function _calculateBarcodeWidth()
0102     {
0103     }
0104 }