You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
2.7 KiB

12 years ago
  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_Pdf
  17. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. * @version $Id: UpdateInfoContainer.php 24593 2012-01-05 20:35:02Z matthew $
  20. */
  21. /**
  22. * Container which collects updated object info.
  23. *
  24. * @package Zend_Pdf
  25. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  26. * @license http://framework.zend.com/license/new-bsd New BSD License
  27. */
  28. class Zend_Pdf_UpdateInfoContainer
  29. {
  30. /**
  31. * Object number
  32. *
  33. * @var integer
  34. */
  35. private $_objNum;
  36. /**
  37. * Generation number
  38. *
  39. * @var integer
  40. */
  41. private $_genNum;
  42. /**
  43. * Flag, which signals, that object is free
  44. *
  45. * @var boolean
  46. */
  47. private $_isFree;
  48. /**
  49. * String representation of the object
  50. *
  51. * @var Zend_Memory_Container|null
  52. */
  53. private $_dump = null;
  54. /**
  55. * Object constructor
  56. *
  57. * @param integer $objCount
  58. */
  59. public function __construct($objNum, $genNum, $isFree, $dump = null)
  60. {
  61. $this->_objNum = $objNum;
  62. $this->_genNum = $genNum;
  63. $this->_isFree = $isFree;
  64. if ($dump !== null) {
  65. if (strlen($dump) > 1024) {
  66. // require_once 'Zend/Pdf.php';
  67. $this->_dump = Zend_Pdf::getMemoryManager()->create($dump);
  68. } else {
  69. $this->_dump = $dump;
  70. }
  71. }
  72. }
  73. /**
  74. * Get object number
  75. *
  76. * @return integer
  77. */
  78. public function getObjNum()
  79. {
  80. return $this->_objNum;
  81. }
  82. /**
  83. * Get generation number
  84. *
  85. * @return integer
  86. */
  87. public function getGenNum()
  88. {
  89. return $this->_genNum;
  90. }
  91. /**
  92. * Check, that object is free
  93. *
  94. * @return boolean
  95. */
  96. public function isFree()
  97. {
  98. return $this->_isFree;
  99. }
  100. /**
  101. * Get string representation of the object
  102. *
  103. * @return string
  104. */
  105. public function getObjectDump()
  106. {
  107. if ($this->_dump === null) {
  108. return '';
  109. }
  110. if (is_string($this->_dump)) {
  111. return $this->_dump;
  112. }
  113. return $this->_dump->getRef();
  114. }
  115. }