RoundingTable extends DataManager
Class RoundingTable
Fields:
- ID int mandatory
- CATALOG_GROUP_ID int mandatory
- PRICE double mandatory
- ROUND_TYPE int mandatory
- ROUND_PRECISION double mandatory
- CREATED_BY int optional
- DATE_CREATE datetime optional
- MODIFIED_BY int optional
- TIMESTAMP_X datetime optional
- CREATED_BY_USER reference to [](\Bitrix\Main\UserTable)
- MODIFIED_BY_USER reference to [](\Bitrix\Main\UserTable)
Table of Contents
Constants
- 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"
- ROUND_DOWN = 0x4
- ROUND_MATH = 0x1
- ROUND_UP = 0x2
Methods
- add() : AddResult
- Adds row to entity table
- addMulti() : AddResult
- Adds several rows to entity table.
- allowClearCache() : void
- Allow clear cache after multiuse add/update/delete.
- checkFields() : mixed
- Checks the data fields before saving to DB. Result stores in the $result object
- cleanCache() : void
- Cleans the tablet cache after data modifications.
- clearCache() : void
- Clear managed cache.
- clearPriceTypeIds() : void
- Clear price type ids.
- createCollection() : EO_Rounding_Collection
- createObject() : EO_Rounding
- cryptoEnabled() : bool
- Returns true if crypto is enabled for a field.
- delete() : DeleteResult
- Deletes row in entity table by primary key
- deleteByPriceType() : void
- Delete rules by price type.
- disallowClearCache() : void
- Disallow clear cache before multiuse add/update/delete.
- enableCrypto() : mixed
- Sets a flag indicating crypto support for a field.
- getById() : EO_Rounding_Result
- Returns selection by entity's primary key
- getByPrimary() : EO_Rounding_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.
- getEntity() : EO_Rounding_Entity
- Returns entity object
- getEntityClass() : Entity|string
- getList() : EO_Rounding_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
- getPresetRoundingValues() : array<string|int, mixed>
- Get preset rounding precision values for public interfaces and all kinds of validations
- getQueryClass() : Query|string
- getRoundTypes() : array<string|int, mixed>
- Return round types.
- 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
- getTableName() : string
- Returns DB table name for entity.
- getTitle() : string|null
- getUfId() : mixed
- isAllowedClearCache() : bool
- Returns current allow mode for cache clearing.
- isCacheable() : bool
- You can disable cache for the tablet completely.
- isUtm() : mixed
- isUts() : mixed
- onAdd() : mixed
- onAfterAdd() : void
- Default onAfterAdd handler. Absolutely necessary.
- onAfterDelete() : void
- Default onAfterDelete handler. Absolutely necessary.
- onAfterUpdate() : void
- Default onAfterUpdate handler. Absolutely necessary.
- onBeforeAdd() : EventResult
- Default onBeforeAdd handler. Absolutely necessary.
- onBeforeDelete() : mixed
- onBeforeUpdate() : EventResult
- Default onBeforeUpdate handler. Absolutely necessary.
- onDelete() : void
- Default onDelete handler. Absolutely necessary.
- onUpdate() : void
- Default onUpdate handler. Absolutely necessary.
- postInitialize() : null
- query() : EO_Rounding_Query
- Creates and returns the Query object for the entity
- setCurrentDeletingObject() : void
- setDefaultScope() : Query
- setPriceTypeIds() : void
- Set price type list for cache clearing.
- unsetEntity() : mixed
- update() : UpdateResult
- Updates row in entity table by primary key
- updateMulti() : UpdateResult
- wakeUpCollection() : EO_Rounding_Collection
- wakeUpObject() : EO_Rounding
Constants
EVENT_ON_ADD
public
mixed
EVENT_ON_ADD
= "OnAdd"
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"
ROUND_DOWN
public
mixed
ROUND_DOWN
= 0x4
ROUND_MATH
public
mixed
ROUND_MATH
= 0x1
ROUND_UP
public
mixed
ROUND_UP
= 0x2
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.
This method uses the default strategy defined in the class.
Tags
Return values
AddResult —Contains ID of inserted row
addMulti()
Adds several rows to entity table.
public
static addMulti(mixed $rows[, bool $ignoreEvents = false ]) : AddResult
This method uses the default strategy defined in the class.
Parameters
- $rows : mixed
- $ignoreEvents : bool = false
Tags
Return values
AddResultallowClearCache()
Allow clear cache after multiuse add/update/delete.
public
static allowClearCache() : void
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
cleanCache()
Cleans the tablet cache after data modifications.
public
static cleanCache() : void
clearCache()
Clear managed cache.
public
static clearCache() : void
clearPriceTypeIds()
Clear price type ids.
public
static clearPriceTypeIds() : void
createCollection()
public
static createCollection() : EO_Rounding_Collection
Return values
EO_Rounding_CollectioncreateObject()
public
static createObject([mixed $setDefaultValues = = 'true' ]) : EO_Rounding
Parameters
- $setDefaultValues : mixed = = 'true'
Return values
EO_RoundingcryptoEnabled()
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
booldelete()
Deletes row in entity table by primary key
public
static delete(mixed $primary) : DeleteResult
Parameters
- $primary : mixed
Tags
Return values
DeleteResultdeleteByPriceType()
Delete rules by price type.
public
static deleteByPriceType(string|int $priceType) : void
Parameters
- $priceType : string|int
-
Price type id.
disallowClearCache()
Disallow clear cache before multiuse add/update/delete.
public
static disallowClearCache() : void
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
getById()
Returns selection by entity's primary key
public
static getById(mixed $id) : EO_Rounding_Result
Parameters
- $id : mixed
-
Primary key of the entity
Return values
EO_Rounding_ResultgetByPrimary()
Returns selection by entity's primary key and optional parameters for getList()
public
static getByPrimary(mixed $primary[, array<string|int, mixed> $parameters = = '[]' ]) : EO_Rounding_Result
Parameters
- $primary : mixed
-
Primary key of the entity
- $parameters : array<string|int, mixed> = = '[]'
-
Additional parameters for getList()
Return values
EO_Rounding_ResultgetCollectionClass()
Returns class of Object collection for current entity.
public
static getCollectionClass() : string|Collection
Return values
string|CollectiongetCollectionClassName()
Returns class name (without namespace) of Object collection for current entity.
public
final static getCollectionClassName() : string
Return values
stringgetCollectionParentClass()
public
static getCollectionParentClass() : Collection|string
Return values
Collection|stringgetConnectionName()
Returns connection name for entity
public
static getConnectionName() : string
Return values
stringgetCount()
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
Return values
intgetEntity()
Returns entity object
public
static getEntity() : EO_Rounding_Entity
Return values
EO_Rounding_EntitygetEntityClass()
public
static getEntityClass() : Entity|string
Return values
Entity|stringgetList()
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_Rounding_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_Rounding_ResultgetMap()
Returns entity map definition.
public
static getMap() : array<string|int, mixed>
Return values
array<string|int, mixed>getObjectClass()
Returns class of Object for current entity.
public
static getObjectClass() : string|EntityObject
Return values
string|EntityObjectgetObjectClassName()
Returns class name (without namespace) of Object for current entity.
public
final static getObjectClassName() : string
Return values
stringgetObjectParentClass()
public
static getObjectParentClass() : EntityObject|string
Return values
EntityObject|stringgetPresetRoundingValues()
Get preset rounding precision values for public interfaces and all kinds of validations
public
static getPresetRoundingValues() : array<string|int, mixed>
Return values
array<string|int, mixed>getQueryClass()
public
static getQueryClass() : Query|string
Return values
Query|stringgetRoundTypes()
Return round types.
public
static getRoundTypes([bool $full = false ]) : array<string|int, mixed>
Parameters
- $full : bool = false
-
Get types with description.
Return values
array<string|int, mixed>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
Return values
array<string|int, mixed>|nullgetRowById()
Returns one row (or null) by entity's primary key
public
static getRowById(mixed $id[, array<string|int, mixed> $parameters = [] ]) : array<string|int, mixed>|null
Parameters
- $id : mixed
-
Primary key of the entity
- $parameters : array<string|int, mixed> = []
-
Additional parameters for getList()
Tags
Return values
array<string|int, mixed>|nullgetTableName()
Returns DB table name for entity.
public
static getTableName() : string
Return values
stringgetTitle()
public
static getTitle() : string|null
Return values
string|nullgetUfId()
public
static getUfId() : mixed
isAllowedClearCache()
Returns current allow mode for cache clearing.
public
static isAllowedClearCache() : bool
Return values
boolisCacheable()
You can disable cache for the tablet completely.
public
static isCacheable() : bool
Return values
boolisUtm()
public
static isUtm() : mixed
isUts()
public
static isUts() : mixed
onAdd()
public
static onAdd(Event $event) : mixed
Parameters
- $event : Event
onAfterAdd()
Default onAfterAdd handler. Absolutely necessary.
public
static onAfterAdd(Event $event) : void
Parameters
- $event : Event
-
Current data for add.
onAfterDelete()
Default onAfterDelete handler. Absolutely necessary.
public
static onAfterDelete(Event $event) : void
Parameters
- $event : Event
-
Current data for delete.
onAfterUpdate()
Default onAfterUpdate handler. Absolutely necessary.
public
static onAfterUpdate(Event $event) : void
Parameters
- $event : Event
-
Current data for update.
onBeforeAdd()
Default onBeforeAdd handler. Absolutely necessary.
public
static onBeforeAdd(Event $event) : EventResult
Parameters
- $event : Event
-
Current data for add.
Return values
EventResultonBeforeDelete()
public
static onBeforeDelete(Event $event) : mixed
Parameters
- $event : Event
onBeforeUpdate()
Default onBeforeUpdate handler. Absolutely necessary.
public
static onBeforeUpdate(Event $event) : EventResult
Parameters
- $event : Event
-
Current data for update.
Return values
EventResultonDelete()
Default onDelete handler. Absolutely necessary.
public
static onDelete(Event $event) : void
Parameters
- $event : Event
-
Current data for delete.
onUpdate()
Default onUpdate handler. Absolutely necessary.
public
static onUpdate(Event $event) : void
Parameters
- $event : Event
-
Current data for update.
postInitialize()
public
static postInitialize(Entity $entity) : null
Parameters
- $entity : Entity
Return values
nullquery()
Creates and returns the Query object for the entity
public
static query() : EO_Rounding_Query
Return values
EO_Rounding_QuerysetCurrentDeletingObject()
public
static setCurrentDeletingObject(EntityObject $object) : void
Parameters
- $object : EntityObject
setDefaultScope()
public
static setDefaultScope(Query $query) : Query
Parameters
- $query : Query
Return values
QuerysetPriceTypeIds()
Set price type list for cache clearing.
public
static setPriceTypeIds(string|int|array<string|int, mixed> $priceTypes) : void
Parameters
- $priceTypes : string|int|array<string|int, mixed>
-
Price types for cache clearing.
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
Return values
UpdateResultupdateMulti()
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
Return values
UpdateResultwakeUpCollection()
public
static wakeUpCollection(mixed $rows) : EO_Rounding_Collection
Parameters
- $rows : mixed
Return values
EO_Rounding_CollectionwakeUpObject()
public
static wakeUpObject(mixed $row) : EO_Rounding
Parameters
- $row : mixed