array('user.role.anonymous', 'user.role.authenticated'), * 'content' => array('node:article:f0a189e6-55fb-47fb-8005-5bef81c44d6d'), * 'module' => array('node', 'user'), * 'theme' => array('claro'), * ); * @endcode * * @see \Drupal\Core\Config\Entity\ConfigDependencyManager * @see \Drupal\Core\Config\Entity\ConfigEntityInterface::getConfigDependencyName() */ public static function calculateDependencies(FieldDefinitionInterface $field_definition); /** * Calculates dependencies for field items on the storage level. * * Dependencies are saved in the field storage configuration entity and are * used to determine configuration synchronization order. For example, if the * field type storage depends on a particular entity type, this method should * return an array of dependencies listing the module that provides the entity * type. * * Dependencies returned from this method are stored in field storage * configuration and are always considered hard dependencies. If the * dependency is removed the field storage configuration must be deleted. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage_definition * The field storage definition. * * @return array * An array of dependencies grouped by type (config, content, module, * theme). For example: * @code * [ * 'config' => ['user.role.anonymous', 'user.role.authenticated'], * 'content' => ['node:article:f0a189e6-55fb-47fb-8005-5bef81c44d6d'], * 'module' => ['node', 'user'], * 'theme' => ['claro'], * ]; * @endcode * * @see \Drupal\Core\Config\Entity\ConfigDependencyManager * @see \Drupal\Core\Config\Entity\ConfigEntityInterface::getConfigDependencyName() */ public static function calculateStorageDependencies(FieldStorageDefinitionInterface $field_storage_definition); /** * Informs the plugin that a dependency of the field will be deleted. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition. * @param array $dependencies * An array of dependencies that will be deleted keyed by dependency type. * Dependency types are, for example, entity, module and theme. * * @return bool * TRUE if the field definition has been changed as a result, FALSE if not. * * @see \Drupal\Core\Config\ConfigEntityInterface::onDependencyRemoval() */ public static function onDependencyRemoval(FieldDefinitionInterface $field_definition, array $dependencies); }