You are here

public function ResourceEntity::__construct in RESTful 7.2

Constructs a Drupal\Component\Plugin\PluginBase object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Overrides Resource::__construct

2 calls to ResourceEntity::__construct()
Articles__1_4::__construct in modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_4.php
Constructs an Articles__1_4 object.
FilesUpload__1_0::__construct in src/Plugin/resource/FilesUpload__1_0.php
Constructs a FilesUpload__1_0 object.
2 methods override ResourceEntity::__construct()
Articles__1_4::__construct in modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_4.php
Constructs an Articles__1_4 object.
FilesUpload__1_0::__construct in src/Plugin/resource/FilesUpload__1_0.php
Constructs a FilesUpload__1_0 object.

File

src/Plugin/resource/ResourceEntity.php, line 37
Contains \Drupal\restful\Plugin\resource\ResourceEntity.

Class

ResourceEntity

Namespace

Drupal\restful\Plugin\resource

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition) {
  if (empty($plugin_definition['dataProvider']['entityType'])) {
    throw new InternalServerErrorException('The entity type was not provided.');
  }
  $this->entityType = $plugin_definition['dataProvider']['entityType'];
  if (isset($plugin_definition['dataProvider']['bundles'])) {
    $this->bundles = $plugin_definition['dataProvider']['bundles'];
  }
  parent::__construct($configuration, $plugin_id, $plugin_definition);
}