Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes
Zend_Pdf_Outline Class Reference
Inheritance diagram for Zend_Pdf_Outline:
Zend_Pdf_Outline_Created Zend_Pdf_Outline_Loaded

Public Member Functions

 getTitle ()
 
 setTitle ($title)
 
 isOpen ()
 
 setIsOpen ($isOpen)
 
 isItalic ()
 
 setIsItalic ($isItalic)
 
 isBold ()
 
 setIsBold ($isBold)
 
 getColor ()
 
 setColor (Zend_Pdf_Color_Rgb $color)
 
 getTarget ()
 
 setTarget ($target=null)
 
 getOptions ()
 
 setOptions (array $options)
 
 openOutlinesCount ()
 
 dumpOutline (Zend_Pdf_ElementFactory_Interface $factory, $updateNavigation, Zend_Pdf_Element $parent, Zend_Pdf_Element $prev=null, SplObjectStorage $processedOutlines=null)
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 
 getChildren ()
 
 hasChildren ()
 
 count ()
 

Static Public Member Functions

static create ($param1, $param2=null)
 

Data Fields

 $childOutlines = array()
 

Protected Attributes

 $_open = false
 

Detailed Description

Definition at line 34 of file Outline.php.

Member Function Documentation

◆ count()

count ( )

count()

Returns
int

Definition at line 369 of file Outline.php.

370  {
371  return count($this->childOutlines);
372  }

◆ create()

static create (   $param1,
  $param2 = null 
)
static

Create new Outline object

It provides two forms of input parameters:

  1. Zend_Pdf_Outline::create(string $title[, Zend_Pdf_Target $target])
  2. Zend_Pdf_Outline::create(array $options)

Second form allows to provide outline options as an array. The followed options are supported: 'title' - string, outline title, required 'open' - boolean, true if outline entry is open (default value is false) 'color' - Zend_Pdf_Color_Rgb object, true if outline entry is open (default value is null - black) 'italic' - boolean, true if outline entry is displayed in italic (default value is false) 'bold' - boolean, true if outline entry is displayed in bold (default value is false) 'target' - Zend_Pdf_Target object or string, outline item destination

Returns
Zend_Pdf_Outline
Exceptions
Zend_Pdf_Exception

Definition at line 230 of file Outline.php.

231  {
232  #require_once 'Zend/Pdf/Outline/Created.php';
233  if (is_string($param1)) {
234  if ($param2 !== null && !($param2 instanceof Zend_Pdf_Target || is_string($param2))) {
235  #require_once 'Zend/Pdf/Exception.php';
236  throw new Zend_Pdf_Exception('Outline create method takes $title (string) and $target (Zend_Pdf_Target or string) or an array as an input');
237  }
238 
239  return new Zend_Pdf_Outline_Created(array('title' => $param1,
240  'target' => $param2));
241  } else {
242  if (!is_array($param1) || $param2 !== null) {
243  #require_once 'Zend/Pdf/Exception.php';
244  throw new Zend_Pdf_Exception('Outline create method takes $title (string) and $destination (Zend_Pdf_Destination) or an array as an input');
245  }
246 
247  return new Zend_Pdf_Outline_Created($param1);
248  }
249  }

◆ current()

current ( )

Returns the child outline.

Returns
Zend_Pdf_Outline

Definition at line 298 of file Outline.php.

299  {
300  return current($this->childOutlines);
301  }

◆ dumpOutline()

dumpOutline ( Zend_Pdf_ElementFactory_Interface  $factory,
  $updateNavigation,
Zend_Pdf_Element  $parent,
Zend_Pdf_Element  $prev = null,
SplObjectStorage  $processedOutlines = null 
)
abstract

Dump Outline and its child outlines into PDF structures

Returns dictionary indirect object or reference

Parameters
Zend_Pdf_ElementFactory$factoryobject factory for newly created indirect objects
boolean$updateNavigationUpdate navigation flag
Zend_Pdf_Element$parentParent outline dictionary reference
Zend_Pdf_Element$prevPrevious outline dictionary reference
SplObjectStorage$processedOutlinesList of already processed outlines
Returns
Zend_Pdf_Element

◆ getChildren()

getChildren ( )

Returns the child outline.

Returns
Zend_Pdf_Outline|null

Definition at line 344 of file Outline.php.

345  {
346  return current($this->childOutlines);
347  }

◆ getColor()

getColor ( )
abstract

Get outline text color.

Returns
Zend_Pdf_Color_Rgb

◆ getOptions()

getOptions ( )

Get outline options

Returns
array

Definition at line 156 of file Outline.php.

