Bitrix API

StagesTable extends DataManager

Class StagesTable

DO NOT WRITE ANYTHING BELOW THIS

<<< ORMENTITYANNOTATION

Table of Contents

Constants

DEF_COLOR_STAGE  = '47D1E2'
Default colors.
EVENT_ON_ADD  = "OnAdd"
EVENT_ON_AFTER_ADD  = "OnAfterAdd"
EVENT_ON_AFTER_DELETE  = "OnAfterDelete"
EVENT_ON_AFTER_UPDATE  = "OnAfterUpdate"
EVENT_ON_BEFORE_ADD  = "OnBeforeAdd"
EVENT_ON_BEFORE_DELETE  = "OnBeforeDelete"
EVENT_ON_BEFORE_UPDATE  = "OnBeforeUpdate"
EVENT_ON_DELETE  = "OnDelete"
EVENT_ON_UPDATE  = "OnUpdate"
MY_PLAN_VERSION  = '6'
SYS_TYPE_DEFAULT  = 'NEW'
SYS_TYPE_FINISH  = 'FINISH'
SYS_TYPE_FINISH_COLOR  = '75D900'
SYS_TYPE_NEW  = 'NEW'
System type of stages (new, in progress, etc.).
SYS_TYPE_NEW_COLOR  = '00C4FB'
SYS_TYPE_PROGRESS  = 'WORK'
SYS_TYPE_PROGRESS_COLOR  = self::DEF_COLOR_STAGE
SYS_TYPE_REVIEW  = 'REVIEW'
WORK_MODE_ACTIVE_SPRINT  = 'A'
WORK_MODE_GROUP  = 'G'
Allowed work modes.
WORK_MODE_TIMELINE  = 'P'
WORK_MODE_USER  = 'U'

Methods

add()  : AddResult
Adds row to entity table
addMulti()  : AddResult
checkFields()  : mixed
Checks the data fields before saving to DB. Result stores in the $result object
checkWorkMode()  : bool
cleanCache()  : void
Cleans the tablet cache after data modifications.
copyView()  : array<string|int, mixed>|bool
Copy view from one entity to another.
createCollection()  : StagesCollection
createObject()  : Stage
cryptoEnabled()  : bool
Returns true if crypto is enabled for a field.
delete()  : DeleteResult
Base delete-method, first check that column is not system.
disableLinkForUser()  : void
Disable link in stage for user.
disablePinForUser()  : void
Disable pin in stage for user.
enableCrypto()  : mixed
Sets a flag indicating crypto support for a field.
getActiveSprintStages()  : array<string|int, mixed>
getById()  : EO_Stages_Result
Returns selection by entity's primary key
getByPrimary()  : EO_Stages_Result
Returns selection by entity's primary key and optional parameters for getList()
getCollectionClass()  : string|Collection
Returns class of Object collection for current entity.
getCollectionClassName()  : string
Returns class name (without namespace) of Object collection for current entity.
getCollectionParentClass()  : Collection|string
getConnectionName()  : string
Returns connection name for entity
getCount()  : int
Performs COUNT query on entity and returns the result.
getDefaultStageId()  : int
Get default stage id.
getEntity()  : EO_Stages_Entity
Returns entity object
getEntityClass()  : Entity|string
getGroupStageById()  : array<string|int, mixed>|null
getGroupStages()  : array<string|int, mixed>
getList()  : EO_Stages_Result
Executes the query and returns selection by parameters of the query. This function is an alias to the Query object functions
getMap()  : array<string|int, mixed>
Returns entity map definition.
getObjectClass()  : string|EntityObject
Returns class of Object for current entity.
getObjectClassName()  : string
Returns class name (without namespace) of Object for current entity.
getObjectParentClass()  : EntityObject|string
getQueryClass()  : Query|string
getRow()  : array<string|int, mixed>|null
Returns one row (or null) by parameters for getList()
getRowById()  : array<string|int, mixed>|null
Returns one row (or null) by entity's primary key
getStageIdByCode()  : int|array<string|int, mixed>
Get stages id by stage code.
getStages()  : array<string|int, mixed>
Get stages and create default.
getStagesCount()  : array<string|int, mixed>
getSystemStage()  : Stage|null
getTableName()  : string
Returns DB table name for entity
getTitle()  : string|null
getUfId()  : mixed
getWorkMode()  : string
isCacheable()  : bool
You can disable cache for the tablet completely.
isUtm()  : mixed
isUts()  : mixed
onAdd()  : mixed
onAfterAdd()  : mixed
onAfterDelete()  : mixed
onAfterUpdate()  : mixed
onBeforeAdd()  : mixed
onBeforeDelete()  : mixed
onBeforeUpdate()  : mixed
onDelete()  : void
onSocNetGroupDelete()  : void
Delete all stages and sprints of group after group delete.
onUpdate()  : mixed
onUserDelete()  : void
Delete all stages of user after user delete.
pinInStage()  : void
Pin the task in the DEFAULT stage for users/group.
pinInTheStage()  : void
Pin the task in the stage for user/group.
postInitialize()  : null
query()  : EO_Stages_Query
Creates and returns the Query object for the entity
setCurrentDeletingObject()  : void
setDefaultScope()  : Query
setWorkMode()  : void
systemDelete()  : DeleteResult
unsetEntity()  : mixed
update()  : UpdateResult
Updates row in entity table by primary key
updateByCode()  : Result|null
Add or update stages by code/id.
updateMulti()  : UpdateResult
wakeUpCollection()  : StagesCollection
wakeUpObject()  : Stage

