Sulu\Component\Websocket\MessageDispatcher\MessageHandlerContext::__construct PHP Method

__construct() public method

public __construct ( Sulu\Component\Websocket\ConnectionContext\ConnectionContextInterface $context, $handlerName )
$context Sulu\Component\Websocket\ConnectionContext\ConnectionContextInterface
    public function __construct(ConnectionContextInterface $context, $handlerName)
    {
        $this->context = $context;
        $this->handlerName = $handlerName;
        $parameterName = 'parameters.' . $handlerName;
        if (!$this->context->has($parameterName)) {
            $this->context->set($parameterName, new ParameterBag());
        }
        $this->parameters = $this->context->get($parameterName);
    }

Usage Example

 public function __construct(AuthenticatedConnectionContextInterface $context, $handlerName)
 {
     parent::__construct($context, $handlerName);
 }