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

Public Member Functions

 __construct ($val=null)
 
 __get ($property)
 
 __set ($property, $value)
 
 getType ()
 
 toString ($factory=null)
 
 makeClone (Zend_Pdf_ElementFactory $factory, array &$processed, $mode)
 
 setParentObject (Zend_Pdf_Element_Object $parent)
 
 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 ()
 

Data Fields

 $items
 
- 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
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Pdf_Element
static phpToPdf ($input)
 

Detailed Description

Definition at line 35 of file Array.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $val = null)

Object constructor

Parameters
array$val- array of Zend_Pdf_Element objects
Exceptions
Zend_Pdf_Exception

Definition at line 53 of file Array.php.

54  {
55  $this->items = new ArrayObject();
56 
57  if ($val !== null && is_array($val)) {
58  foreach ($val as $element) {
59  if (!$element instanceof Zend_Pdf_Element) {
60  #require_once 'Zend/Pdf/Exception.php';
61  throw new Zend_Pdf_Exception('Array elements must be Zend_Pdf_Element objects');
62  }
63  $this->items[] = $element;
64  }
65  } else if ($val !== null){
66  #require_once 'Zend/Pdf/Exception.php';
67  throw new Zend_Pdf_Exception('Argument must be an array');
68  }
69  }
$element
Definition: element.phtml:12

Member Function Documentation

◆ __get()

__get (   $property)

Getter

Parameters
string$property
Exceptions
Zend_Pdf_Exception

Definition at line 78 of file Array.php.

78  {
79  #require_once 'Zend/Pdf/Exception.php';
80  throw new Zend_Pdf_Exception('Undefined property: Zend_Pdf_Element_Array::$' . $property);
81  }

◆ __set()

__set (   $property,
  $value 
)

Setter

Parameters
mixed$offset
mixed$value
Exceptions
Zend_Pdf_Exception

Definition at line 91 of file Array.php.

91  {
92  #require_once 'Zend/Pdf/Exception.php';
93  throw new Zend_Pdf_Exception('Undefined property: Zend_Pdf_Element_Array::$' . $property);
94  }

◆ getType()

getType ( )

Return type of the element.

Returns
integer

Definition at line 101 of file Array.php.

102  {
104  }
const TYPE_ARRAY
Definition: Element.php:36

◆ 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 139 of file Array.php.

140  {
141  $newArray = new self();
142 
143  foreach ($this->items as $key => $value) {
144  $newArray->items[$key] = $value->makeClone($factory, $processed, $mode);
145  }
146 
147  return $newArray;
148  }
$value
Definition: gender.phtml:16
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
Definition: grid.phtml:15

◆ setParentObject()

setParentObject ( Zend_Pdf_Element_Object  $parent)

Set top level parent indirect object.

Parameters
Zend_Pdf_Element_Object$parent

Definition at line 155 of file Array.php.

156  {
157  parent::setParentObject($parent);
158 
159  foreach ($this->items as $item) {
160  $item->setParentObject($parent);
161  }
162  }

◆ toPhp()

toPhp ( )

Convert PDF element to PHP type.

Dictionary is returned as an associative array

Returns
mixed

Definition at line 171 of file Array.php.

172  {
173  $phpArray = array();
174 
175  foreach ($this->items as $item) {
176  $phpArray[] = $item->toPhp();
177  }
178 
179  return $phpArray;
180  }

◆ toString()

toString (   $factory = null)

Return object as string

Parameters
Zend_Pdf_Factory$factory
Returns
string

Definition at line 113 of file Array.php.

114  {
115  $outStr = '[';
116  $lastNL = 0;
117 
118  foreach ($this->items as $element) {
119  if (strlen($outStr) - $lastNL > 128) {
120  $outStr .= "\n";
121  $lastNL = strlen($outStr);
122  }
123 
124  $outStr .= $element->toString($factory) . ' ';
125  }
126  $outStr .= ']';
127 
128  return $outStr;
129  }
$element
Definition: element.phtml:12

Field Documentation

◆ $items

$items

Definition at line 44 of file Array.php.


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