Documentation

EntityContactTable

This class table handles contact binding to SPA items.

Theoretically, this table can be used for binding to any entity type, however, presently it is used for SPAs only.

Primary key consist of several fields (ENTITY_TYPE_ID, ENTITY_ID, CONTACT_ID)

Data is principally sourced from this table when handling SPA contacts.

The field CONTACT_ID in [link=prototypeitem]PrototypeItem[/link] has been kept for backward compatibility.


Inheritance chain

Descendant for class Bitrix\Main\ORM\Data\DataManager.

\Bitrix\Crm\Binding\EntityContactTable extends \Bitrix\Main\ORM\Data\DataManager

Table fields

Field Description Required
ENTITY_TYPE_IDType ID within CRM. Unmodifiable parameter, can be specified only when creating entity.
ENTITY_IDEntity ID.
CONTACT_IDContact ID.
SORTSort index.
ROLE_IDRole type ID.
IS_PRIMARYFlag, specifying contact as primary.

Bindings are added to this table for handling SPA itemsб see the method \Bitrix\Crm\Model\Dynamic\TypeTable::addReferencesToEntity()

Class methods

Generating field values

MethodDescription Available from version
public static function deleteByItem(
    int $entityTypeId,
    int $entityId
): void
Method deletes all records associated with the type $entityTypeId of element $entityId.
public static function getContactIds(
    int $entityTypeId,
    int $entityId
): array
Method returns array with contact IDs, associated with the element type $entityTypeId of the element $entityId.


© «Bitrix24», 2001-2024