Bitrix API

Task

Task cleanlier class.

Table of Contents

Constants

DROP_FOLDER  = 'DROP_FOLDER'
DROP_TRASHCAN  = 'DROP_TRASHCAN'
DROP_UNNECESSARY_VERSION  = 'DROP_UNNECESSARY_VERSION'
EMPTY_FOLDER  = 'EMPTY_FOLDER'
TASK_STATUS_CANCEL  = 4
TASK_STATUS_DONE  = 3
TASK_STATUS_NONE  = 0
TASK_STATUS_RUNNING  = 2
TASK_STATUS_WAIT  = 1

Methods

collectLogData()  : array<string|int, mixed>
Collects data for logging.
fixState()  : bool
Saves task state.
getCountFilesToDrop()  : int
Gets count files to drop.
getCountVersionToDrop()  : int
Gets dropped folder count.
getDroppedFileCount()  : int
Gets dropped file count.
getDroppedFolderCount()  : int
Gets dropped folder count.
getDroppedVersionCount()  : int
Gets dropped version count.
getFailCount()  : int
Gets fail count.
getId()  : int
Gets task id.
getIndicator()  : IVolumeIndicator|bool
Returns object indicator corresponding to task.
getIndicatorType()  : string
Returns indicator class name.
getIterationFileCount()  : int
Gets count files loaded by filter for iteration.
getLastError()  : int
Gets last error text occurred in iteration.
getLastFileId()  : int
Gets last file id.
getOwnerId()  : int
Gets task owner id.
getParam()  : string|int|null
Gets task parameter.
getStatus()  : int
Gets task status.
getStatusSubTask()  : int
Gets task status.
hasFatalError()  : bool
Has fatal error.
hasTaskFinished()  : bool
Checks if all files have deleted.
hasUserCanceled()  : bool
Check user cancel task.
increaseDroppedFileCount()  : void
Increases dropped file count.
increaseDroppedFolderCount()  : void
Increases dropped folder count.
increaseDroppedVersionCount()  : void
Increases dropped version count.
increaseFailCount()  : void
Increases fail count.
isRunningMode()  : bool
Checks if status is in running mode.
loadTaskById()  : bool
Loads task params from db.
log()  : bool
Fix data of object to table log.
raiseFatalError()  : void
Set fatal error.
resetFail()  : void
Reset fail and error.
setIndicatorType()  : void
Sets indicator type.
setIterationFileCount()  : void
Sets count files loaded by filter for iteration.
setLastError()  : void
Sets last error text ocoried in iteration.
setLastFileId()  : void
Sets last file id.
setOwnerId()  : void
Sets task owner id.
setParam()  : void
Sets task parameter.
setStatus()  : void
Sets task status.
setStatusSubTask()  : void
Sets task status.

Constants

DROP_FOLDER

public mixed DROP_FOLDER = 'DROP_FOLDER'

DROP_TRASHCAN

public mixed DROP_TRASHCAN = 'DROP_TRASHCAN'

DROP_UNNECESSARY_VERSION

public mixed DROP_UNNECESSARY_VERSION = 'DROP_UNNECESSARY_VERSION'

EMPTY_FOLDER

public mixed EMPTY_FOLDER = 'EMPTY_FOLDER'

TASK_STATUS_CANCEL

public mixed TASK_STATUS_CANCEL = 4

TASK_STATUS_DONE

public mixed TASK_STATUS_DONE = 3

TASK_STATUS_NONE

public mixed TASK_STATUS_NONE = 0

TASK_STATUS_RUNNING

public mixed TASK_STATUS_RUNNING = 2

TASK_STATUS_WAIT

public mixed TASK_STATUS_WAIT = 1

Methods

collectLogData()

Collects data for logging.

public collectLogData(BaseObject|Version $object) : array<string|int, mixed>
Parameters
$object : BaseObject|Version

Object to delete.

Return values
array<string|int, mixed>

fixState()

Saves task state.

public fixState() : bool
Return values
bool

getCountFilesToDrop()

Gets count files to drop.

public getCountFilesToDrop() : int
Return values
int

getCountVersionToDrop()

Gets dropped folder count.

public getCountVersionToDrop() : int
Return values
int

getDroppedFileCount()

Gets dropped file count.

public getDroppedFileCount() : int
Return values
int

getDroppedFolderCount()

Gets dropped folder count.

public getDroppedFolderCount() : int
Return values
int

getDroppedVersionCount()

Gets dropped version count.

