Error.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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-2015 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-2015 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. *
  46. * @param bool $recalculate
  47. * @return integer
  48. */
  49. public function getHeight($recalculate = false)
  50. {
  51. return 40;
  52. }
  53. /**
  54. * Width is forced
  55. *
  56. * @param bool $recalculate
  57. * @return integer
  58. */
  59. public function getWidth($recalculate = false)
  60. {
  61. return 400;
  62. }
  63. /**
  64. * Reset precedent instructions
  65. * and draw the error message
  66. * @return array
  67. */
  68. public function draw()
  69. {
  70. $this->_instructions = array();
  71. $this->_addText('ERROR:', 10, array(5 , 18), $this->_font, 0, 'left');
  72. $this->_addText($this->_text, 10, array(5 , 32), $this->_font, 0, 'left');
  73. return $this->_instructions;
  74. }
  75. /**
  76. * For compatibility reason
  77. * @return void
  78. */
  79. protected function _prepareBarcode()
  80. {
  81. }
  82. /**
  83. * For compatibility reason
  84. * @return void
  85. */
  86. protected function _checkParams()
  87. {
  88. }
  89. /**
  90. * For compatibility reason
  91. * @return void
  92. */
  93. protected function _calculateBarcodeWidth()
  94. {
  95. }
  96. }