You are here

public function FilesUpload__1_0::__construct in RESTful 7.2

Constructs a FilesUpload__1_0 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 ResourceEntity::__construct

File

src/Plugin/resource/FilesUpload__1_0.php, line 45
Contains \Drupal\restful\Plugin\resource\FilesUpload__1_0

Class

FilesUpload__1_0
Class FilesUpload__1_0 @package Drupal\restful_example\Plugin\Resource

Namespace

Drupal\restful\Plugin\resource

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);

  // Set dynamic options that cannot be set in the annotation.
  $plugin_definition = $this
    ->getPluginDefinition();
  $plugin_definition['authenticationOptional'] = (bool) variable_get('restful_file_upload_allow_anonymous_user', FALSE);

  // Store the plugin definition.
  $this->pluginDefinition = $plugin_definition;
}