phpBB

Code Changes

File: phpbb/event/dispatcher.php

  Unmodified   Added   Modified   Removed
Line 14Line 14
namespace phpbb\event;

use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;

namespace phpbb\event;

use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;

 
use Symfony\Component\EventDispatcher\Event;


/**
* Extension of the Symfony2 EventDispatcher


/**
* Extension of the Symfony2 EventDispatcher

Line 31Line 32
*/
class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_interface
{

*/
class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_interface
{

 
	/**
* @var bool
*/
protected $disabled = false;


	/**
* {@inheritdoc}
*/

	/**
* {@inheritdoc}
*/

Line 39Line 45
		$event = new \phpbb\event\data($data);
$this->dispatch($eventName, $event);
return $event->get_data_filtered(array_keys($data));

		$event = new \phpbb\event\data($data);
$this->dispatch($eventName, $event);
return $event->get_data_filtered(array_keys($data));

 
	}

/**
* {@inheritdoc}
*/
public function dispatch($eventName, Event $event = null)
{
if ($this->disabled)
{
return $event;
}

return parent::dispatch($eventName, $event);
}

/**
* {@inheritdoc}
*/
public function disable()
{
$this->disabled = true;
}

/**
* {@inheritdoc}
*/
public function enable()
{
$this->disabled = false;

	}
}


	}
}