function Routes::rebuild

Same name in other branches
  1. 9 core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::rebuild()
  2. 8.9.x core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::rebuild()
  3. 10 core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::rebuild()

Invalidates any JSON:API resource type dependent responses and routes.

4 calls to Routes::rebuild()
jsonapi_entity_bundle_create in core/modules/jsonapi/jsonapi.module
Implements hook_entity_bundle_create().
jsonapi_entity_bundle_delete in core/modules/jsonapi/jsonapi.module
Implements hook_entity_bundle_delete().
jsonapi_entity_create in core/modules/jsonapi/jsonapi.module
Implements hook_entity_create().
jsonapi_entity_delete in core/modules/jsonapi/jsonapi.module
Implements hook_entity_delete().

File

core/modules/jsonapi/src/Routing/Routes.php, line 476

Class

Routes
Defines dynamic routes.

Namespace

Drupal\jsonapi\Routing

Code

public static function rebuild() {
    \Drupal::service('cache_tags.invalidator')->invalidateTags([
        'jsonapi_resource_types',
    ]);
    \Drupal::service('router.builder')->setRebuildNeeded();
}

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