- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/integration/recyclebin/dynamic.php
- Класс: Bitrix\Crm\Integration\Recyclebin\Dynamic
- Вызов: Dynamic::moveFromRecyclebin
static function moveFromRecyclebin(Recyclebin\Internals\Entity $entity)
{
$entityTypeName = $entity->getEntityType();
if(strpos($entityTypeName, self::SHORT_PREFIX) === 0)
{
$entityTypeName = strtoupper(
str_replace(self::SHORT_PREFIX, '', $entityTypeName)
);
}
$entityTypeId = \CCrmOwnerType::ResolveID($entityTypeName);
if(!\CCrmOwnerType::isUseDynamicTypeBasedApproach($entityTypeId))
{
return false;
}
$entityId = (int)$entity->getEntityId();
if($entityId <= 0)
{
return false;
}
return Crm\Recycling\DynamicController::getInstance($entityTypeId)->recover(
$entityId,
[
'ID' => $entity->getId(),
'SLOTS' => self::prepareDataSlots($entity),
'SLOT_MAP' => self::prepareDataSlotMap($entity),
'FILES' => $entity->getFiles(),
]
);
}