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
Method | Description | 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
Method | Description | 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.
Method | Description | 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 |
---|---|---|
ID | SPA ID. | Yes |
NAME | SPA string ID. Generated automatically. | Yes |
TABLE_NAME | Table name storing this SPA items. Generated automatically as b_crm_dynamic_items_{ENTITY_TYPE_ID} . | Yes |
TITLE | SPA title. | Yes |
CODE | Character ID that can be filled out via REST. | |
CREATED_BY | User ID who created an SPA. | Yes |
ENTITY_TYPE_ID | SAP type ID within CRM. | |
IS_CATEGORIES_ENABLED | Indicates if SPA has enabled pipelines. | |
IS_STAGES_ENABLED | Indicates if SPA has enabled stages. | |
IS_BEGIN_CLOSE_DATES_ENABLED | Indicates enabled "Start date" and "End date". | |
IS_CLIENT_ENABLED | Indicates if "Customer" field is enabled (binding to company and contacts). | |
IS_USE_IN_USERFIELD_ENABLED | Indicates if SPA is accessible in the custom field "Bind to CRM items". | |
IS_LINK_WITH_PRODUCTS_ENABLED | Indicates if products are enabled. | |
IS_CRM_TRACKING_ENABLED | Indicates if UTM-tags handling is enabled (not yet recommended). | |
IS_MYCOMPANY_ENABLED | Indicates if "My company details" field is enabled. | |
IS_DOCUMENTS_ENABLED | Indicates if document printing is enabled. | |
IS_SOURCE_ENABLED | Indicates if"Source" и "Source details" fields are enabled. | |
IS_OBSERVERS_ENABLED | Indicates if "Observers" field is enabled. | |
IS_RECYCLEBIN_ENABLED | Indicates if recycle bin feature is enabled. | |
IS_AUTOMATION_ENABLED | Indicates if automation rules and triggers are enabled. | |
IS_BIZ_PROC_ENABLED | Indicates if Workflow designer is enabled. | |
IS_SET_OPEN_PERMISSIONS | Indicates 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.