refactor cartAdd EventListener, removing Request references

This commit is contained in:
Manuel Raynaud
2013-08-14 15:10:21 +02:00
parent 61342e06f4
commit ab81b58e94
8 changed files with 126 additions and 59 deletions

View File

@@ -23,21 +23,22 @@
namespace Thelia\Core\Event;
use Symfony\Component\EventDispatcher\Event;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Model\Cart;
class CartEvent extends ActionEvent
class CartEvent extends Event
{
protected $cart;
public $cart;
public $quantity;
public $append;
public $newness;
public $productSaleElementsId;
public $product;
public $cartItem;
public function __construct(Request $request, Cart $cart)
public function __construct(Cart $cart)
{
parent::__construct($request);
$this->cart = $cart;
}
public function getCart()
{
return $this->cart;
}
}

View File

@@ -116,7 +116,7 @@ final class TheliaEvents
/**
* sent when a new item is added to current cart
*/
const AFTER_CARTADDITEM = "cart.addItem";
const AFTER_CARTADDITEM = "cart.after.addItem";
/**
* sent when a cart item is modify