You are here

public function ResourceDecoratorBase::getControllerFromPath in RESTful 7.2

Return the controller for a given path.

Parameters

string $path: (optional) The path to use. If none is provided the path from the resource will be used.

ResourceInterface $resource: (optional) Use the passed in resource instead of $this. This is mainly used by decorator resources.

Return value

callable A callable as expected by ResourceManager::executeCallback.

Throws

BadRequestException

ForbiddenException

GoneException

NotImplementedException

ServerConfigurationException

Overrides ResourceInterface::getControllerFromPath

See also

ResourceManager::executeCallback()

1 call to ResourceDecoratorBase::getControllerFromPath()
CacheDecoratedResource::process in src/Plugin/resource/Decorators/CacheDecoratedResource.php
Controller function that passes the data along and executes right action.

File

src/Plugin/resource/Decorators/ResourceDecoratorBase.php, line 261
Contains \Drupal\restful\Plugin\resource\Decorators\ResourceDecoratorBase.

Class

ResourceDecoratorBase
Class ResourceDecoratorBase.

Namespace

Drupal\restful\Plugin\resource\Decorators

Code

public function getControllerFromPath($path = NULL, ResourceInterface $resource = NULL) {
  return $this->subject
    ->getControllerFromPath($path, $resource ?: $this);
}