Bitrix API

Document

Class Document

Tags
@property-read

int ID

@property-read

int FILE_ID

@property-read

int IMAGE_ID

@property-read

int PDF_ID

@property-read

DateTime UPDATE_TIME

@property-read

int TEMPLATE_ID

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'

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
Result

checkFields()

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|null

enablePublicUrl()

public enablePublicUrl([bool $status = true ]) : Result
Parameters
$status : bool = true
Return values
Result

enableStamps()

public enableStamps([bool $status = true ]) : $this
Parameters
$status : bool = true
Return values
$this

excludeFields()

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
$this

getCreationMethod()

public getCreationMethod() : string
Return values
string

getDownloadUrl()

public getDownloadUrl([bool $absolute = false ]) : Uri
Parameters
$absolute : bool = false
Return values
Uri

getEmailDiskFile()

public getEmailDiskFile([bool $isDocxIfNoPdf = false ]) : int
Parameters
$isDocxIfNoPdf : bool = false
Return values
int

getFields()

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
Result

getFileName()

public getFileName([string $extension = '' ]) : string
Parameters
$extension : string = ''
Return values
string

getImageUrl()

public getImageUrl([bool $absolute = false ]) : Uri
Parameters
$absolute : bool = false
Return values
Uri

getIsCheckAccess()

public getIsCheckAccess() : bool
Return values
bool

getNumber()

public getNumber([bool $preview = true ]) : string
Parameters
$preview : bool = true
Return values
string

getPdfUrl()

public getPdfUrl([bool $absolute = false ]) : Uri
Parameters
$absolute : bool = false
Return values
Uri

getPrintUrl()

public getPrintUrl([bool $absolute = false ]) : Uri
Parameters
$absolute : bool = false
Return values
Uri

getPublicUrl()

public getPublicUrl([bool $absolute = true ]) : Uri|false
Parameters
$absolute : bool = true
Return values
Uri|false

getTitle()

public getTitle() : string
Return values
string

getUserId()

public getUserId() : int
Return values
int

getValue()

Returns value by its $name.

public getValue(string $name) : array<string|int, mixed>|string
Parameters
$name : string
Return values
array<string|int, mixed>|string

hasAccess()

public hasAccess([mixed $userId = null ]) : bool
Parameters
$userId : mixed = null
Return values
bool

isStampsEnabled()

public isStampsEnabled() : bool
Return values
bool

loadById()

Loads document from database by id

public static loadById(mixed $documentId) : Document|null
Parameters
$documentId : mixed
Return values
Document|null

setCheckFields()

public setCheckFields(bool $isCheckFields) : Document
Parameters
$isCheckFields : bool
Return values
Document

setFields()

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
$this

setIsCheckAccess()

public setIsCheckAccess(bool $isCheckAccess) : Document
Parameters
$isCheckAccess : bool
Return values
Document

setPlaceholderForFieldEmptyValue()

public setPlaceholderForFieldEmptyValue(string|null $placeholderForFieldEmptyValue) : Document
Parameters
$placeholderForFieldEmptyValue : string|null
Return values
Document

setProductsTableVariant()

public setProductsTableVariant(bool $variant) : $this
Parameters
$variant : bool
Return values
$this

setStorage()

public setStorage(Storage $storage) : $this
Parameters
$storage : Storage
Return values
$this

setUserId()

public setUserId(int $userId) : $this
Parameters
$userId : int
Return values
$this

setValues()

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
$this

update()

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
Result

upload()

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
Tags
throws
Exception
Return values
Result

        
On this page

Search results