function Serializer::calculateDependencies

Same name in other branches
  1. 9 core/modules/rest/src/Plugin/views/style/Serializer.php \Drupal\rest\Plugin\views\style\Serializer::calculateDependencies()
  2. 8.9.x core/modules/rest/src/Plugin/views/style/Serializer.php \Drupal\rest\Plugin\views\style\Serializer::calculateDependencies()
  3. 10 core/modules/rest/src/Plugin/views/style/Serializer.php \Drupal\rest\Plugin\views\style\Serializer::calculateDependencies()

Overrides PluginBase::calculateDependencies

File

core/modules/rest/src/Plugin/views/style/Serializer.php, line 183

Class

Serializer
The style plugin for serialized output formats.

Namespace

Drupal\rest\Plugin\views\style

Code

public function calculateDependencies() {
    $dependencies = parent::calculateDependencies();
    $formats = $this->getFormats();
    $providers = array_intersect_key($this->formatProviders, array_flip($formats));
    // The plugin always uses services from the serialization module.
    $providers[] = 'serialization';
    $dependencies += [
        'module' => [],
    ];
    $dependencies['module'] = array_merge($dependencies['module'], $providers);
    return $dependencies;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.