start refactoring customer update process
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
"symfony-cmf/routing": "1.0.0",
|
||||
|
||||
"symfony/form": "2.2.*",
|
||||
"symfony/validator": "2.3.*",
|
||||
"symfony/validator": "2.3.*@dev",
|
||||
|
||||
"smarty/smarty": "v3.1.14",
|
||||
"kriswallsmith/assetic": "1.2.*@dev",
|
||||
|
||||
13
composer.lock
generated
13
composer.lock
generated
@@ -3,7 +3,7 @@
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
|
||||
],
|
||||
"hash": "978f18a84f0206422f94441fd85bb387",
|
||||
"hash": "458aeccc06b7394d7653a9063b6fd981",
|
||||
"packages": [
|
||||
{
|
||||
"name": "ezyang/htmlpurifier",
|
||||
@@ -1509,17 +1509,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/validator",
|
||||
"version": "v2.3.3",
|
||||
"version": "2.3.x-dev",
|
||||
"target-dir": "Symfony/Component/Validator",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Validator.git",
|
||||
"reference": "v2.3.3"
|
||||
"reference": "55808a75bf373a8edb6400239268d315f0a326c7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Validator/zipball/v2.3.3",
|
||||
"reference": "v2.3.3",
|
||||
"url": "https://api.github.com/repos/symfony/Validator/zipball/55808a75bf373a8edb6400239268d315f0a326c7",
|
||||
"reference": "55808a75bf373a8edb6400239268d315f0a326c7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1566,7 +1566,7 @@
|
||||
],
|
||||
"description": "Symfony Validator Component",
|
||||
"homepage": "http://symfony.com",
|
||||
"time": "2013-08-06 05:59:49"
|
||||
"time": "2013-08-13 20:18:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
@@ -2039,6 +2039,7 @@
|
||||
"ezyang/htmlpurifier": 20,
|
||||
"ircmaxell/password-compat": 20,
|
||||
"propel/propel": 15,
|
||||
"symfony/validator": 20,
|
||||
"kriswallsmith/assetic": 20,
|
||||
"leafo/lessphp": 20,
|
||||
"ptachoire/cssembed": 20,
|
||||
|
||||
@@ -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