You are here

public function Formatter::setResource in RESTful 7.2

Sets the underlying resource.

Parameters

ResourceInterface $resource: The resource to set.

Overrides FormatterInterface::setResource

File

src/Plugin/formatter/Formatter.php, line 78
Contains \Drupal\restful\Plugin\formatter\Formatter

Class

Formatter
Class Formatter.

Namespace

Drupal\restful\Plugin\formatter

Code

public function setResource(ResourceInterface $resource) {
  $this->resource = $resource;
  $this
    ->setConfiguration(array(
    'resource' => $resource,
  ));
}