Error.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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-2012 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /** @see Zend_Barcode_Object_ObjectAbstract */
  23. require_once 'Zend/Barcode/Object/ObjectAbstract.php';
  24. /**
  25. * Class for generate Barcode
  26. *
  27. * @category Zend
  28. * @package Zend_Barcode
  29. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. */
  32. class Zend_Barcode_Object_Error extends Zend_Barcode_Object_ObjectAbstract
  33. {
  34. /**
  35. * All texts are accepted
  36. * @param string $value
  37. * @return boolean
  38. */
  39. public function validateText($value)
  40. {
  41. return true;
  42. }
  43. /**
  44. * Height is forced
  45. * @return integer
  46. */
  47. public function getHeight($recalculate = false)
  48. {
  49. return 40;
  50. }
  51. /**
  52. * Width is forced
  53. * @return integer
  54. */
  55. public function getWidth($recalculate = false)
  56. {
  57. return 400;
  58. }
  59. /**
  60. * Reset precedent instructions
  61. * and draw the error message
  62. * @return array
  63. */
  64. public function draw()
  65. {
  66. $this->_instructions = array();
  67. $this->_addText('ERROR:', 10, array(5 , 18), $this->_font, 0, 'left');
  68. $this->_addText($this->_text, 10, array(5 , 32), $this->_font, 0, 'left');
  69. return $this->_instructions;
  70. }
  71. /**
  72. * For compatibility reason
  73. * @return void
  74. */
  75. protected function _prepareBarcode()
  76. {
  77. }
  78. /**
  79. * For compatibility reason
  80. * @return void
  81. */
  82. protected function _checkParams()
  83. {
  84. }
  85. /**
  86. * For compatibility reason
  87. * @return void
  88. */
  89. protected function _calculateBarcodeWidth()
  90. {
  91. }
  92. }