You are here

public function Resource::doGet in RESTful 7.2

Shorthand method to perform a quick GET request.

Parameters

string $path: The resource path.

array $query: The parsed query string.

Return value

array The array ready for the formatter.

Overrides ResourceInterface::doGet

File

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

Class

Resource

Namespace

Drupal\restful\Plugin\resource

Code

public function doGet($path = '', array $query = array()) {
  $this
    ->setPath($path);
  $this
    ->setRequest(Request::create($this
    ->versionedUrl($path, array(
    'absolute' => FALSE,
  )), $query, RequestInterface::METHOD_GET));
  return $this
    ->process();
}