public function TestController::deleteHeartbeats in Heartbeat 8
1 string reference to 'TestController::deleteHeartbeats'
File
- src/
Controller/ TestController.php, line 163
Class
- TestController
- Class TestController.
Namespace
Drupal\heartbeat\ControllerCode
public function deleteHeartbeats() {
$entities = \Drupal::service("entity.query")
->get("heartbeat")
->execute();
foreach ($entities as $entity) {
$heartbeat = \Drupal::service("entity_type.manager")
->getStorage("heartbeat")
->load($entity);
$heartbeat
->delete();
}
return [
'#type' => 'markup',
'#markup' => $this
->t('Deleting them Heartbeats'),
];
}