annotate core/lib/Drupal/Core/Entity/EntityHandlerInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\Entity;
Chris@0 4
Chris@0 5 use Symfony\Component\DependencyInjection\ContainerInterface;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Defines an interface for entity handlers.
Chris@0 9 *
Chris@0 10 * This interface can be implemented by entity handlers that require
Chris@0 11 * dependency injection.
Chris@0 12 *
Chris@0 13 * @ingroup entity_api
Chris@0 14 */
Chris@0 15 interface EntityHandlerInterface {
Chris@0 16
Chris@0 17 /**
Chris@0 18 * Instantiates a new instance of this entity handler.
Chris@0 19 *
Chris@0 20 * This is a factory method that returns a new instance of this object. The
Chris@0 21 * factory should pass any needed dependencies into the constructor of this
Chris@0 22 * object, but not the container itself. Every call to this method must return
Chris@0 23 * a new instance of this object; that is, it may not implement a singleton.
Chris@0 24 *
Chris@0 25 * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
Chris@0 26 * The service container this object should use.
Chris@0 27 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
Chris@0 28 * The entity type definition.
Chris@0 29 *
Chris@0 30 * @return static
Chris@0 31 * A new instance of the entity handler.
Chris@0 32 */
Chris@0 33 public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type);
Chris@0 34
Chris@0 35 }