Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / lib / Drupal / Core / Config / Entity / ConfigEntityStorageInterface.php
1 <?php
2
3 namespace Drupal\Core\Config\Entity;
4
5 use Drupal\Core\Entity\EntityStorageInterface;
6
7 /**
8  * Provides an interface for configuration entity storage.
9  */
10 interface ConfigEntityStorageInterface extends EntityStorageInterface {
11
12   /**
13    * Extracts the configuration entity ID from the full configuration name.
14    *
15    * @param string $config_name
16    *   The full configuration name to extract the ID from; for example,
17    *   'views.view.archive'.
18    * @param string $config_prefix
19    *   The config prefix of the configuration entity; for example, 'views.view'.
20    *
21    * @return string
22    *   The ID of the configuration entity.
23    */
24   public static function getIDFromConfigName($config_name, $config_prefix);
25
26   /**
27    * Creates a configuration entity from storage values.
28    *
29    * Allows the configuration entity storage to massage storage values before
30    * creating an entity.
31    *
32    * @param array $values
33    *   The array of values from the configuration storage.
34    *
35    * @return ConfigEntityInterface
36    *   The configuration entity.
37    *
38    * @see \Drupal\Core\Entity\EntityStorageBase::mapFromStorageRecords()
39    * @see \Drupal\field\FieldStorageConfigStorage::mapFromStorageRecords()
40    */
41   public function createFromStorageRecord(array $values);
42
43   /**
44    * Updates a configuration entity from storage values.
45    *
46    * Allows the configuration entity storage to massage storage values before
47    * updating an entity.
48    *
49    * @param ConfigEntityInterface $entity
50    *   The configuration entity to update.
51    * @param array $values
52    *   The array of values from the configuration storage.
53    *
54    * @return ConfigEntityInterface
55    *   The configuration entity.
56    *
57    * @see \Drupal\Core\Entity\EntityStorageBase::mapFromStorageRecords()
58    * @see \Drupal\field\FieldStorageConfigStorage::mapFromStorageRecords()
59    */
60   public function updateFromStorageRecord(ConfigEntityInterface $entity, array $values);
61
62   /**
63    * Loads one entity in their original form without overrides.
64    *
65    * @param mixed $id
66    *   The ID of the entity to load.
67    *
68    * @return \Drupal\Core\Entity\EntityInterface|null
69    *   An entity object. NULL if no matching entity is found.
70    */
71   public function loadOverrideFree($id);
72
73   /**
74    * Loads one or more entities in their original form without overrides.
75    *
76    * @param $ids
77    *   An array of entity IDs, or NULL to load all entities.
78    *
79    * @return \Drupal\Core\Entity\EntityInterface[]
80    *   An array of entity objects indexed by their IDs. Returns an empty array
81    *   if no matching entities are found.
82    */
83   public function loadMultipleOverrideFree(array $ids = NULL);
84
85 }