public static function Group::preDelete in Group 2.0.x
Same name and namespace in other branches
- 8 src/Entity/Group.php \Drupal\group\Entity\Group::preDelete()
Acts on entities before they are deleted and before hooks are invoked.
Used before the entities are deleted and before invoking the delete hook.
Parameters
\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.
\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.
Overrides EntityBase::preDelete
File
- src/
Entity/ Group.php, line 380
Class
- Group
- Defines the Group entity.
Namespace
Drupal\group\EntityCode
public static function preDelete(EntityStorageInterface $storage, array $entities) {
// Remove all group content from these groups as well.
foreach ($entities as $group) {
foreach ($group
->getContent() as $group_content) {
$group_content
->delete();
}
}
}