Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityTypeRepositoryInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 /**
6  * Provides an interface for helper methods for loading entity types.
7  */
8 interface EntityTypeRepositoryInterface {
9
10   /**
11    * Builds a list of entity type labels suitable for a Form API options list.
12    *
13    * @param bool $group
14    *   (optional) Whether to group entity types by plugin group (e.g. 'content',
15    *   'config'). Defaults to FALSE.
16    *
17    * @return array
18    *   An array of entity type labels, keyed by entity type name.
19    */
20   public function getEntityTypeLabels($group = FALSE);
21
22   /**
23    * Gets the entity type ID based on the class that is called on.
24    *
25    * Compares the class this is called on against the known entity classes
26    * and returns the entity type ID of a direct match or a subclass as fallback,
27    * to support entity type definitions that were altered.
28    *
29    * @param string $class_name
30    *   Class name to use for searching the entity type ID.
31    *
32    * @return string
33    *   The entity type ID.
34    *
35    * @throws \Drupal\Core\Entity\Exception\AmbiguousEntityClassException
36    *   Thrown when multiple subclasses correspond to the called class.
37    * @throws \Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException
38    *   Thrown when no entity class corresponds to the called class.
39    *
40    * @see \Drupal\Core\Entity\Entity::load()
41    * @see \Drupal\Core\Entity\Entity::loadMultiple()
42    */
43   public function getEntityTypeFromClass($class_name);
44
45   /**
46    * Clear the static cache.
47    *
48    * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
49    *
50    * @todo Remove in https://www.drupal.org/node/2549143.
51    */
52   public function clearCachedDefinitions();
53
54 }