You are here

public function Resource::getRequest in RESTful 7.2

Get the request object.

Return value

RequestInterface The request object.

Throws

\Drupal\restful\Exception\ServerConfigurationException

Overrides ResourceInterface::getRequest

5 calls to Resource::getRequest()
Resource::dataProviderFactory in src/Plugin/resource/Resource.php
Data provider factory.
Resource::getAccount in src/Plugin/resource/Resource.php
Get the user from for request.
Resource::getUrl in src/Plugin/resource/Resource.php
Helper method; Get the URL of the resource and query strings.
Resource::__construct in src/Plugin/resource/Resource.php
Constructs a Drupal\Component\Plugin\PluginBase object.
ResourceEntity::dataProviderFactory in src/Plugin/resource/ResourceEntity.php
Data provider factory.

File

src/Plugin/resource/Resource.php, line 142
Contains \Drupal\restful\Plugin\resource\Resource.

Class

Resource

Namespace

Drupal\restful\Plugin\resource

Code

public function getRequest() {
  if (isset($this->request)) {
    return $this->request;
  }
  $instance_configuration = $this
    ->getConfiguration();
  if (!($this->request = $instance_configuration['request'])) {
    throw new ServerConfigurationException('Request object is not available for the Resource plugin.');
  }
  return $this->request;
}