DocumentSession extends Model
Table of Contents
Constants
- ERROR_INTERNAL_ADD = 'DISK_MO_28000'
- ERROR_INTERNAL_DELETE = 'DISK_MO_28002'
- ERROR_INTERNAL_UPDATE = 'DISK_MO_28001'
- REF_INFO = 'info'
- REF_OBJECT = 'object'
- REF_OWNER = 'owner'
- REF_USER = 'user'
- REF_VERSION = 'version'
- STATUS_ACTIVE = \Bitrix\Disk\Document\Models\DocumentSessionTable::STATUS_ACTIVE
- STATUS_BROKEN = \Bitrix\Disk\Document\Models\DocumentSessionTable::STATUS_BROKEN
- STATUS_NON_ACTIVE = \Bitrix\Disk\Document\Models\DocumentSessionTable::STATUS_NON_ACTIVE
- TYPE_EDIT = \Bitrix\Disk\Document\Models\DocumentSessionTable::TYPE_EDIT
- TYPE_VIEW = \Bitrix\Disk\Document\Models\DocumentSessionTable::TYPE_VIEW
Methods
- __call() : mixed
- We have to normalize getMapReferenceAttributes() and use lower case.
- add() : mixed
- belongsToUser() : bool
- buildFromResult() : static
- Builds model from \Bitrix\Main\Entity\Result.
- buildFromRow() : Model
- Builds model from row which received from database.
- canChangeRights() : bool
- canEdit() : bool
- canRead() : bool
- canRename() : bool
- canShare() : bool
- canTransformToEdit() : bool
- canTransformUserToEdit() : bool
- canUserChangeRights() : bool
- canUserEdit() : bool
- canUserRead() : bool
- canUserRename() : bool
- canUserShare() : bool
- className() : string
- Returns the fully qualified name of this class.
- cloneWithNewHash() : self|null
- countActiveSessions() : int
- createEditSession() : self|null
- createInfo() : DocumentInfo
- delete() : bool
- forkForUser() : self|null
- getById() : static
- getContext() : DocumentSessionContext|null
- getContextRaw() : string|null
- getCreateTime() : DateTime
- getErrorByCode() : array<string|int, Error>
- Getting once error with the necessary code.
- getErrors() : array<string|int, Error>
- Getting array of errors.
- getErrorsByCode() : array<string|int, Error>
- Getting array of errors with the necessary code.
- getExternalHash() : string
- getFile() : File|null
- getFilename() : string
- getId() : mixed
- getInfo() : DocumentInfo|null
- getList() : Result
- getMapAttributes() : array<string|int, mixed>
- Returns the list of pair for mapping data and object properties.
- getMapReferenceAttributes() : array<string|int, mixed>
- Returns the list attributes which is connected with another models.
- getModelList() : array<string|int, static>
- Get model list like getList
- getObject() : File|null
- getObjectId() : int
- getOwner() : EmptyUser|SystemUser|User
- getOwnerId() : int
- getPrimary() : mixed
- getService() : DocumentService|null
- getServiceRaw() : string|null
- getStatus() : int
- getTableClassName() : string
- Gets the fully qualified name of table class which belongs to current model.
- getType() : int
- getUser() : EmptyUser|SystemUser|User
- getUserId() : int
- getVersion() : Version|null
- getVersionId() : int
- isActive() : bool
- isBroken() : bool
- isEdit() : bool
- isExclusive() : bool
- isNonActive() : bool
- isOutdatedByFileContent() : bool
- isVersion() : bool
- isView() : bool
- load() : static
- Returns once model by specific filter.
- loadBatchById() : mixed
- Returns list of models by specific filter by id.
- loadById() : static
- offsetExists() : bool
- (PHP 5 >= 5.0.0)<br/> Whether a offset exists
- offsetGet() : mixed
- (PHP 5 >= 5.0.0)<br/> Offset to retrieve
- offsetSet() : void
- (PHP 5 >= 5.0.0)<br/> Offset to set
- offsetUnset() : void
- (PHP 5 >= 5.0.0)<br/> Offset to unset
- resetReferenceValue() : void
- setAsActive() : bool
- setAsBroken() : bool
- setAsNonActive() : bool
- setReferenceValue() : mixed
- setUserId() : self
- toArray() : array<string|int, mixed>
- Export model to array. Use map attributes and field getter.
- transformToEdit() : bool
Constants
ERROR_INTERNAL_ADD
public
mixed
ERROR_INTERNAL_ADD
= 'DISK_MO_28000'
ERROR_INTERNAL_DELETE
public
mixed
ERROR_INTERNAL_DELETE
= 'DISK_MO_28002'
ERROR_INTERNAL_UPDATE
public
mixed
ERROR_INTERNAL_UPDATE
= 'DISK_MO_28001'
REF_INFO
public
mixed
REF_INFO
= 'info'
REF_OBJECT
public
mixed
REF_OBJECT
= 'object'
REF_OWNER
public
mixed
REF_OWNER
= 'owner'
REF_USER
public
mixed
REF_USER
= 'user'
REF_VERSION
public
mixed
REF_VERSION
= 'version'
STATUS_ACTIVE
public
mixed
STATUS_ACTIVE
= \Bitrix\Disk\Document\Models\DocumentSessionTable::STATUS_ACTIVE
STATUS_BROKEN
public
mixed
STATUS_BROKEN
= \Bitrix\Disk\Document\Models\DocumentSessionTable::STATUS_BROKEN
STATUS_NON_ACTIVE
public
mixed
STATUS_NON_ACTIVE
= \Bitrix\Disk\Document\Models\DocumentSessionTable::STATUS_NON_ACTIVE
TYPE_EDIT
public
mixed
TYPE_EDIT
= \Bitrix\Disk\Document\Models\DocumentSessionTable::TYPE_EDIT
TYPE_VIEW
public
mixed
TYPE_VIEW
= \Bitrix\Disk\Document\Models\DocumentSessionTable::TYPE_VIEW
Methods
__call()
We have to normalize getMapReferenceAttributes() and use lower case.
public
__call(mixed $name, mixed $arguments) : mixed
Parameters
- $name : mixed
- $arguments : mixed
add()
public
static add(array<string|int, mixed> $data, ErrorCollection $errorCollection) : mixed
Parameters
- $data : array<string|int, mixed>
- $errorCollection : ErrorCollection
belongsToUser()
public
belongsToUser(int $userId) : bool
Parameters
- $userId : int
Return values
boolbuildFromResult()
Builds model from \Bitrix\Main\Entity\Result.
public
static buildFromResult(Result $result) : static
Parameters
- $result : Result
-
Query result.
Tags
Return values
staticbuildFromRow()
Builds model from row which received from database.
public
static buildFromRow(array<string|int, mixed> $row[, array<string|int, mixed>|null $with = [] ]) : Model
Parameters
- $row : array<string|int, mixed>
-
Row.
- $with : array<string|int, mixed>|null = []
-
Description of connected entities.
Tags
Return values
ModelcanChangeRights()
public
canChangeRights(SecurityContext $securityContext) : bool
Parameters
- $securityContext : SecurityContext
Return values
boolcanEdit()
public
canEdit(SecurityContext $securityContext) : bool
Parameters
- $securityContext : SecurityContext
Return values
boolcanRead()
public
canRead(SecurityContext $securityContext) : bool
Parameters
- $securityContext : SecurityContext
Return values
boolcanRename()
public
canRename(SecurityContext $securityContext) : bool
Parameters
- $securityContext : SecurityContext
Return values
boolcanShare()
public
canShare(SecurityContext $securityContext) : bool
Parameters
- $securityContext : SecurityContext
Return values
boolcanTransformToEdit()
public
canTransformToEdit(SecurityContext $securityContext) : bool
Parameters
- $securityContext : SecurityContext
Return values
boolcanTransformUserToEdit()
public
canTransformUserToEdit(CurrentUser $user) : bool
Parameters
- $user : CurrentUser
Return values
boolcanUserChangeRights()
public
canUserChangeRights(CurrentUser $user) : bool
Parameters
- $user : CurrentUser
Return values
boolcanUserEdit()
public
canUserEdit(CurrentUser $user) : bool
Parameters
- $user : CurrentUser
Return values
boolcanUserRead()
public
canUserRead(CurrentUser $user) : bool
Parameters
- $user : CurrentUser
Return values
boolcanUserRename()
public
canUserRename(CurrentUser $user) : bool
Parameters
- $user : CurrentUser
Return values
boolcanUserShare()
public
canUserShare(CurrentUser $user) : bool
Parameters
- $user : CurrentUser
Return values
boolclassName()
Returns the fully qualified name of this class.
public
static className() : string
Return values
stringcloneWithNewHash()
public
cloneWithNewHash(int $userId[, DocumentSessionContext|null $context = null ]) : self|null
Parameters
- $userId : int
- $context : DocumentSessionContext|null = null
Return values
self|nullcountActiveSessions()
public
countActiveSessions() : int
Return values
intcreateEditSession()
public
createEditSession() : self|null
Return values
self|nullcreateInfo()
public
createInfo() : DocumentInfo
Return values
DocumentInfodelete()
public
delete() : bool
Return values
boolforkForUser()
public
forkForUser(int $userId[, DocumentSessionContext|null $context = null ]) : self|null
Parameters
- $userId : int
- $context : DocumentSessionContext|null = null
Return values
self|nullgetById()
public
static getById(mixed $id[, array<string|int, mixed> $with = array() ]) : static
Parameters
- $id : mixed
- $with : array<string|int, mixed> = array()
Tags
Return values
staticgetContext()
public
getContext() : DocumentSessionContext|null
Return values
DocumentSessionContext|nullgetContextRaw()
public
getContextRaw() : string|null
Return values
string|nullgetCreateTime()
public
getCreateTime() : DateTime
Return values
DateTimegetErrorByCode()
Getting once error with the necessary code.
public
getErrorByCode(mixed $code) : array<string|int, Error>
Parameters
- $code : mixed
-
Code of error.
Tags
Return values
array<string|int, Error>getErrors()
Getting array of errors.
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getErrorsByCode()
Getting array of errors with the necessary code.
public
getErrorsByCode(mixed $code) : array<string|int, Error>
Parameters
- $code : mixed
-
Code of error.
Tags
Return values
array<string|int, Error>getExternalHash()
public
getExternalHash() : string
Return values
stringgetFile()
public
getFile() : File|null
Return values
File|nullgetFilename()
public
getFilename() : string
Return values
stringgetId()
public
getId() : mixed
getInfo()
public
getInfo() : DocumentInfo|null
Return values
DocumentInfo|nullgetList()
public
static getList(array<string|int, mixed> $parameters) : Result
Parameters
- $parameters : array<string|int, mixed>
Tags
Return values
ResultgetMapAttributes()
Returns the list of pair for mapping data and object properties.
public
static getMapAttributes() : array<string|int, mixed>
Key is field in DataManager, value is object property.
Return values
array<string|int, mixed>getMapReferenceAttributes()
Returns the list attributes which is connected with another models.
public
static getMapReferenceAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getModelList()
Get model list like getList
public
static getModelList(array<string|int, mixed> $parameters) : array<string|int, static>
Parameters
- $parameters : array<string|int, mixed>
Return values
array<string|int, static>getObject()
public
getObject() : File|null
Return values
File|nullgetObjectId()
public
getObjectId() : int
Return values
intgetOwner()
public
getOwner() : EmptyUser|SystemUser|User
Return values
EmptyUser|SystemUser|UsergetOwnerId()
public
getOwnerId() : int
Return values
intgetPrimary()
public
getPrimary() : mixed
getService()
public
getService() : DocumentService|null
Return values
DocumentService|nullgetServiceRaw()
public
getServiceRaw() : string|null
Return values
string|nullgetStatus()
public
getStatus() : int
Return values
intgetTableClassName()
Gets the fully qualified name of table class which belongs to current model.
public
static getTableClassName() : string
Return values
stringgetType()
public
getType() : int
Return values
intgetUser()
public
getUser() : EmptyUser|SystemUser|User
Return values
EmptyUser|SystemUser|UsergetUserId()
public
getUserId() : int
Return values
intgetVersion()
public
getVersion() : Version|null
Return values
Version|nullgetVersionId()
public
getVersionId() : int
Return values
intisActive()
public
isActive() : bool
Return values
boolisBroken()
public
isBroken() : bool
Return values
boolisEdit()
public
isEdit() : bool
Return values
boolisExclusive()
public
isExclusive() : bool
Return values
boolisNonActive()
public
isNonActive() : bool
Return values
boolisOutdatedByFileContent()
public
isOutdatedByFileContent() : bool
Return values
boolisVersion()
public
isVersion() : bool
Return values
boolisView()
public
isView() : bool
Return values
boolload()
Returns once model by specific filter.
public
static load(array<string|int, mixed> $filter[, array<string|int, mixed> $with = array() ]) : static
Parameters
- $filter : array<string|int, mixed>
-
Filter.
- $with : array<string|int, mixed> = array()
-
List of eager loading.
Tags
Return values
staticloadBatchById()
Returns list of models by specific filter by id.
public
static loadBatchById(array<string|int, mixed> $ids[, array<string|int, mixed> $with = [] ]) : mixed
Parameters
- $ids : array<string|int, mixed>
-
List of ids.
- $with : array<string|int, mixed> = []
-
List of eager loading.
loadById()
public
static loadById(mixed $id[, array<string|int, mixed> $with = array() ]) : static
Parameters
- $id : mixed
- $with : array<string|int, mixed> = array()
Tags
Return values
staticoffsetExists()
(PHP 5 >= 5.0.0)<br/> Whether a offset exists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
-
An offset to check for.
Tags
Return values
bool —true on success or false on failure.
The return value will be casted to boolean if non-boolean was returned.
offsetGet()
(PHP 5 >= 5.0.0)<br/> Offset to retrieve
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
-
The offset to retrieve.
Tags
Attributes
- #[ReturnTypeWillChange]
Return values
mixed —Can return all value types.
offsetSet()
(PHP 5 >= 5.0.0)<br/> Offset to set
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
-
The offset to assign the value to.
- $value : mixed
-
The value to set.
Tags
offsetUnset()
(PHP 5 >= 5.0.0)<br/> Offset to unset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
-
The offset to unset.
Tags
resetReferenceValue()
public
resetReferenceValue(string $referenceName) : void
Parameters
- $referenceName : string
setAsActive()
public
setAsActive() : bool
Return values
boolsetAsBroken()
public
setAsBroken() : bool
Return values
boolsetAsNonActive()
public
setAsNonActive() : bool
Return values
boolsetReferenceValue()
public
setReferenceValue(mixed $referenceName, mixed $value) : mixed
Parameters
- $referenceName : mixed
- $value : mixed
Tags
setUserId()
public
setUserId(int $userId) : self
Parameters
- $userId : int
Return values
selftoArray()
Export model to array. Use map attributes and field getter.
public
toArray([array<string|int, mixed> $with = [] ][, array<string|int, mixed>|null $allowedFields = null ]) : array<string|int, mixed>
Parameters
- $with : array<string|int, mixed> = []
- $allowedFields : array<string|int, mixed>|null = null
Return values
array<string|int, mixed>transformToEdit()
public
transformToEdit() : bool