You are here

public function DataProviderFile::__construct in RESTful 7.2

Constructs a DataProviderFile object.

Overrides DataProviderEntity::__construct

File

src/Plugin/resource/DataProvider/DataProviderFile.php, line 26
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderFile.

Class

DataProviderFile
Class DataProviderFile.

Namespace

Drupal\restful\Plugin\resource\DataProvider

Code

public function __construct(RequestInterface $request, ResourceFieldCollectionInterface $field_definitions, $account, $plugin_id, $resource_path, array $options, $langcode = NULL) {
  parent::__construct($request, $field_definitions, $account, $plugin_id, $resource_path, $options, $langcode);
  $file_options = empty($this->options['options']) ? array() : $this->options['options'];
  $default_values = array(
    'validators' => array(
      'file_validate_extensions' => array(),
      'file_validate_size' => array(),
    ),
    'scheme' => file_default_scheme(),
    'replace' => FILE_EXISTS_RENAME,
  );
  $this->options['options'] = drupal_array_merge_deep($default_values, $file_options);
}