Constants

DEF_COLOR_STAGE

Default colors.

public mixed DEF_COLOR_STAGE = '47D1E2'

EVENT_ON_AFTER_ADD

public mixed EVENT_ON_AFTER_ADD = "OnAfterAdd"

EVENT_ON_AFTER_DELETE

public mixed EVENT_ON_AFTER_DELETE = "OnAfterDelete"

EVENT_ON_AFTER_UPDATE

public mixed EVENT_ON_AFTER_UPDATE = "OnAfterUpdate"

EVENT_ON_BEFORE_ADD

public mixed EVENT_ON_BEFORE_ADD = "OnBeforeAdd"

EVENT_ON_BEFORE_DELETE

public mixed EVENT_ON_BEFORE_DELETE = "OnBeforeDelete"

EVENT_ON_BEFORE_UPDATE

public mixed EVENT_ON_BEFORE_UPDATE = "OnBeforeUpdate"

EVENT_ON_DELETE

public mixed EVENT_ON_DELETE = "OnDelete"

EVENT_ON_UPDATE

public mixed EVENT_ON_UPDATE = "OnUpdate"

MY_PLAN_VERSION

public mixed MY_PLAN_VERSION = '6'

SYS_TYPE_DEFAULT

public mixed SYS_TYPE_DEFAULT = 'NEW'

SYS_TYPE_FINISH

public mixed SYS_TYPE_FINISH = 'FINISH'

SYS_TYPE_FINISH_COLOR

public mixed SYS_TYPE_FINISH_COLOR = '75D900'

SYS_TYPE_NEW

System type of stages (new, in progress, etc.).

public mixed SYS_TYPE_NEW = 'NEW'

Separated from other stages - timeline's stages, sprint's stages.

Tags
see
TimeLineTable::getStages()

SYS_TYPE_NEW_COLOR

public mixed SYS_TYPE_NEW_COLOR = '00C4FB'

SYS_TYPE_PROGRESS

public mixed SYS_TYPE_PROGRESS = 'WORK'

SYS_TYPE_PROGRESS_COLOR

public mixed SYS_TYPE_PROGRESS_COLOR = self::DEF_COLOR_STAGE

SYS_TYPE_REVIEW

public mixed SYS_TYPE_REVIEW = 'REVIEW'

WORK_MODE_ACTIVE_SPRINT

public mixed WORK_MODE_ACTIVE_SPRINT = 'A'

WORK_MODE_GROUP

Allowed work modes.

public mixed WORK_MODE_GROUP = 'G'

WORK_MODE_TIMELINE

public mixed WORK_MODE_TIMELINE = 'P'

WORK_MODE_USER

public mixed WORK_MODE_USER = 'U'

Methods

add()

Adds row to entity table

public static add(array<string|int, mixed> $data) : AddResult
Parameters
$data : array<string|int, mixed>

An array with fields like array( "fields" => array( "FIELD1" => "value1", "FIELD2" => "value2", ), "auth_context" => \Bitrix\Main\Authentication\Context object ) or just a plain array of fields.

Tags
throws
Exception
Return values
AddResult

Contains ID of inserted row

addMulti()

public static addMulti(mixed $rows[, bool $ignoreEvents = false ]) : AddResult
Parameters
$rows : mixed
$ignoreEvents : bool = false
Tags
throws
ArgumentException
throws
SystemException
Return values
AddResult

checkFields()

Checks the data fields before saving to DB. Result stores in the $result object

public static checkFields(Result $result, mixed $primary, array<string|int, mixed> $data) : mixed
Parameters
$result : Result
$primary : mixed
$data : array<string|int, mixed>
Tags
throws
ArgumentException
throws
SystemException

checkWorkMode()

public static checkWorkMode(string $mode) : bool
Parameters
$mode : string
Return values
bool

cleanCache()

Cleans the tablet cache after data modifications.

public static cleanCache() : void

copyView()

Copy view from one entity to another.

