Drupal 8  8.0.2
EntityTypeRepository Class Reference
Inheritance diagram for EntityTypeRepository:

Public Member Functions

 __construct (EntityTypeManagerInterface $entity_type_manager)
 
 getEntityTypeLabels ($group=FALSE)
 
 getEntityTypeFromClass ($class_name)
 
 clearCachedDefinitions ()
 

Protected Attributes

 $entityTypeManager
 
 $classNameEntityTypeMap = []
 

Detailed Description

Provides helper methods for loading entity types.

See Also

Constructor & Destructor Documentation

__construct ( EntityTypeManagerInterface  $entity_type_manager)

Constructs a new EntityTypeRepository.

Parameters
\Drupal\Core\Entity\EntityTypeManagerInterface$entity_type_managerThe entity type manager.

References Drupal\entityTypeManager().

Here is the call graph for this function:

Member Function Documentation

clearCachedDefinitions ( )

{Clear the static cache.

Deprecated:
in Drupal 8.0.0, will be removed before Drupal 9.0.0.
Todo:
Remove in https://www.drupal.org/node/2549143.
}

Implements EntityTypeRepositoryInterface.

getEntityTypeFromClass (   $class_name)

{Gets the entity type ID based on the class that is called on.Compares the class this is called on against the known entity classes and returns the entity type ID of a direct match or a subclass as fallback, to support entity type definitions that were altered.

Parameters
string$class_nameClass name to use for searching the entity type ID.
Returns
string The entity type ID.
Exceptions
\Drupal\Core\Entity\Exception\AmbiguousEntityClassExceptionThrown when multiple subclasses correspond to the called class.
\Drupal\Core\Entity\Exception\NoCorrespondingEntityClassExceptionThrown when no entity class corresponds to the called class.
See Also
::load()
::loadMultiple()
}

Implements EntityTypeRepositoryInterface.

References Drupal\entityTypeManager().

Here is the call graph for this function:

getEntityTypeLabels (   $group = FALSE)

{Builds a list of entity type labels suitable for a Form API options list.

Parameters
bool$group(optional) Whether to group entity types by plugin group (e.g. 'content', 'config'). Defaults to FALSE.
Returns
array An array of entity type labels, keyed by entity type name.
}

Implements EntityTypeRepositoryInterface.

References Drupal\entityTypeManager(), and t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: