TmpFile extends Model
Table of Contents
Constants
- ERROR_BUCKET_ID_EMPTY = 'DISK_TMP_FILE_22000'
- ERROR_CLOUD_APPEND_INVALID_CHUNK_SIZE = 'DISK_TMP_FILE_22018'
- ERROR_CLOUD_FINISH_UPLOAD = 'DISK_TMP_FILE_22022'
- ERROR_CLOUD_START_UPLOAD = 'DISK_TMP_FILE_22019'
- ERROR_CLOUD_UPLOAD_PART = 'DISK_TMP_FILE_22021'
- ERROR_DELETE_CLOUD_FILE = 'DISK_TMP_FILE_22003'
- ERROR_DELETE_FILE = 'DISK_TMP_FILE_22004'
- ERROR_EXISTS_FILE = 'DISK_TMP_FILE_22023'
- ERROR_GET_FILE_CONTENTS = 'DISK_TMP_FILE_22020'
- ERROR_INCLUDE_CLOUDS = 'DISK_TMP_FILE_22001'
- ERROR_INIT_BUCKET = 'DISK_TMP_FILE_22002'
- ERROR_INTERNAL_ADD = 'DISK_MO_28000'
- ERROR_INTERNAL_DELETE = 'DISK_MO_28002'
- ERROR_INTERNAL_UPDATE = 'DISK_MO_28001'
- ERROR_IS_NOT_UPLOADED_FILE = 'DISK_TMP_FILE_22016'
- ERROR_MOVE_FILE = 'DISK_TMP_FILE_22025'
- ERROR_MOVE_UPLOADED_FILE = 'DISK_TMP_FILE_22017'
- ERROR_PUT_CONTENTS = 'DISK_TMP_FILE_22024'
- ERROR_UPLOAD_FILE = 'DISK_TMP_FILE_22015'
- ERROR_UPLOAD_MAX_FILE_SIZE = 'DISK_TMP_FILE_22005'
Methods
- append() : bool
- Appends contents to file.
- buildFromResult() : static
- Builds model from \Bitrix\Main\Entity\Result.
- buildFromRow() : Model
- Builds model from row which received from database.
- className() : string
- Returns the fully qualified name of this class.
- createFromFileArray() : Model|null|static
- Creates TmpFile model from file array ($_FILE).
- createInBucketFirstPartFromFileArray() : Model|null|static
- Creates first part of file in bucket.
- delete() : bool
- Deletes TmpFile.
- getAbsolutePath() : null|string
- Returns absolute path to file.
- getBucketId() : int
- Returns id of bucket (only for cloud files).
- getById() : static
- getContentType() : string
- Returns content type.
- getCreatedBy() : int
- Returns id of user, who created object.
- getCreateTime() : DateTime
- Returns time of create object.
- getCreateUser() : User
- Returns user model, who created object.
- 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.
- getFilename() : string
- Returns file name.
- getHeight() : int
- Returns height. If tmp file is not image, then returns null.
- getId() : mixed
- 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
- getPath() : string
- Returns path.
- getPrimary() : mixed
- getReceivedSize() : int
- Returns received size of file in bytes.
- getSize() : int
- Returns size in bytes.
- getTableClassName() : string
- Gets the fully qualified name of table class which belongs to current model.
- getToken() : string
- Returns token.
- getWidth() : int
- Returns width. If tmp file is not image, then returns null.
- isCloud() : bool
- Tells if tmp file locates in cloud.
- 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
- registerDelayedDeleteOnShutdown() : void
- Registers delayed delete which will do on the shutdown.
- toArray() : array<string|int, mixed>
- Export model to array. Use map attributes and field getter.
Constants
ERROR_BUCKET_ID_EMPTY
public
mixed
ERROR_BUCKET_ID_EMPTY
= 'DISK_TMP_FILE_22000'
ERROR_CLOUD_APPEND_INVALID_CHUNK_SIZE
public
mixed
ERROR_CLOUD_APPEND_INVALID_CHUNK_SIZE
= 'DISK_TMP_FILE_22018'
ERROR_CLOUD_FINISH_UPLOAD
public
mixed
ERROR_CLOUD_FINISH_UPLOAD
= 'DISK_TMP_FILE_22022'
ERROR_CLOUD_START_UPLOAD
public
mixed
ERROR_CLOUD_START_UPLOAD
= 'DISK_TMP_FILE_22019'
ERROR_CLOUD_UPLOAD_PART
public
mixed
ERROR_CLOUD_UPLOAD_PART
= 'DISK_TMP_FILE_22021'
ERROR_DELETE_CLOUD_FILE
public
mixed
ERROR_DELETE_CLOUD_FILE
= 'DISK_TMP_FILE_22003'
ERROR_DELETE_FILE
public
mixed
ERROR_DELETE_FILE
= 'DISK_TMP_FILE_22004'
ERROR_EXISTS_FILE
public
mixed
ERROR_EXISTS_FILE
= 'DISK_TMP_FILE_22023'
ERROR_GET_FILE_CONTENTS
public
mixed
ERROR_GET_FILE_CONTENTS
= 'DISK_TMP_FILE_22020'
ERROR_INCLUDE_CLOUDS
public
mixed
ERROR_INCLUDE_CLOUDS
= 'DISK_TMP_FILE_22001'
ERROR_INIT_BUCKET
public
mixed
ERROR_INIT_BUCKET
= 'DISK_TMP_FILE_22002'
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'
ERROR_IS_NOT_UPLOADED_FILE
public
mixed
ERROR_IS_NOT_UPLOADED_FILE
= 'DISK_TMP_FILE_22016'
ERROR_MOVE_FILE
public
mixed
ERROR_MOVE_FILE
= 'DISK_TMP_FILE_22025'
ERROR_MOVE_UPLOADED_FILE
public
mixed
ERROR_MOVE_UPLOADED_FILE
= 'DISK_TMP_FILE_22017'
ERROR_PUT_CONTENTS
public
mixed
ERROR_PUT_CONTENTS
= 'DISK_TMP_FILE_22024'
ERROR_UPLOAD_FILE
public
mixed
ERROR_UPLOAD_FILE
= 'DISK_TMP_FILE_22015'
ERROR_UPLOAD_MAX_FILE_SIZE
public
mixed
ERROR_UPLOAD_MAX_FILE_SIZE
= 'DISK_TMP_FILE_22005'
Methods
append()
Appends contents to file.
public
append(string $fileContent, array<string|int, mixed> $params) : bool
Parameters
- $fileContent : string
-
File content.
- $params : array<string|int, mixed>
-
Parameters (startRange, endRange, fileSize).
Tags
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
ModelclassName()
Returns the fully qualified name of this class.
public
static className() : string
Return values
stringcreateFromFileArray()
Creates TmpFile model from file array ($_FILE).
public
static createFromFileArray(array<string|int, mixed> $fileData, array<string|int, mixed> $data, ErrorCollection $errorCollection) : Model|null|static
Parameters
- $fileData : array<string|int, mixed>
-
Array like as $_FILE.
- $data : array<string|int, mixed>
-
Additional fields to TmpFile.
- $errorCollection : ErrorCollection
-
Error collection.
Return values
Model|null|staticcreateInBucketFirstPartFromFileArray()
Creates first part of file in bucket.
public
static createInBucketFirstPartFromFileArray(array<string|int, mixed> $fileData, array<string|int, mixed> $data, CCloudStorageBucket $bucket, array<string|int, mixed> $params, ErrorCollection $errorCollection) : Model|null|static
Parameters
- $fileData : array<string|int, mixed>
-
Array like as $_FILE.
- $data : array<string|int, mixed>
-
Additional fields to TmpFile.
- $bucket : CCloudStorageBucket
-
Cloud bucket.
- $params : array<string|int, mixed>
-
Parameters (startRange, endRange, fileSize).
- $errorCollection : ErrorCollection
-
Error collection.
Return values
Model|null|staticdelete()
Deletes TmpFile.
public
delete() : bool
The method attempts to destroy content (cloud or file from file system).
Return values
boolgetAbsolutePath()
Returns absolute path to file.
public
getAbsolutePath() : null|string
Return values
null|stringgetBucketId()
Returns id of bucket (only for cloud files).
public
getBucketId() : int
Return values
intgetById()
public
static getById(mixed $id[, array<string|int, mixed> $with = array() ]) : static
Parameters
- $id : mixed
- $with : array<string|int, mixed> = array()
Tags
Return values
staticgetContentType()
Returns content type.
public
getContentType() : string
Return values
stringgetCreatedBy()
Returns id of user, who created object.
public
getCreatedBy() : int
Return values
intgetCreateTime()
Returns time of create object.
public
getCreateTime() : DateTime
Return values
DateTimegetCreateUser()
Returns user model, who created object.
public
getCreateUser() : User
Return values
UsergetErrorByCode()
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>getFilename()
Returns file name.
public
getFilename() : string
Return values
stringgetHeight()
Returns height. If tmp file is not image, then returns null.
public
getHeight() : int
Return values
intgetId()
public
getId() : mixed
getList()
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>getPath()
Returns path.
public
getPath() : string
Return values
stringgetPrimary()
public
getPrimary() : mixed
getReceivedSize()
Returns received size of file in bytes.
public
getReceivedSize() : int
Return values
intgetSize()
Returns size in bytes.
public
getSize() : int
Return values
intgetTableClassName()
Gets the fully qualified name of table class which belongs to current model.
public
static getTableClassName() : string
Tags
Return values
stringgetToken()
Returns token.
public
getToken() : string
Return values
stringgetWidth()
Returns width. If tmp file is not image, then returns null.
public
getWidth() : int
Return values
intisCloud()
Tells if tmp file locates in cloud.
public
isCloud() : 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
registerDelayedDeleteOnShutdown()
Registers delayed delete which will do on the shutdown.
public
registerDelayedDeleteOnShutdown() : void
toArray()
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