/**
  * Data provider factory.
  *
  * @return DataProviderEntityInterface
  *   The data provider for this resource.
  *
  * @throws ServerConfigurationException
  */
 public function dataProviderFactory()
 {
     $plugin_definition = $this->getPluginDefinition();
     $field_definitions = $this->getFieldDefinitions();
     if (!empty($plugin_definition['dataProvider']['viewMode'])) {
         $field_definitions_array = $this->viewModeFields($plugin_definition['dataProvider']['viewMode']);
         $field_definitions = ResourceFieldCollection::factory($field_definitions_array, $this->getRequest());
     }
     $class_name = $this->dataProviderClassName();
     if (!class_exists($class_name)) {
         throw new ServerConfigurationException(sprintf('The DataProvider could not be found for this resource: %s.', $this->getResourceMachineName()));
     }
     return new $class_name($this->getRequest(), $field_definitions, $this->getAccount(), $this->getPluginId(), $this->getPath(), $plugin_definition['dataProvider']);
 }
 /**
  * Constructs a Drupal\Component\Plugin\PluginBase object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->fieldDefinitions = ResourceFieldCollection::factory($this->processPublicFields($this->publicFields()), $this->getRequest());
     $this->initAuthenticationManager();
 }