Bitrix API

Cleaner

Task cleanlier class.

Table of Contents

Constants

AGENT_INTERVAL  = 60
DROP_ACTIVITY  = 'DROP_ACTIVITY'
DROP_ENTITY  = 'DROP_ENTITY'
DROP_EVENT  = 'DROP_EVENT'
DROP_FILE  = 'DROP_FILE'
TASK_STATUS_CANCEL  = 4
TASK_STATUS_DONE  = 3
TASK_STATUS_NONE  = 0
TASK_STATUS_RUNNING  = 2
TASK_STATUS_WAIT  = 1

Methods

addWorker()  : bool
Adds delayed delete worker agent.
agentName()  : string
Returns agent's name.
canAgentUseCrontab()  : bool
Checks ability agent to use Crontab.
cancelWorker()  : void
Cancels all agent process.
className()  : string
Returns the fully qualified name of this class.
clearProgressInfo()  : void
Remove stepper progress bar.
countWorker()  : int
Count worker agent for user.
fixState()  : bool
Saves task state.
getCountToDrop()  : int
Gets count to drop.
getDroppedCount()  : int
Gets dropped smt count.
getFailCount()  : int
Gets fail count.
getId()  : int
Gets task id.
getIndicator()  : IVolumeIndicator|null
Returns object indicator corresponding to task.
getIndicatorType()  : string
Returns indicator class name.
getIterationCount()  : int
Gets count loaded by filter for iteration.
getLastError()  : int
Gets last error text occurred in iteration.
getLastId()  : int
Gets last file id.
getOwnerId()  : int
Gets task owner id.
getParam()  : string|int|null
Gets task parameter.
getProgressInfo()  : array<string|int, mixed>|null
Set up information showing at stepper progress bar.
getStatus()  : int
Gets task status.
getStatusSubTask()  : int
Gets task status.
hasFatalError()  : bool
Has fatal error.
hasTaskFinished()  : bool
Checks if all have deleted.
hasUserCanceled()  : bool
Check user cancel task.
isCronRun()  : bool
Determines if a script is loaded via cron/command line.
isRunningMode()  : bool
Checks if status is in running mode.
loadTaskById()  : bool
Loads task params from db.
raiseFatalError()  : self
Set fatal error.
runProcess()  : string
Main cleaning agent.
runWorker()  : string
setDroppedCount()  : self
Sets dropped smt count.
setFailCount()  : self
Sets fail count.
setIndicatorType()  : self
Sets indicator type.
setIterationCount()  : self
Sets count loaded by filter for iteration.
setLastError()  : self
Sets last error text occurred in iteration.
setLastId()  : self
Sets last proceeded id.
setOwnerId()  : self
Sets task owner id.
setParam()  : self
Sets task parameter.
setProgressInfo()  : void
Set up information showing at stepper progress bar.
setStatus()  : self
Sets task status.
setStatusSubTask()  : self
Sets task status.

Constants

AGENT_INTERVAL

public mixed AGENT_INTERVAL = 60

DROP_ACTIVITY

public mixed DROP_ACTIVITY = 'DROP_ACTIVITY'

DROP_ENTITY

public mixed DROP_ENTITY = 'DROP_ENTITY'

DROP_EVENT

public mixed DROP_EVENT = 'DROP_EVENT'

DROP_FILE

public mixed DROP_FILE = 'DROP_FILE'

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

addWorker()

Adds delayed delete worker agent.

public static addWorker(array<string|int, mixed> $params, IVolumeIndicator $indicator) : bool
Parameters
$params : array<string|int, mixed>

Named parameters: int ownerId - who is owner, int taskId - as row private id from b_crm_volume as task id, int delay - number seconds to delay first execution string filter - filter bool DROP_ENTITY - set job to drop entity bool DROP_FILE - set job to drop file bool DROP_EVENT - set job to drop event bool DROP_ACTIVITY - set job to drop activity.

$indicator : IVolumeIndicator

Indicator to setup agent.

Return values
bool

agentName()

Returns agent's name.

public static agentName() : string
Return values
string

canAgentUseCrontab()

Checks ability agent to use Crontab.

