From 0b9e2552ed60cc60938344cf24850ccdd10bbf22 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 4 Sep 2013 08:30:24 +0200 Subject: [PATCH] modify travis script --- .travis.yml | 1 + core/lib/Thelia/Action/Address.php | 2 ++ .../Core/Event/AddressCreateOrUpdateEvent.php | 34 +++++++++++++++++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ed4aba4a..3ee2064b8 100755 --- a/.travis.yml +++ b/.travis.yml @@ -12,3 +12,4 @@ before_script: - composer install --prefer-dist --dev - sh -c "mysql -u$DB_USER -e 'SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS thelia;SET FOREIGN_KEY_CHECKS = 1;'; fi" - php Thelia thelia:install --db_host=localhost --db_username=$DB_USER --db_name=thelia + - php install/faker.php diff --git a/core/lib/Thelia/Action/Address.php b/core/lib/Thelia/Action/Address.php index 021927190..892547304 100644 --- a/core/lib/Thelia/Action/Address.php +++ b/core/lib/Thelia/Action/Address.php @@ -63,6 +63,8 @@ class Address extends BaseAction implements EventSubscriberInterface ->setCompany($event->getCompany()) ->save() ; + + $event->setAddress($addressModel); } /** diff --git a/core/lib/Thelia/Core/Event/AddressCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/AddressCreateOrUpdateEvent.php index 81c836a83..872021429 100644 --- a/core/lib/Thelia/Core/Event/AddressCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/AddressCreateOrUpdateEvent.php @@ -23,6 +23,7 @@ namespace Thelia\Core\Event; use Symfony\Component\EventDispatcher\Event; +use Thelia\Model\Address; use Thelia\Model\Customer; @@ -103,7 +104,12 @@ class AddressCreateOrUpdateEvent extends Event */ protected $customer; - function __construct($label, $title, $firstname, $lastname, $address1, $address2, $address3, $zipcode, $city, $country, $cellphone, $phone, $company, Customer $customer) + /** + * @var \Thelia\Model\Address + */ + protected $address; + + function __construct($label, $title, $firstname, $lastname, $address1, $address2, $address3, $zipcode, $city, $country, $cellphone, $phone, $company) { $this->address1 = $address1; $this->address2 = $address2; @@ -118,7 +124,6 @@ class AddressCreateOrUpdateEvent extends Event $this->phone = $phone; $this->title = $title; $this->zipcode = $zipcode; - $this->customer = $customer; } /** @@ -225,6 +230,14 @@ class AddressCreateOrUpdateEvent extends Event return $this->zipcode; } + /** + * @param \Thelia\Model\Customer $customer + */ + public function setCustomer(Customer $customer) + { + $this->customer = $customer; + } + /** * @return \Thelia\Model\Customer */ @@ -233,4 +246,21 @@ class AddressCreateOrUpdateEvent extends Event return $this->customer; } + /** + * @param \Thelia\Model\Address $address + */ + public function setAddress(Address $address) + { + $this->address = $address; + } + + /** + * @return \Thelia\Model\Address + */ + public function getAddress() + { + return $this->address; + } + + } \ No newline at end of file