public function Container::set in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/DependencyInjection/Container.php \Drupal\Core\DependencyInjection\Container::set()
- 9 core/lib/Drupal/Core/DependencyInjection/Container.php \Drupal\Core\DependencyInjection\Container::set()
File
- core/
lib/ Drupal/ Core/ DependencyInjection/ Container.php, line 15
Class
- Container
- Extends the Drupal container to set the service ID on the created object.
Namespace
Drupal\Core\DependencyInjectionCode
public function set($id, $service) {
parent::set($id, $service);
// Ensure that the _serviceId property is set on synthetic services as well.
if (isset($this->services[$id]) && is_object($this->services[$id]) && !isset($this->services[$id]->_serviceId)) {
$this->services[$id]->_serviceId = $id;
}
}