This commit is contained in:
Manuel Raynaud
2013-10-18 09:28:17 +02:00
parent 12b5a81364
commit 52ed89f1aa
70 changed files with 136 additions and 244 deletions

View File

@@ -32,7 +32,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Country as CountryModel;
use Thelia\Model\CountryQuery;
/**
* Class Country
* @package Thelia\Action
@@ -85,15 +84,13 @@ class Country extends BaseAction implements EventSubscriberInterface
public function toggleDefault(CountryToggleDefaultEvent $event)
{
if( null !== $country = CountryQuery::create()->findPk($event->getCountryId()))
{
if ( null !== $country = CountryQuery::create()->findPk($event->getCountryId())) {
$country->toggleDefault();
$event->setCountry($country);
}
}
/**
* Returns an array of event names this subscriber wants to listen to.
*
@@ -123,4 +120,4 @@ class Country extends BaseAction implements EventSubscriberInterface
TheliaEvents::COUNTRY_TOGGLE_DEFAULT => array('toggleDefault', 128)
);
}
}
}