function Routes::getRouteName

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

Get a unique route name for the JSON:API resource type and route type.

Parameters

\Drupal\jsonapi\ResourceType\ResourceType $resource_type: The resource type for which the route collection should be created.

string $route_type: The route type. E.g. 'individual' or 'collection'.

Return value

string The generated route name.

5 calls to Routes::getRouteName()
EntityReferenceFieldNormalizer::getRelationshipLinks in core/modules/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php
Gets the links for the relationship.
Relationship::buildLinkCollectionFromEntityReferenceField in core/modules/jsonapi/src/JsonApiResource/Relationship.php
Builds a LinkCollection for the given entity reference field.
ResourceObject::buildLinksFromEntity in core/modules/jsonapi/src/JsonApiResource/ResourceObject.php
Builds a LinkCollection for the given entity.
Routes::getIndividualRoutesForResourceType in core/modules/jsonapi/src/Routing/Routes.php
Gets a route collection for the given resource type.
Routes::getRoutesForResourceType in core/modules/jsonapi/src/Routing/Routes.php
Gets applicable resource routes for a JSON:API resource type.

File

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

Class

Routes
Defines dynamic routes.

Namespace

Drupal\jsonapi\Routing

Code

public static function getRouteName(ResourceType $resource_type, $route_type) {
    return sprintf('jsonapi.%s.%s', $resource_type->getTypeName(), $route_type);
}

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