event classes must extends ActionEvent
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
<!-- end customer routes -->
|
||||
|
||||
<!-- customer address routes -->
|
||||
<route id="customer.adress.create" path="/customer/address/create" >
|
||||
<route id="address.create" path="/address/create" >
|
||||
<default key="_controller">Thelia\Controller\Front\CustomerAddressController::createAction</default>
|
||||
</route>
|
||||
<!-- end customer address routes -->
|
||||
|
||||
@@ -32,7 +32,7 @@ use Thelia\Model\Customer;
|
||||
* @package Thelia\Core\Event
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class AddressCreateOrUpdateEvent extends Event
|
||||
class AddressCreateOrUpdateEvent extends ActionEvent
|
||||
{
|
||||
/**
|
||||
* @var string address label
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Thelia\Core\Event;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Thelia\Model\Cart;
|
||||
|
||||
class CartEvent extends Event
|
||||
class CartEvent extends ActionEvent
|
||||
{
|
||||
protected $cart;
|
||||
protected $quantity;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Thelia\Core\Event;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Thelia\Model\Customer;
|
||||
|
||||
class CustomerCreateOrUpdateEvent extends Event {
|
||||
class CustomerCreateOrUpdateEvent extends ActionEvent {
|
||||
|
||||
//base parameters for creating new customer
|
||||
protected $title;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Thelia\Model\Base\Address as BaseAddress;
|
||||
|
||||
@@ -19,4 +20,61 @@ class Address extends BaseAddress {
|
||||
return $this->dispatcher;
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to be run before inserting to database
|
||||
* @param ConnectionInterface $con
|
||||
* @return boolean
|
||||
*/
|
||||
public function preInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to be run after inserting to database
|
||||
* @param ConnectionInterface $con
|
||||
*/
|
||||
public function postInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to be run before updating the object in database
|
||||
* @param ConnectionInterface $con
|
||||
* @return boolean
|
||||
*/
|
||||
public function preUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to be run after updating the object in database
|
||||
* @param ConnectionInterface $con
|
||||
*/
|
||||
public function postUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to be run before deleting the object in database
|
||||
* @param ConnectionInterface $con
|
||||
* @return boolean
|
||||
*/
|
||||
public function preDelete(ConnectionInterface $con = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to be run after deleting the object in database
|
||||
* @param ConnectionInterface $con
|
||||
*/
|
||||
public function postDelete(ConnectionInterface $con = null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user