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

38 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace Symfony\Framework;
use Symfony\Component\EventDispatcher\EventDispatcher as BaseEventDispatcher;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\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) {
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
$container->get($id)->register($this, $priority);
}
}
}