From 394edf8fdc355eac13cc095ba9f655f6c1550a6d Mon Sep 17 00:00:00 2001 From: Benjamin Perche Date: Tue, 5 Aug 2014 09:07:18 +0200 Subject: [PATCH] =?UTF-8?q?Add=20preInsert=20method=20for=20positions=20?= =?UTF-8?q?=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20core/lib/Thelia/Mode?= =?UTF-8?q?l/ExportCategory.php=20=09modifi=C3=A9:=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20core/lib/Thelia/Model/Import.php=20=09modifi=C3=A9:=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20core/lib/Thelia/Model/ImportCategory.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/Thelia/Model/ExportCategory.php | 11 +++++++++++ core/lib/Thelia/Model/Import.php | 11 +++++++++++ core/lib/Thelia/Model/ImportCategory.php | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/core/lib/Thelia/Model/ExportCategory.php b/core/lib/Thelia/Model/ExportCategory.php index f6e155eea..f812148ba 100644 --- a/core/lib/Thelia/Model/ExportCategory.php +++ b/core/lib/Thelia/Model/ExportCategory.php @@ -2,6 +2,7 @@ namespace Thelia\Model; +use Propel\Runtime\Connection\ConnectionInterface; use Thelia\Model\Base\ExportCategory as BaseExportCategory; use Thelia\Model\Tools\ModelEventDispatcherTrait; use Thelia\Model\Tools\PositionManagementTrait; @@ -10,4 +11,14 @@ class ExportCategory extends BaseExportCategory { use PositionManagementTrait; use ModelEventDispatcherTrait; + + /** + * {@inheritDoc} + */ + public function preInsert(ConnectionInterface $con = null) + { + $this->setPosition($this->getNextPosition()); + + return true; + } } diff --git a/core/lib/Thelia/Model/Import.php b/core/lib/Thelia/Model/Import.php index f7cbb1000..0c6086e13 100644 --- a/core/lib/Thelia/Model/Import.php +++ b/core/lib/Thelia/Model/Import.php @@ -3,6 +3,7 @@ namespace Thelia\Model; use Exception; +use Propel\Runtime\Connection\ConnectionInterface; use Propel\Runtime\Exception\ClassNotFoundException; use Propel\Runtime\Propel; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -57,4 +58,14 @@ class Import extends BaseImport return $instance; } + + /** + * {@inheritDoc} + */ + public function preInsert(ConnectionInterface $con = null) + { + $this->setPosition($this->getNextPosition()); + + return true; + } } diff --git a/core/lib/Thelia/Model/ImportCategory.php b/core/lib/Thelia/Model/ImportCategory.php index 6aca35800..1a1fdef6a 100644 --- a/core/lib/Thelia/Model/ImportCategory.php +++ b/core/lib/Thelia/Model/ImportCategory.php @@ -2,6 +2,7 @@ namespace Thelia\Model; +use Propel\Runtime\Connection\ConnectionInterface; use Thelia\Model\Base\ImportCategory as BaseImportCategory; use Thelia\Model\Tools\ModelEventDispatcherTrait; use Thelia\Model\Tools\PositionManagementTrait; @@ -10,4 +11,14 @@ class ImportCategory extends BaseImportCategory { use PositionManagementTrait; use ModelEventDispatcherTrait; + + /** + * {@inheritDoc} + */ + public function preInsert(ConnectionInterface $con = null) + { + $this->setPosition($this->getNextPosition()); + + return true; + } }