Bitrix API

GroupLocationTable extends Connector

Class GroupLocationTable

DO NOT WRITE ANYTHING BELOW THIS

<<< ORMENTITYANNOTATION

Table of Contents

Constants

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_GroupLocation_Collection
createObject()  : EO_GroupLocation
delete()  : DeleteResult
Removes a connection between location and entity
deleteAll()  : mixed
deleteAllForOwner()  : mixed
deleteByGroupId()  : mixed
getById()  : EO_GroupLocation_Result
getByPrimary()  : EO_GroupLocation_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_GroupLocation_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_GroupLocation_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_GroupLocation_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_GroupLocation_Collection
wakeUpObject()  : EO_GroupLocation

Constants

DB_GROUP_FLAG

public mixed DB_GROUP_FLAG = 'G'

DB_LOCATION_FLAG

public mixed DB_LOCATION_FLAG = 'L'

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
AddResult

checkConnectionExists()

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
    bool

    checkLinkUsage()

    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
    throws
    ArgumentNullException
    Return values
    bool

    checkLinkUsageAny()

    public static checkLinkUsageAny(mixed $entityPrimary) : mixed
    Parameters
    $entityPrimary : mixed

    createCollection()

    public static createCollection() : EO_GroupLocation_Collection
    Return values
    EO_GroupLocation_Collection

    createObject()

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

    delete()

    Removes a connection between location and entity

    public static delete(mixed $primary) : DeleteResult
    Parameters
    $primary : mixed

    relation primary key value

    Return values
    DeleteResult

    deleteAll()

    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)

    deleteByGroupId()

    public static deleteByGroupId(mixed $groupId) : mixed
    Parameters
    $groupId : mixed

    getById()

    public static getById(mixed $id) : EO_GroupLocation_Result
    Parameters
    $id : mixed
    Return values
    EO_GroupLocation_Result

    getByPrimary()

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

    getConnectedEntites()

    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
    throws
    ArgumentNullException
    throws
    NotImplementedException
    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
    throws
    ArgumentNullException
    throws
    NotImplementedException
    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
    int

    getEntity()

    public static getEntity() : EO_GroupLocation_Entity
    Return values
    EO_GroupLocation_Entity

    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_GroupLocation_Result
    Parameters
    $parameters : array<string|int, mixed> = = '[]'
    Return values
    EO_GroupLocation_Result

    getLocationLinkField()

    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
    string

    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
    string

    getTypeField()

    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
    string

    getUseCodes()

    Just a shortcut to link type identification

    public static getUseCodes() : bool
    Return values
    bool

    getUseGroups()

    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
    bool

    getUseLinkTracking()

    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
    bool

    normalizeLocationList()

    public static normalizeLocationList([mixed $denormalizedList = array() ]) : mixed
    Parameters
    $denormalizedList : mixed = array()

    onAfterModifiy()

    public static onAfterModifiy() : mixed

    query()

    public static query() : EO_GroupLocation_Query
    Return values
    EO_GroupLocation_Query

    resetMultipleForOwner()

    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
    string

    update()

    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
    UpdateResult

    updateMultipleForOwner()

    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
    throws
    ArgumentNullException
    Return values
    bool

    wakeUpCollection()

    public static wakeUpCollection(mixed $rows) : EO_GroupLocation_Collection
    Parameters
    $rows : mixed
    Return values
    EO_GroupLocation_Collection

    wakeUpObject()

    public static wakeUpObject(mixed $row) : EO_GroupLocation
    Parameters
    $row : mixed
    Return values
    EO_GroupLocation
    
            
    On this page

    Search results