You are here

protected function FormatterJsonApi::getRequest in RESTful 7.2

Gets the request object for this formatter.

Return value

RequestInterface The request object.

File

src/Plugin/formatter/FormatterJsonApi.php, line 257
Contains \Drupal\restful\Plugin\formatter\FormatterJsonApi.

Class

FormatterJsonApi
Class FormatterJsonApi @package Drupal\restful\Plugin\formatter

Namespace

Drupal\restful\Plugin\formatter

Code

protected function getRequest() {
  if ($resource = $this
    ->getResource()) {
    return $resource
      ->getRequest();
  }
  return restful()
    ->getRequest();
}