Esempio n. 1
0
 /**
  * Overrides Drupal\configuration\Config\Configuration::alterDependencies().
  */
 public static function alterDependencies(Configuration $config)
 {
     if ($config->configForEntity()) {
         $entity_type = $config->getEntityType();
         if (empty($entity_type)) {
             return;
         }
         $fields = field_info_instances($entity_type, $config->getIdentifier());
         foreach ($fields as $name => $field) {
             $identifier = $entity_type . "." . $field['field_name'] . "." . $field['bundle'];
             // Avoid include multiple times the same dependency.
             if (empty($stack['field.' . $identifier])) {
                 $field = new FieldConfiguration($identifier);
                 $field->build();
                 $field->addToDependencies($config);
                 $config->addToOptionalConfigurations($field);
                 $stack['field.' . $identifier] = TRUE;
             }
         }
     }
 }