Documentation

TypeTable

Class for handling SPA table

ORM object: \Bitrix\Crm\Model\Dynamic\Type.

Learn more about custom field value storage.


Inheritance chain

Descendant or base class Bitrix\Main\UserField\Internal\TypeDataManager.

Bitrix\Crm\Model\Dynamic\TypeTable extends Bitrix\Main\UserField\Internal\TypeDataManager

Class methods

Generating field values

MethodDescription Available from version
public static function generateName(
    string $title = null,
    int $try = 0
): ?string
Method generates new value for NAME column based on the SPA $title. Method is recursive, that's why, call counter is located in $try. Method returns field value or null.
public static function getNextAvailableEntityTypeId(): ?int
Method returns the next possible SPA type ID. When method returns null, it means there are no more available IDs.

Data read

MethodDescription Available from version
public static function getByEntityTypeId(
    int $entityTypeId
): QueryResult
Method returns a table query result with filter by $entityTypeId

Event handlers

Class has a set of event handler methods. These handlers verify status of associated tables and can interrupt certain actions. For example, you cannot delete an SPA having some items.

All SPA-associated data is deleted from SPA-binded tables after deleting this SPA. Both tables with items and full-text index are deleted as well.

New binded tables are created and system fields are generated upon creating a new entry.

MethodDescription Available from version
public static function createItemIndexTable(
    $type
): Result
Creates table for storage of full-text index items. Returns the object \Bitrix\Main\Result

Table fields

Field Description Required
IDSPA ID.Yes
NAMESPA string ID. Generated automatically.Yes
TABLE_NAMETable name storing this SPA items. Generated automatically as b_crm_dynamic_items_{ENTITY_TYPE_ID}.Yes
TITLESPA title.Yes
CODECharacter ID that can be filled out via REST.
CREATED_BYUser ID who created an SPA.Yes
ENTITY_TYPE_IDSAP type ID within CRM.
IS_CATEGORIES_ENABLEDIndicates if SPA has enabled pipelines.
IS_STAGES_ENABLED Indicates if SPA has enabled stages.
IS_BEGIN_CLOSE_DATES_ENABLEDIndicates enabled "Start date" and "End date".
IS_CLIENT_ENABLEDIndicates if "Customer" field is enabled (binding to company and contacts).
IS_USE_IN_USERFIELD_ENABLEDIndicates if SPA is accessible in the custom field "Bind to CRM items".
IS_LINK_WITH_PRODUCTS_ENABLEDIndicates if products are enabled.
IS_CRM_TRACKING_ENABLEDIndicates if UTM-tags handling is enabled (not yet recommended).
IS_MYCOMPANY_ENABLEDIndicates if "My company details" field is enabled.
IS_DOCUMENTS_ENABLEDIndicates if document printing is enabled.
IS_SOURCE_ENABLEDIndicates if"Source" и "Source details" fields are enabled.
IS_OBSERVERS_ENABLEDIndicates if "Observers" field is enabled.
IS_RECYCLEBIN_ENABLEDIndicates if recycle bin feature is enabled.
IS_AUTOMATION_ENABLEDIndicates if automation rules and triggers are enabled.
IS_BIZ_PROC_ENABLEDIndicates if Workflow designer is enabled.
IS_SET_OPEN_PERMISSIONSIndicates if access to all fields is granted for new pipeline.

Note: Presently, the field ENTITY_TYPE_ID can receive values from 128 to 192. This is related to corresponding column in some tables has dimensions TINYINT (for example, field OWNER_TYPE_ID in the table b_crm_act). It's planned to modify the table structure and expand the range of possible values, and remove limit to 64 possible SPAs.



© «Bitrix24», 2001-2023
Up