function JsonapiHooks::entityCreate

Implements hook_entity_create().

Attributes

#[Hook('entity_create')]

File

core/modules/jsonapi/src/Hook/JsonapiHooks.php, line 79

Class

JsonapiHooks
Hook implementations for jsonapi.

Namespace

Drupal\jsonapi\Hook

Code

public function entityCreate(EntityInterface $entity) : void {
  if (in_array($entity->getEntityTypeId(), [
    'field_storage_config',
    'field_config',
  ])) {
    // @todo Only do this when relationship fields are updated, not just any field.
    Routes::rebuild();
  }
}

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