Example #1
0
 /**
  * {@inheritdoc}
  */
 public function calculateDependencies()
 {
     $this->dependencies = parent::calculateDependencies();
     // Add the module providing the configured field storage as a dependency.
     if (($field_storage_definition = $this->getFieldStorageDefinition()) && $field_storage_definition instanceof EntityInterface) {
         $this->dependencies['config'][] = $field_storage_definition->getConfigDependencyName();
     }
     if (!empty($this->options['type'])) {
         // Add the module providing the formatter.
         $this->dependencies['module'][] = $this->formatterPluginManager->getDefinition($this->options['type'])['provider'];
         // Add the formatter's dependencies.
         if (($formatter = $this->getFormatterInstance()) && $formatter instanceof DependentPluginInterface) {
             $this->calculatePluginDependencies($formatter);
         }
     }
     return $this->dependencies;
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function calculateDependencies()
 {
     $dependencies = parent::calculateDependencies();
     $view_mode = $this->entityManager->getStorage('entity_view_mode')->load($this->getEntityTypeId() . '.' . $this->options['view_mode']);
     if ($view_mode) {
         $dependencies[$view_mode->getConfigDependencyKey()][] = $view_mode->getConfigDependencyName();
     }
     return $dependencies;
 }