Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Zend_Pdf_Element_Reference Class Reference
Inheritance diagram for Zend_Pdf_Element_Reference:
Zend_Pdf_Element

Public Member Functions

 __construct ($objNum, $genNum=0, Zend_Pdf_Element_Reference_Context $context, Zend_Pdf_ElementFactory $factory)
 
 getFactory ()
 
 getType ()
 
 toString ($factory=null)
 
 makeClone (Zend_Pdf_ElementFactory $factory, array &$processed, $mode)
 
 touch ()
 
 getObject ()
 
 __get ($property)
 
 __set ($property, $value)
 
 __call ($method, $args)
 
 cleanUp ()
 
 toPhp ()
 
- Public Member Functions inherited from Zend_Pdf_Element
 getType ()
 
 toString ($factory=null)
 
 makeClone (Zend_Pdf_ElementFactory $factory, array &$processed, $mode)
 
 setParentObject (Zend_Pdf_Element_Object $parent)
 
 getParentObject ()
 
 touch ()
 
 cleanUp ()
 
 toPhp ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Pdf_Element
static phpToPdf ($input)
 
- Data Fields inherited from Zend_Pdf_Element
const TYPE_BOOL = 1
 
const TYPE_NUMERIC = 2
 
const TYPE_STRING = 3
 
const TYPE_NAME = 4
 
const TYPE_ARRAY = 5
 
const TYPE_DICTIONARY = 6
 
const TYPE_STREAM = 7
 
const TYPE_NULL = 11
 
const CLONE_MODE_SKIP_PAGES = 1
 
const CLONE_MODE_FORCE_CLONING = 2
 

Detailed Description

Definition at line 38 of file Reference.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $objNum,
  $genNum = 0,
Zend_Pdf_Element_Reference_Context  $context,
Zend_Pdf_ElementFactory  $factory 
)

Object constructor:

Parameters
integer$objNum
integer$genNum
Zend_Pdf_Element_Reference_Context$context
Zend_Pdf_ElementFactory$factory
Exceptions
Zend_Pdf_Exception

Definition at line 91 of file Reference.php.

92  {
93  if ( !(is_integer($objNum) && $objNum > 0) ) {
94  #require_once 'Zend/Pdf/Exception.php';
95  throw new Zend_Pdf_Exception('Object number must be positive integer');
96  }
97  if ( !(is_integer($genNum) && $genNum >= 0) ) {
98  #require_once 'Zend/Pdf/Exception.php';
99  throw new Zend_Pdf_Exception('Generation number must be non-negative integer');
100  }
101 
102  $this->_objNum = $objNum;
103  $this->_genNum = $genNum;
104  $this->_ref = null;
105  $this->_context = $context;
106  $this->_factory = $factory;
107  }

Member Function Documentation

◆ __call()

__call (   $method,
  $args 
)

Call handler

Parameters
string$method
array$args
Returns
mixed

Definition at line 273 of file Reference.php.

274  {
275  if ($this->_ref === null) {
276  $this->_dereference();
277  }
278 
279  return call_user_func_array(array($this->_ref, $method), $args);
280  }
$method
Definition: info.phtml:13

◆ __get()

__get (   $property)

Get handler

Parameters
string$property
Returns
mixed

Definition at line 242 of file Reference.php.

243  {
244  if ($this->_ref === null) {
245  $this->_dereference();
246  }
247 
248  return $this->_ref->$property;
249  }

◆ __set()

__set (   $property,
  $value 
)

Set handler

Parameters
string$property
mixed$value

Definition at line 257 of file Reference.php.

258  {
259  if ($this->_ref === null) {
260  $this->_dereference();
261  }
262 
263  $this->_ref->$property = $value;
264  }
$value
Definition: gender.phtml:16

◆ cleanUp()

cleanUp ( )

Clean up resources

Definition at line 285 of file Reference.php.

286  {
287  $this->_ref = null;
288  }

◆ getFactory()

getFactory ( )

Check, that object is generated by specified factory

Returns
Zend_Pdf_ElementFactory

Definition at line 114 of file Reference.php.

115  {
116  return $this->_factory;
117  }

◆ getObject()

getObject ( )

Return object, which can be used to identify object and its references identity

Returns
Zend_Pdf_Element_Object

Definition at line 227 of file Reference.php.

228  {
229  if ($this->_ref === null) {
230  $this->_dereference();
231  }
232 
233  return $this->_ref;
234  }

◆ getType()

getType ( )

Return type of the element.

Returns
integer

Definition at line 125 of file Reference.php.

126  {
127  if ($this->_ref === null) {
128  $this->_dereference();
129  }
130 
131  return $this->_ref->getType();
132  }

◆ makeClone()

makeClone ( Zend_Pdf_ElementFactory  $factory,
array &  $processed,
  $mode 
)

Detach PDF object from the factory (if applicable), clone it and attach to new factory.

Parameters
Zend_Pdf_ElementFactory$factoryThe factory to attach
array&$processedList of already processed indirect objects, used to avoid objects duplication
integer$modeCloning mode (defines filter for objects cloning)
Returns
Zend_Pdf_Element

Definition at line 192 of file Reference.php.

193  {
194  if ($this->_ref === null) {
195  $this->_dereference();
196  }
197 
198  // This code duplicates code in Zend_Pdf_Element_Object class,
199  // but allows to avoid unnecessary method call in most cases
200  $id = spl_object_hash($this->_ref);
201  if (isset($processed[$id])) {
202  // Do nothing if object is already processed
203  // return it
204  return $processed[$id];
205  }
206 
207  return $this->_ref->makeClone($factory, $processed, $mode);
208  }
$id
Definition: fieldset.phtml:14
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
Definition: grid.phtml:15

◆ toPhp()

toPhp ( )

Convert PDF element to PHP type.

Returns
mixed

Definition at line 295 of file Reference.php.

296  {
297  if ($this->_ref === null) {
298  $this->_dereference();
299  }
300 
301  return $this->_ref->toPhp();
302  }

◆ toString()

toString (   $factory = null)

Return reference to the object

Parameters
Zend_Pdf_Factory$factory
Returns
string

Definition at line 141 of file Reference.php.

142  {
143  if ($factory === null) {
144  $shift = 0;
145  } else {
146  $shift = $factory->getEnumerationShift($this->_factory);
147  }
148 
149  return $this->_objNum + $shift . ' ' . $this->_genNum . ' R';
150  }

◆ touch()

touch ( )

Mark object as modified, to include it into new PDF file segment.

Definition at line 213 of file Reference.php.

214  {
215  if ($this->_ref === null) {
216  $this->_dereference();
217  }
218 
219  $this->_ref->touch();
220  }

The documentation for this class was generated from the following file: