DocumentHandler implements IErrorable
Table of Contents
Interfaces
Constants
- ERROR_CODE_APP_IN_BLACKLIST = 'DISK_DOC_HANDLER_220028'
- ERROR_CODE_APP_NOT_CONFIGURED = 'DISK_DOC_HANDLER_220027'
- ERROR_CODE_INSUFFICIENT_SCOPE = 'DISK_DOC_HANDLER_220022'
- ERROR_CODE_INVALID_ACCESS_LEVEL = 'DISK_DOC_HANDLER_220026'
- ERROR_CODE_INVALID_CREDENTIALS = 'DISK_DOC_HANDLER_220023'
- ERROR_CODE_NOT_FOUND = 'DISK_DOC_HANDLER_220030'
- ERROR_CODE_NOT_FOUND_ETAG = 'DISK_DOC_HANDLER_220031'
- ERROR_CODE_NOT_GRANTED_APP = 'DISK_DOC_HANDLER_220025'
- ERROR_CODE_NOT_INSTALLED_APP = 'DISK_DOC_HANDLER_220024'
- ERROR_CODE_UNKNOWN = 'DISK_DOC_HANDLER_220029'
- ERROR_INVALID_RESPONSE_STATUS = 'DISK_DOC_HANDLER_22002'
- ERROR_REQUIRED_PARAMETER = 'DISK_DOC_HANDLER_22003'
- SPECIFIC_FOLDER_CODE = \Bitrix\Disk\SpecificFolder::CODE_FOR_UPLOADED_FILES
Methods
- __construct() : mixed
- checkAccessibleTokenService() : bool
- Execute this method for check potential possibility get access token.
- checkHttpResponse() : bool
- checkViewFile() : bool|null
- Check success view file in service.
- className() : string
- createBlankFile() : FileData|null
- Create new blank file in cloud service.
- createFile() : FileData|null
- Create file in cloud service by upload from us server.
- deleteFile() : bool
- Delete file from cloud service by FileData::id
- downloadFile() : FileData|null
- Download file from cloud service by FileData::id, put contents in FileData::src
- downloadPartFile() : FileData|null
- Download part of file from cloud service by FileData::id, put contents in FileData::src
- getAccessToken() : string
- getCode() : string
- Internal code. Identificate document handler
- getConvertExtension() : mixed
- getDataForViewFile() : array<string|int, mixed>|null
- Get data for showing preview file.
- getErrorByCode() : array<string|int, Error>
- Getting once error with the necessary code.
- getErrorContainer() : mixed
- getErrors() : array<string|int, Error>
- Getting array of errors.
- getErrorsByCode() : array<string|int, Error>
- Getting array of errors with the necessary code.
- getFileMetadata() : array<string|int, mixed>|null
- Gets a file's metadata by ID.
- getName() : string
- Public name document handler. May show in user interface.
- getUrlForAuthorizeInTokenService() : string
- Return link for authorize user in external service.
- getUserId() : int
- Returns user id.
- hasAccessToken() : bool
- isEditable() : bool
- Detect by extension editable or not
- isNeedConvertExtension() : bool
- Detect by extension needle or not convert? We work with latest office
- isRequiredAuthorization() : bool
- Need re-run oauth authorization?
- listEditableExtensions() : array<string|int, mixed>
- queryAccessToken() : $this
- Request and store access token (self::accessToken) for self::userId
- setUserId() : int
- Sets user id.
- wasChangedAfterCreation() : bool
- Tells if file in cloud service was changed. For example, the method compares created date and modified date.
Constants
ERROR_CODE_APP_IN_BLACKLIST
public
mixed
ERROR_CODE_APP_IN_BLACKLIST
= 'DISK_DOC_HANDLER_220028'
ERROR_CODE_APP_NOT_CONFIGURED
public
mixed
ERROR_CODE_APP_NOT_CONFIGURED
= 'DISK_DOC_HANDLER_220027'
ERROR_CODE_INSUFFICIENT_SCOPE
public
mixed
ERROR_CODE_INSUFFICIENT_SCOPE
= 'DISK_DOC_HANDLER_220022'
ERROR_CODE_INVALID_ACCESS_LEVEL
public
mixed
ERROR_CODE_INVALID_ACCESS_LEVEL
= 'DISK_DOC_HANDLER_220026'
ERROR_CODE_INVALID_CREDENTIALS
public
mixed
ERROR_CODE_INVALID_CREDENTIALS
= 'DISK_DOC_HANDLER_220023'
ERROR_CODE_NOT_FOUND
public
mixed
ERROR_CODE_NOT_FOUND
= 'DISK_DOC_HANDLER_220030'
ERROR_CODE_NOT_FOUND_ETAG
public
mixed
ERROR_CODE_NOT_FOUND_ETAG
= 'DISK_DOC_HANDLER_220031'
ERROR_CODE_NOT_GRANTED_APP
public
mixed
ERROR_CODE_NOT_GRANTED_APP
= 'DISK_DOC_HANDLER_220025'
ERROR_CODE_NOT_INSTALLED_APP
public
mixed
ERROR_CODE_NOT_INSTALLED_APP
= 'DISK_DOC_HANDLER_220024'
ERROR_CODE_UNKNOWN
public
mixed
ERROR_CODE_UNKNOWN
= 'DISK_DOC_HANDLER_220029'
ERROR_INVALID_RESPONSE_STATUS
public
mixed
ERROR_INVALID_RESPONSE_STATUS
= 'DISK_DOC_HANDLER_22002'
ERROR_REQUIRED_PARAMETER
public
mixed
ERROR_REQUIRED_PARAMETER
= 'DISK_DOC_HANDLER_22003'
SPECIFIC_FOLDER_CODE
public
mixed
SPECIFIC_FOLDER_CODE
= \Bitrix\Disk\SpecificFolder::CODE_FOR_UPLOADED_FILES
Methods
__construct()
public
__construct(mixed $userId) : mixed
Parameters
- $userId : mixed
checkAccessibleTokenService()
Execute this method for check potential possibility get access token.
public
abstract checkAccessibleTokenService() : bool
Return values
boolcheckHttpResponse()
public
checkHttpResponse(HttpClient $http) : bool
Parameters
- $http : HttpClient
Return values
boolcheckViewFile()
Check success view file in service.
public
checkViewFile(FileData $fileData) : bool|null
Parameters
- $fileData : FileData
Return values
bool|nullclassName()
public
static className() : string
Return values
string —the fully qualified name of this class.
createBlankFile()
Create new blank file in cloud service.
public
abstract createBlankFile(FileData $fileData) : FileData|null
It is not necessary set shared rights on file.
Parameters
- $fileData : FileData
Return values
FileData|nullcreateFile()
Create file in cloud service by upload from us server.
public
abstract createFile(FileData $fileData) : FileData|null
Necessary set shared rights on file for common work.
Parameters
- $fileData : FileData
Return values
FileData|nulldeleteFile()
Delete file from cloud service by FileData::id
public
abstract deleteFile(FileData $fileData) : bool
Parameters
- $fileData : FileData
Return values
booldownloadFile()
Download file from cloud service by FileData::id, put contents in FileData::src
public
abstract downloadFile(FileData $fileData) : FileData|null
Parameters
- $fileData : FileData
Return values
FileData|nulldownloadPartFile()
Download part of file from cloud service by FileData::id, put contents in FileData::src
public
abstract downloadPartFile(FileData $fileData, mixed $startRange, mixed $chunkSize) : FileData|null
Parameters
- $fileData : FileData
- $startRange : mixed
- $chunkSize : mixed
Return values
FileData|nullgetAccessToken()
public
getAccessToken() : string
Return values
stringgetCode()
Internal code. Identificate document handler
public
static getCode() : string
Max length is 10 chars
Tags
Return values
stringgetConvertExtension()
public
static getConvertExtension(mixed $extension) : mixed
Parameters
- $extension : mixed
getDataForViewFile()
Get data for showing preview file.
public
abstract getDataForViewFile(FileData $fileData) : array<string|int, mixed>|null
Array must be contains keys: id, viewUrl, neededDelete, neededCheckView
Parameters
- $fileData : FileData
Return values
array<string|int, mixed>|nullgetErrorByCode()
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>getErrorContainer()
public
getErrorContainer() : mixed
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>getFileMetadata()
Gets a file's metadata by ID.
public
abstract getFileMetadata(FileData $fileData) : array<string|int, mixed>|null
Parameters
- $fileData : FileData
Return values
array<string|int, mixed>|null —Describes file (id, title, size)
getName()
Public name document handler. May show in user interface.
public
static getName() : string
Tags
Return values
stringgetUrlForAuthorizeInTokenService()
Return link for authorize user in external service.
public
abstract getUrlForAuthorizeInTokenService([string $mode = 'modal' ]) : string
Parameters
- $mode : string = 'modal'
Return values
stringgetUserId()
Returns user id.
public
getUserId() : int
Return values
inthasAccessToken()
public
hasAccessToken() : bool
Return values
boolisEditable()
Detect by extension editable or not
public
static isEditable(mixed $extension) : bool
Parameters
- $extension : mixed
Return values
boolisNeedConvertExtension()
Detect by extension needle or not convert? We work with latest office
public
static isNeedConvertExtension(mixed $extension) : bool
Parameters
- $extension : mixed
Return values
boolisRequiredAuthorization()
Need re-run oauth authorization?
public
isRequiredAuthorization() : bool
Return values
boollistEditableExtensions()
public
static listEditableExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>queryAccessToken()
Request and store access token (self::accessToken) for self::userId
public
abstract queryAccessToken() : $this
Return values
$thissetUserId()
Sets user id.
public
setUserId(mixed $userId) : int
Parameters
- $userId : mixed
Return values
intwasChangedAfterCreation()
Tells if file in cloud service was changed. For example, the method compares created date and modified date.
public
wasChangedAfterCreation(array<string|int, mixed> $currentMetadata[, array<string|int, mixed> $oldMetadata = array() ]) : bool
Parameters
- $currentMetadata : array<string|int, mixed>
-
Metadata (@see \Bitrix\Disk\Document::getFileMetadata());
- $oldMetadata : array<string|int, mixed> = array()
-
Old metadata.