Documentation

FieldTable

Description and methods

ORM object for handling table of field visibility settings.

Chain of inheritance

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

Methods

Method Description Available from version
public static function removeByTypeId(int $typeId): Result Deletes all records from table with filter TYPE_ID = $typeId. Used when deleting a process.

Returns object Bitrix\Main\Result

public static function removeByTypeId(int $stageId): Result Deletes all records from table for filter STAGE_ID = $typeId. Used when deleting a stage.

This method is not recommended for use when $stageId = 0 - it deletes a lot more than should not be deleted.

Returns object Bitrix\Main\Result

public static function getGroupedList(int $typeId, int $stageId, bool $isFullInfo = false): array Returns array with settings, grouped by visibility and field code.

When $isFullInfo = false, the value is only true. When $isFullInfo = true, the value contains full array of strings from database.

Next example has the field UF_RPA_1_NAME printed in quick form for creating and in the details form in kanban.

// $isFullInfo = false;
[
    'kanban' => [
        'UF_RPA_1_NAME' => true,
        'UF_RPA_1_1246818523891' => true, 
    ], 
    'create' => [
        'UF_RPA_1_NAME' => true,
    ],
];

// $isFullInfo = true;
[
    'kanban' => [
        'UF_RPA_1_NAME' => [
            'ID' => '1',
            'TYPE_ID' => '1',
            'STAGE_ID' => '0',
            'FIELD' => 'UF_RPA_1_NAME',
            'VISIBILITY' => 'kanban',
        ],
        'UF_RPA_1_1246818523891' => [...], 
    ], 
    'create' => [
        'UF_RPA_1_NAME' => [...],
    ],
];
public static function mergeSettings(int $typeId, int $stageId, array $fields, string $visibilityType = null): Result Method saves current settings for the type $typeId at the stage $stageId from array $fields. When passing $visibilityType, saving is performed only for this type of visibility. It is required for saving only a single set of settings, to avoid resetting other settings.

This method immediately sends requests to the database - deletes redundant settings and adds new ones.

Returns object Bitrix\Main\Result.

public static function getVisibilityTypes(): array Returns array of available values for the field VISIBILITY

[
    'visible',
    'editable',
    'mandatory',
    'kanban',
    'create',
];

Table fields

Field Description Type Required
ID Int
TYPE_ID Process ID.Int Yes
STAGE_ID Stage ID. When this field contains 0, this setting applies to all stages.Int Yes
FIELD User field ID.String Yes
VISIBILITY Type of setting, accepts one of the following values:
  1. visible - when field has this setting, its values are displayed during viewing. By default its considered that all fields are visible everywhere and this option is not used.
  2. editable - when a field has this setting, its value is available for editing at specific stage. By default, all fields can be edited and this option is not used.
  3. mandatory - similarly field setting specifying that this field is required at specific stage. By default, all fields are optional and presently are not used.
  4. kanban - fields with this setting are displayed in the viewing form in kanban
  5. create - fields with this setting are printed in quick creation form for item in kanban
String Yes


© «Bitrix24», 2001-2024
Up