Add preInsert method for positions

modifié:         core/lib/Thelia/Model/ExportCategory.php
	modifié:         core/lib/Thelia/Model/Import.php
	modifié:         core/lib/Thelia/Model/ImportCategory.php
This commit is contained in:
Benjamin Perche
2014-08-05 09:07:18 +02:00
parent 1bbf34e8a2
commit 394edf8fdc
3 changed files with 33 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
namespace Thelia\Model; namespace Thelia\Model;
use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Model\Base\ExportCategory as BaseExportCategory; use Thelia\Model\Base\ExportCategory as BaseExportCategory;
use Thelia\Model\Tools\ModelEventDispatcherTrait; use Thelia\Model\Tools\ModelEventDispatcherTrait;
use Thelia\Model\Tools\PositionManagementTrait; use Thelia\Model\Tools\PositionManagementTrait;
@@ -10,4 +11,14 @@ class ExportCategory extends BaseExportCategory
{ {
use PositionManagementTrait; use PositionManagementTrait;
use ModelEventDispatcherTrait; use ModelEventDispatcherTrait;
/**
* {@inheritDoc}
*/
public function preInsert(ConnectionInterface $con = null)
{
$this->setPosition($this->getNextPosition());
return true;
}
} }

View File

@@ -3,6 +3,7 @@
namespace Thelia\Model; namespace Thelia\Model;
use Exception; use Exception;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\ClassNotFoundException; use Propel\Runtime\Exception\ClassNotFoundException;
use Propel\Runtime\Propel; use Propel\Runtime\Propel;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -57,4 +58,14 @@ class Import extends BaseImport
return $instance; return $instance;
} }
/**
* {@inheritDoc}
*/
public function preInsert(ConnectionInterface $con = null)
{
$this->setPosition($this->getNextPosition());
return true;
}
} }

View File

@@ -2,6 +2,7 @@
namespace Thelia\Model; namespace Thelia\Model;
use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Model\Base\ImportCategory as BaseImportCategory; use Thelia\Model\Base\ImportCategory as BaseImportCategory;
use Thelia\Model\Tools\ModelEventDispatcherTrait; use Thelia\Model\Tools\ModelEventDispatcherTrait;
use Thelia\Model\Tools\PositionManagementTrait; use Thelia\Model\Tools\PositionManagementTrait;
@@ -10,4 +11,14 @@ class ImportCategory extends BaseImportCategory
{ {
use PositionManagementTrait; use PositionManagementTrait;
use ModelEventDispatcherTrait; use ModelEventDispatcherTrait;
/**
* {@inheritDoc}
*/
public function preInsert(ConnectionInterface $con = null)
{
$this->setPosition($this->getNextPosition());
return true;
}
} }