start refactoring customer update process
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
"symfony-cmf/routing": "1.0.0",
|
"symfony-cmf/routing": "1.0.0",
|
||||||
|
|
||||||
"symfony/form": "2.2.*",
|
"symfony/form": "2.2.*",
|
||||||
"symfony/validator": "2.3.*",
|
"symfony/validator": "2.3.*@dev",
|
||||||
|
|
||||||
"smarty/smarty": "v3.1.14",
|
"smarty/smarty": "v3.1.14",
|
||||||
"kriswallsmith/assetic": "1.2.*@dev",
|
"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",
|
"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"
|
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
|
||||||
],
|
],
|
||||||
"hash": "978f18a84f0206422f94441fd85bb387",
|
"hash": "458aeccc06b7394d7653a9063b6fd981",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "ezyang/htmlpurifier",
|
"name": "ezyang/htmlpurifier",
|
||||||
@@ -1509,17 +1509,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/validator",
|
"name": "symfony/validator",
|
||||||
"version": "v2.3.3",
|
"version": "2.3.x-dev",
|
||||||
"target-dir": "Symfony/Component/Validator",
|
"target-dir": "Symfony/Component/Validator",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/Validator.git",
|
"url": "https://github.com/symfony/Validator.git",
|
||||||
"reference": "v2.3.3"
|
"reference": "55808a75bf373a8edb6400239268d315f0a326c7"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/Validator/zipball/v2.3.3",
|
"url": "https://api.github.com/repos/symfony/Validator/zipball/55808a75bf373a8edb6400239268d315f0a326c7",
|
||||||
"reference": "v2.3.3",
|
"reference": "55808a75bf373a8edb6400239268d315f0a326c7",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1566,7 +1566,7 @@
|
|||||||
],
|
],
|
||||||
"description": "Symfony Validator Component",
|
"description": "Symfony Validator Component",
|
||||||
"homepage": "http://symfony.com",
|
"homepage": "http://symfony.com",
|
||||||
"time": "2013-08-06 05:59:49"
|
"time": "2013-08-13 20:18:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/yaml",
|
"name": "symfony/yaml",
|
||||||
@@ -2039,6 +2039,7 @@
|
|||||||
"ezyang/htmlpurifier": 20,
|
"ezyang/htmlpurifier": 20,
|
||||||
"ircmaxell/password-compat": 20,
|
"ircmaxell/password-compat": 20,
|
||||||
"propel/propel": 15,
|
"propel/propel": 15,
|
||||||
|
"symfony/validator": 20,
|
||||||
"kriswallsmith/assetic": 20,
|
"kriswallsmith/assetic": 20,
|
||||||
"leafo/lessphp": 20,
|
"leafo/lessphp": 20,
|
||||||
"ptachoire/cssembed": 20,
|
"ptachoire/cssembed": 20,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Thelia\Action;
|
|||||||
|
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Thelia\Core\Event\ActionEvent;
|
use Thelia\Core\Event\ActionEvent;
|
||||||
use Thelia\Core\Event\CustomerCreateEvent;
|
use Thelia\Core\Event\CustomerCreateOrUpdateEvent;
|
||||||
use Thelia\Core\Event\TheliaEvents;
|
use Thelia\Core\Event\TheliaEvents;
|
||||||
use Thelia\Form\CustomerCreation;
|
use Thelia\Form\CustomerCreation;
|
||||||
use Thelia\Form\CustomerModification;
|
use Thelia\Form\CustomerModification;
|
||||||
@@ -42,7 +42,7 @@ use Propel\Runtime\Exception\PropelException;
|
|||||||
class Customer extends BaseAction implements EventSubscriberInterface
|
class Customer extends BaseAction implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
public function create(CustomerCreateEvent $event)
|
public function create(CustomerCreateOrUpdateEvent $event)
|
||||||
{
|
{
|
||||||
|
|
||||||
$customer = new CustomerModel();
|
$customer = new CustomerModel();
|
||||||
|
|||||||
@@ -14,6 +14,10 @@
|
|||||||
<default key="_view">connexion</default>
|
<default key="_view">connexion</default>
|
||||||
</route>
|
</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">
|
<route id="cart.add.process" path="/cart/add">
|
||||||
<default key="_controller">Thelia\Controller\Front\CartController::addItem</default>
|
<default key="_controller">Thelia\Controller\Front\CartController::addItem</default>
|
||||||
<default key="_view">cart</default>
|
<default key="_view">cart</default>
|
||||||
|
|||||||
@@ -23,8 +23,7 @@
|
|||||||
namespace Thelia\Controller\Front;
|
namespace Thelia\Controller\Front;
|
||||||
|
|
||||||
use Propel\Runtime\Exception\PropelException;
|
use Propel\Runtime\Exception\PropelException;
|
||||||
use Thelia\Core\Event\CustomerCreateEvent;
|
use Thelia\Core\Event\CustomerCreateOrUpdateEvent;
|
||||||
use Thelia\Core\Event\CustomerEvent;
|
|
||||||
use Thelia\Core\Security\SecurityContext;
|
use Thelia\Core\Security\SecurityContext;
|
||||||
use Thelia\Form\CustomerCreation;
|
use Thelia\Form\CustomerCreation;
|
||||||
use Thelia\Form\Exception\FormValidationException;
|
use Thelia\Form\Exception\FormValidationException;
|
||||||
@@ -47,7 +46,7 @@ class CustomerController extends BaseFrontController
|
|||||||
|
|
||||||
$data = $form->getData();
|
$data = $form->getData();
|
||||||
|
|
||||||
$customerCreateEvent = new CustomerCreateEvent(
|
$customerCreateEvent = new CustomerCreateOrUpdateEvent(
|
||||||
$data["title"],
|
$data["title"],
|
||||||
$data["firstname"],
|
$data["firstname"],
|
||||||
$data["lastname"],
|
$data["lastname"],
|
||||||
@@ -81,7 +80,11 @@ class CustomerController extends BaseFrontController
|
|||||||
$this->getParserContext()->setGeneralError($e->getMessage());
|
$this->getParserContext()->setGeneralError($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateAction()
|
||||||
|
{
|
||||||
|
$request = $this->getRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loginAction()
|
public function loginAction()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Thelia\Core\Event;
|
|||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Component\EventDispatcher\Event;
|
||||||
use Thelia\Model\Customer;
|
use Thelia\Model\Customer;
|
||||||
|
|
||||||
class CustomerCreateEvent extends Event {
|
class CustomerCreateOrUpdateEvent extends Event {
|
||||||
|
|
||||||
//base parameters for creating new customer
|
//base parameters for creating new customer
|
||||||
protected $title;
|
protected $title;
|
||||||
Reference in New Issue
Block a user