157  {
158  return array('title' => $this->_title,
159  'open' => $this->_open,
160  'color' => $this->_color,
161  'italic' => $this->_italic,
162  'bold' => $this->_bold,
163  'target' => $this->_target);
164  }

◆ getTarget()

getTarget ( )
abstract

Get outline target.

Returns
Zend_Pdf_Target

◆ getTitle()

getTitle ( )
abstract

Get outline title.

Returns
string

◆ hasChildren()

hasChildren ( )

Implements RecursiveIterator interface.

Returns
bool whether container has any pages

Definition at line 354 of file Outline.php.

355  {
356  return count($this->childOutlines) > 0;
357  }

◆ isBold()

isBold ( )
abstract

Returns true if outline item is displayed in bold

Returns
boolean

◆ isItalic()

isItalic ( )
abstract

Returns true if outline item is displayed in italic

Returns
boolean

◆ isOpen()

isOpen ( )

Returns true if outline item is open by default

Returns
boolean

Definition at line 71 of file Outline.php.

72  {
73  return $this->_open;
74  }

◆ key()

key ( )

Returns current iterator key

Returns
integer

Definition at line 308 of file Outline.php.

309  {
310  return key($this->childOutlines);
311  }

◆ next()

next ( )

Go to next child

Definition at line 316 of file Outline.php.

317  {
318  return next($this->childOutlines);
319  }

◆ openOutlinesCount()

openOutlinesCount ( )

Returns number of the total number of open items at all levels of the outline.

Definition at line 257 of file Outline.php.

258  {
259  $count = 1; // Include this outline
260 
261  if ($this->isOpen()) {
262  foreach ($this->childOutlines as $child) {
263  $count += $child->openOutlinesCount();
264  }
265  }
266 
267  return $count;
268  }
$count
Definition: recent.phtml:13

◆ rewind()

rewind ( )

Rewind children

Definition at line 324 of file Outline.php.

325  {
326  return reset($this->childOutlines);
327  }

◆ setColor()

setColor ( Zend_Pdf_Color_Rgb  $color)
abstract

Set outline text color. (null means default color which is black)

Parameters
Zend_Pdf_Color_Rgb$color
Returns
Zend_Pdf_Outline

◆ setIsBold()

setIsBold (   $isBold)
abstract

Sets 'isBold' outline flag

Parameters
boolean$isBold
Returns
Zend_Pdf_Outline

◆ setIsItalic()

setIsItalic (   $isItalic)
abstract

Sets 'isItalic' outline flag

Parameters
boolean$isItalic
Returns
Zend_Pdf_Outline

◆ setIsOpen()

setIsOpen (   $isOpen)

Sets 'isOpen' outline flag

Parameters
boolean$isOpen
Returns
Zend_Pdf_Outline

Definition at line 82 of file Outline.php.

83  {
84  $this->_open = $isOpen;
85  return $this;
86  }

◆ setOptions()

setOptions ( array  $options)

Set outline options

Parameters
array$options
Returns
Zend_Pdf_Action
Exceptions
Zend_Pdf_Exception

Definition at line 173 of file Outline.php.

174  {
175  foreach ($options as $key => $value) {
176  switch ($key) {
177  case 'title':
178  $this->setTitle($value);
179  break;
180 
181  case 'open':
182  $this->setIsOpen($value);
183  break;
184 
185  case 'color':
186  $this->setColor($value);
187  break;
188  case 'italic':
189  $this->setIsItalic($value);
190  break;
191 
192  case 'bold':
193  $this->setIsBold($value);
194  break;
195 
196  case 'target':
197  $this->setTarget($value);
198  break;
199 
200  default:
201  #require_once 'Zend/Pdf/Exception.php';
202  throw new Zend_Pdf_Exception("Unknown option name - '$key'.");
203  break;
204  }
205  }
206 
207  return $this;
208  }
setIsOpen($isOpen)
Definition: Outline.php:82
setIsItalic($isItalic)
setTarget($target=null)
$value
Definition: gender.phtml:16
setIsBold($isBold)
setColor(Zend_Pdf_Color_Rgb $color)

◆ setTarget()

setTarget (   $target = null)
abstract

Set outline target. Null means no target

Parameters
Zend_Pdf_Target | string$target
Returns
Zend_Pdf_Outline

◆ setTitle()

setTitle (   $title)
abstract

Set outline title

Parameters
string$title
Returns
Zend_Pdf_Outline

◆ valid()

valid ( )

Check if current position is valid

Returns
boolean

Definition at line 334 of file Outline.php.

335  {
336  return current($this->childOutlines) !== false;
337  }

Field Documentation

◆ $_open

$_open = false
protected

Definition at line 41 of file Outline.php.

◆ $childOutlines

$childOutlines = array()

Definition at line 48 of file Outline.php.


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