You are here

protected function ResourceBase::getBaseRoute in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/rest/src/Plugin/ResourceBase.php \Drupal\rest\Plugin\ResourceBase::getBaseRoute()

Gets the base route for a particular method.

Parameters

string $canonical_path: The canonical path for the resource.

string $method: The HTTP method to be used for the route.

Return value

\Symfony\Component\Routing\Route The created base route.

2 calls to ResourceBase::getBaseRoute()
EntityResource::getBaseRoute in core/modules/rest/src/Plugin/rest/resource/EntityResource.php
Gets the base route for a particular method.
ResourceBase::routes in core/modules/rest/src/Plugin/ResourceBase.php
Returns a collection of routes with URL path information for the resource.
2 methods override ResourceBase::getBaseRoute()
EntityResource::getBaseRoute in core/modules/rest/src/Plugin/rest/resource/EntityResource.php
Gets the base route for a particular method.
FileUploadResource::getBaseRoute in core/modules/file/src/Plugin/rest/resource/FileUploadResource.php
Gets the base route for a particular method.

File

core/modules/rest/src/Plugin/ResourceBase.php, line 171

Class

ResourceBase
Common base class for resource plugins.

Namespace

Drupal\rest\Plugin

Code

protected function getBaseRoute($canonical_path, $method) {
  return new Route($canonical_path, [
    '_controller' => 'Drupal\\rest\\RequestHandler::handle',
  ], $this
    ->getBaseRouteRequirements($method), [], '', [], [
    $method,
  ]);
}