You are here

public function DataProviderVariable::__construct in RESTful 7.2

Constructor.

Parameters

RequestInterface $request: The request.

ResourceFieldCollectionInterface $field_definitions: The field definitions.

object $account: The authenticated account.

string $plugin_id: The resource ID.

string $resource_path: The resource path.

array $options: The plugin options for the data provider.

string $langcode: (Optional) The entity language code.

Overrides DataProvider::__construct

File

modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php, line 29
Contains \Drupal\restful_example\Plugin\resource\variables\DataProviderVariable.

Class

DataProviderVariable
Class DataProviderVariable.

Namespace

Drupal\restful_example\Plugin\resource\variables

Code

public function __construct(RequestInterface $request, ResourceFieldCollectionInterface $field_definitions, $account, $plugin_id, $resource_path = NULL, array $options = array(), $langcode = NULL) {
  parent::__construct($request, $field_definitions, $account, $plugin_id, $resource_path, $options, $langcode);
  if (empty($this->options['urlParams'])) {
    $this->options['urlParams'] = array(
      'filter' => TRUE,
      'sort' => TRUE,
      'fields' => TRUE,
    );
  }
}