setasign\SetaPDF2\Core\Type\Dictionary

DictionaryHelper Helper class for handling of dictionaries

File: /SetaPDF v2/Core/Type/Dictionary/DictionaryHelper.php
Old class name (alias): \SetaPDF_Core_Type_Dictionary_Helper

Class hierarchy

Summary

Static Methods

getValue()

public static DictionaryHelper::getValue (
\setasign\SetaPDF2\Core\Type\PdfDictionary $dictionary,
string $key,
?mixed $defaultValue = null,
bool $phpValueFromScalarTypes = false
): mixed

Get the value.

Parameters
$dictionary: \setasign\SetaPDF2\Core\Type\PdfDictionary
 
$key: string
 
$defaultValue: ?mixed
 
$phpValueFromScalarTypes: bool
 

keyHasValue()

public static DictionaryHelper::keyHasValue (
\setasign\SetaPDF2\Core\Type\PdfDictionary $dictionary,
string $key,
mixed $value
): bool

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

Parameters
$dictionary: \setasign\SetaPDF2\Core\Type\PdfDictionary
 
$key: string
 
$value: mixed
 

resolveAttribute()

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: \setasign\SetaPDF2\Core\Type\PdfDictionary
 
$name: string
 
$default: null
 
$ensure: bool
 
$parentName: string
 

resolveDictionaryByAttribute()

Resolves a 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: \setasign\SetaPDF2\Core\Type\PdfDictionary
 
$name: string

attribute/key name

$parentName: string
 

resolveObjectByAttribute()

Resolves an object in a tree containing a specific name.

Parameters
$object: \setasign\SetaPDF2\Core\Type\IndirectObjectInterface
 
$name: string

attribute/key name

$parentName: string