OnDocFormDelete
Последнее обновление Oct 14th, 2026 | История страницы | Улучшить эту страницу | Сообщить о проблеме
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moreСобытие: OnDocFormDelete¶
Событие запускается после удаления ресурса в менеджере, из процессора Resource\Delete.
- Служба: 1 - Parser Service Events
- Group: Resources
Параметры события¶
| Имя | Описание |
|---|---|
| id | Идентификатор ресурса. |
| children | Массив идентификаторов дочерних элементов этого ресурса, которые были удалены. |
| resource | Ссылка на объект modResource. |
Пример¶
Такой плагин запишет в журнал ошибок удалённый ресурс вместе с его дочерними ресурсами:
<?php
$eventName = $modx->event->name;
switch($eventName) {
case 'OnDocFormDelete':
$modx->log(modX::LOG_LEVEL_ERROR, 'Resource '.$id.' was deleted');
foreach ($children as $childId) {
$child = $modx->getObject('modResource', $childId);
if ($child) {
$modx->log(modX::LOG_LEVEL_ERROR, 'Child deleted: '.$child->get('pagetitle'));
}
}
break;
}
Смотри также¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