public static canAgentUseCrontab() : bool
Return values
bool

cancelWorker()

Cancels all agent process.

public static cancelWorker([int $ownerId = -1 ]) : void
Parameters
$ownerId : int = -1

Whom will mark as deleted by.

className()

Returns the fully qualified name of this class.

public static className() : string
Return values
string

clearProgressInfo()

Remove stepper progress bar.

public static clearProgressInfo([int $ownerId = -1 ]) : void
Parameters
$ownerId : int = -1

Whom will mark as deleted by.

countWorker()

Count worker agent for user.

public static countWorker([int $ownerId = -1 ]) : int
Parameters
$ownerId : int = -1

Whom will mark as deleted by.

Return values
int

fixState()

Saves task state.

public fixState([string $subTask = '' ]) : bool
Parameters
$subTask : string = ''

Subtask code.

Return values
bool

getCountToDrop()

Gets count to drop.

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

Sub task to check.

Return values
int

getDroppedCount()

Gets dropped smt count.

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

Sub task to check.

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

getIterationCount()

Gets count loaded by filter for iteration.

public getIterationCount() : int
Return values
int

getLastError()

Gets last error text occurred in iteration.

public getLastError() : int
Return values
int

getLastId()

Gets last file id.

public getLastId() : 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

getProgressInfo()

Set up information showing at stepper progress bar.

public static getProgressInfo(int $ownerId) : array<string|int, mixed>|null
Parameters
$ownerId : int

Whom will mark as deleted by.

Return values
array<string|int, mixed>|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 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

isCronRun()

Determines if a script is loaded via cron/command line.

public static isCronRun() : bool
Return values
bool

isRunningMode()

Checks if status is in running mode.

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

Status to check.

$runningStatus : array<string|int, int> = array(self::TASK_STATUS_WAIT, self::TASK_STATUS_RUNNING)

This statuses are in running mode.

Return values
bool

loadTaskById()

Loads task params from db.

public loadTaskById(int $taskId[, int $ownerId = 0 ]) : bool
Parameters
$taskId : int

Id of saved indicator result from b_crm_volume.

$ownerId : int = 0

Task owner id.

Return values
bool

raiseFatalError()

Set fatal error.

public raiseFatalError() : self
Return values
self

runProcess()

Main cleaning agent.

public static runProcess() : string
Return values
string

runWorker()

public static runWorker(int $taskId) : string
Parameters
$taskId : int

Id of saved indicator result from b_disk_volume.

Tags
todo

Remove it

Return values
string

setDroppedCount()

Sets dropped smt count.

public setDroppedCount(string $subTask, int $count) : self
Parameters
$subTask : string

Sub task to check.

$count : int

Amount to set.

Return values
self

setFailCount()

Sets fail count.

public setFailCount(int $count) : self
Parameters
$count : int

Amount to set.

Return values
self

setIndicatorType()

Sets indicator type.

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

Indicator class name.

Return values
self

setIterationCount()

Sets count loaded by filter for iteration.

public setIterationCount(int $iterationCount) : self
Parameters
$iterationCount : int

Count rows in result set.

Return values
self

setLastError()

Sets last error text occurred in iteration.

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

Error text to save.

Return values
self

setLastId()

Sets last proceeded id.

public setLastId(int $lastId) : self
Parameters
$lastId : int

Last proceeded id.

Return values
self

setOwnerId()

Sets task owner id.

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

Owner id.

Return values
self

setParam()

Sets task parameter.

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

Parameter code.

$value : string

Parameter value.

Return values
self

setProgressInfo()

Set up information showing at stepper progress bar.

public static setProgressInfo(int $ownerId, int $totalToDrop[, int $droppedCount = 0 ][, int $failCount = 0 ]) : void
Parameters
$ownerId : int

Whom will mark as deleted by.

$totalToDrop : int

Total smt to drop.

$droppedCount : int = 0

Dropped smt count.

$failCount : int = 0

Failed deletion count.

setStatus()

Sets task status.

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

Task status.

Return values
self

setStatusSubTask()

Sets task status.

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

Subtask code.

$status : int

Subtask status.

Return values
self

        
On this page

Search results