- Модуль: landing
- Путь к файлу: ~/bitrix/modules/landing/lib/file.php
- Класс: BitrixLandingFile
- Вызов: File::delete
static function delete($fileId, $entityId, $entityType)
{
//@tmp log
Debug::log(
$entityId . '@' . $entityType,
'fileId: ' . print_r($fileId, true) . '@' . print_r(BitrixMainDiagHelper::getBackTrace(15), true),
'LANDING_FILE_MARK_DELETE'
);
$filter = array(
'ENTITY_ID' => $entityId,
'=ENTITY_TYPE' => $entityType
);
if ($fileId)
{
$filter['FILE_ID'] = $fileId;
}
$res = FileTable::getList(array(
'select' => array(
'ID', 'FILE_ID'
),
'filter' => $filter
));
while ($row = $res->fetch())
{
$resUpdate = FileTable::update(
$row['ID'],
array(
'FILE_ID' => -1 * abs($row['FILE_ID'])
)
);
$resUpdate->isSuccess();
}
}