function core_event_dispatcher_entity_field_access in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/core_event_dispatcher/core_event_dispatcher.module \core_event_dispatcher_entity_field_access()
Implements hook_entity_field_access().
2 calls to core_event_dispatcher_entity_field_access()
- EntityFieldAccessEventTest::testEntityFieldAccessEventWithoutResult in modules/
core_event_dispatcher/ tests/ src/ Unit/ Entity/ EntityFieldAccessEventTest.php - Field access event with result set.
- EntityFieldAccessEventTest::testEntityFieldAccessEventWithResultSet in modules/
core_event_dispatcher/ tests/ src/ Unit/ Entity/ EntityFieldAccessEventTest.php - Field access event with result set.
File
- modules/
core_event_dispatcher/ core_event_dispatcher.module, line 401 - Core event dispatcher submodule.
Code
function core_event_dispatcher_entity_field_access(string $operation, FieldDefinitionInterface $fieldDefinition, AccountInterface $account, FieldItemListInterface $items = NULL) {
/** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
$manager = Drupal::service('hook_event_dispatcher.manager');
$event = new EntityFieldAccessEvent($operation, $fieldDefinition, $account, $items);
$manager
->register($event);
return $event
->getAccessResult();
}