setasign\SetaPDF2\Merger\Collection

Schema Class for handling data schemas in PDF Collections/Portfolios/Packages.

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

Class hierarchy

Summary

Constants

DATA_COMPRESSED_SIZE

public const string Schema::DATA_COMPRESSED_SIZE = 'CompressedSize'

Constant defining the compressed size property

DATA_CREATION_DATE

public const string Schema::DATA_CREATION_DATE = 'CreationDate'

Constant defining the creation date property

DATA_DESCRIPTION

public const string Schema::DATA_DESCRIPTION = 'Desc'

Constant defining the description property

DATA_FILE_NAME

public const string Schema::DATA_FILE_NAME = 'F'

Constant defining the file name property

DATA_MODIFICATION_DATE

public const string Schema::DATA_MODIFICATION_DATE = 'ModDate'

Constant defining the modification date property

DATA_SIZE

public const string Schema::DATA_SIZE = 'Size'

Constant defining the size property

TYPE_DATE

public const string Schema::TYPE_DATE = 'D'

Constant defining a date data type

TYPE_NUMBER

public const string Schema::TYPE_NUMBER = 'N'

Constant defining a number type

TYPE_STRING

public const string Schema::TYPE_STRING = 'S'

Constant defining a string data type (value needs to be in PdfDocEncoding or UTF-16BE)


Properties

$_collection

The collection instance.


Methods

__construct()

The constructor.

Parameters
$collection : \SetaPDF_Merger_Collection
 

addField()

public Schema::addField (
string $name,
null|string|\SetaPDF_Merger_Collection_Schema_Field $fieldOrFieldName = null,
?string $dataType = null,
?int $order = null
): \SetaPDF_Merger_Collection_Schema_Field

Add a field to the schema.

Parameters
$name : string

The internal field key name.

$fieldOrFieldName : null|string|\SetaPDF_Merger_Collection_Schema_Field

The field name or an instance of a field.

$dataType : ?string

The data field or type. See class constants for possible values.

$order : ?int

The relative order of the field name in the user interface. You should set this, otherwise you will get an unexpected result in different PDF viewers.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

See

addFields()

public Schema::addFields (
array $fields
): void

Adds several fields to the schema.

Parameters
$fields : array

The keys are the internal field key name while the values are passed as additional parameter to the addField() method.

See

cleanUp()

public Schema::cleanUp (
void
): void

Remove cycled references.

getCollection()

Get the collection instance.

getDictionary()

public Schema::getDictionary (
bool $create = false
): ?\SetaPDF_Core_Type_Dictionary

Get and/or create the schema dictionary.

Parameters
$create : bool
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getField()

Get a field instance by its name.

Parameters
$name : string
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

hasField()

public Schema::hasField (
string $name
): bool

Check if a field exists.

Parameters
$name : string
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

removeField()

public Schema::removeField (
string $name
): bool

Remove a field from the schema.

Parameters
$name : string