- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/scrum/internal/itemtable.php
- Класс: BitrixTasksScrumInternalItemTable
- Вызов: ItemTable::getMap
static function getMap()
{
$id = new FieldsIntegerField('ID');
$id->configurePrimary(true);
$id->configureAutocomplete(true);
$entityId = new FieldsIntegerField('ENTITY_ID');
$typeId = new FieldsIntegerField('TYPE_ID');
$epicId = new FieldsIntegerField('EPIC_ID');
$active = new FieldsStringField('ACTIVE');
$active->addValidator(new ValidatorsLengthValidator(1, 1));
$active->configureDefaultValue('Y');
$name = new FieldsStringField('NAME');
$name->addValidator(new ValidatorsLengthValidator(null, 255));
$description = new FieldsTextField('DESCRIPTION');
$sort = new FieldsIntegerField('SORT');
$sort->configureDefaultValue(0);
$createdBy = new FieldsIntegerField('CREATED_BY');
$modifiedBy = new FieldsIntegerField('MODIFIED_BY');
$storyPoints = new FieldsStringField('STORY_POINTS');
$sourceId = new FieldsIntegerField('SOURCE_ID');
$info = new FieldsObjectField('INFO');
$info->configureRequired(false);
$info->configureObjectClass(ItemInfo::class);
$info->configureSerializeCallback(function (?ItemInfo $itemInfo)
{
return $itemInfo ? Json::encode($itemInfo->getInfoData()) : [];
});
$info->configureUnserializeCallback(function ($value)
{
$data = (is_string($value) && !empty($value) ? Json::decode($value) : []);
$itemInfo = new ItemInfo();
$itemInfo->setInfoData($data);
return $itemInfo;
});
$entity = new Reference('ENTITY', EntityTable::class, Join::on('this.ENTITY_ID', 'ref.ID'));
$entity->configureJoinType(Join::TYPE_LEFT);
$type = new Reference('TYPE', TypeTable::class, Join::on('this.TYPE_ID', 'ref.ID'));
$type->configureJoinType(Join::TYPE_LEFT);
$epic = new Reference('EPIC', EpicTable::class, Join::on('this.EPIC_ID', 'ref.ID'));
$epic->configureJoinType(Join::TYPE_LEFT);
return [
$id,
$entityId,
$typeId,
$epicId,
$active,
$name,
$description,
$sort,
$createdBy,
$modifiedBy,
$storyPoints,
$sourceId,
$info,
$entity,
$type,
$epic,
];
}