function EntityTestHooks::entityTestCreateAccess

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/entity_test/src/Hook/EntityTestHooks.php \Drupal\entity_test\Hook\EntityTestHooks::entityTestCreateAccess()

Implements hook_ENTITY_TYPE_create_access() for 'entity_test'.

Attributes

#[Hook('entity_test_create_access')]

File

core/modules/system/tests/modules/entity_test/src/Hook/EntityTestHooks.php, line 712

Class

EntityTestHooks
Hook implementations for entity_test.

Namespace

Drupal\entity_test\Hook

Code

public function entityTestCreateAccess(AccountInterface $account, $context, $entity_bundle) : AccessResultInterface {
  \Drupal::state()->set('entity_test_entity_test_create_access', TRUE);
  // No opinion.
  return AccessResult::neutral();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.