FileUploader
Table of Contents
Methods
- __construct() : mixed
- checkFile() : Result
- Check whether is $fileData is a valid file description for $field
- checkFileById() : Result
- Check whether is bFileId references is a valid file for $field
- deleteFilePersistently() : self
- deleteTemporaryFiles() : $this
- Delete all not bound files.
- getFilePath() : string|null
- Returns site-relative path to a file with id $fileId. If file not found, returns null.
- markFileAsPersistent() : $this
- Mark $fileId as successfully bind to some \Bitrix\Crm\Item
- registerFileId() : void
- Register $fileId for $field.
- saveFilePersistently() : int|null
- Saves new file with $fileData for $field permanently.
- saveFileTemporary() : int|null
- Saves new file with $fileData for $field.
Methods
__construct()
public
__construct() : mixed
checkFile()
Check whether is $fileData is a valid file description for $field
public
final checkFile(Field $field, array<string|int, mixed> $fileData) : Result
Parameters
- $field : Field
- $fileData : array<string|int, mixed>
Return values
ResultcheckFileById()
Check whether is bFileId references is a valid file for $field
public
final checkFileById(Field $field, int $bFileId) : Result
Parameters
- $field : Field
- $bFileId : int
Return values
ResultdeleteFilePersistently()
public
final deleteFilePersistently(int $fileId) : self
Parameters
- $fileId : int
Return values
selfdeleteTemporaryFiles()
Delete all not bound files.
public
deleteTemporaryFiles() : $this
Return values
$thisgetFilePath()
Returns site-relative path to a file with id $fileId. If file not found, returns null.
public
final getFilePath(int $fileId) : string|null
Parameters
- $fileId : int
Return values
string|nullmarkFileAsPersistent()
Mark $fileId as successfully bind to some \Bitrix\Crm\Item
public
markFileAsPersistent(int $fileId) : $this
Parameters
- $fileId : int
Return values
$thisregisterFileId()
Register $fileId for $field.
public
registerFileId(Field $field, int $fileId) : void
Parameters
- $field : Field
- $fileId : int
saveFilePersistently()
Saves new file with $fileData for $field permanently.
public
saveFilePersistently(Field $field, array<string|int, mixed> $fileData) : int|null
Parameters
- $field : Field
- $fileData : array<string|int, mixed>
Return values
int|nullsaveFileTemporary()
Saves new file with $fileData for $field.
public
saveFileTemporary(Field $field, array<string|int, mixed> $fileData) : int|null
If during the hit this file is not bind to any \Bitrix\Crm\Item it will be deleted.
Parameters
- $field : Field
- $fileData : array<string|int, mixed>