Document
Class Document
Tags
Table of Contents
Constants
- ERROR_NO_TRANSFORMER_MODULE = 'ERROR_NO_TRANSFORMER_MODULE'
- IMAGE = 'jpg'
- PDF = 'pdf'
- PRODUCTS_TABLE_VARIANT_PLACEHOLDER = 'productsTableVariant'
- STAMPS_ENABLED_PLACEHOLDER = 'stampsEnabled'
- THIS_PLACEHOLDER = 'this'
Methods
- __get() : mixed
- actualize() : Result
- Recreate document using the same external values.
- checkFields() : array<string|int, mixed>
- If $requiredOnly is true returns a list of required with empty values.
- createByTemplate() : Document|null
- Creates new document from template on specific value.
- enablePublicUrl() : Result
- enableStamps() : $this
- excludeFields() : $this
- Add $fieldNames to $this->excludeFields (it is not rewrite them)
- getCreateTime() : DateTime
- getCreationMethod() : string
- getDownloadUrl() : Uri
- getEmailDiskFile() : int
- getFields() : array<string|int, mixed>
- Returns array with all placeholders, their field descriptions and actual values.
- getFile() : Result
- getFileName() : string
- getImageUrl() : Uri
- getIsCheckAccess() : bool
- getNumber() : string
- getPdfUrl() : Uri
- getPrintUrl() : Uri
- getProvider() : DataProvider|Nameable|null
- getPublicUrl() : Uri|false
- getTemplate() : Template|null
- getTitle() : string
- getUpdateTime() : DateTime
- getUserId() : int
- getValue() : array<string|int, mixed>|string
- Returns value by its $name.
- hasAccess() : bool
- isStampsEnabled() : bool
- loadById() : Document|null
- Loads document from database by id
- setCheckFields() : Document
- setFields() : $this
- Add new fields or rewrite old ones (except 'SOURCE' and 'DOCUMENT'), but does not clear all the list.
- setImageId() : Document
- setIsCheckAccess() : Document
- setPdfId() : Document
- setPlaceholderForFieldEmptyValue() : Document
- setProductsTableVariant() : $this
- setStorage() : $this
- setTemplate() : $this
- setUserId() : $this
- setValues() : $this
- Add new values or rewrite old ones, but does not clear all the list.
- update() : Result
- upload() : Result
- Uploads new externally-formed document
Constants
ERROR_NO_TRANSFORMER_MODULE
public
mixed
ERROR_NO_TRANSFORMER_MODULE
= 'ERROR_NO_TRANSFORMER_MODULE'
IMAGE
public
mixed
IMAGE
= 'jpg'
public
mixed
PDF
= 'pdf'
PRODUCTS_TABLE_VARIANT_PLACEHOLDER
public
mixed
PRODUCTS_TABLE_VARIANT_PLACEHOLDER
= 'productsTableVariant'
STAMPS_ENABLED_PLACEHOLDER
public
mixed
STAMPS_ENABLED_PLACEHOLDER
= 'stampsEnabled'
THIS_PLACEHOLDER
public
mixed
THIS_PLACEHOLDER
= 'this'
Methods
__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
actualize()
Recreate document using the same external values.
public
actualize([int|null $userId = null ][, bool $sendToTransformation = true ][, bool $skipTransformationError = false ]) : Result
Parameters
- $userId : int|null = null
- $sendToTransformation : bool = true
- $skipTransformationError : bool = false
Return values
ResultcheckFields()
If $requiredOnly is true returns a list of required with empty values.
public
checkFields([bool $requiredOnly = true ]) : array<string|int, mixed>
If false - returns a list of not found placeholders without a value.
Parameters
- $requiredOnly : bool = true
Return values
array<string|int, mixed>createByTemplate()
Creates new document from template on specific value.
public
static createByTemplate(Template $template, mixed $value[, array<string|int, mixed> $data = [] ]) : Document|null
Template should have specified sourceType.
Parameters
- $template : Template
- $value : mixed
- $data : array<string|int, mixed> = []
Return values
Document|nullenablePublicUrl()
public
enablePublicUrl([bool $status = true ]) : Result
Parameters
- $status : bool = true
Return values
ResultenableStamps()
public
enableStamps([bool $status = true ]) : $this
Parameters
- $status : bool = true
Return values
$thisexcludeFields()
Add $fieldNames to $this->excludeFields (it is not rewrite them)
public
excludeFields(array<string|int, mixed> $fieldNames) : $this
Parameters
- $fieldNames : array<string|int, mixed>
Return values
$thisgetCreateTime()
public
getCreateTime() : DateTime
Return values
DateTimegetCreationMethod()
public
getCreationMethod() : string
Return values
stringgetDownloadUrl()
public
getDownloadUrl([bool $absolute = false ]) : Uri
Parameters
- $absolute : bool = false
Return values
UrigetEmailDiskFile()
public
getEmailDiskFile([bool $isDocxIfNoPdf = false ]) : int
Parameters
- $isDocxIfNoPdf : bool = false
Return values
intgetFields()
Returns array with all placeholders, their field descriptions and actual values.
public
getFields([array<string|int, mixed> $fieldNames = [] ][, bool $isConvertValuesToString = false ][, bool $groupsAsArrays = false ]) : array<string|int, mixed>
Parameters
- $fieldNames : array<string|int, mixed> = []
- $isConvertValuesToString : bool = false
- $groupsAsArrays : bool = false
Return values
array<string|int, mixed>getFile()
public
getFile([bool $sendToTransformation = true ][, bool $skipTransformationError = false ]) : Result
Parameters
- $sendToTransformation : bool = true
- $skipTransformationError : bool = false
Return values
ResultgetFileName()
public
getFileName([string $extension = '' ]) : string
Parameters
- $extension : string = ''
Return values
stringgetImageUrl()
public
getImageUrl([bool $absolute = false ]) : Uri
Parameters
- $absolute : bool = false
Return values
UrigetIsCheckAccess()
public
getIsCheckAccess() : bool
Return values
boolgetNumber()
public
getNumber([bool $preview = true ]) : string
Parameters
- $preview : bool = true
Return values
stringgetPdfUrl()
public
getPdfUrl([bool $absolute = false ]) : Uri
Parameters
- $absolute : bool = false
Return values
UrigetPrintUrl()
public
getPrintUrl([bool $absolute = false ]) : Uri
Parameters
- $absolute : bool = false
Return values
UrigetProvider()
public
getProvider() : DataProvider|Nameable|null
Return values
DataProvider|Nameable|nullgetPublicUrl()
public
getPublicUrl([bool $absolute = true ]) : Uri|false
Parameters
- $absolute : bool = true
Return values
Uri|falsegetTemplate()
public
getTemplate() : Template|null
Return values
Template|nullgetTitle()
public
getTitle() : string
Return values
stringgetUpdateTime()
public
getUpdateTime() : DateTime
Return values
DateTimegetUserId()
public
getUserId() : int
Return values
intgetValue()
Returns value by its $name.
public
getValue(string $name) : array<string|int, mixed>|string
Parameters
- $name : string
Return values
array<string|int, mixed>|stringhasAccess()
public
hasAccess([mixed $userId = null ]) : bool
Parameters
- $userId : mixed = null
Return values
boolisStampsEnabled()
public
isStampsEnabled() : bool
Return values
boolloadById()
Loads document from database by id
public
static loadById(mixed $documentId) : Document|null
Parameters
- $documentId : mixed
Return values
Document|nullsetCheckFields()
public
setCheckFields(bool $isCheckFields) : Document
Parameters
- $isCheckFields : bool
Return values
DocumentsetFields()
Add new fields or rewrite old ones (except 'SOURCE' and 'DOCUMENT'), but does not clear all the list.
public
setFields(array<string|int, mixed> $fields) : $this
Parameters
- $fields : array<string|int, mixed>
Return values
$thissetImageId()
public
setImageId(int $imageId) : Document
Parameters
- $imageId : int
Return values
DocumentsetIsCheckAccess()
public
setIsCheckAccess(bool $isCheckAccess) : Document
Parameters
- $isCheckAccess : bool
Return values
DocumentsetPdfId()
public
setPdfId(int $pdfId) : Document
Parameters
- $pdfId : int
Return values
DocumentsetPlaceholderForFieldEmptyValue()
public
setPlaceholderForFieldEmptyValue(string|null $placeholderForFieldEmptyValue) : Document
Parameters
- $placeholderForFieldEmptyValue : string|null
Return values
DocumentsetProductsTableVariant()
public
setProductsTableVariant(bool $variant) : $this
Parameters
- $variant : bool
Return values
$thissetStorage()
public
setStorage(Storage $storage) : $this
Parameters
- $storage : Storage
Return values
$thissetTemplate()
public
setTemplate(Template $template) : $this
Parameters
- $template : Template
Return values
$thissetUserId()
public
setUserId(int $userId) : $this
Parameters
- $userId : int
Return values
$thissetValues()
Add new values or rewrite old ones, but does not clear all the list.
public
setValues(array<string|int, mixed> $values) : $this
Parameters
- $values : array<string|int, mixed>
Return values
$thisupdate()
public
update(array<string|int, mixed> $values[, bool $sendToTransformation = true ][, bool $skipTransformationError = false ]) : Result
Parameters
- $values : array<string|int, mixed>
- $sendToTransformation : bool = true
- $skipTransformationError : bool = false
Return values
Resultupload()
Uploads new externally-formed document
public
static upload(Template $template, mixed $value, mixed $title, mixed $number, mixed $fileId[, null $pdfId = null ][, null $imageId = null ]) : Result
Parameters
- $template : Template
- $value : mixed
- $title : mixed
- $number : mixed
- $fileId : mixed
- $pdfId : null = null
- $imageId : null = null