public static copyView(int $fromEntityId, int $toEntityId[, string $entityType = self::WORK_MODE_GROUP ]) : array<string|int, mixed>|bool
Parameters
$fromEntityId : int
$toEntityId : int
$entityType : string = self::WORK_MODE_GROUP
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
throws
Exception
Return values
array<string|int, mixed>|bool

createObject()

public static createObject([mixed $setDefaultValues = = 'true' ]) : Stage
Parameters
$setDefaultValues : mixed = = 'true'
Return values
Stage

cryptoEnabled()

Returns true if crypto is enabled for a field.

public static cryptoEnabled(string $field[, string $table = null ]) : bool
Parameters
$field : string
$table : string = null
Return values
bool

delete()

Base delete-method, first check that column is not system.

public static delete(mixed $primary[, int $entityId = 0 ]) : DeleteResult
Parameters
$primary : mixed
$entityId : int = 0
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
throws
Exception
Return values
DeleteResult

disableLinkForUser()

Disable link in stage for user.

public static disableLinkForUser(array<string|int, mixed>|int $userIds) : void
Parameters
$userIds : array<string|int, mixed>|int

disablePinForUser()

Disable pin in stage for user.

public static disablePinForUser(array<string|int, mixed>|int $userIds) : void
Parameters
$userIds : array<string|int, mixed>|int

enableCrypto()

Sets a flag indicating crypto support for a field.

public static enableCrypto(string $field[, string $table = null ][, bool $mode = true ]) : mixed
Parameters
$field : string
$table : string = null
$mode : bool = true

getActiveSprintStages()

public static getActiveSprintStages(int $sprintId[, bool $disableCreate = false ]) : array<string|int, mixed>
Parameters
$sprintId : int
$disableCreate : bool = false
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>

getById()

Returns selection by entity's primary key

public static getById(mixed $id) : EO_Stages_Result
Parameters
$id : mixed

Primary key of the entity

Return values
EO_Stages_Result

getByPrimary()

Returns selection by entity's primary key and optional parameters for getList()

public static getByPrimary(mixed $primary[, array<string|int, mixed> $parameters = = '[]' ]) : EO_Stages_Result
Parameters
$primary : mixed

Primary key of the entity

$parameters : array<string|int, mixed> = = '[]'

Additional parameters for getList()

Return values
EO_Stages_Result

getCollectionClass()

Returns class of Object collection for current entity.

public static getCollectionClass() : string|Collection
Return values
string|Collection

getCollectionClassName()

Returns class name (without namespace) of Object collection for current entity.

public final static getCollectionClassName() : string
Return values
string

getConnectionName()

Returns connection name for entity

public static getConnectionName() : string
Return values
string

getCount()

Performs COUNT query on entity and returns the result.

public static getCount([array<string|int, mixed>|ConditionTree $filter = array() ][, array<string|int, mixed> $cache = array() ]) : int
Parameters
$filter : array<string|int, mixed>|ConditionTree = array()
$cache : array<string|int, mixed> = array()

An array of cache options "ttl" => integer indicating cache TTL

Tags
throws
ObjectPropertyException
throws
SystemException
Return values
int

getDefaultStageId()

Get default stage id.

public static getDefaultStageId([mixed $id = 0 ]) : int
Parameters
$id : mixed = 0
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
throws
Exception
Return values
int

getEntity()

Returns entity object

public static getEntity() : EO_Stages_Entity
Return values
EO_Stages_Entity

getGroupStageById()

public static getGroupStageById(int $stageId, int $groupId) : array<string|int, mixed>|null
Parameters
$stageId : int
$groupId : int
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>|null

getGroupStages()

public static getGroupStages(int $groupId[, bool $disableCreate = false ]) : array<string|int, mixed>
Parameters
$groupId : int
$disableCreate : bool = false
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>

getList()

Executes the query and returns selection by parameters of the query. This function is an alias to the Query object functions

public static getList([array<string|int, mixed> $parameters = = '[]' ]) : EO_Stages_Result
Parameters
$parameters : array<string|int, mixed> = = '[]'

An array of query parameters, available keys are:
"select" => array of fields in the SELECT part of the query, aliases are possible in the form of "alias"=>"field";
"filter" => array of filters in the WHERE/HAVING part of the query in the form of "(condition)field"=>"value"; also could be an instance of Filter;
"group" => array of fields in the GROUP BY part of the query;
"order" => array of fields in the ORDER BY part of the query in the form of "field"=>"asc|desc";
"limit" => integer indicating maximum number of rows in the selection (like LIMIT n in MySql);
"offset" => integer indicating first row number in the selection (like LIMIT n, 100 in MySql);
"runtime" => array of entity fields created dynamically;
"cache => array of cache options:
"ttl" => integer indicating cache TTL;
"cache_joins" => boolean enabling to cache joins, false by default.

Return values
EO_Stages_Result

getMap()

Returns entity map definition.

public static getMap() : array<string|int, mixed>