public getDroppedVersionCount() : int
Return values
int

getFailCount()

Gets fail count.

public getFailCount() : int
Return values
int

getId()

Gets task id.

public getId() : int
Return values
int

getIndicatorType()

Returns indicator class name.

public getIndicatorType() : string
Return values
string

getIterationFileCount()

Gets count files loaded by filter for iteration.

public getIterationFileCount() : int
Return values
int

getLastError()

Gets last error text occurred in iteration.

public getLastError() : int
Return values
int

getLastFileId()

Gets last file id.

public getLastFileId() : int
Return values
int

getOwnerId()

Gets task owner id.

public getOwnerId() : int
Return values
int

getParam()

Gets task parameter.

public getParam(string $code) : string|int|null
Parameters
$code : string

Parameter code.

Return values
string|int|null

getStatus()

Gets task status.

public getStatus() : int
Return values
int

getStatusSubTask()

Gets task status.

public getStatusSubTask(string $subTask) : int
Parameters
$subTask : string

Subtask code.

Return values
int

hasFatalError()

Has fatal error.

public hasFatalError() : bool
Return values
bool

hasTaskFinished()

Checks if all files have deleted.

public hasTaskFinished(string $subTask) : bool
Parameters
$subTask : string

Sub task to check.

Return values
bool

hasUserCanceled()

Check user cancel task.

public hasUserCanceled() : bool
Return values
bool

increaseDroppedFileCount()

Increases dropped file count.

public increaseDroppedFileCount([int $delta = 1 ]) : void
Parameters
$delta : int = 1

Amount to add.

increaseDroppedFolderCount()

Increases dropped folder count.

public increaseDroppedFolderCount([int $delta = 1 ]) : void
Parameters
$delta : int = 1

Amount to add.

increaseDroppedVersionCount()

Increases dropped version count.

public increaseDroppedVersionCount([int $delta = 1 ]) : void
Parameters
$delta : int = 1

Amount to add.

increaseFailCount()

Increases fail count.

public increaseFailCount([int $delta = 1 ]) : void
Parameters
$delta : int = 1

Amount to add.

isRunningMode()

Checks if status is in running mode.

public static isRunningMode(int $status[, array<string|int, int> $runningStatus = [self::TASK_STATUS_WAIT, self::TASK_STATUS_RUNNING] ]) : bool
Parameters
$status : int

Status to check.

$runningStatus : array<string|int, int> = [self::TASK_STATUS_WAIT, self::TASK_STATUS_RUNNING]

These statuses are running modes.

Return values
bool

loadTaskById()

Loads task params from db.

public loadTaskById(int $filterId[, int $ownerId = DiskSystemUser::SYSTEM_USER_ID ]) : bool
Parameters
$filterId : int

Id of saved indicator result from b_disk_volume.

$ownerId : int = DiskSystemUser::SYSTEM_USER_ID

Task owner id.

Return values
bool

log()

Fix data of object to table log.

public log(array<string|int, mixed> $data, string $operation) : bool
Parameters
$data : array<string|int, mixed>

File or folder info.

$operation : string

Operation name.

Return values
bool

raiseFatalError()

Set fatal error.

public raiseFatalError() : void

resetFail()

Reset fail and error.

public resetFail() : void

setIndicatorType()

Sets indicator type.

public setIndicatorType(string $indicatorType) : void
Parameters
$indicatorType : string

Indicator class name.

setIterationFileCount()

Sets count files loaded by filter for iteration.

public setIterationFileCount(int $iterationFileCount) : void
Parameters
$iterationFileCount : int

Count rows in result set.

setLastError()

Sets last error text ocoried in iteration.

public setLastError(string $errorText) : void
Parameters
$errorText : string

Error text to save.

setLastFileId()

Sets last file id.

public setLastFileId(int $lastFileId) : void
Parameters
$lastFileId : int

File id.

setOwnerId()

Sets task owner id.

public setOwnerId(int $ownerId) : void
Parameters
$ownerId : int

Owner id.

setParam()

Sets task parameter.

public setParam(string $code, string $value) : void
Parameters
$code : string

Parameter code.

$value : string

Parameter value.

setStatus()

Sets task status.

public setStatus(int $status) : void
Parameters
$status : int

Task status.

setStatusSubTask()

Sets task status.

public setStatusSubTask(string $subTask, int $status) : void
Parameters
$subTask : string

Subtask code.

$status : int

Subtask status.


        
On this page

Search results