setasign\SetaPDF2\Core\DataStructure\Tree
NumberTree Data structure class for Number Trees
File: /SetaPDF v2/Core/DataStructure/Tree/NumberTree.php            
        Old class name (alias):
        \SetaPDF_Core_DataStructure_NumberTree    
Class hierarchy
Implements
Summary
Static Properties
Properties
$_values
A cache for resolved entries
The index is the key while the value is an array of both key and value object.
Methods
__construct()
\setasign\SetaPDF2\Core\Document $document
The constructor.
Parameters
- $rootDictionary : \setasign\SetaPDF2\Core\Type\PdfDictionary
 - $document : \setasign\SetaPDF2\Core\Document
 
_findLastLeafNode()
array &$intermediateNodes,
array &$ensuredObjectsList = array ( )
Finds the last leaf node.
Parameters
- $node : \setasign\SetaPDF2\Core\Type\PdfDictionary
 - $intermediateNodes : array
 - $ensuredObjectsList : array
 
Exceptions
_findLeaveNodeByKey()
string|int $key,
bool $exactMatch = true,
array &$intermediateNodes = array ( ),
array &$kidsInfo = array ( ),
array &$ensuredObjectsList = array ( )
Find an appropriate leaf node by a key.
Parameters
- $node : \setasign\SetaPDF2\Core\Type\PdfDictionary
 - $key : string|int
 - $exactMatch : bool
 - $intermediateNodes : array
 - $kidsInfo : array
 - $ensuredObjectsList : array
 
Exceptions
_get()
Gets a key value pair by a root node and a key.
Parameters
- $node : \setasign\SetaPDF2\Core\Type\PdfDictionary
 - $key : string
 
Exceptions
_getBlankLeafNodeObject()
Helper method to create a blank leaf node
Parameters
- $intermediate : bool
 
add()
\setasign\SetaPDF2\Core\Type\AbstractType $value
Add a keyed value to the tree.
For name trees: Make sure you pass the name in PDFDocEncoding or UTF-16BE including BOM.
Parameters
- $key : int|string|\setasign\SetaPDF2\Core\Type\PdfScalarValueInterface
 Depends on the implementation
- $value : \setasign\SetaPDF2\Core\Type\AbstractType
 
Exceptions
Throws KeyAlreadyExistsException
Throws \setasign\SetaPDF2\Core\Type\Exception
See
cleanUp()
Release objects to free memory and cycled references
After calling this method the instance of this object is unusable!
get()
string $className = null
Get an object by a key.
Parameters
- $key : string|int
 - $className : string
 
Exceptions
merge()
Merges another tree into this tree.
As all items have to be unique this method will call a callback function given in $alreadyExistsCallback if an item already exists.
Parameters
- $tree : AbstractTree
 - $alreadyExistsCallback : ?callback
 Will be called if an item already exists.
This method can take control over the renaming of the item. The method will be called as long as it will not throw an exception of KeyAlreadyExistsException.
The parameter of the callback function are: The key value and an incremental number of renaming attempts.
Return Values
An array of renamed items
Exceptions
Throws KeyAlreadyExistsException
toPhp()
Returns an array with named keys and name values
Exceptions
Throws \setasign\SetaPDF2\Core\Type\Exception
