refactor modify Article action

This commit is contained in:
Manuel Raynaud
2013-08-13 10:09:12 +02:00
parent 541fe7f75d
commit cf5ccdc7ae
5 changed files with 118 additions and 108 deletions

View File

@@ -43,11 +43,6 @@ abstract class ActionEvent extends Event
*/
protected $request;
/**
*
* @var string
*/
protected $action;
protected $errorForm = null;
@@ -58,10 +53,9 @@ abstract class ActionEvent extends Event
* @param \Symfony\Component\HttpFoundation\Request $request
* @param string $action
*/
public function __construct(Request $request, $action)
public function __construct(Request $request)
{
$this->request = $request;
$this->action = $action;
}
@@ -79,15 +73,6 @@ abstract class ActionEvent extends Event
return null;
}
/**
*
* @return string
*/
public function getAction()
{
return $this->action;
}
/**
*
* @return \Symfony\Component\HttpFoundation\Request

View File

@@ -30,9 +30,9 @@ class CartEvent extends ActionEvent {
protected $cart;
public function __construct(Request $request, $action, Cart $cart)
public function __construct(Request $request, Cart $cart)
{
parent::__construct($request, $action);
parent::__construct($request);
$this->cart = $cart;
}

View File

@@ -121,10 +121,20 @@ final class TheliaEvents
/**
* sent when a new item is added to current cart
*/
const CART_ADDITEM = "cart.addItem";
const AFTER_CARTADDITEM = "cart.addItem";
/**
* sent when a cart item is modify
*/
const CART_MODIFYITEM = "cart.modifyItem";
const AFTER_CARTMODIFYITEM = "cart.modifyItem";
/**
* sent for addArticle action
*/
const CART_ADDITEM = "action.addArticle";
/**
* sent on modify article action
*/
const CART_MODIFYARTICLE = "action.modifyArticle";
}