You are here

interface ClassResolverInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/DependencyInjection/ClassResolverInterface.php \Drupal\Core\DependencyInjection\ClassResolverInterface

Provides an interface to get a instance of a class with dependency injection.

Hierarchy

Expanded class hierarchy of ClassResolverInterface

All classes that implement ClassResolverInterface

10 files declare their use of ClassResolverInterface
ConstraintValidatorFactory.php in core/lib/Drupal/Core/Validation/ConstraintValidatorFactory.php
Contains \Drupal\Core\Validation\ConstraintValidatorFactory.
ControllerResolver.php in core/lib/Drupal/Core/Controller/ControllerResolver.php
Contains \Drupal\Core\Controller\ControllerResolver.
EntityResolverManager.php in core/lib/Drupal/Core/Entity/EntityResolverManager.php
Contains \Drupal\Core\Entity\EntityResolverManager.
EntityTypeManager.php in core/lib/Drupal/Core/Entity/EntityTypeManager.php
Contains \Drupal\Core\Entity\EntityTypeManager.
FormBuilder.php in core/lib/Drupal/Core/Form/FormBuilder.php
Contains \Drupal\Core\Form\FormBuilder.

... See full list

File

core/lib/Drupal/Core/DependencyInjection/ClassResolverInterface.php, line 13
Contains \Drupal\Core\DependencyInjection\ClassResolverInterface.

Namespace

Drupal\Core\DependencyInjection
View source
interface ClassResolverInterface {

  /**
   * Returns a class instance with a given class definition.
   *
   * In contrast to controllers you don't specify a method.
   *
   * @param string $definition
   *   A class name or service name.
   *
   * @return object
   *   The instance of the class.
   *
   * @throws \InvalidArgumentException
   *   If $class is not a valid service identifier and the class does not exist.
   */
  public function getInstanceFromDefinition($definition);

}

Members

Namesort descending Modifiers Type Description Overrides
ClassResolverInterface::getInstanceFromDefinition public function Returns a class instance with a given class definition. 1