Overrides DatabaseStorageController::preDelete().
Overrides DatabaseStorageController::preDelete
protected function preDelete($entities) {
// Nothing to do if we don't want to reparent children.
if ($this->preventReparenting) {
return;
}
foreach ($entities as $entity) {
// Children get re-attached to the item's parent.
if ($entity->has_children) {
$children = $this
->loadByProperties(array(
'plid' => $entity->plid,
));
foreach ($children as $child) {
$child->plid = $entity->plid;
$this
->save($child);
}
}
}
}