SiteLocationTable extends Connector
Class SiteLocationTable
DO NOT WRITE ANYTHING BELOW THIS
<<< ORMENTITYANNOTATION
Table of Contents
Constants
- ALL_SITES = '*'
- DB_GROUP_FLAG = 'G'
- DB_LOCATION_FLAG = 'L'
- LINK_CODE = 0x2
- LINK_ID = 0x1
- LSTAT_ABOVE_CONNECTOR = 0x3
- LSTAT_BELOW_CONNECTOR = 0x4
- LSTAT_IN_NOT_CONNECTED_BRANCH = 0x1
- LSTAT_IS_CONNECTOR = 0x2
Methods
- add() : AddResult
- Adds a new connection between location and entity
- checkConnectionExists() : bool
- Check if location is connected with entity
- checkLinkUsage() : bool
- Check if there is a link between entity and locations, optionally of a certain type (default: locations)
- checkLinkUsageAny() : mixed
- createCollection() : EO_SiteLocation_Collection
- createObject() : EO_SiteLocation
- delete() : DeleteResult
- Removes a connection between location and entity
- deleteAll() : mixed
- deleteAllForOwner() : mixed
- getById() : EO_SiteLocation_Result
- getByPrimary() : EO_SiteLocation_Result
- getConnectedEntites() : mixed
- getConnectedEntitesByCode() : mixed
- getConnectedEntitiesQuery() : mixed
- getConnectedGroups() : Result
- Returns a set of location groups that connected with a given entity.
- getConnectedLocations() : mixed
- getConnectedLocationsQuery() : string
- Returns a set of locations that connected with a given entity, directly and, optionally, through groups.
- getConnectedLocationsSql() : mixed
- More preferable alias for getConnectedLocationsQuery()
- getConnectType() : int
- Return the connection type for the current entity. Return value that is equal to self::LINK_ID stands for ID, otherwise - for CODE link type
- getEntity() : EO_SiteLocation_Entity
- getFilePath() : mixed
- getLinkField() : string
- Method returns name of table column that provides linking between location table and entity table. For example, for delivery it should return 'DELIVERY_ID' Limitation: mechanism does not support compound primary keys
- getLinkStatusForMultipleNodes() : mixed
- Functions for massive check for link type
- getList() : EO_SiteLocation_Result
- getLocationLinkField() : string
- Returns a name of the filed that keep location id or code. By default 'LOCATION_ID' is used for the most. For newly-created entites this should be LOCATION_CODE (string)
- getMap() : mixed
- getTableName() : mixed
- getTargetEntityName() : string
- Method should return a name of the "target" entity plus namespace but without trailing 'Table'. For example, for delivery this should be 'Bitrix\Sale\Delivery\Delivery'
- getTargetEntityPrimaryField() : string
- Returns a name of the primary field of the "target" entity. By default 'ID' is used for the most. See target entity class for sure.
- getTypeField() : string
- Returns a name of type filed. By default 'LOCATION_TYPE' is used for the most of. Does not make any sense if getUseGroups() returns false
- getUseCodes() : bool
- Just a shortcut to link type identification
- getUseGroups() : bool
- Show whether or not entity use linking through groups. E.g. delivery would return true, but location groups (which can be treated as entity too) - always return false (groups cannot be connected with groups)
- getUseLinkTracking() : bool
- Show whether or not entity use link tracking. Link tracking allows keeping information about link existence in option strings.
- normalizeLocationList() : mixed
- onAfterModifiy() : mixed
- query() : EO_SiteLocation_Query
- resetMultipleForOwner() : mixed
- Removes all links and creates new ones
- unionize() : string
- Wraps a set of sqls to a union
- update() : UpdateResult
- Updates a connection between location and entity
- updateMultipleForOwner() : bool
- Establishes several connections between entity and locations. Could be used to add and delete selected relations.
- wakeUpCollection() : EO_SiteLocation_Collection
- wakeUpObject() : EO_SiteLocation
Constants
ALL_SITES
public
mixed
ALL_SITES
= '*'
DB_GROUP_FLAG
public
mixed
DB_GROUP_FLAG
= 'G'
DB_LOCATION_FLAG
public
mixed
DB_LOCATION_FLAG
= 'L'
LINK_CODE
public
mixed
LINK_CODE
= 0x2
LINK_ID
public
mixed
LINK_ID
= 0x1
LSTAT_ABOVE_CONNECTOR
public
mixed
LSTAT_ABOVE_CONNECTOR
= 0x3
LSTAT_BELOW_CONNECTOR
public
mixed
LSTAT_BELOW_CONNECTOR
= 0x4
LSTAT_IN_NOT_CONNECTED_BRANCH
public
mixed
LSTAT_IN_NOT_CONNECTED_BRANCH
= 0x1
LSTAT_IS_CONNECTOR
public
mixed
LSTAT_IS_CONNECTOR
= 0x2
Methods
add()
Adds a new connection between location and entity
public
static add(array<string|int, mixed> $data) : AddResult
Parameters
- $data : array<string|int, mixed>
-
data to add (See getMap() of a certain implementation for $data key details)
Return values
AddResultcheckConnectionExists()
Check if location is connected with entity
public
static checkConnectionExists(mixed $entityPrimary, mixed $locationPrimary[, mixed $behaviour = array('LOCATION_LINK_TYPE' => 'ID') ]) : bool
Parameters
- $entityPrimary : mixed
-
mixed Entity being checked
- $locationPrimary : mixed
-
mixed Location being checked. Could be a value of ID or CODE depending on what connection type is selected (see below)
- $behaviour : mixed = array('LOCATION_LINK_TYPE' => 'ID')
-
mixed[] A set of flags that modify function behaviour
- LOCATION_LINK_TYPE string One of: ID, CODE, AUTO. If ID, than match by ID is used (default, for compatibility), if CODE than match by CODE. In case of AUTO the target field value depends on entity connect type.
Return values
boolcheckLinkUsage()
Check if there is a link between entity and locations, optionally of a certain type (default: locations)
public
static checkLinkUsage(mixed $entityPrimary[, string $linkType = self::DB_LOCATION_FLAG ]) : bool
Parameters
- $entityPrimary : mixed
-
primary key for an entity
- $linkType : string = self::DB_LOCATION_FLAG
-
link type (G or L (default))
Tags
Return values
boolcheckLinkUsageAny()
public
static checkLinkUsageAny(mixed $entityPrimary) : mixed
Parameters
- $entityPrimary : mixed
createCollection()
public
static createCollection() : EO_SiteLocation_Collection
Return values
EO_SiteLocation_CollectioncreateObject()
public
static createObject([mixed $setDefaultValues = = 'true' ]) : EO_SiteLocation
Parameters
- $setDefaultValues : mixed = = 'true'
Return values
EO_SiteLocationdelete()
Removes a connection between location and entity
public
static delete(mixed $primary) : DeleteResult
Parameters
- $primary : mixed
-
relation primary key value
Return values
DeleteResultdeleteAll()
public
static deleteAll() : mixed
deleteAllForOwner()
public
static deleteAllForOwner(mixed $entityPrimary[, mixed $behaviour = array('BATCH_MODE' => false) ]) : mixed
Parameters
- $entityPrimary : mixed
- $behaviour : mixed = array('BATCH_MODE' => false)
getById()
public
static getById(mixed $id) : EO_SiteLocation_Result
Parameters
- $id : mixed
Return values
EO_SiteLocation_ResultgetByPrimary()
public
static getByPrimary(mixed $primary[, array<string|int, mixed> $parameters = = '[]' ]) : EO_SiteLocation_Result
Parameters
- $primary : mixed
- $parameters : array<string|int, mixed> = = '[]'
Return values
EO_SiteLocation_ResultgetConnectedEntites()
public
static getConnectedEntites(mixed $locationPrimary[, mixed $parameters = array() ]) : mixed
Parameters
- $locationPrimary : mixed
- $parameters : mixed = array()
getConnectedEntitesByCode()
public
static getConnectedEntitesByCode(mixed $locationPrimary[, mixed $parameters = array() ]) : mixed
Parameters
- $locationPrimary : mixed
- $parameters : mixed = array()
getConnectedEntitiesQuery()
public
static getConnectedEntitiesQuery(mixed $locationPrimary[, mixed $linkType = 'id' ][, mixed $parameters = array() ]) : mixed
Parameters
- $locationPrimary : mixed
- $linkType : mixed = 'id'
- $parameters : mixed = array()
getConnectedGroups()
Returns a set of location groups that connected with a given entity.
public
static getConnectedGroups(mixed $entityPrimary[, array<string|int, mixed> $parameters = array() ]) : Result
Parameters
- $entityPrimary : mixed
-
primary key for an entity
- $parameters : array<string|int, mixed> = array()
-
for ORM getList()
Tags
Return values
Result —list of locations
getConnectedLocations()
public
static getConnectedLocations(mixed $entityPrimary[, mixed $parameters = array() ][, mixed $behaviour = array('GET_LINKED_THROUGH_GROUPS' => false) ]) : mixed
Parameters
- $entityPrimary : mixed
- $parameters : mixed = array()
- $behaviour : mixed = array('GET_LINKED_THROUGH_GROUPS' => false)
getConnectedLocationsQuery()
Returns a set of locations that connected with a given entity, directly and, optionally, through groups.
public
static getConnectedLocationsQuery(mixed $entityPrimary[, array<string|int, mixed> $parameters = array() ][, array<string|int, string> $behaviour = array('GET_LINKED_THROUGH_GROUPS' => false) ]) : string
Parameters
- $entityPrimary : mixed
-
primary key for an entity
- $parameters : array<string|int, mixed> = array()
-
filter and select parameters in ORM getlist() style, functionality is enought for usage, but limited. See limitations in code comments.
- $behaviour : array<string|int, string> = array('GET_LINKED_THROUGH_GROUPS' => false)
-
a set of behaviour options:
- GET_LINKED_THROUGH_GROUPS boolean (default true) - if set to true, locations will be searched also throurgh groups (if entity connector supports groups)
Tags
Return values
string —an SQL-query string that, being called, returns a list of locations
getConnectedLocationsSql()
More preferable alias for getConnectedLocationsQuery()
public
static getConnectedLocationsSql(mixed $entityPrimary[, mixed $parameters = array() ][, mixed $behaviour = array('GET_LINKED_THROUGH_GROUPS' => false) ]) : mixed
Parameters
- $entityPrimary : mixed
- $parameters : mixed = array()
- $behaviour : mixed = array('GET_LINKED_THROUGH_GROUPS' => false)
getConnectType()
Return the connection type for the current entity. Return value that is equal to self::LINK_ID stands for ID, otherwise - for CODE link type
public
static getConnectType() : int
Return values
intgetEntity()
public
static getEntity() : EO_SiteLocation_Entity
Return values
EO_SiteLocation_EntitygetFilePath()
public
static getFilePath() : mixed
getLinkField()
Method returns name of table column that provides linking between location table and entity table. For example, for delivery it should return 'DELIVERY_ID' Limitation: mechanism does not support compound primary keys
public
static getLinkField() : string
Return values
string —field name
getLinkStatusForMultipleNodes()
Functions for massive check for link type
public
static getLinkStatusForMultipleNodes(mixed $nodeInfo, mixed $entityPrimary[, mixed $connectors = false ]) : mixed
Parameters
- $nodeInfo : mixed
- $entityPrimary : mixed
- $connectors : mixed = false
getList()
public
static getList([array<string|int, mixed> $parameters = = '[]' ]) : EO_SiteLocation_Result
Parameters
- $parameters : array<string|int, mixed> = = '[]'
Return values
EO_SiteLocation_ResultgetLocationLinkField()
Returns a name of the filed that keep location id or code. By default 'LOCATION_ID' is used for the most. For newly-created entites this should be LOCATION_CODE (string)
public
static getLocationLinkField() : string
Return values
stringgetMap()
public
static getMap() : mixed
getTableName()
public
static getTableName() : mixed
getTargetEntityName()
Method should return a name of the "target" entity plus namespace but without trailing 'Table'. For example, for delivery this should be 'Bitrix\Sale\Delivery\Delivery'
public
static getTargetEntityName() : string
Return values
string —table name
getTargetEntityPrimaryField()
Returns a name of the primary field of the "target" entity. By default 'ID' is used for the most. See target entity class for sure.
public
static getTargetEntityPrimaryField() : string
Return values
stringgetTypeField()
Returns a name of type filed. By default 'LOCATION_TYPE' is used for the most of. Does not make any sense if getUseGroups() returns false
public
static getTypeField() : string
Return values
stringgetUseCodes()
Just a shortcut to link type identification
public
static getUseCodes() : bool
Return values
boolgetUseGroups()
Show whether or not entity use linking through groups. E.g. delivery would return true, but location groups (which can be treated as entity too) - always return false (groups cannot be connected with groups)
public
static getUseGroups() : bool
Return values
boolgetUseLinkTracking()
Show whether or not entity use link tracking. Link tracking allows keeping information about link existence in option strings.
public
static getUseLinkTracking() : bool
So, this is some kind of cacheing mechanism. It can be usefull, but may exceed option string length when there are lots of entity records exist.
Return values
boolnormalizeLocationList()
public
static normalizeLocationList([mixed $denormalizedList = array() ]) : mixed
Parameters
- $denormalizedList : mixed = array()
onAfterModifiy()
public
static onAfterModifiy() : mixed
query()
public
static query() : EO_SiteLocation_Query
Return values
EO_SiteLocation_QueryresetMultipleForOwner()
Removes all links and creates new ones
public
static resetMultipleForOwner(mixed $entityPrimary[, mixed $links = array() ]) : mixed
Parameters
- $entityPrimary : mixed
- $links : mixed = array()
unionize()
Wraps a set of sqls to a union
public
static unionize(array<string|int, string> $sqls) : string
Parameters
- $sqls : array<string|int, string>
-
a set of SQL select queries to wrap
Return values
stringupdate()
Updates a connection between location and entity
public
static update(mixed $primary, array<string|int, mixed> $data) : UpdateResult
Parameters
- $primary : mixed
-
relation primary key value
- $data : array<string|int, mixed>
-
data to update with (See getMap() of a certain implementation for $data key details)
Return values
UpdateResultupdateMultipleForOwner()
Establishes several connections between entity and locations. Could be used to add and delete selected relations.
public
static updateMultipleForOwner(mixed $entityPrimary[, array<string|int, array<string|int, int>>|array<string|int, array<string|int, string>> $links = array() ][, mixed $behaviour = array('REMOVE_ABSENT' => true) ]) : bool
Parameters
- $entityPrimary : mixed
-
primary key for an entity
- $links : array<string|int, array<string|int, int>>|array<string|int, array<string|int, string>> = array()
-
array of locations and groups to link an entity with
Argument format: array( 'L' => array(), // an array of IDs or CODEs of locations 'G' => array() // an array of IDs or CODEs of location groups )
- $behaviour : mixed = array('REMOVE_ABSENT' => true)
Tags
Return values
boolwakeUpCollection()
public
static wakeUpCollection(mixed $rows) : EO_SiteLocation_Collection
Parameters
- $rows : mixed
Return values
EO_SiteLocation_CollectionwakeUpObject()
public
static wakeUpObject(mixed $row) : EO_SiteLocation
Parameters
- $row : mixed