Skip to content

EntityHooks

Entity hooks for the Helper module.


  • Full name: \Drupal\helper\Hook\EntityHooks

Properties

entityTypeHelper

protected \Drupal\helper\EntityType $entityTypeHelper

Methods

__construct

Constructs a new EntityHooks object.

public __construct(\Drupal\helper\EntityType $entityTypeHelper): mixed

Parameters:

Parameter Type Description
$entityTypeHelper \Drupal\helper\EntityType

entityFieldAccess

Implements hook_entity_field_access().

public entityFieldAccess(mixed $operation, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, \Drupal\Core\Session\AccountInterface $account, ?\Drupal\Core\Field\FieldItemListInterface $items = null): \Drupal\Core\Access\AccessResultInterface

Deny access to entity reference fields if there are no options available.

Parameters:

Parameter Type Description
$operation mixed
$field_definition \Drupal\Core\Field\FieldDefinitionInterface
$account \Drupal\Core\Session\AccountInterface
$items ?\Drupal\Core\Field\FieldItemListInterface