Event handler.

@param \WyriHaximus\TwigView\Event\ConstructEvent $event Event.
186462
public function construct(ConstructEvent $event)
    {
        // CakePHP specific tags
        try {
            $event->getTwig()->addTokenParser(new TokenParser\Cell());
            $event->getTwig()->addTokenParser(new TokenParser\Element());
        } catch (LogicException $d) {
            // Nothing to do as token parser already added.
        }
    }
132089
protected function triggerEvent($event, $source = null, $data = null) {
		$this->getEventsManager()->trigger($event, $source, $data);
	}
655913
public function onCreate(CreateResourceEvent $event)
    {
        $request = $this->container->get('request');
        $form = $this->formFactory->create(new DirectoryType(), new Directory());
        $form->handleRequest($request);

        if ($form->isValid()) {
            $published = $form->get('published')->getData();
            $event->setPublished($published);
            $event->setResources(array($form->getData()));
            $event->stopPropagation();

            return;
        }

        $content = $this->templating->render(
            'ClarolineCoreBundle:Resource:createForm.html.twig',
            array(
                'form' => $form->createView(),
                'resourceType' => 'directory'
            )
        );
        $event->setErrorFormContent($content);
        $event->stopPropagation();
    }
519201
public function send(Event $event)
    {
        $message = $this->getEventMessage($event);
        $this->flush($message);
    }
638580
public function handle($event)
    {
        if ($event instanceof CExceptionEvent)
            $this->logExceptionEvent($event);
        else
            $this->logErrorEvent($event);
        parent::handle($event);
    }
830481
protected function fireEvent($event)
    {
        $this->app['events']->fire(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]);
    }
584533
function(event) {
        if (typeof event === "string") {
            event = { type: event };
        }
        if (typeof event.target !== "undefined") {
            event.target = this;
        }

        if (typeof event.type === "undefined") {
            throw new Error("Event object missing 'type' property.");
        }

        if (this._listeners[event.type]) {

            //create a copy of the array and use that so listeners can't chane
            var listeners = this._listeners[event.type].concat();
            for (var i=0, len=listeners.length; i < len; i++) {
                listeners[i].call(this, event);
            }
        }
    }
666787
final protected static function triggerEvent($event, array $context = array())
	{
		if (array_key_exists($event, static::$registered_events)) {
			array_map(function($handler) use ($context)
			{
				call_user_func($handler, $context);
			}, static::$registered_events[$event]);
		}
	}
915959
public function process(\core\event\base $event) {
        $this->init();
        foreach ($this->writers as $plugin => $writer) {
            try {
                $writer->write($event, $this);
            } catch (\Exception $e) {
                debugging('Exception detected when logging event ' . $event->eventname . ' in ' . $plugin . ': ' .
                    $e->getMessage(), DEBUG_NORMAL, $e->getTrace());
            }
        }
    }
628337
public function initialize(Event $event) {
		$table = $event->getSubject();
		if (!in_array(get_class($table), $this->config['tableClass'])) {
			return;
		}

		$this->_setValidators($table);
	}
1191229
public function handle(DomainEvent $event) : void {
        $this->projections->each(function (Projection $projection) use ($event) {
            $projection->handle($event);
        });
    }
1340925
public function dispatch(Event $event) {

		$this->lastEvent = $event;
		$eventName = $event->getName();

		if (isset($this->registry[$eventName])) {

			foreach ($this->getSortedRegistry($eventName) as $listener) {
				call_user_func($listener, $event);
			}
			
		}

	}
677241
public function handle(Registered $event)
    {
        if ($event->user instanceof MustVerifyEmail && ! $event->user->hasVerifiedEmail()) {
            $event->user->sendEmailVerificationNotification();
        }
    }
652677
private function postProcess(Event $event)
	{
		$skipped = false;

		foreach ($this->dispatcher->getListeners($event) as $listener)
		{
			if (!($listener instanceof TraceableListener))
			{
				// A new listener was added during dispatch.
				continue;
			}

			// Unwrap listener
			//$this->dispatcher->removeListener($listener, $event);
			//$this->dispatcher->addListener($listener->getWrappedListener(), $event);
			$priority = $this->dispatcher->getListenerPriority($listener, $event);

			$this->dispatcher->getListeners()[$event->getName()]->remove($listener);
			$this->dispatcher->getListeners()[$event->getName()]->add($listener->getWrappedListener(), $priority);

			$info = $this->getListenerInfo($listener->getWrappedListener(), $event->getName());

			$eventName = $event->getName();

			if ($listener->wasCalled())
			{
				if (null !== $this->logger)
				{
					$this->logger->debug(sprintf('Notified event "%s" to listener "%s".', $eventName, $info['pretty']));
				}

				if (!isset($this->called[$eventName]))
				{
					$this->called[$eventName] = new \SplObjectStorage();
				}

				$this->called[$eventName]->attach($listener);
			}

			if (null !== $this->logger && $skipped)
			{
				$this->logger->debug(sprintf('Listener "%s" was not called for event "%s".', $info['pretty'], $eventName));
			}

			if ($listener->stoppedPropagation())
			{
				if (null !== $this->logger)
				{
					$this->logger->debug(sprintf('Listener "%s" stopped propagation of the event "%s".', $info['pretty'], $eventName));
				}

				$skipped = true;
			}
		}
	}
1330576
public function notify($event = null)
    {
        /* @var Doozr_Base_Crud_Interface $observer */
        foreach ($this->observer as $observer) {
            $observer->update($this, $event);
        }

        $this->clear();
    }
954410
public function taskFinished(BuildEvent $event)
    {
        // ignore tasks in root
        if ($event->getTarget()->getName() == "") {
            return;
        }

        $this->remTasks--;
        $this->bar->advance();
    }
56948
public function onConsoleCommand(ConsoleCommandEvent $event)
    {
        $input = $event->getInput();
        if (!$input->hasOption($this->mockParamName)) {
            return;
        }

        $this->mock($input->getOption($this->mockParamName));
    }