You are here

public function RestfulDataProviderDbQuery::__construct in RESTful 7

Constructs a RestfulDataProviderDbQuery object.

Parameters

array $plugin: Plugin definition.

RestfulAuthenticationManager $auth_manager: (optional) Injected authentication manager.

DrupalCacheInterface $cache_controller: (optional) Injected cache backend.

string $language: (optional) The language to return items in.

Overrides RestfulBase::__construct

File

plugins/restful/RestfulDataProviderDbQuery.php, line 104
Contains \RestfulDataProviderDbQuery

Class

RestfulDataProviderDbQuery
@file Contains \RestfulDataProviderDbQuery

Code

public function __construct(array $plugin, \RestfulAuthenticationManager $auth_manager = NULL, \DrupalCacheInterface $cache_controller = NULL, $language = NULL) {
  parent::__construct($plugin, $auth_manager, $cache_controller, $language);

  // Validate keys exist in the plugin's "data provider options".
  $required_keys = array(
    'table_name',
    'id_column',
  );
  $options = $this
    ->processDataProviderOptions($required_keys);
  $this->tableName = $options['table_name'];
  $this->idColumn = $options['id_column'];
  $this->primary = empty($plugin['data_provider_options']['primary']) ? NULL : ($this->primary = $plugin['data_provider_options']['primary']);
}