public function __construct(array $plugin, \RestfulAuthenticationManager $auth_manager = NULL, \DrupalCacheInterface $cache_controller = NULL, $language = NULL) { parent::__construct($plugin, $auth_manager, $cache_controller, $language); if (!empty($plugin['bundles'])) { $this->bundles = $plugin['bundles']; } $this->authenticationManager = $auth_manager ? $auth_manager : new \RestfulAuthenticationManager(); $this->cacheController = $cache_controller ? $cache_controller : $this->newCacheObject(); }
/** * Overrides \RestfulEntityBase::__construct() * * Set the "options" key from the plugin info, specific for file upload, with * the following keys: * - "validators": By default no validation is done on the file extensions or * file size. * - "scheme": By default the default scheme (e.g. public, private) is used. */ public function __construct(array $plugin, \RestfulAuthenticationManager $auth_manager = NULL, \DrupalCacheInterface $cache_controller = NULL, $language = NULL) { parent::__construct($plugin, $auth_manager, $cache_controller, $language); if (!$options = $this->getPluginKey('options')) { $options = array(); } $default_values = array( 'validators' => array( 'file_validate_extensions' => array(), 'file_validate_size' => array(), ), 'scheme' => file_default_scheme(), 'replace' => FILE_EXISTS_RENAME, ); $this->setPluginKey('options', drupal_array_merge_deep($default_values, $options)); }