From 198bd9bec8adfa347394defdf32c23004fbb030f Mon Sep 17 00:00:00 2001 From: Etienne Roudeix Date: Thu, 19 Sep 2013 16:06:42 +0200 Subject: [PATCH] add abstract getDispatcher method to use CartTrai --- core/lib/Thelia/Coupon/CouponBaseAdapter.php | 10 ++++++++++ core/lib/Thelia/Model/Base/Order.php | 12 +----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/lib/Thelia/Coupon/CouponBaseAdapter.php b/core/lib/Thelia/Coupon/CouponBaseAdapter.php index f9fae8651..046b4ac81 100644 --- a/core/lib/Thelia/Coupon/CouponBaseAdapter.php +++ b/core/lib/Thelia/Coupon/CouponBaseAdapter.php @@ -266,4 +266,14 @@ class CouponBaseAdapter implements CouponAdapterInterface { return $this->container->get('thelia.constraint.validator'); } + + /** + * Return the event dispatcher, + * + * @return \Symfony\Component\EventDispatcher\EventDispatcher + */ + public function getDispatcher() + { + return $this->container->get('event_dispatcher'); + } } diff --git a/core/lib/Thelia/Model/Base/Order.php b/core/lib/Thelia/Model/Base/Order.php index 582ec6e23..a2cd3f829 100644 --- a/core/lib/Thelia/Model/Base/Order.php +++ b/core/lib/Thelia/Model/Base/Order.php @@ -1653,18 +1653,8 @@ abstract class Order implements ActiveRecordInterface $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } - $db = Propel::getServiceContainer()->getAdapter(OrderTableMap::DATABASE_NAME); - $dbMap = Propel::getServiceContainer()->getDatabaseMap(OrderTableMap::DATABASE_NAME); - - $tableName = OrderTableMap::TABLE_NAME; - - if ($db->useQuoteIdentifier()) { - $tableName = $db->quoteIdentifierTable($tableName); - } - $sql = sprintf( - 'INSERT INTO %s (%s) VALUES (%s)', - $tableName, + 'INSERT INTO order (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) );