Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Target.php
Go to the documentation of this file.
1 <?php
32 abstract class Zend_Pdf_Target
33 {
41  public static function load(Zend_Pdf_Element $resource) {
42  #require_once 'Zend/Pdf/Element.php';
43  if ($resource->getType() == Zend_Pdf_Element::TYPE_DICTIONARY) {
44  if (($resource->Type === null || $resource->Type->value =='Action') && $resource->S !== null) {
45  // It's a well-formed action, load it
46  #require_once 'Zend/Pdf/Action.php';
48  } else if ($resource->D !== null) {
49  // It's a destination
50  $resource = $resource->D;
51  } else {
52  #require_once 'Zend/Pdf/Exception.php';
53  throw new Zend_Pdf_Exception('Wrong resource type.');
54  }
55  }
56 
57  if ($resource->getType() == Zend_Pdf_Element::TYPE_ARRAY ||
58  $resource->getType() == Zend_Pdf_Element::TYPE_NAME ||
60  // Resource is an array, just treat it as an explicit destination array
61  #require_once 'Zend/Pdf/Destination.php';
63  } else {
64  #require_once 'Zend/Pdf/Exception.php';
65  throw new Zend_Pdf_Exception( 'Wrong resource type.' );
66  }
67  }
68 
75  abstract public function getResource();
76 }
const TYPE_NAME
Definition: Element.php:35
const TYPE_ARRAY
Definition: Element.php:36
$resource
Definition: bulk.php:12
const TYPE_DICTIONARY
Definition: Element.php:37
const TYPE_STRING
Definition: Element.php:34
static load(Zend_Pdf_Element $resource)
Definition: Target.php:41
static load(Zend_Pdf_Element $resource)
Definition: Destination.php:49
static load(Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions=null)
Definition: Action.php:115