start refactoring customer update process
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Thelia\Action;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
use Thelia\Core\Event\CustomerCreateEvent;
|
||||
use Thelia\Core\Event\CustomerCreateOrUpdateEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Form\CustomerCreation;
|
||||
use Thelia\Form\CustomerModification;
|
||||
@@ -42,7 +42,7 @@ use Propel\Runtime\Exception\PropelException;
|
||||
class Customer extends BaseAction implements EventSubscriberInterface
|
||||
{
|
||||
|
||||
public function create(CustomerCreateEvent $event)
|
||||
public function create(CustomerCreateOrUpdateEvent $event)
|
||||
{
|
||||
|
||||
$customer = new CustomerModel();
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
<default key="_view">connexion</default>
|
||||
</route>
|
||||
|
||||
<route id="customer.update.process" path="/customer/update" methods="post">
|
||||
<default key="_controller">Thelia\Controller\Front\CustomerController::updateAction</default>
|
||||
</route>
|
||||
|
||||
<route id="cart.add.process" path="/cart/add">
|
||||
<default key="_controller">Thelia\Controller\Front\CartController::addItem</default>
|
||||
<default key="_view">cart</default>
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
namespace Thelia\Controller\Front;
|
||||
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Core\Event\CustomerCreateEvent;
|
||||
use Thelia\Core\Event\CustomerEvent;
|
||||
use Thelia\Core\Event\CustomerCreateOrUpdateEvent;
|
||||
use Thelia\Core\Security\SecurityContext;
|
||||
use Thelia\Form\CustomerCreation;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
@@ -47,7 +46,7 @@ class CustomerController extends BaseFrontController
|
||||
|
||||
$data = $form->getData();
|
||||
|
||||
$customerCreateEvent = new CustomerCreateEvent(
|
||||
$customerCreateEvent = new CustomerCreateOrUpdateEvent(
|
||||
$data["title"],
|
||||
$data["firstname"],
|
||||
$data["lastname"],
|
||||
@@ -81,7 +80,11 @@ class CustomerController extends BaseFrontController
|
||||
$this->getParserContext()->setGeneralError($e->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function updateAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
}
|
||||
|
||||
public function loginAction()
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Thelia\Core\Event;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Thelia\Model\Customer;
|
||||
|
||||
class CustomerCreateEvent extends Event {
|
||||
class CustomerCreateOrUpdateEvent extends Event {
|
||||
|
||||
//base parameters for creating new customer
|
||||
protected $title;
|
||||
Reference in New Issue
Block a user