protected function AcsfDuplicationScrubUserHandler::deleteEntities in Acquia Cloud Site Factory Connector 8
Same name and namespace in other branches
- 8.2 src/Event/AcsfDuplicationScrubUserHandler.php \Drupal\acsf\Event\AcsfDuplicationScrubUserHandler::deleteEntities()
Deletes entities.
Parameters
array $entities: The entities to delete.
Overrides AcsfDuplicationScrubEntityHandler::deleteEntities
File
- src/
Event/ AcsfDuplicationScrubUserHandler.php, line 38
Class
- AcsfDuplicationScrubUserHandler
- Handles the scrubbing of Drupal users.
Namespace
Drupal\acsf\EventCode
protected function deleteEntities(array $entities) {
// Delete the entities one by one. This may be slower than mass deleting
// them, but this way we can catch an exception without a mass delete
// being fully rolled back.
foreach ($entities as $entity) {
try {
$this
->reassignFiles($entity
->id());
$entity
->delete();
} catch (\Exception $e) {
// OK, we'll live with not scrubbing this.
}
}
}