|
1 <?php |
|
2 /** |
|
3 * Zend Framework |
|
4 * |
|
5 * LICENSE |
|
6 * |
|
7 * This source file is subject to the new BSD license that is bundled |
|
8 * with this package in the file LICENSE.txt. |
|
9 * It is also available through the world-wide-web at this URL: |
|
10 * http://framework.zend.com/license/new-bsd |
|
11 * If you did not receive a copy of the license and are unable to |
|
12 * obtain it through the world-wide-web, please send an email |
|
13 * to license@zend.com so we can send you a copy immediately. |
|
14 * |
|
15 * @category Zend |
|
16 * @package Zend_Barcode |
|
17 * @subpackage Object |
|
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
20 * @version $Id: Error.php 20096 2010-01-06 02:05:09Z bkarwin $ |
|
21 */ |
|
22 |
|
23 /** @see Zend_Barcode_Object_ObjectAbstract */ |
|
24 require_once 'Zend/Barcode/Object/ObjectAbstract.php'; |
|
25 |
|
26 /** |
|
27 * Class for generate Barcode |
|
28 * |
|
29 * @category Zend |
|
30 * @package Zend_Barcode |
|
31 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
32 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
33 */ |
|
34 class Zend_Barcode_Object_Error extends Zend_Barcode_Object_ObjectAbstract |
|
35 { |
|
36 /** |
|
37 * All texts are accepted |
|
38 * @param string $value |
|
39 * @return boolean |
|
40 */ |
|
41 public function validateText($value) |
|
42 { |
|
43 return true; |
|
44 } |
|
45 |
|
46 /** |
|
47 * Height is forced |
|
48 * @return integer |
|
49 */ |
|
50 public function getHeight($recalculate = false) |
|
51 { |
|
52 return 40; |
|
53 } |
|
54 |
|
55 /** |
|
56 * Width is forced |
|
57 * @return integer |
|
58 */ |
|
59 public function getWidth($recalculate = false) |
|
60 { |
|
61 return 400; |
|
62 } |
|
63 |
|
64 /** |
|
65 * Reset precedent instructions |
|
66 * and draw the error message |
|
67 * @return array |
|
68 */ |
|
69 public function draw() |
|
70 { |
|
71 $this->_instructions = array(); |
|
72 $this->_addText('ERROR:', 10, array(5 , 18), $this->_font, 0, 'left'); |
|
73 $this->_addText($this->_text, 10, array(5 , 32), $this->_font, 0, 'left'); |
|
74 return $this->_instructions; |
|
75 } |
|
76 |
|
77 /** |
|
78 * For compatibility reason |
|
79 * @return void |
|
80 */ |
|
81 protected function _prepareBarcode() |
|
82 { |
|
83 } |
|
84 |
|
85 /** |
|
86 * For compatibility reason |
|
87 * @return void |
|
88 */ |
|
89 protected function _checkParams() |
|
90 { |
|
91 } |
|
92 |
|
93 /** |
|
94 * For compatibility reason |
|
95 * @return void |
|
96 */ |
|
97 protected function _calculateBarcodeWidth() |
|
98 { |
|
99 } |
|
100 } |