3 namespace Drupal\Core\DependencyInjection;
5 use Drupal\Component\DependencyInjection\Container as DrupalContainer;
6 use Symfony\Component\DependencyInjection\ContainerInterface;
9 * Extends the Drupal container to set the service ID on the created object.
11 class Container extends DrupalContainer {
16 public function set($id, $service, $scope = ContainerInterface::SCOPE_CONTAINER) {
17 parent::set($id, $service, $scope);
19 // Ensure that the _serviceId property is set on synthetic services as well.
20 if (isset($this->services[$id]) && is_object($this->services[$id]) && !isset($this->services[$id]->_serviceId)) {
21 $this->services[$id]->_serviceId = $id;
28 public function __sleep() {
29 assert(FALSE, 'The container was serialized.');
30 return array_keys(get_object_vars($this));