Added another front page space for Yaffs info. Added roave security for composer.
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityLastInstalledSchemaRepositoryInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 use Drupal\Core\Field\FieldStorageDefinitionInterface;
6
7 /**
8  * Provides an interface for an installed entity definition repository.
9  */
10 interface EntityLastInstalledSchemaRepositoryInterface {
11
12   /**
13    * Gets the entity type definition in its most recently installed state.
14    *
15    * During the application lifetime, entity type definitions can change. For
16    * example, updated code can be deployed. The getDefinition() method will
17    * always return the definition as determined by the current codebase. This
18    * method, however, returns what the definition was when the last time that
19    * one of the \Drupal\Core\Entity\EntityTypeListenerInterface events was last
20    * fired and completed successfully. In other words, the definition that
21    * the entity type's handlers have incorporated into the application state.
22    * For example, if the entity type's storage handler is SQL-based, the
23    * definition for which database tables were created.
24    *
25    * Application management code can check if getDefinition() differs from
26    * getLastInstalledDefinition() and decide whether to:
27    * - Invoke the appropriate \Drupal\Core\Entity\EntityTypeListenerInterface
28    *   event so that handlers react to the new definition.
29    * - Raise a warning that the application state is incompatible with the
30    *   codebase.
31    * - Perform some other action.
32    *
33    * @param string $entity_type_id
34    *   The entity type ID.
35    *
36    * @return \Drupal\Core\Entity\EntityTypeInterface|null
37    *   The installed entity type definition, or NULL if the entity type has
38    *   not yet been installed via onEntityTypeCreate().
39    *
40    * @see \Drupal\Core\Entity\EntityTypeListenerInterface
41    */
42   public function getLastInstalledDefinition($entity_type_id);
43
44   /**
45    * Stores the entity type definition in the application state.
46    *
47    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
48    *   The entity type definition.
49    *
50    * @return $this
51    */
52   public function setLastInstalledDefinition(EntityTypeInterface $entity_type);
53
54   /**
55    * Deletes the entity type definition from the application state.
56    *
57    * @param string $entity_type_id
58    *   The entity type definition identifier.
59    *
60    * @return $this
61    */
62   public function deleteLastInstalledDefinition($entity_type_id);
63
64   /**
65    * Gets the entity type's most recently installed field storage definitions.
66    *
67    * During the application lifetime, field storage definitions can change. For
68    * example, updated code can be deployed. The getFieldStorageDefinitions()
69    * method will always return the definitions as determined by the current
70    * codebase. This method, however, returns what the definitions were when the
71    * last time that one of the
72    * \Drupal\Core\Field\FieldStorageDefinitionListenerInterface events was last
73    * fired and completed successfully. In other words, the definitions that
74    * the entity type's handlers have incorporated into the application state.
75    * For example, if the entity type's storage handler is SQL-based, the
76    * definitions for which database tables were created.
77    *
78    * Application management code can check if getFieldStorageDefinitions()
79    * differs from getLastInstalledFieldStorageDefinitions() and decide whether
80    * to:
81    * - Invoke the appropriate
82    *   \Drupal\Core\Field\FieldStorageDefinitionListenerInterface
83    *   events so that handlers react to the new definitions.
84    * - Raise a warning that the application state is incompatible with the
85    *   codebase.
86    * - Perform some other action.
87    *
88    * @param string $entity_type_id
89    *   The entity type ID.
90    *
91    * @return \Drupal\Core\Field\FieldStorageDefinitionInterface[]
92    *   The array of installed field storage definitions for the entity type,
93    *   keyed by field name.
94    *
95    * @see \Drupal\Core\Entity\EntityTypeListenerInterface
96    */
97   public function getLastInstalledFieldStorageDefinitions($entity_type_id);
98
99   /**
100    * Stores the entity type's field storage definitions in the application state.
101    *
102    * @param string $entity_type_id
103    *   The entity type identifier.
104    * @param \Drupal\Core\Field\FieldStorageDefinitionInterface[] $storage_definitions
105    *   An array of field storage definitions.
106    */
107   public function setLastInstalledFieldStorageDefinitions($entity_type_id, array $storage_definitions);
108
109   /**
110    * Stores the field storage definition in the application state.
111    *
112    * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
113    *   The field storage definition.
114    */
115   public function setLastInstalledFieldStorageDefinition(FieldStorageDefinitionInterface $storage_definition);
116
117   /**
118    * Deletes the field storage definition from the application state.
119    *
120    * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
121    *   The field storage definition.
122    */
123   public function deleteLastInstalledFieldStorageDefinition(FieldStorageDefinitionInterface $storage_definition);
124
125 }