function ContainerInjectionInterface::create

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/DependencyInjection/ContainerInjectionInterface.php \Drupal\Core\DependencyInjection\ContainerInjectionInterface::create()
  2. 10 core/lib/Drupal/Core/DependencyInjection/ContainerInjectionInterface.php \Drupal\Core\DependencyInjection\ContainerInjectionInterface::create()
  3. 8.9.x core/lib/Drupal/Core/DependencyInjection/ContainerInjectionInterface.php \Drupal\Core\DependencyInjection\ContainerInjectionInterface::create()

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.

10 methods override ContainerInjectionInterface::create()
AllowedValuesConstraintValidator::create in core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/AllowedValuesConstraintValidator.php
Instantiates a new instance of this class.
ChooseSectionController::create in core/modules/layout_builder/src/Controller/ChooseSectionController.php
Instantiates a new instance of this class.
ControllerBase::create in core/lib/Drupal/Core/Controller/ControllerBase.php
Instantiates a new instance of this class.
EntityOperations::create in core/modules/content_moderation/src/EntityOperations.php
Instantiates a new instance of this class.
EntityReferenceSupportedNewEntitiesConstraintValidator::create in core/modules/workspaces/src/Plugin/Validation/Constraint/EntityReferenceSupportedNewEntitiesConstraintValidator.php
Instantiates a new instance of this class.

... See full list

File

core/lib/Drupal/Core/DependencyInjection/ContainerInjectionInterface.php, line 26

Class

ContainerInjectionInterface
Defines a common interface for dependency container injection.

Namespace

Drupal\Core\DependencyInjection

Code

public static function create(ContainerInterface $container);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.