You are here

public function EntityTestDefinitionSubscriber::hasEventFired in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/entity_test/src/EntityTestDefinitionSubscriber.php \Drupal\entity_test\EntityTestDefinitionSubscriber::hasEventFired()
  2. 9 core/modules/system/tests/modules/entity_test/src/EntityTestDefinitionSubscriber.php \Drupal\entity_test\EntityTestDefinitionSubscriber::hasEventFired()

Checks whether an event has been dispatched.

Parameters

string $event_name: The event name.

Return value

bool TRUE if the event has been dispatched, FALSE otherwise.

File

core/modules/system/tests/modules/entity_test/src/EntityTestDefinitionSubscriber.php, line 234

Class

EntityTestDefinitionSubscriber
Test entity type and field storage definition event subscriber.

Namespace

Drupal\entity_test

Code

public function hasEventFired($event_name) {
  return (bool) $this->state
    ->get($event_name);
}