put dedicated controller for address mangamenent
This commit is contained in:
@@ -60,6 +60,13 @@ class Address extends BaseAction implements EventSubscriberInterface
|
||||
$address->delete();
|
||||
}
|
||||
|
||||
public function useDefault(AddressEvent $event)
|
||||
{
|
||||
$address = $event->getAddress();
|
||||
|
||||
$address->makeItDefault();
|
||||
}
|
||||
|
||||
protected function createOrUpdate(AddressModel $addressModel, AddressCreateOrUpdateEvent $event)
|
||||
{
|
||||
$addressModel->setDispatcher($this->getDispatcher());
|
||||
@@ -125,7 +132,8 @@ class Address extends BaseAction implements EventSubscriberInterface
|
||||
return array(
|
||||
TheliaEvents::ADDRESS_CREATE => array("create", 128),
|
||||
TheliaEvents::ADDRESS_UPDATE => array("update", 128),
|
||||
TheliaEvents::ADDRESS_DELETE => array("delete", 128)
|
||||
TheliaEvents::ADDRESS_DELETE => array("delete", 128),
|
||||
TheliaEvents::ADDRESS_DEFAULT => array('useDefault', 128),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user