Update profil [It's not working yet]

This commit is contained in:
touffies
2013-10-24 00:19:00 +02:00
parent 3e3695e5d3
commit 009e779110
3 changed files with 45 additions and 27 deletions

View File

@@ -60,6 +60,27 @@ class Customer extends BaseAction implements EventSubscriberInterface
}
public function updateProfil(CustomerCreateOrUpdateEvent $event)
{
$customer = $event->getCustomer();
$customer->setDispatcher($this->getDispatcher());
$customer
->setTitleId($event->getTitle())
->setFirstname($event->getFirstname())
->setLastname($event->getLastname())
->setEmail($event->getEmail())
->setPassword($event->getPassword())
->setReseller($event->getReseller())
->setSponsor($event->getSponsor())
->setDiscount($event->getDiscount())
->save();
$event->setCustomer($customer);
}
public function delete(CustomerEvent $event)
{
$customer = $event->getCustomer();
@@ -110,11 +131,6 @@ class Customer extends BaseAction implements EventSubscriberInterface
$this->getSecurityContext()->clearCustomerUser();
}
public function changePassword(ActionEvent $event)
{
// TODO
}
/**
* Return the security context
*
@@ -150,6 +166,7 @@ class Customer extends BaseAction implements EventSubscriberInterface
return array(
TheliaEvents::CUSTOMER_CREATEACCOUNT => array('create', 128),
TheliaEvents::CUSTOMER_UPDATEACCOUNT => array('modify', 128),
TheliaEvents::CUSTOMER_UPDATEPROFIL => array('updateProfil', 128),
TheliaEvents::CUSTOMER_LOGOUT => array('logout', 128),
TheliaEvents::CUSTOMER_LOGIN => array('login', 128),
TheliaEvents::CUSTOMER_DELETEACCOUNT => array('delete', 128),