42 lines
841 B
PHP
42 lines
841 B
PHP
<?php
|
|
|
|
namespace KupShop\OrderingBundle\Event;
|
|
|
|
use Symfony\Contracts\EventDispatcher\Event;
|
|
|
|
class CartEvent extends Event
|
|
{
|
|
/** Pred zacatkem kontroly kosiku - spousti se pred odeslanim objednavky */
|
|
public const CHECK_CART = 'kupshop.cart.check_cart';
|
|
|
|
/** Pred kontrolou skladovosti produktu v kosiku - spousti se na kazdem kroku kosiku */
|
|
public const CHECK_CART_ITEMS = 'kupshop.cart.check_cart_items';
|
|
|
|
/**
|
|
* @var \cart
|
|
*/
|
|
private $cart;
|
|
|
|
private $errors;
|
|
|
|
public function __construct(\Cart $cart)
|
|
{
|
|
$this->cart = $cart;
|
|
}
|
|
|
|
public function getCart(): \Cart
|
|
{
|
|
return $this->cart;
|
|
}
|
|
|
|
public function setError($error, $index)
|
|
{
|
|
$this->errors[$index] = $error;
|
|
}
|
|
|
|
public function getErrors()
|
|
{
|
|
return $this->errors;
|
|
}
|
|
}
|