3 namespace Drupal\Core\Entity;
5 use Symfony\Component\DependencyInjection\ContainerInterface;
8 * Defines an interface for entity handlers.
10 * This interface can be implemented by entity handlers that require
11 * dependency injection.
15 interface EntityHandlerInterface {
18 * Instantiates a new instance of this entity handler.
20 * This is a factory method that returns a new instance of this object. The
21 * factory should pass any needed dependencies into the constructor of this
22 * object, but not the container itself. Every call to this method must return
23 * a new instance of this object; that is, it may not implement a singleton.
25 * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
26 * The service container this object should use.
27 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
28 * The entity type definition.
31 * A new instance of the entity handler.
33 public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type);