refactor modify Article action
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
Reference in New Issue
Block a user