Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Explicit.php
Go to the documentation of this file.
1 <?php
25 #require_once 'Zend/Pdf/Element.php';
26 
27 
29 #require_once 'Zend/Pdf/Destination.php';
30 
40 {
46  protected $_destinationArray;
47 
53  protected $_isRemote;
54 
61  public function __construct(Zend_Pdf_Element $destinationArray)
62  {
63  if ($destinationArray->getType() != Zend_Pdf_Element::TYPE_ARRAY) {
64  #require_once 'Zend/Pdf/Exception.php';
65  throw new Zend_Pdf_Exception('Explicit destination resource Array must be a direct or an indirect array object.');
66  }
67 
68  $this->_destinationArray = $destinationArray;
69 
70  switch (count($this->_destinationArray->items)) {
71  case 0:
72  #require_once 'Zend/Pdf/Exception.php';
73  throw new Zend_Pdf_Exception('Destination array must contain a page reference.');
74  break;
75 
76  case 1:
77  #require_once 'Zend/Pdf/Exception.php';
78  throw new Zend_Pdf_Exception('Destination array must contain a destination type name.');
79  break;
80 
81  default:
82  // Do nothing
83  break;
84  }
85 
86  switch ($this->_destinationArray->items[0]->getType()) {
88  $this->_isRemote = true;
89  break;
90 
92  $this->_isRemote = false;
93  break;
94 
95  default:
96  #require_once 'Zend/Pdf/Exception.php';
97  throw new Zend_Pdf_Exception('Destination target must be a page number or page dictionary object.');
98  break;
99  }
100  }
101 
107  public function isRemote()
108  {
109  return $this->_isRemote;
110  }
111 
118  public function getResource()
119  {
121  }
122 }
const TYPE_NUMERIC
Definition: Element.php:33
const TYPE_ARRAY
Definition: Element.php:36
const TYPE_DICTIONARY
Definition: Element.php:37
__construct(Zend_Pdf_Element $destinationArray)
Definition: Explicit.php:61