3 namespace Drupal\Core\Config\Entity;
5 use Drupal\Core\Entity\EntityTypeInterface;
8 * Provides an interface for a configuration entity type and its metadata.
10 interface ConfigEntityTypeInterface extends EntityTypeInterface {
13 * Length limit of the configuration entity prefix.
15 * Configuration entity names are composed of two parts:
16 * - The config prefix, which is returned by getConfigPrefix() and is
18 * - The provider module name (limited to 50 characters by
19 * DRUPAL_EXTENSION_NAME_MAX_LENGTH).
20 * - The module-specific namespace identifier, which defaults to the
21 * configuration entity type ID. Entity type IDs are limited to 32
22 * characters by EntityTypeInterface::ID_MAX_LENGTH.
23 * - The configuration entity ID.
24 * So, a typical configuration entity filename will look something like:
25 * provider_module_name.namespace_identifier.config_entity_id.yml
27 * Most file systems limit a file name's length to 255 characters, so
28 * ConfigBase::MAX_NAME_LENGTH restricts the full configuration object name
29 * to 250 characters (leaving 5 for the file extension). Therefore, in
30 * order to leave sufficient characters to construct a configuration ID,
31 * the configuration entity prefix is limited to 83 characters: up to 50
32 * characters for the module name, 1 for the dot, and 32 for the namespace
33 * identifier. This also allows modules with shorter names to define longer
34 * namespace identifiers if desired.
36 * @see \Drupal\Core\Config\ConfigBase::MAX_NAME_LENGTH
37 * @see \Drupal\Core\Config\Entity\ConfigEntityTypeInterface::getConfigPrefix()
38 * @see DRUPAL_EXTENSION_NAME_MAX_LENGTH
39 * @see \Drupal\Core\Config\Entity\ConfigEntityStorage::MAX_ID_LENGTH
40 * @see \Drupal\Core\Entity\EntityTypeInterface::ID_MAX_LENGTH
42 const PREFIX_LENGTH = 83;
45 * Gets the config prefix used by the configuration entity type.
47 * The config prefix is used to prefix configuration entity IDs when they are
48 * stored in the configuration system. The default config prefix is
49 * constructed from the name of the module that provides the entity type and
50 * the ID of the entity type. If a config_prefix annotation is present it will
51 * be used in place of the entity type ID.
53 * Prefixing with the module that provides the configuration entity type
54 * ensures that configuration entities depend on the module that provides the
55 * configuration entity type.
60 * @throws \Drupal\Core\Config\ConfigPrefixLengthException
61 * Exception thrown when the length of the prefix exceeds PREFIX_LENGTH.
63 public function getConfigPrefix();
66 * Gets the config entity properties to export if declared on the annotation.
69 * The properties to export or NULL if they can not be determine from the
70 * config entity type annotation.
72 public function getPropertiesToExport();
75 * Gets the keys that are available for fast lookup.
78 * The list of lookup keys.
80 public function getLookupKeys();