SetaPDF_Core_Type_Dictionary_Helper Helper class for handling of dictionaries

File: /SetaPDF v2/Core/Type/Dictionary/Helper.php

Class hierarchy

Summary

Static Methods

getValue()

public static SetaPDF_Core_Type_Dictionary_Helper::getValue (
SetaPDF_Core_Type_Dictionary $dictionary, string $key [, null|mixed $defaultValue = null [, boolean $phpValueFromScalarTypes = false ]]
): mixed

Get the value.

Parameters
$dictionary : SetaPDF_Core_Type_Dictionary
 
$key : string
 
$defaultValue : null|mixed
 
$phpValueFromScalarTypes : boolean
 

keyHasValue()

public static SetaPDF_Core_Type_Dictionary_Helper::keyHasValue (
SetaPDF_Core_Type_Dictionary $dictionary, string $key, mixed $value
): boolean

Checks if a value of a key equals an expected value.

Parameters
$dictionary : SetaPDF_Core_Type_Dictionary
 
$key : string
 
$value : mixed
 

resolveAttribute()

public static SetaPDF_Core_Type_Dictionary_Helper::resolveAttribute (
SetaPDF_Core_Type_Dictionary $dict, string $name [, null $default = null [, bool $ensure = true [, string $parentName = 'Parent' ]]]
): null|SetaPDF_Core_Type_AbstractType|SetaPDF_Core_Type_Dictionary|SetaPDF_Core_Type_Array

Resolves an attributes value by name.

If the $name key is in the dictionary this will return the value of this entry.

If the $parent key is in the dictionary and is also a dictionary this will search the $name key in this and return it if found.

If nothing is found $default will be returned.

Parameters
$dict : SetaPDF_Core_Type_Dictionary
 
$name : string
 
$default : null
 
$ensure : bool
 
$parentName : string
 

resolveDictionaryByAttribute()

public static SetaPDF_Core_Type_Dictionary_Helper::resolveDictionaryByAttribute (
SetaPDF_Core_Type_Dictionary $dict, string $name [, string $parentName = 'Parent' ]
): SetaPDF_Core_Type_Dictionary|boolean

Resolves an dictionary in a tree containing a specific name.

If the $name key is in the dictionary this will return the dictionary.

If the $parent key is in the dictionary and is also a dictionary this will search the $name key in this and return the child dictionary.

If nothing is found false will be returned.

Parameters
$dict : SetaPDF_Core_Type_Dictionary
 
$name : string

attribute/key name

$parentName : string
 

resolveObjectByAttribute()

Resolves an object in a tree containing a specific name.

Parameters
$object : SetaPDF_Core_Type_IndirectObjectInterface
 
$name : string

attribute/key name

$parentName : string