setasign\SetaPDF2\Merger\Collection

Item Class representing a collection item.

File: /SetaPDF v2/Merger/Collection/Item.php
Old class name (alias): \SetaPDF_Merger_Collection_Item

A collection item shall contain the data described in the collection schema for a particular file or folder.

Class hierarchy

Summary

Properties

$_dictionary

The collection item dictionary.


Methods

__construct()

The constructor.

Parameters
$dictionary : ?\setasign\SetaPDF2\Core\Type\PdfDictionary
 

_createPdfValue()

Prepares a value depending on its type.

Parameters
$value : string|number
 
$type : string
 
Exceptions

Throws \setasign\SetaPDF2\NotImplementedException

getData()

public Item::getData (
void
): array

Get the data as PHP values.

Return Values

If the value is a collection subitem the value will be an array of 2 values where the first key is the value and the second the prefix.

getDictionary()

Get the dictionary.

setData()

public Item::setData (
array $data,
?Schema $schema = null
): void

Set several entries in this item.

Parameters
$data : array

The keys are the entry names.

$schema : ?Schema
 
Exceptions

Throws \setasign\SetaPDF2\NotImplementedException

Throws \setasign\SetaPDF2\Core\Type\Exception

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

setEntry()

public Item::setEntry (
string $name,
mixed $value,
null|string|Schema $type = null
): void

Set the data of an entry in this collection item.

Parameters
$name : string
 
$value : mixed

To create a subitem, pass an array of 2 values where the first value is the data and the second value is the prefix.

$type : null|string|Schema

If $type is null the type will be resolved by the PHP type. Otherwise, a constant value of Schema::DATA_TYPE_* have to be passed or an instance of Schema from which the type will be resolved automatically and ensured that the field exists in the schema.

Exceptions

Throws \setasign\SetaPDF2\NotImplementedException

Throws \setasign\SetaPDF2\Core\Type\Exception

Throws \setasign\SetaPDF2\Core\SecHandler\Exception