To get initialized fields @see \Bitrix\Main\ORM\Entity::getFields() and \Bitrix\Main\ORM\Entity::getField()

Return values
array<string|int, mixed>

getObjectClassName()

Returns class name (without namespace) of Object for current entity.

public final static getObjectClassName() : string
Return values
string

getRow()

Returns one row (or null) by parameters for getList()

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

Primary key of the entity

Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>|null

getRowById()

Returns one row (or null) by entity's primary key

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

Primary key of the entity

Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>|null

getStageIdByCode()

Get stages id by stage code.

public static getStageIdByCode(int $id[, int $entityId = 0 ]) : int|array<string|int, mixed>
Parameters
$id : int
$entityId : int = 0
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
throws
Exception
Return values
int|array<string|int, mixed>

getStages()

Get stages and create default.

public static getStages([int|string $entityId = 0 ][, bool $disableCreate = false ]) : array<string|int, mixed>
Parameters
$entityId : int|string = 0
$disableCreate : bool = false
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
throws
Exception
Return values
array<string|int, mixed>

getStagesCount()

public static getStagesCount(array<string|int, mixed> $stageList[, array<string|int, mixed> $filter = [] ][, mixed $userId = false ]) : array<string|int, mixed>
Parameters
$stageList : array<string|int, mixed>
$filter : array<string|int, mixed> = []
$userId : mixed = false
Tags
throws
InvalidGroupByException
Return values
array<string|int, mixed>

getSystemStage()

public static getSystemStage(int $groupId[, bool $force = false ]) : Stage|null
Parameters
$groupId : int
$force : bool = false
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
Stage|null

getTableName()

Returns DB table name for entity

public static getTableName() : string
Return values
string

getTitle()

public static getTitle() : string|null
Return values
string|null

getWorkMode()

public static getWorkMode() : string
Return values
string

isCacheable()

You can disable cache for the tablet completely.

public static isCacheable() : bool
Return values
bool

onDelete()

public static onDelete(Event $event) : void
Parameters
$event : Event

onSocNetGroupDelete()

Delete all stages and sprints of group after group delete.

public static onSocNetGroupDelete(int $groupId) : void
Parameters
$groupId : int
Tags
throws
ObjectPropertyException
throws
SystemException
throws
ArgumentException
throws
Exception

onUserDelete()

Delete all stages of user after user delete.

public static onUserDelete(int $userId) : void
Parameters
$userId : int
Tags
throws
Exception

pinInStage()

Pin the task in the DEFAULT stage for users/group.

public static pinInStage(int $taskId[, int|array<string|int, mixed> $users = [] ][, bool $refreshGroup = false ]) : void
Parameters
$taskId : int
$users : int|array<string|int, mixed> = []
$refreshGroup : bool = false
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
throws
Exception

pinInTheStage()

Pin the task in the stage for user/group.

public static pinInTheStage(int $taskId, int $stageId) : void
Parameters
$taskId : int
$stageId : int
Tags
throws
SqlQueryException
throws
ObjectPropertyException
throws
TasksException
throws
ArgumentException
throws
SystemException

postInitialize()

public static postInitialize(Entity $entity) : null
Parameters
$entity : Entity
Return values
null

query()

Creates and returns the Query object for the entity

public static query() : EO_Stages_Query
Return values
EO_Stages_Query

setWorkMode()

public static setWorkMode(string $mode) : void
Parameters
$mode : string

unsetEntity()

public static unsetEntity(mixed $class) : mixed
Parameters
$class : mixed

update()

Updates row in entity table by primary key

public static update(mixed $primary, array<string|int, mixed> $data) : UpdateResult
Parameters
$primary : mixed
$data : array<string|int, mixed>

An array with fields like array( "fields" => array( "FIELD1" => "value1", "FIELD2" => "value2", ), "auth_context" => \Bitrix\Main\Authentication\Context object ) or just a plain array of fields.

Tags
throws
Exception
Return values
UpdateResult

updateByCode()

Add or update stages by code/id.

public static updateByCode(mixed $id, mixed $fields) : Result|null
Parameters
$id : mixed
$fields : mixed
Tags
throws
ArgumentException
throws
SqlQueryException
throws
ObjectPropertyException
throws
SystemException
throws
Exception
Return values
Result|null

updateMulti()

public static updateMulti(array<string|int, mixed> $primaries, array<string|int, mixed> $data[, bool $ignoreEvents = false ]) : UpdateResult
Parameters
$primaries : array<string|int, mixed>
$data : array<string|int, mixed>
$ignoreEvents : bool = false
Tags
throws
ArgumentException
throws
SystemException
Return values
UpdateResult

wakeUpObject()

public static wakeUpObject(mixed $row) : Stage
Parameters
$row : mixed
Return values
Stage

        
On this page

Search results