abstract class SessionListener in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/EventListener/SessionListener.php \Symfony\Component\HttpKernel\EventListener\SessionListener
Sets the session in the request.
@author Johannes M. Schmitt <schmittjoh@gmail.com>
Hierarchy
- class \Symfony\Component\HttpKernel\EventListener\SessionListener implements EventSubscriberInterface
Expanded class hierarchy of SessionListener
File
- vendor/
symfony/ http-kernel/ EventListener/ SessionListener.php, line 23
Namespace
Symfony\Component\HttpKernel\EventListenerView source
abstract class SessionListener implements EventSubscriberInterface {
public function onKernelRequest(GetResponseEvent $event) {
if (!$event
->isMasterRequest()) {
return;
}
$request = $event
->getRequest();
$session = $this
->getSession();
if (null === $session || $request
->hasSession()) {
return;
}
$request
->setSession($session);
}
public static function getSubscribedEvents() {
return array(
KernelEvents::REQUEST => array(
'onKernelRequest',
128,
),
);
}
/**
* Gets the session object.
*
* @return SessionInterface|null A SessionInterface instance or null if no session is available
*/
protected abstract function getSession();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SessionListener:: |
abstract protected | function | Gets the session object. | |
SessionListener:: |
public static | function |
Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface:: |
|
SessionListener:: |
public | function |