Eccube\Service\CartService::addError PHP Method

addError() public method

public addError ( string $error = null, string $productName = null ) : CartService
$error string
$productName string
return CartService
    public function addError($error = null, $productName = null)
    {
        $this->errors[] = $error;
        $this->session->getFlashBag()->add('eccube.front.request.error', $error);
        if (!is_null($productName)) {
            $this->session->getFlashBag()->add('eccube.front.request.product', $productName);
        }
        return $this;
    }