test area listener (#198]

This commit is contained in:
Manuel Raynaud
2014-02-03 11:40:12 +01:00
parent 0c87b7606c
commit c18718254c
2 changed files with 97 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ class Area extends BaseAction implements EventSubscriberInterface
public function removeCountry(AreaRemoveCountryEvent $event)
{
if (null !== $country = CountryQuery::create()->findPk($event->getCountryId())) {
$event->setArea($country->getArea());
$country->setDispatcher($event->getDispatcher());
$country->setAreaId(null)
->save();