This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Framework/EventDispatcher.php

36 lines
979 B
PHP
Raw Normal View History

<?php
namespace Symfony\Framework;
use Symfony\Components\EventDispatcher\EventDispatcher as BaseEventDispatcher;
use Symfony\Components\EventDispatcher\Event;
use Symfony\Components\DependencyInjection\ContainerInterface;
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
2010-05-19 08:16:18 +01:00
* This EventDispatcher implementation uses a DependencyInjection container to load listeners.
*
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class EventDispatcher extends BaseEventDispatcher
{
/**
* Constructor.
*
*/
public function __construct(ContainerInterface $container)
{
2010-08-05 06:34:53 +01:00
foreach ($container->findTaggedServiceIds('kernel.listener') as $id => $attributes) {
2010-06-27 17:28:29 +01:00
$container->get($id)->register($this);
}
}
}