Modules\Core\Source\Libs\Middleware\ItemPerPageMiddleware::setOption PHP Method

setOption() public method

public setOption ( $value, RequestParams $allParams )
$allParams app\helpers\RequestParams
    public function setOption($value, RequestParams $allParams)
    {
        $this->groupName = $this->groupName . basename($allParams->getRequest()->getUri()->getPath());
        $arParams = ['value' => $value, 'codeName' => $this->variableName, 'groupName' => $this->groupName];
        $event = new BaseContainerEvent($this->c, $arParams);
        $event = $this->c->dispatcher->dispatch('middleware.itemparpage.before', $event);
        $value = $event->getParams()['value'] ? $event->getParams()['value'] : $allParams->all($this->variableName);
        $result = $this->storeParams($value);
        Session::push('admin_panel.count_page', $allParams->all($this->variableName));
        $arParams = ['result' => $result, 'allParams' => $allParams];
        $event = new BaseContainerEvent($this->c, $arParams);
        $this->c->dispatcher->dispatch('middleware.itemparpage.after', $event);
    }