diff --git a/core/lib/Thelia/Config/Resources/export.xml b/core/lib/Thelia/Config/Resources/export.xml new file mode 100644 index 000000000..3bacdca5a --- /dev/null +++ b/core/lib/Thelia/Config/Resources/export.xml @@ -0,0 +1,26 @@ + + + + + + + Customers + Clients + + + + + + + Mailing + Exporter le nom, prénom et adresse mail des clients inscrits et des abonnées à la newsletter + + + Mailing + Export the last name, first name and email address of the customers and the newsletter subscribers + + + + diff --git a/core/lib/Thelia/Controller/Admin/CustomerExportController.php b/core/lib/Thelia/Controller/Admin/CustomerExportController.php index 901e3c305..3215a2106 100644 --- a/core/lib/Thelia/Controller/Admin/CustomerExportController.php +++ b/core/lib/Thelia/Controller/Admin/CustomerExportController.php @@ -12,11 +12,6 @@ namespace Thelia\Controller\Admin; -use Thelia\Core\HttpFoundation\Response; -use Thelia\Core\Security\AccessManager; -use Thelia\Core\Security\Resource\AdminResources; -use Thelia\Model\NewsletterQuery; - /** * Class CustomerExportController * @package Thelia\Controller\Admin @@ -36,6 +31,6 @@ class CustomerExportController extends BaseAdminController public function mailing() { - + } } diff --git a/core/lib/Thelia/Controller/Admin/ExportController.php b/core/lib/Thelia/Controller/Admin/ExportController.php index a1ea06c2e..7637f1978 100644 --- a/core/lib/Thelia/Controller/Admin/ExportController.php +++ b/core/lib/Thelia/Controller/Admin/ExportController.php @@ -14,7 +14,6 @@ namespace Thelia\Controller\Admin; use Thelia\Core\Security\AccessManager; use Thelia\Core\Security\Resource\AdminResources; -use Thelia\Core\Template\Loop\ImportExportType; use Thelia\Core\Translation\Translator; use Thelia\Model\ExportCategoryQuery; use Thelia\Model\ExportQuery; @@ -138,6 +137,7 @@ class ExportController extends BaseAdminController ) ); } + return $export; } @@ -155,6 +155,7 @@ class ExportController extends BaseAdminController ) ); } + return $category; } } diff --git a/core/lib/Thelia/Controller/Admin/ImportExportController.php b/core/lib/Thelia/Controller/Admin/ImportExportController.php index dbecd9312..a72a4e683 100644 --- a/core/lib/Thelia/Controller/Admin/ImportExportController.php +++ b/core/lib/Thelia/Controller/Admin/ImportExportController.php @@ -58,7 +58,7 @@ class ImportExportController extends BaseAdminController public function export($id) { - if (null === $export = $this->getExport($id)) { + if (null === $export = $this->getExport($id)) { return $this->render("404"); } @@ -75,7 +75,6 @@ class ImportExportController extends BaseAdminController $archiveBuilders[$archiveBuilder] = $archiveBuilder; } - /** * Get the allowed formatters to inject them into the form */ @@ -121,30 +120,30 @@ class ImportExportController extends BaseAdminController if (!$boundForm->get("do_compress")->getData()) { - /** - * Build an event containing the formatter and the handler. - * Used for specific configuration (e.g: XML node names) - */ - $event = new ExportEvent($formatter, $handler); - - if (!$boundForm->get("do_compress")->getData()) - { /** - * Dispatch the event + * Build an event containing the formatter and the handler. + * Used for specific configuration (e.g: XML node names) */ - $this->dispatch(TheliaEvents::BEFORE_EXPORT, $event); + $event = new ExportEvent($formatter, $handler); - $formattedContent = $formatter->encode($data); + if (!$boundForm->get("do_compress")->getData()) { + /** + * Dispatch the event + */ + $this->dispatch(TheliaEvents::BEFORE_EXPORT, $event); - return new Response( - $formattedContent, - 200, - [ - "Content-Type" => $formatter->getMimeType(), - "Content-Disposition" => - "attachment; filename=\"" . $filename . "\"", - ] - ); + $formattedContent = $formatter->encode($data); + + return new Response( + $formattedContent, + 200, + [ + "Content-Type" => $formatter->getMimeType(), + "Content-Disposition" => + "attachment; filename=\"" . $filename . "\"", + ] + ); + } } else { /** @var \Thelia\Core\FileFormat\Archive\ArchiveBuilderInterface $archiveBuilder */ $archiveBuilder = $this->archiveBuilderManager->get( @@ -186,9 +185,9 @@ class ImportExportController extends BaseAdminController return $archiveBuilder->buildArchiveResponse($formatter::FILENAME); } - } catch(FormValidationException $e) { + } catch (FormValidationException $e) { $errorMessage = $this->createStandardFormValidationErrorMessage($e); - } catch(\Exception $e) { + } catch (\Exception $e) { $errorMessage = $e->getMessage(); } @@ -248,7 +247,7 @@ class ImportExportController extends BaseAdminController public function exportView($id) { - if (null === $export = $this->getExport($id)) { + if (null === $export = $this->getExport($id)) { return $this->render("404"); } @@ -277,6 +276,11 @@ class ImportExportController extends BaseAdminController } } + $this->getParserContext() + ->set("HAS_IMAGES", $export->hasImages($this->container)) + ->set("HAS_DOCUMENTS", $export->hasDocuments($this->container)) + ; + /** Then render the form */ if ($this->getRequest()->isXmlHttpRequest()) { return $this->render("ajax/export-modal"); @@ -302,4 +306,4 @@ class ImportExportController extends BaseAdminController return $export; } -} \ No newline at end of file +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterArchiveBuilderPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterArchiveBuilderPass.php index 82cc9bbd8..fc49bb4fc 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterArchiveBuilderPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterArchiveBuilderPass.php @@ -51,4 +51,4 @@ class RegisterArchiveBuilderPass implements CompilerPassInterface ); } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterFormatterPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterFormatterPass.php index d6ae4dda5..2e66ed8f6 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterFormatterPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterFormatterPass.php @@ -51,4 +51,4 @@ class RegisterFormatterPass implements CompilerPassInterface ); } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php b/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php index a8808372d..0c173d575 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php +++ b/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php @@ -12,6 +12,7 @@ namespace Thelia\Core\DependencyInjection\Loader; +use Propel\Runtime\Propel; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\Config\Util\XmlUtils; use Symfony\Component\DependencyInjection\DefinitionDecorator; @@ -24,6 +25,14 @@ use Symfony\Component\DependencyInjection\SimpleXMLElement; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Loader\FileLoader; +use Thelia\Core\Translation\Translator; +use Thelia\ImportExport\ExportHandler; +use Thelia\Model\Export; +use Thelia\Model\ExportCategory; +use Thelia\Model\ExportCategoryQuery; +use Thelia\Model\ExportQuery; +use Thelia\Model\Map\ExportCategoryTableMap; +use Thelia\Model\Map\ExportTableMap; /** * @@ -63,6 +72,10 @@ class XmlFileLoader extends FileLoader $this->parseForms($xml); $this->parseDefinitions($xml, $path); + + $this->parseExportCategories($xml); + + $this->parseExports($xml); } protected function parseCommands(SimpleXMLElement $xml) @@ -276,6 +289,157 @@ class XmlFileLoader extends FileLoader $this->container->setDefinition($id, $definition); } + protected function parseExportCategories(SimpleXMLElement $xml) + { + if (false === $exportCategories = $xml->xpath('//config:export_categories/config:export_category')) { + return; + } + + $con = Propel::getWriteConnection(ExportCategoryTableMap::DATABASE_NAME); + $con->beginTransaction(); + + try { + /** @var SimpleXMLElement $exportCategory */ + foreach ($exportCategories as $exportCategory) { + $id = (string) $exportCategory->getAttributeAsPhp("id"); + + $exportCategoryModel = ExportCategoryQuery::create()->findOneByRef($id); + + if ($exportCategoryModel === null) { + $exportCategoryModel = new ExportCategory(); + $exportCategoryModel + ->setRef($id) + ->setPositionToLast() + ->save($con) + ; + } + + /** @var SimpleXMLElement $child */ + foreach ($exportCategory->children() as $child) { + $locale = (string) $child->getAttributeAsPhp("locale"); + $value = (string) $child; + + $exportCategoryModel + ->setLocale($locale) + ->setTitle($value) + ->save($con); + ; + } + } + + $con->commit(); + } catch (\Exception $e) { + $con->rollBack(); + + throw $e; + } + } + + protected function parseExports(SimpleXMLElement $xml) + { + if (false === $exports = $xml->xpath('//config:exports/config:export')) { + return; + } + + $con = Propel::getWriteConnection(ExportTableMap::DATABASE_NAME); + $con->beginTransaction(); + + try { + /** @var SimpleXMLElement $export */ + foreach ($exports as $export) { + $id = (string) $export->getAttributeAsPhp("id"); + $class = (string) $export->getAttributeAsPhp("class"); + $categoryRef = (string) $export->getAttributeAsPhp("category_id"); + + if (!class_exists($class)) { + throw new \ErrorException( + Translator::getInstance()->trans( + "The class \"%class\" doesn't exist", + [ + "%class" => $class + ] + ) + ); + } + + $classInstance = new $class($this->container); + + if (!$classInstance instanceof ExportHandler) { + throw new \ErrorException( + Translator::getInstance()->trans( + "The class \"%class\" must extend %baseClass", + [ + "%class" => $class, + "%baseClass" => "Thelia\\ImportExport\\ExportHandler", + ] + ) + ); + } + + $category = ExportCategoryQuery::create()->findOneByRef($categoryRef); + + if (null === $category) { + throw new \ErrorException( + Translator::getInstance()->trans( + "The export category \"%category\" doesn't exist", + [ + "%category" => $categoryRef + ] + ) + ); + } + + $exportModel = ExportQuery::create()->findOneByRef($id); + + if (null === $exportModel) { + $exportModel = new Export(); + $exportModel + ->setRef($id) + ->setPositionToLast() + ; + } + + $exportModel + ->setExportCategory($category) + ->setHandleClass($class) + ->save($con) + ; + + /** @var SimpleXMLElement $descriptive */ + foreach ($export->children() as $descriptive) { + $locale = $descriptive->getAttributeAsPhp("locale"); + $title = null; + $description = null; + + /** @var SimpleXMLElement $row */ + foreach ($descriptive->children() as $row) { + switch ($row->getName()) { + case "title": + $title = (string) $row; + break; + case "description": + $description = (string) $row; + break; + } + } + + $exportModel + ->setLocale($locale) + ->setTitle($title) + ->setDescription($description) + ->save($con) + ; + } + } + + $con->commit(); + } catch (\Exception $e) { + $con->rollBack(); + + throw $e; + } + } + /** * Parses a XML file. * diff --git a/core/lib/Thelia/Core/DependencyInjection/Loader/schema/dic/config/thelia-1.0.xsd b/core/lib/Thelia/Core/DependencyInjection/Loader/schema/dic/config/thelia-1.0.xsd index 43c0eff65..f46e90eea 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Loader/schema/dic/config/thelia-1.0.xsd +++ b/core/lib/Thelia/Core/DependencyInjection/Loader/schema/dic/config/thelia-1.0.xsd @@ -17,6 +17,8 @@ + + @@ -212,4 +214,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/lib/Thelia/Core/Event/ImportExport/Export.php b/core/lib/Thelia/Core/Event/ImportExport/Export.php index 4e3c5a5f5..d6e51b28a 100644 --- a/core/lib/Thelia/Core/Event/ImportExport/Export.php +++ b/core/lib/Thelia/Core/Event/ImportExport/Export.php @@ -32,7 +32,7 @@ class Export extends ActionEvent /** @var \Thelia\Core\FileFormat\Archive\AbstractArchiveBuilder */ protected $archiveBuilder; - function __construct( + public function __construct( AbstractFormatter $formatter, ExportHandler $handler, AbstractArchiveBuilder $archiveBuilder = null @@ -43,7 +43,7 @@ class Export extends ActionEvent } /** - * @param AbstractArchiveBuilder $archiveBuilder + * @param AbstractArchiveBuilder $archiveBuilder * @return $this */ public function setArchiveBuilder(AbstractArchiveBuilder $archiveBuilder) @@ -62,7 +62,7 @@ class Export extends ActionEvent } /** - * @param AbstractFormatter $formatter + * @param AbstractFormatter $formatter * @return $this */ public function setFormatter(AbstractFormatter $formatter) @@ -81,7 +81,7 @@ class Export extends ActionEvent } /** - * @param ExportHandler $handler + * @param ExportHandler $handler * @return $this */ public function setHandler(ExportHandler $handler) @@ -98,4 +98,4 @@ class Export extends ActionEvent { return $this->handler; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderManager.php b/core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderManager.php index 4ad09e5fc..2168ed019 100644 --- a/core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderManager.php +++ b/core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderManager.php @@ -76,7 +76,7 @@ class ArchiveBuilderManager $names = []; /** @var AbstractArchiveBuilder $builder */ - foreach($this->archiveBuilders as $builder) { + foreach ($this->archiveBuilders as $builder) { $names[] = $builder->getName(); } diff --git a/core/lib/Thelia/Core/FileFormat/Formatting/Formatter/JsonFormatter.php b/core/lib/Thelia/Core/FileFormat/Formatting/Formatter/JsonFormatter.php index 75a4a9148..a8cd9f3dd 100644 --- a/core/lib/Thelia/Core/FileFormat/Formatting/Formatter/JsonFormatter.php +++ b/core/lib/Thelia/Core/FileFormat/Formatting/Formatter/JsonFormatter.php @@ -92,4 +92,4 @@ class JsonFormatter extends AbstractFormatter { return ExportType::EXPORT_UNBOUNDED; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/FileFormat/Formatting/Formatter/XMLFormatter.php b/core/lib/Thelia/Core/FileFormat/Formatting/Formatter/XMLFormatter.php index df9a1b8d2..480054158 100644 --- a/core/lib/Thelia/Core/FileFormat/Formatting/Formatter/XMLFormatter.php +++ b/core/lib/Thelia/Core/FileFormat/Formatting/Formatter/XMLFormatter.php @@ -153,6 +153,7 @@ class XMLFormatter extends AbstractFormatter } $data = new FormatterData($this->getAliases()); + return $data->setData($array); } @@ -160,4 +161,4 @@ class XMLFormatter extends AbstractFormatter { return ExportType::EXPORT_UNBOUNDED; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/FileFormat/Formatting/FormatterData.php b/core/lib/Thelia/Core/FileFormat/Formatting/FormatterData.php index 707b7e374..d09338f45 100644 --- a/core/lib/Thelia/Core/FileFormat/Formatting/FormatterData.php +++ b/core/lib/Thelia/Core/FileFormat/Formatting/FormatterData.php @@ -65,7 +65,7 @@ class FormatterData } /** - * @param array $data + * @param array $data * @return $this * * Sets raw data with aliases @@ -75,6 +75,7 @@ class FormatterData { if (empty($this->aliases)) { $this->data = $data; + return $this; } @@ -84,7 +85,7 @@ class FormatterData } /** - * @param ModelCriteria $criteria + * @param ModelCriteria $criteria * @return $this|null * * Loads a model criteria. @@ -157,7 +158,7 @@ class FormatterData } /** - * @param array $row + * @param array $row * @return $this */ public function addRow(array $row) @@ -168,7 +169,7 @@ class FormatterData } /** - * @param int $index + * @param int $index * @return array|bool */ public function popRow($index = 0) @@ -183,7 +184,7 @@ class FormatterData } /** - * @param int $index + * @param int $index * @return array|bool * @throws \OutOfBoundsException */ @@ -208,8 +209,8 @@ class FormatterData } /** - * @param array $data - * @param array $aliases + * @param array $data + * @param array $aliases * @return array */ protected function reverseAliases(array $data, array $aliases) diff --git a/core/lib/Thelia/Core/FileFormat/Formatting/FormatterManager.php b/core/lib/Thelia/Core/FileFormat/Formatting/FormatterManager.php index f2334aebe..c5432ecf1 100644 --- a/core/lib/Thelia/Core/FileFormat/Formatting/FormatterManager.php +++ b/core/lib/Thelia/Core/FileFormat/Formatting/FormatterManager.php @@ -77,7 +77,7 @@ class FormatterManager $names = []; /** @var AbstractFormatter $formatter */ - foreach($this->formatters as $formatter) { + foreach ($this->formatters as $formatter) { $names[] = $formatter->getName(); } diff --git a/core/lib/Thelia/Core/Template/Loop/ArchiveBuilder.php b/core/lib/Thelia/Core/Template/Loop/ArchiveBuilder.php index 59a2b712a..b21eff052 100644 --- a/core/lib/Thelia/Core/Template/Loop/ArchiveBuilder.php +++ b/core/lib/Thelia/Core/Template/Loop/ArchiveBuilder.php @@ -39,15 +39,13 @@ class ArchiveBuilder extends BaseLoop implements ArraySearchLoopInterface $rawArchiveBuilders = array_change_key_case($service->getAll()); - $allowedArchiveBuilder = $this->getAllowed_archive_builder(); $archiveBuilders = []; if ($allowedArchiveBuilder !== null) { $allowedArchiveBuilder = explode(",", $allowedArchiveBuilder); - - foreach($allowedArchiveBuilder as $archiveBuilder) { + foreach ($allowedArchiveBuilder as $archiveBuilder) { $archiveBuilder = trim(strtolower($archiveBuilder)); if (isset($rawArchiveBuilders[$archiveBuilder])) { @@ -131,4 +129,4 @@ class ArchiveBuilder extends BaseLoop implements ArraySearchLoopInterface ) ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/Export.php b/core/lib/Thelia/Core/Template/Loop/Export.php index 1975832e5..30660c2da 100644 --- a/core/lib/Thelia/Core/Template/Loop/Export.php +++ b/core/lib/Thelia/Core/Template/Loop/Export.php @@ -34,4 +34,4 @@ class Export extends ImportExportType { return "ExportCategoryId"; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/ExportCategory.php b/core/lib/Thelia/Core/Template/Loop/ExportCategory.php index 3fc425a77..997e8edb5 100644 --- a/core/lib/Thelia/Core/Template/Loop/ExportCategory.php +++ b/core/lib/Thelia/Core/Template/Loop/ExportCategory.php @@ -25,4 +25,4 @@ class ExportCategory extends ImportExportCategory return ExportCategoryQuery::create(); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/Formatter.php b/core/lib/Thelia/Core/Template/Loop/Formatter.php index 4fd127154..849f2ecd9 100644 --- a/core/lib/Thelia/Core/Template/Loop/Formatter.php +++ b/core/lib/Thelia/Core/Template/Loop/Formatter.php @@ -140,4 +140,4 @@ class Formatter extends BaseLoop implements ArraySearchLoopInterface ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/Import.php b/core/lib/Thelia/Core/Template/Loop/Import.php index c730bd4f0..d8701c117 100644 --- a/core/lib/Thelia/Core/Template/Loop/Import.php +++ b/core/lib/Thelia/Core/Template/Loop/Import.php @@ -34,4 +34,4 @@ class Import extends ImportExportType { return "ImportCategoryId"; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/ImportCategory.php b/core/lib/Thelia/Core/Template/Loop/ImportCategory.php index 9b7b5f57d..bf54ee45d 100644 --- a/core/lib/Thelia/Core/Template/Loop/ImportCategory.php +++ b/core/lib/Thelia/Core/Template/Loop/ImportCategory.php @@ -24,4 +24,4 @@ class ImportCategory extends ImportExportCategory { return ImportCategoryQuery::create(); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/ImportExportCategory.php b/core/lib/Thelia/Core/Template/Loop/ImportExportCategory.php index d04094db2..4bf50ee69 100644 --- a/core/lib/Thelia/Core/Template/Loop/ImportExportCategory.php +++ b/core/lib/Thelia/Core/Template/Loop/ImportExportCategory.php @@ -37,8 +37,7 @@ abstract class ImportExportCategory extends BaseLoop implements PropelSearchLoop */ public function parseResults(LoopResult $loopResult) { - foreach ($loopResult->getResultDataCollection() as $category) - { + foreach ($loopResult->getResultDataCollection() as $category) { $loopResultRow = new LoopResultRow($category); $loopResultRow @@ -68,7 +67,7 @@ abstract class ImportExportCategory extends BaseLoop implements PropelSearchLoop if (null !== $orders = $this->getOrder()) { foreach ($orders as $order) { - switch($order) { + switch ($order) { case "id": $query->orderById(); break; @@ -133,4 +132,4 @@ abstract class ImportExportCategory extends BaseLoop implements PropelSearchLoop } abstract protected function getQueryModel(); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/ImportExportType.php b/core/lib/Thelia/Core/Template/Loop/ImportExportType.php index 1dee9a74c..d1f9a4802 100644 --- a/core/lib/Thelia/Core/Template/Loop/ImportExportType.php +++ b/core/lib/Thelia/Core/Template/Loop/ImportExportType.php @@ -14,7 +14,6 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\ModelCriteria; use Thelia\Core\Template\Element\BaseI18nLoop; -use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Element\PropelSearchLoopInterface; @@ -56,6 +55,7 @@ abstract class ImportExportType extends BaseI18nLoop implements PropelSearchLoop ->set("URL", $url) ->set("POSITION", $type->getPosition()) ->set("CATEGORY_ID", $type->getByName($this->getCategoryName())) + ->set("HANDLE_CLASS", $type->getHandleClass()) ; $loopResult->addRow($loopResultRow); @@ -76,7 +76,6 @@ abstract class ImportExportType extends BaseI18nLoop implements PropelSearchLoop $this->configureI18nProcessing($query, array('TITLE', 'DESCRIPTION')); - if (null !== $ids = $this->getId()) { $query->filterById($ids); } @@ -87,7 +86,7 @@ abstract class ImportExportType extends BaseI18nLoop implements PropelSearchLoop if (null !== $orders = $this->getOrder()) { foreach ($orders as $order) { - switch($order) { + switch ($order) { case "id": $query->orderById(); break; @@ -162,4 +161,4 @@ abstract class ImportExportType extends BaseI18nLoop implements PropelSearchLoop abstract protected function getQueryModel(); abstract protected function getCategoryName(); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Exception/FileNotFoundException.php b/core/lib/Thelia/Exception/FileNotFoundException.php index ceb27f5de..23157f80b 100644 --- a/core/lib/Thelia/Exception/FileNotFoundException.php +++ b/core/lib/Thelia/Exception/FileNotFoundException.php @@ -20,4 +20,4 @@ namespace Thelia\Exception; class FileNotFoundException extends \Exception { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Exception/FileNotReadableException.php b/core/lib/Thelia/Exception/FileNotReadableException.php index e88aa6441..7afdab25f 100644 --- a/core/lib/Thelia/Exception/FileNotReadableException.php +++ b/core/lib/Thelia/Exception/FileNotReadableException.php @@ -20,4 +20,4 @@ namespace Thelia\Exception; class FileNotReadableException extends \Exception { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Exception/HttpUrlException.php b/core/lib/Thelia/Exception/HttpUrlException.php index 18088a474..9e86e889b 100644 --- a/core/lib/Thelia/Exception/HttpUrlException.php +++ b/core/lib/Thelia/Exception/HttpUrlException.php @@ -20,4 +20,4 @@ namespace Thelia\Exception; class HttpUrlException extends \Exception { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Form/ExportForm.php b/core/lib/Thelia/Form/ExportForm.php index 62ba68065..9449127ba 100644 --- a/core/lib/Thelia/Form/ExportForm.php +++ b/core/lib/Thelia/Form/ExportForm.php @@ -13,7 +13,6 @@ namespace Thelia\Form; use Thelia\Core\HttpFoundation\Request; use Thelia\Core\Translation\Translator; -use Thelia\Form\BaseForm; /** * Class ExportForm @@ -24,7 +23,8 @@ class ExportForm extends BaseForm { protected $translator; - public function __construct(Request $request, $type= "form", $data = array(), $options = array()) { + public function __construct(Request $request, $type= "form", $data = array(), $options = array()) + { $this->translator = Translator::getInstance(); parent::__construct($request, $type, $data, $options); @@ -65,4 +65,4 @@ class ExportForm extends BaseForm { return "thelia_export"; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/ImportExport/Export/MailingExport.php b/core/lib/Thelia/ImportExport/Export/MailingExport.php index 982e45f56..060d431ff 100644 --- a/core/lib/Thelia/ImportExport/Export/MailingExport.php +++ b/core/lib/Thelia/ImportExport/Export/MailingExport.php @@ -11,7 +11,6 @@ /*************************************************************************************/ namespace Thelia\ImportExport\Export; -use Symfony\Component\DependencyInjection\ContainerInterface; use Thelia\Core\FileFormat\Formatting\FormatterData; use Thelia\Core\Translation\Translator; use Thelia\ImportExport\ExportHandler; diff --git a/core/lib/Thelia/Model/Base/Export.php b/core/lib/Thelia/Model/Base/Export.php index a2d8cb9a3..304bccdcd 100644 --- a/core/lib/Thelia/Model/Base/Export.php +++ b/core/lib/Thelia/Model/Base/Export.php @@ -65,6 +65,12 @@ abstract class Export implements ActiveRecordInterface */ protected $id; + /** + * The value for the ref field. + * @var string + */ + protected $ref; + /** * The value for the export_category_id field. * @var int @@ -78,10 +84,10 @@ abstract class Export implements ActiveRecordInterface protected $position; /** - * The value for the handleclass field. + * The value for the handle_class field. * @var string */ - protected $handleclass; + protected $handle_class; /** * The value for the created_at field. @@ -403,6 +409,17 @@ abstract class Export implements ActiveRecordInterface return $this->id; } + /** + * Get the [ref] column value. + * + * @return string + */ + public function getRef() + { + + return $this->ref; + } + /** * Get the [export_category_id] column value. * @@ -426,14 +443,14 @@ abstract class Export implements ActiveRecordInterface } /** - * Get the [handleclass] column value. + * Get the [handle_class] column value. * * @return string */ - public function getHandleclass() + public function getHandleClass() { - return $this->handleclass; + return $this->handle_class; } /** @@ -497,6 +514,27 @@ abstract class Export implements ActiveRecordInterface return $this; } // setId() + /** + * Set the value of [ref] column. + * + * @param string $v new value + * @return \Thelia\Model\Export The current object (for fluent API support) + */ + public function setRef($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->ref !== $v) { + $this->ref = $v; + $this->modifiedColumns[ExportTableMap::REF] = true; + } + + + return $this; + } // setRef() + /** * Set the value of [export_category_id] column. * @@ -544,25 +582,25 @@ abstract class Export implements ActiveRecordInterface } // setPosition() /** - * Set the value of [handleclass] column. + * Set the value of [handle_class] column. * * @param string $v new value * @return \Thelia\Model\Export The current object (for fluent API support) */ - public function setHandleclass($v) + public function setHandleClass($v) { if ($v !== null) { $v = (string) $v; } - if ($this->handleclass !== $v) { - $this->handleclass = $v; - $this->modifiedColumns[ExportTableMap::HANDLECLASS] = true; + if ($this->handle_class !== $v) { + $this->handle_class = $v; + $this->modifiedColumns[ExportTableMap::HANDLE_CLASS] = true; } return $this; - } // setHandleclass() + } // setHandleClass() /** * Sets the value of [created_at] column to a normalized version of the date/time value specified. @@ -646,22 +684,25 @@ abstract class Export implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ExportTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)]; $this->id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ExportTableMap::translateFieldName('ExportCategoryId', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ExportTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)]; + $this->ref = (null !== $col) ? (string) $col : null; + + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ExportTableMap::translateFieldName('ExportCategoryId', TableMap::TYPE_PHPNAME, $indexType)]; $this->export_category_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ExportTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ExportTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; $this->position = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ExportTableMap::translateFieldName('Handleclass', TableMap::TYPE_PHPNAME, $indexType)]; - $this->handleclass = (null !== $col) ? (string) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ExportTableMap::translateFieldName('HandleClass', TableMap::TYPE_PHPNAME, $indexType)]; + $this->handle_class = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ExportTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ExportTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ExportTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ExportTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -674,7 +715,7 @@ abstract class Export implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 6; // 6 = ExportTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 7; // 7 = ExportTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating \Thelia\Model\Export object", 0, $e); @@ -932,14 +973,17 @@ abstract class Export implements ActiveRecordInterface if ($this->isColumnModified(ExportTableMap::ID)) { $modifiedColumns[':p' . $index++] = '`ID`'; } + if ($this->isColumnModified(ExportTableMap::REF)) { + $modifiedColumns[':p' . $index++] = '`REF`'; + } if ($this->isColumnModified(ExportTableMap::EXPORT_CATEGORY_ID)) { $modifiedColumns[':p' . $index++] = '`EXPORT_CATEGORY_ID`'; } if ($this->isColumnModified(ExportTableMap::POSITION)) { $modifiedColumns[':p' . $index++] = '`POSITION`'; } - if ($this->isColumnModified(ExportTableMap::HANDLECLASS)) { - $modifiedColumns[':p' . $index++] = '`HANDLECLASS`'; + if ($this->isColumnModified(ExportTableMap::HANDLE_CLASS)) { + $modifiedColumns[':p' . $index++] = '`HANDLE_CLASS`'; } if ($this->isColumnModified(ExportTableMap::CREATED_AT)) { $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; @@ -961,14 +1005,17 @@ abstract class Export implements ActiveRecordInterface case '`ID`': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; + case '`REF`': + $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); + break; case '`EXPORT_CATEGORY_ID`': $stmt->bindValue($identifier, $this->export_category_id, PDO::PARAM_INT); break; case '`POSITION`': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; - case '`HANDLECLASS`': - $stmt->bindValue($identifier, $this->handleclass, PDO::PARAM_STR); + case '`HANDLE_CLASS`': + $stmt->bindValue($identifier, $this->handle_class, PDO::PARAM_STR); break; case '`CREATED_AT`': $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); @@ -1042,18 +1089,21 @@ abstract class Export implements ActiveRecordInterface return $this->getId(); break; case 1: - return $this->getExportCategoryId(); + return $this->getRef(); break; case 2: - return $this->getPosition(); + return $this->getExportCategoryId(); break; case 3: - return $this->getHandleclass(); + return $this->getPosition(); break; case 4: - return $this->getCreatedAt(); + return $this->getHandleClass(); break; case 5: + return $this->getCreatedAt(); + break; + case 6: return $this->getUpdatedAt(); break; default: @@ -1086,11 +1136,12 @@ abstract class Export implements ActiveRecordInterface $keys = ExportTableMap::getFieldNames($keyType); $result = array( $keys[0] => $this->getId(), - $keys[1] => $this->getExportCategoryId(), - $keys[2] => $this->getPosition(), - $keys[3] => $this->getHandleclass(), - $keys[4] => $this->getCreatedAt(), - $keys[5] => $this->getUpdatedAt(), + $keys[1] => $this->getRef(), + $keys[2] => $this->getExportCategoryId(), + $keys[3] => $this->getPosition(), + $keys[4] => $this->getHandleClass(), + $keys[5] => $this->getCreatedAt(), + $keys[6] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -1142,18 +1193,21 @@ abstract class Export implements ActiveRecordInterface $this->setId($value); break; case 1: - $this->setExportCategoryId($value); + $this->setRef($value); break; case 2: - $this->setPosition($value); + $this->setExportCategoryId($value); break; case 3: - $this->setHandleclass($value); + $this->setPosition($value); break; case 4: - $this->setCreatedAt($value); + $this->setHandleClass($value); break; case 5: + $this->setCreatedAt($value); + break; + case 6: $this->setUpdatedAt($value); break; } // switch() @@ -1181,11 +1235,12 @@ abstract class Export implements ActiveRecordInterface $keys = ExportTableMap::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setExportCategoryId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setPosition($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setHandleclass($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setUpdatedAt($arr[$keys[5]]); + if (array_key_exists($keys[1], $arr)) $this->setRef($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setExportCategoryId($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setPosition($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setHandleClass($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]); } /** @@ -1198,9 +1253,10 @@ abstract class Export implements ActiveRecordInterface $criteria = new Criteria(ExportTableMap::DATABASE_NAME); if ($this->isColumnModified(ExportTableMap::ID)) $criteria->add(ExportTableMap::ID, $this->id); + if ($this->isColumnModified(ExportTableMap::REF)) $criteria->add(ExportTableMap::REF, $this->ref); if ($this->isColumnModified(ExportTableMap::EXPORT_CATEGORY_ID)) $criteria->add(ExportTableMap::EXPORT_CATEGORY_ID, $this->export_category_id); if ($this->isColumnModified(ExportTableMap::POSITION)) $criteria->add(ExportTableMap::POSITION, $this->position); - if ($this->isColumnModified(ExportTableMap::HANDLECLASS)) $criteria->add(ExportTableMap::HANDLECLASS, $this->handleclass); + if ($this->isColumnModified(ExportTableMap::HANDLE_CLASS)) $criteria->add(ExportTableMap::HANDLE_CLASS, $this->handle_class); if ($this->isColumnModified(ExportTableMap::CREATED_AT)) $criteria->add(ExportTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(ExportTableMap::UPDATED_AT)) $criteria->add(ExportTableMap::UPDATED_AT, $this->updated_at); @@ -1266,9 +1322,10 @@ abstract class Export implements ActiveRecordInterface */ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { + $copyObj->setRef($this->getRef()); $copyObj->setExportCategoryId($this->getExportCategoryId()); $copyObj->setPosition($this->getPosition()); - $copyObj->setHandleclass($this->getHandleclass()); + $copyObj->setHandleClass($this->getHandleClass()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); @@ -1611,9 +1668,10 @@ abstract class Export implements ActiveRecordInterface public function clear() { $this->id = null; + $this->ref = null; $this->export_category_id = null; $this->position = null; - $this->handleclass = null; + $this->handle_class = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; diff --git a/core/lib/Thelia/Model/Base/ExportCategory.php b/core/lib/Thelia/Model/Base/ExportCategory.php index c100fc5b9..6f7ce72ec 100644 --- a/core/lib/Thelia/Model/Base/ExportCategory.php +++ b/core/lib/Thelia/Model/Base/ExportCategory.php @@ -65,6 +65,12 @@ abstract class ExportCategory implements ActiveRecordInterface */ protected $id; + /** + * The value for the ref field. + * @var string + */ + protected $ref; + /** * The value for the position field. * @var int @@ -398,6 +404,17 @@ abstract class ExportCategory implements ActiveRecordInterface return $this->id; } + /** + * Get the [ref] column value. + * + * @return string + */ + public function getRef() + { + + return $this->ref; + } + /** * Get the [position] column value. * @@ -470,6 +487,27 @@ abstract class ExportCategory implements ActiveRecordInterface return $this; } // setId() + /** + * Set the value of [ref] column. + * + * @param string $v new value + * @return \Thelia\Model\ExportCategory The current object (for fluent API support) + */ + public function setRef($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->ref !== $v) { + $this->ref = $v; + $this->modifiedColumns[ExportCategoryTableMap::REF] = true; + } + + + return $this; + } // setRef() + /** * Set the value of [position] column. * @@ -573,16 +611,19 @@ abstract class ExportCategory implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ExportCategoryTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)]; $this->id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ExportCategoryTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ExportCategoryTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)]; + $this->ref = (null !== $col) ? (string) $col : null; + + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ExportCategoryTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; $this->position = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ExportCategoryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ExportCategoryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ExportCategoryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ExportCategoryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -595,7 +636,7 @@ abstract class ExportCategory implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 4; // 4 = ExportCategoryTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 5; // 5 = ExportCategoryTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating \Thelia\Model\ExportCategory object", 0, $e); @@ -856,6 +897,9 @@ abstract class ExportCategory implements ActiveRecordInterface if ($this->isColumnModified(ExportCategoryTableMap::ID)) { $modifiedColumns[':p' . $index++] = '`ID`'; } + if ($this->isColumnModified(ExportCategoryTableMap::REF)) { + $modifiedColumns[':p' . $index++] = '`REF`'; + } if ($this->isColumnModified(ExportCategoryTableMap::POSITION)) { $modifiedColumns[':p' . $index++] = '`POSITION`'; } @@ -879,6 +923,9 @@ abstract class ExportCategory implements ActiveRecordInterface case '`ID`': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; + case '`REF`': + $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); + break; case '`POSITION`': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; @@ -954,12 +1001,15 @@ abstract class ExportCategory implements ActiveRecordInterface return $this->getId(); break; case 1: - return $this->getPosition(); + return $this->getRef(); break; case 2: - return $this->getCreatedAt(); + return $this->getPosition(); break; case 3: + return $this->getCreatedAt(); + break; + case 4: return $this->getUpdatedAt(); break; default: @@ -992,9 +1042,10 @@ abstract class ExportCategory implements ActiveRecordInterface $keys = ExportCategoryTableMap::getFieldNames($keyType); $result = array( $keys[0] => $this->getId(), - $keys[1] => $this->getPosition(), - $keys[2] => $this->getCreatedAt(), - $keys[3] => $this->getUpdatedAt(), + $keys[1] => $this->getRef(), + $keys[2] => $this->getPosition(), + $keys[3] => $this->getCreatedAt(), + $keys[4] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -1046,12 +1097,15 @@ abstract class ExportCategory implements ActiveRecordInterface $this->setId($value); break; case 1: - $this->setPosition($value); + $this->setRef($value); break; case 2: - $this->setCreatedAt($value); + $this->setPosition($value); break; case 3: + $this->setCreatedAt($value); + break; + case 4: $this->setUpdatedAt($value); break; } // switch() @@ -1079,9 +1133,10 @@ abstract class ExportCategory implements ActiveRecordInterface $keys = ExportCategoryTableMap::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setPosition($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setCreatedAt($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]); + if (array_key_exists($keys[1], $arr)) $this->setRef($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setPosition($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]); } /** @@ -1094,6 +1149,7 @@ abstract class ExportCategory implements ActiveRecordInterface $criteria = new Criteria(ExportCategoryTableMap::DATABASE_NAME); if ($this->isColumnModified(ExportCategoryTableMap::ID)) $criteria->add(ExportCategoryTableMap::ID, $this->id); + if ($this->isColumnModified(ExportCategoryTableMap::REF)) $criteria->add(ExportCategoryTableMap::REF, $this->ref); if ($this->isColumnModified(ExportCategoryTableMap::POSITION)) $criteria->add(ExportCategoryTableMap::POSITION, $this->position); if ($this->isColumnModified(ExportCategoryTableMap::CREATED_AT)) $criteria->add(ExportCategoryTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(ExportCategoryTableMap::UPDATED_AT)) $criteria->add(ExportCategoryTableMap::UPDATED_AT, $this->updated_at); @@ -1160,6 +1216,7 @@ abstract class ExportCategory implements ActiveRecordInterface */ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { + $copyObj->setRef($this->getRef()); $copyObj->setPosition($this->getPosition()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); @@ -1679,6 +1736,7 @@ abstract class ExportCategory implements ActiveRecordInterface public function clear() { $this->id = null; + $this->ref = null; $this->position = null; $this->created_at = null; $this->updated_at = null; diff --git a/core/lib/Thelia/Model/Base/ExportCategoryQuery.php b/core/lib/Thelia/Model/Base/ExportCategoryQuery.php index af24f3f5a..a24b1f8e3 100644 --- a/core/lib/Thelia/Model/Base/ExportCategoryQuery.php +++ b/core/lib/Thelia/Model/Base/ExportCategoryQuery.php @@ -23,11 +23,13 @@ use Thelia\Model\Map\ExportCategoryTableMap; * * * @method ChildExportCategoryQuery orderById($order = Criteria::ASC) Order by the id column + * @method ChildExportCategoryQuery orderByRef($order = Criteria::ASC) Order by the ref column * @method ChildExportCategoryQuery orderByPosition($order = Criteria::ASC) Order by the position column * @method ChildExportCategoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildExportCategoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * * @method ChildExportCategoryQuery groupById() Group by the id column + * @method ChildExportCategoryQuery groupByRef() Group by the ref column * @method ChildExportCategoryQuery groupByPosition() Group by the position column * @method ChildExportCategoryQuery groupByCreatedAt() Group by the created_at column * @method ChildExportCategoryQuery groupByUpdatedAt() Group by the updated_at column @@ -48,11 +50,13 @@ use Thelia\Model\Map\ExportCategoryTableMap; * @method ChildExportCategory findOneOrCreate(ConnectionInterface $con = null) Return the first ChildExportCategory matching the query, or a new ChildExportCategory object populated from the query conditions when no match is found * * @method ChildExportCategory findOneById(int $id) Return the first ChildExportCategory filtered by the id column + * @method ChildExportCategory findOneByRef(string $ref) Return the first ChildExportCategory filtered by the ref column * @method ChildExportCategory findOneByPosition(int $position) Return the first ChildExportCategory filtered by the position column * @method ChildExportCategory findOneByCreatedAt(string $created_at) Return the first ChildExportCategory filtered by the created_at column * @method ChildExportCategory findOneByUpdatedAt(string $updated_at) Return the first ChildExportCategory filtered by the updated_at column * * @method array findById(int $id) Return ChildExportCategory objects filtered by the id column + * @method array findByRef(string $ref) Return ChildExportCategory objects filtered by the ref column * @method array findByPosition(int $position) Return ChildExportCategory objects filtered by the position column * @method array findByCreatedAt(string $created_at) Return ChildExportCategory objects filtered by the created_at column * @method array findByUpdatedAt(string $updated_at) Return ChildExportCategory objects filtered by the updated_at column @@ -144,7 +148,7 @@ abstract class ExportCategoryQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `export_category` WHERE `ID` = :p0'; + $sql = 'SELECT `ID`, `REF`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `export_category` WHERE `ID` = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -274,6 +278,35 @@ abstract class ExportCategoryQuery extends ModelCriteria return $this->addUsingAlias(ExportCategoryTableMap::ID, $id, $comparison); } + /** + * Filter the query on the ref column + * + * Example usage: + * + * $query->filterByRef('fooValue'); // WHERE ref = 'fooValue' + * $query->filterByRef('%fooValue%'); // WHERE ref LIKE '%fooValue%' + * + * + * @param string $ref The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildExportCategoryQuery The current query, for fluid interface + */ + public function filterByRef($ref = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($ref)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $ref)) { + $ref = str_replace('*', '%', $ref); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(ExportCategoryTableMap::REF, $ref, $comparison); + } + /** * Filter the query on the position column * diff --git a/core/lib/Thelia/Model/Base/ExportQuery.php b/core/lib/Thelia/Model/Base/ExportQuery.php index 65e266d73..73397efb2 100644 --- a/core/lib/Thelia/Model/Base/ExportQuery.php +++ b/core/lib/Thelia/Model/Base/ExportQuery.php @@ -23,16 +23,18 @@ use Thelia\Model\Map\ExportTableMap; * * * @method ChildExportQuery orderById($order = Criteria::ASC) Order by the id column + * @method ChildExportQuery orderByRef($order = Criteria::ASC) Order by the ref column * @method ChildExportQuery orderByExportCategoryId($order = Criteria::ASC) Order by the export_category_id column * @method ChildExportQuery orderByPosition($order = Criteria::ASC) Order by the position column - * @method ChildExportQuery orderByHandleclass($order = Criteria::ASC) Order by the handleClass column + * @method ChildExportQuery orderByHandleClass($order = Criteria::ASC) Order by the handle_class column * @method ChildExportQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildExportQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * * @method ChildExportQuery groupById() Group by the id column + * @method ChildExportQuery groupByRef() Group by the ref column * @method ChildExportQuery groupByExportCategoryId() Group by the export_category_id column * @method ChildExportQuery groupByPosition() Group by the position column - * @method ChildExportQuery groupByHandleclass() Group by the handleClass column + * @method ChildExportQuery groupByHandleClass() Group by the handle_class column * @method ChildExportQuery groupByCreatedAt() Group by the created_at column * @method ChildExportQuery groupByUpdatedAt() Group by the updated_at column * @@ -52,16 +54,18 @@ use Thelia\Model\Map\ExportTableMap; * @method ChildExport findOneOrCreate(ConnectionInterface $con = null) Return the first ChildExport matching the query, or a new ChildExport object populated from the query conditions when no match is found * * @method ChildExport findOneById(int $id) Return the first ChildExport filtered by the id column + * @method ChildExport findOneByRef(string $ref) Return the first ChildExport filtered by the ref column * @method ChildExport findOneByExportCategoryId(int $export_category_id) Return the first ChildExport filtered by the export_category_id column * @method ChildExport findOneByPosition(int $position) Return the first ChildExport filtered by the position column - * @method ChildExport findOneByHandleclass(string $handleClass) Return the first ChildExport filtered by the handleClass column + * @method ChildExport findOneByHandleClass(string $handle_class) Return the first ChildExport filtered by the handle_class column * @method ChildExport findOneByCreatedAt(string $created_at) Return the first ChildExport filtered by the created_at column * @method ChildExport findOneByUpdatedAt(string $updated_at) Return the first ChildExport filtered by the updated_at column * * @method array findById(int $id) Return ChildExport objects filtered by the id column + * @method array findByRef(string $ref) Return ChildExport objects filtered by the ref column * @method array findByExportCategoryId(int $export_category_id) Return ChildExport objects filtered by the export_category_id column * @method array findByPosition(int $position) Return ChildExport objects filtered by the position column - * @method array findByHandleclass(string $handleClass) Return ChildExport objects filtered by the handleClass column + * @method array findByHandleClass(string $handle_class) Return ChildExport objects filtered by the handle_class column * @method array findByCreatedAt(string $created_at) Return ChildExport objects filtered by the created_at column * @method array findByUpdatedAt(string $updated_at) Return ChildExport objects filtered by the updated_at column * @@ -152,7 +156,7 @@ abstract class ExportQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `EXPORT_CATEGORY_ID`, `POSITION`, `HANDLECLASS`, `CREATED_AT`, `UPDATED_AT` FROM `export` WHERE `ID` = :p0'; + $sql = 'SELECT `ID`, `REF`, `EXPORT_CATEGORY_ID`, `POSITION`, `HANDLE_CLASS`, `CREATED_AT`, `UPDATED_AT` FROM `export` WHERE `ID` = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -282,6 +286,35 @@ abstract class ExportQuery extends ModelCriteria return $this->addUsingAlias(ExportTableMap::ID, $id, $comparison); } + /** + * Filter the query on the ref column + * + * Example usage: + * + * $query->filterByRef('fooValue'); // WHERE ref = 'fooValue' + * $query->filterByRef('%fooValue%'); // WHERE ref LIKE '%fooValue%' + * + * + * @param string $ref The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildExportQuery The current query, for fluid interface + */ + public function filterByRef($ref = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($ref)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $ref)) { + $ref = str_replace('*', '%', $ref); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(ExportTableMap::REF, $ref, $comparison); + } + /** * Filter the query on the export_category_id column * @@ -367,32 +400,32 @@ abstract class ExportQuery extends ModelCriteria } /** - * Filter the query on the handleClass column + * Filter the query on the handle_class column * * Example usage: * - * $query->filterByHandleclass('fooValue'); // WHERE handleClass = 'fooValue' - * $query->filterByHandleclass('%fooValue%'); // WHERE handleClass LIKE '%fooValue%' + * $query->filterByHandleClass('fooValue'); // WHERE handle_class = 'fooValue' + * $query->filterByHandleClass('%fooValue%'); // WHERE handle_class LIKE '%fooValue%' * * - * @param string $handleclass The value to use as filter. + * @param string $handleClass The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildExportQuery The current query, for fluid interface */ - public function filterByHandleclass($handleclass = null, $comparison = null) + public function filterByHandleClass($handleClass = null, $comparison = null) { if (null === $comparison) { - if (is_array($handleclass)) { + if (is_array($handleClass)) { $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $handleclass)) { - $handleclass = str_replace('*', '%', $handleclass); + } elseif (preg_match('/[\%\*]/', $handleClass)) { + $handleClass = str_replace('*', '%', $handleClass); $comparison = Criteria::LIKE; } } - return $this->addUsingAlias(ExportTableMap::HANDLECLASS, $handleclass, $comparison); + return $this->addUsingAlias(ExportTableMap::HANDLE_CLASS, $handleClass, $comparison); } /** diff --git a/core/lib/Thelia/Model/Base/Import.php b/core/lib/Thelia/Model/Base/Import.php index 180125c2e..0b65b3867 100644 --- a/core/lib/Thelia/Model/Base/Import.php +++ b/core/lib/Thelia/Model/Base/Import.php @@ -65,6 +65,12 @@ abstract class Import implements ActiveRecordInterface */ protected $id; + /** + * The value for the ref field. + * @var string + */ + protected $ref; + /** * The value for the import_category_id field. * @var int @@ -78,10 +84,10 @@ abstract class Import implements ActiveRecordInterface protected $position; /** - * The value for the handleclass field. + * The value for the handle_class field. * @var string */ - protected $handleclass; + protected $handle_class; /** * The value for the created_at field. @@ -403,6 +409,17 @@ abstract class Import implements ActiveRecordInterface return $this->id; } + /** + * Get the [ref] column value. + * + * @return string + */ + public function getRef() + { + + return $this->ref; + } + /** * Get the [import_category_id] column value. * @@ -426,14 +443,14 @@ abstract class Import implements ActiveRecordInterface } /** - * Get the [handleclass] column value. + * Get the [handle_class] column value. * * @return string */ - public function getHandleclass() + public function getHandleClass() { - return $this->handleclass; + return $this->handle_class; } /** @@ -497,6 +514,27 @@ abstract class Import implements ActiveRecordInterface return $this; } // setId() + /** + * Set the value of [ref] column. + * + * @param string $v new value + * @return \Thelia\Model\Import The current object (for fluent API support) + */ + public function setRef($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->ref !== $v) { + $this->ref = $v; + $this->modifiedColumns[ImportTableMap::REF] = true; + } + + + return $this; + } // setRef() + /** * Set the value of [import_category_id] column. * @@ -544,25 +582,25 @@ abstract class Import implements ActiveRecordInterface } // setPosition() /** - * Set the value of [handleclass] column. + * Set the value of [handle_class] column. * * @param string $v new value * @return \Thelia\Model\Import The current object (for fluent API support) */ - public function setHandleclass($v) + public function setHandleClass($v) { if ($v !== null) { $v = (string) $v; } - if ($this->handleclass !== $v) { - $this->handleclass = $v; - $this->modifiedColumns[ImportTableMap::HANDLECLASS] = true; + if ($this->handle_class !== $v) { + $this->handle_class = $v; + $this->modifiedColumns[ImportTableMap::HANDLE_CLASS] = true; } return $this; - } // setHandleclass() + } // setHandleClass() /** * Sets the value of [created_at] column to a normalized version of the date/time value specified. @@ -646,22 +684,25 @@ abstract class Import implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ImportTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)]; $this->id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ImportTableMap::translateFieldName('ImportCategoryId', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ImportTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)]; + $this->ref = (null !== $col) ? (string) $col : null; + + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ImportTableMap::translateFieldName('ImportCategoryId', TableMap::TYPE_PHPNAME, $indexType)]; $this->import_category_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ImportTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ImportTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; $this->position = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ImportTableMap::translateFieldName('Handleclass', TableMap::TYPE_PHPNAME, $indexType)]; - $this->handleclass = (null !== $col) ? (string) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ImportTableMap::translateFieldName('HandleClass', TableMap::TYPE_PHPNAME, $indexType)]; + $this->handle_class = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ImportTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ImportTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ImportTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ImportTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -674,7 +715,7 @@ abstract class Import implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 6; // 6 = ImportTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 7; // 7 = ImportTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating \Thelia\Model\Import object", 0, $e); @@ -932,14 +973,17 @@ abstract class Import implements ActiveRecordInterface if ($this->isColumnModified(ImportTableMap::ID)) { $modifiedColumns[':p' . $index++] = '`ID`'; } + if ($this->isColumnModified(ImportTableMap::REF)) { + $modifiedColumns[':p' . $index++] = '`REF`'; + } if ($this->isColumnModified(ImportTableMap::IMPORT_CATEGORY_ID)) { $modifiedColumns[':p' . $index++] = '`IMPORT_CATEGORY_ID`'; } if ($this->isColumnModified(ImportTableMap::POSITION)) { $modifiedColumns[':p' . $index++] = '`POSITION`'; } - if ($this->isColumnModified(ImportTableMap::HANDLECLASS)) { - $modifiedColumns[':p' . $index++] = '`HANDLECLASS`'; + if ($this->isColumnModified(ImportTableMap::HANDLE_CLASS)) { + $modifiedColumns[':p' . $index++] = '`HANDLE_CLASS`'; } if ($this->isColumnModified(ImportTableMap::CREATED_AT)) { $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; @@ -961,14 +1005,17 @@ abstract class Import implements ActiveRecordInterface case '`ID`': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; + case '`REF`': + $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); + break; case '`IMPORT_CATEGORY_ID`': $stmt->bindValue($identifier, $this->import_category_id, PDO::PARAM_INT); break; case '`POSITION`': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; - case '`HANDLECLASS`': - $stmt->bindValue($identifier, $this->handleclass, PDO::PARAM_STR); + case '`HANDLE_CLASS`': + $stmt->bindValue($identifier, $this->handle_class, PDO::PARAM_STR); break; case '`CREATED_AT`': $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); @@ -1042,18 +1089,21 @@ abstract class Import implements ActiveRecordInterface return $this->getId(); break; case 1: - return $this->getImportCategoryId(); + return $this->getRef(); break; case 2: - return $this->getPosition(); + return $this->getImportCategoryId(); break; case 3: - return $this->getHandleclass(); + return $this->getPosition(); break; case 4: - return $this->getCreatedAt(); + return $this->getHandleClass(); break; case 5: + return $this->getCreatedAt(); + break; + case 6: return $this->getUpdatedAt(); break; default: @@ -1086,11 +1136,12 @@ abstract class Import implements ActiveRecordInterface $keys = ImportTableMap::getFieldNames($keyType); $result = array( $keys[0] => $this->getId(), - $keys[1] => $this->getImportCategoryId(), - $keys[2] => $this->getPosition(), - $keys[3] => $this->getHandleclass(), - $keys[4] => $this->getCreatedAt(), - $keys[5] => $this->getUpdatedAt(), + $keys[1] => $this->getRef(), + $keys[2] => $this->getImportCategoryId(), + $keys[3] => $this->getPosition(), + $keys[4] => $this->getHandleClass(), + $keys[5] => $this->getCreatedAt(), + $keys[6] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -1142,18 +1193,21 @@ abstract class Import implements ActiveRecordInterface $this->setId($value); break; case 1: - $this->setImportCategoryId($value); + $this->setRef($value); break; case 2: - $this->setPosition($value); + $this->setImportCategoryId($value); break; case 3: - $this->setHandleclass($value); + $this->setPosition($value); break; case 4: - $this->setCreatedAt($value); + $this->setHandleClass($value); break; case 5: + $this->setCreatedAt($value); + break; + case 6: $this->setUpdatedAt($value); break; } // switch() @@ -1181,11 +1235,12 @@ abstract class Import implements ActiveRecordInterface $keys = ImportTableMap::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setImportCategoryId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setPosition($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setHandleclass($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setUpdatedAt($arr[$keys[5]]); + if (array_key_exists($keys[1], $arr)) $this->setRef($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setImportCategoryId($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setPosition($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setHandleClass($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]); } /** @@ -1198,9 +1253,10 @@ abstract class Import implements ActiveRecordInterface $criteria = new Criteria(ImportTableMap::DATABASE_NAME); if ($this->isColumnModified(ImportTableMap::ID)) $criteria->add(ImportTableMap::ID, $this->id); + if ($this->isColumnModified(ImportTableMap::REF)) $criteria->add(ImportTableMap::REF, $this->ref); if ($this->isColumnModified(ImportTableMap::IMPORT_CATEGORY_ID)) $criteria->add(ImportTableMap::IMPORT_CATEGORY_ID, $this->import_category_id); if ($this->isColumnModified(ImportTableMap::POSITION)) $criteria->add(ImportTableMap::POSITION, $this->position); - if ($this->isColumnModified(ImportTableMap::HANDLECLASS)) $criteria->add(ImportTableMap::HANDLECLASS, $this->handleclass); + if ($this->isColumnModified(ImportTableMap::HANDLE_CLASS)) $criteria->add(ImportTableMap::HANDLE_CLASS, $this->handle_class); if ($this->isColumnModified(ImportTableMap::CREATED_AT)) $criteria->add(ImportTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(ImportTableMap::UPDATED_AT)) $criteria->add(ImportTableMap::UPDATED_AT, $this->updated_at); @@ -1266,9 +1322,10 @@ abstract class Import implements ActiveRecordInterface */ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { + $copyObj->setRef($this->getRef()); $copyObj->setImportCategoryId($this->getImportCategoryId()); $copyObj->setPosition($this->getPosition()); - $copyObj->setHandleclass($this->getHandleclass()); + $copyObj->setHandleClass($this->getHandleClass()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); @@ -1611,9 +1668,10 @@ abstract class Import implements ActiveRecordInterface public function clear() { $this->id = null; + $this->ref = null; $this->import_category_id = null; $this->position = null; - $this->handleclass = null; + $this->handle_class = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; diff --git a/core/lib/Thelia/Model/Base/ImportCategory.php b/core/lib/Thelia/Model/Base/ImportCategory.php index 83f3f2810..2822e810b 100644 --- a/core/lib/Thelia/Model/Base/ImportCategory.php +++ b/core/lib/Thelia/Model/Base/ImportCategory.php @@ -65,6 +65,12 @@ abstract class ImportCategory implements ActiveRecordInterface */ protected $id; + /** + * The value for the ref field. + * @var string + */ + protected $ref; + /** * The value for the position field. * @var int @@ -398,6 +404,17 @@ abstract class ImportCategory implements ActiveRecordInterface return $this->id; } + /** + * Get the [ref] column value. + * + * @return string + */ + public function getRef() + { + + return $this->ref; + } + /** * Get the [position] column value. * @@ -470,6 +487,27 @@ abstract class ImportCategory implements ActiveRecordInterface return $this; } // setId() + /** + * Set the value of [ref] column. + * + * @param string $v new value + * @return \Thelia\Model\ImportCategory The current object (for fluent API support) + */ + public function setRef($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->ref !== $v) { + $this->ref = $v; + $this->modifiedColumns[ImportCategoryTableMap::REF] = true; + } + + + return $this; + } // setRef() + /** * Set the value of [position] column. * @@ -573,16 +611,19 @@ abstract class ImportCategory implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ImportCategoryTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)]; $this->id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ImportCategoryTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ImportCategoryTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)]; + $this->ref = (null !== $col) ? (string) $col : null; + + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ImportCategoryTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; $this->position = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ImportCategoryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ImportCategoryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ImportCategoryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ImportCategoryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -595,7 +636,7 @@ abstract class ImportCategory implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 4; // 4 = ImportCategoryTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 5; // 5 = ImportCategoryTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating \Thelia\Model\ImportCategory object", 0, $e); @@ -856,6 +897,9 @@ abstract class ImportCategory implements ActiveRecordInterface if ($this->isColumnModified(ImportCategoryTableMap::ID)) { $modifiedColumns[':p' . $index++] = '`ID`'; } + if ($this->isColumnModified(ImportCategoryTableMap::REF)) { + $modifiedColumns[':p' . $index++] = '`REF`'; + } if ($this->isColumnModified(ImportCategoryTableMap::POSITION)) { $modifiedColumns[':p' . $index++] = '`POSITION`'; } @@ -879,6 +923,9 @@ abstract class ImportCategory implements ActiveRecordInterface case '`ID`': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; + case '`REF`': + $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); + break; case '`POSITION`': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; @@ -954,12 +1001,15 @@ abstract class ImportCategory implements ActiveRecordInterface return $this->getId(); break; case 1: - return $this->getPosition(); + return $this->getRef(); break; case 2: - return $this->getCreatedAt(); + return $this->getPosition(); break; case 3: + return $this->getCreatedAt(); + break; + case 4: return $this->getUpdatedAt(); break; default: @@ -992,9 +1042,10 @@ abstract class ImportCategory implements ActiveRecordInterface $keys = ImportCategoryTableMap::getFieldNames($keyType); $result = array( $keys[0] => $this->getId(), - $keys[1] => $this->getPosition(), - $keys[2] => $this->getCreatedAt(), - $keys[3] => $this->getUpdatedAt(), + $keys[1] => $this->getRef(), + $keys[2] => $this->getPosition(), + $keys[3] => $this->getCreatedAt(), + $keys[4] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -1046,12 +1097,15 @@ abstract class ImportCategory implements ActiveRecordInterface $this->setId($value); break; case 1: - $this->setPosition($value); + $this->setRef($value); break; case 2: - $this->setCreatedAt($value); + $this->setPosition($value); break; case 3: + $this->setCreatedAt($value); + break; + case 4: $this->setUpdatedAt($value); break; } // switch() @@ -1079,9 +1133,10 @@ abstract class ImportCategory implements ActiveRecordInterface $keys = ImportCategoryTableMap::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setPosition($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setCreatedAt($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]); + if (array_key_exists($keys[1], $arr)) $this->setRef($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setPosition($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]); } /** @@ -1094,6 +1149,7 @@ abstract class ImportCategory implements ActiveRecordInterface $criteria = new Criteria(ImportCategoryTableMap::DATABASE_NAME); if ($this->isColumnModified(ImportCategoryTableMap::ID)) $criteria->add(ImportCategoryTableMap::ID, $this->id); + if ($this->isColumnModified(ImportCategoryTableMap::REF)) $criteria->add(ImportCategoryTableMap::REF, $this->ref); if ($this->isColumnModified(ImportCategoryTableMap::POSITION)) $criteria->add(ImportCategoryTableMap::POSITION, $this->position); if ($this->isColumnModified(ImportCategoryTableMap::CREATED_AT)) $criteria->add(ImportCategoryTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(ImportCategoryTableMap::UPDATED_AT)) $criteria->add(ImportCategoryTableMap::UPDATED_AT, $this->updated_at); @@ -1160,6 +1216,7 @@ abstract class ImportCategory implements ActiveRecordInterface */ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { + $copyObj->setRef($this->getRef()); $copyObj->setPosition($this->getPosition()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); @@ -1679,6 +1736,7 @@ abstract class ImportCategory implements ActiveRecordInterface public function clear() { $this->id = null; + $this->ref = null; $this->position = null; $this->created_at = null; $this->updated_at = null; diff --git a/core/lib/Thelia/Model/Base/ImportCategoryQuery.php b/core/lib/Thelia/Model/Base/ImportCategoryQuery.php index 9c00639ad..a9dd3115c 100644 --- a/core/lib/Thelia/Model/Base/ImportCategoryQuery.php +++ b/core/lib/Thelia/Model/Base/ImportCategoryQuery.php @@ -23,11 +23,13 @@ use Thelia\Model\Map\ImportCategoryTableMap; * * * @method ChildImportCategoryQuery orderById($order = Criteria::ASC) Order by the id column + * @method ChildImportCategoryQuery orderByRef($order = Criteria::ASC) Order by the ref column * @method ChildImportCategoryQuery orderByPosition($order = Criteria::ASC) Order by the position column * @method ChildImportCategoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildImportCategoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * * @method ChildImportCategoryQuery groupById() Group by the id column + * @method ChildImportCategoryQuery groupByRef() Group by the ref column * @method ChildImportCategoryQuery groupByPosition() Group by the position column * @method ChildImportCategoryQuery groupByCreatedAt() Group by the created_at column * @method ChildImportCategoryQuery groupByUpdatedAt() Group by the updated_at column @@ -48,11 +50,13 @@ use Thelia\Model\Map\ImportCategoryTableMap; * @method ChildImportCategory findOneOrCreate(ConnectionInterface $con = null) Return the first ChildImportCategory matching the query, or a new ChildImportCategory object populated from the query conditions when no match is found * * @method ChildImportCategory findOneById(int $id) Return the first ChildImportCategory filtered by the id column + * @method ChildImportCategory findOneByRef(string $ref) Return the first ChildImportCategory filtered by the ref column * @method ChildImportCategory findOneByPosition(int $position) Return the first ChildImportCategory filtered by the position column * @method ChildImportCategory findOneByCreatedAt(string $created_at) Return the first ChildImportCategory filtered by the created_at column * @method ChildImportCategory findOneByUpdatedAt(string $updated_at) Return the first ChildImportCategory filtered by the updated_at column * * @method array findById(int $id) Return ChildImportCategory objects filtered by the id column + * @method array findByRef(string $ref) Return ChildImportCategory objects filtered by the ref column * @method array findByPosition(int $position) Return ChildImportCategory objects filtered by the position column * @method array findByCreatedAt(string $created_at) Return ChildImportCategory objects filtered by the created_at column * @method array findByUpdatedAt(string $updated_at) Return ChildImportCategory objects filtered by the updated_at column @@ -144,7 +148,7 @@ abstract class ImportCategoryQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `import_category` WHERE `ID` = :p0'; + $sql = 'SELECT `ID`, `REF`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `import_category` WHERE `ID` = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -274,6 +278,35 @@ abstract class ImportCategoryQuery extends ModelCriteria return $this->addUsingAlias(ImportCategoryTableMap::ID, $id, $comparison); } + /** + * Filter the query on the ref column + * + * Example usage: + * + * $query->filterByRef('fooValue'); // WHERE ref = 'fooValue' + * $query->filterByRef('%fooValue%'); // WHERE ref LIKE '%fooValue%' + * + * + * @param string $ref The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildImportCategoryQuery The current query, for fluid interface + */ + public function filterByRef($ref = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($ref)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $ref)) { + $ref = str_replace('*', '%', $ref); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(ImportCategoryTableMap::REF, $ref, $comparison); + } + /** * Filter the query on the position column * diff --git a/core/lib/Thelia/Model/Base/ImportQuery.php b/core/lib/Thelia/Model/Base/ImportQuery.php index 883783ebb..434952923 100644 --- a/core/lib/Thelia/Model/Base/ImportQuery.php +++ b/core/lib/Thelia/Model/Base/ImportQuery.php @@ -23,16 +23,18 @@ use Thelia\Model\Map\ImportTableMap; * * * @method ChildImportQuery orderById($order = Criteria::ASC) Order by the id column + * @method ChildImportQuery orderByRef($order = Criteria::ASC) Order by the ref column * @method ChildImportQuery orderByImportCategoryId($order = Criteria::ASC) Order by the import_category_id column * @method ChildImportQuery orderByPosition($order = Criteria::ASC) Order by the position column - * @method ChildImportQuery orderByHandleclass($order = Criteria::ASC) Order by the handleClass column + * @method ChildImportQuery orderByHandleClass($order = Criteria::ASC) Order by the handle_class column * @method ChildImportQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildImportQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * * @method ChildImportQuery groupById() Group by the id column + * @method ChildImportQuery groupByRef() Group by the ref column * @method ChildImportQuery groupByImportCategoryId() Group by the import_category_id column * @method ChildImportQuery groupByPosition() Group by the position column - * @method ChildImportQuery groupByHandleclass() Group by the handleClass column + * @method ChildImportQuery groupByHandleClass() Group by the handle_class column * @method ChildImportQuery groupByCreatedAt() Group by the created_at column * @method ChildImportQuery groupByUpdatedAt() Group by the updated_at column * @@ -52,16 +54,18 @@ use Thelia\Model\Map\ImportTableMap; * @method ChildImport findOneOrCreate(ConnectionInterface $con = null) Return the first ChildImport matching the query, or a new ChildImport object populated from the query conditions when no match is found * * @method ChildImport findOneById(int $id) Return the first ChildImport filtered by the id column + * @method ChildImport findOneByRef(string $ref) Return the first ChildImport filtered by the ref column * @method ChildImport findOneByImportCategoryId(int $import_category_id) Return the first ChildImport filtered by the import_category_id column * @method ChildImport findOneByPosition(int $position) Return the first ChildImport filtered by the position column - * @method ChildImport findOneByHandleclass(string $handleClass) Return the first ChildImport filtered by the handleClass column + * @method ChildImport findOneByHandleClass(string $handle_class) Return the first ChildImport filtered by the handle_class column * @method ChildImport findOneByCreatedAt(string $created_at) Return the first ChildImport filtered by the created_at column * @method ChildImport findOneByUpdatedAt(string $updated_at) Return the first ChildImport filtered by the updated_at column * * @method array findById(int $id) Return ChildImport objects filtered by the id column + * @method array findByRef(string $ref) Return ChildImport objects filtered by the ref column * @method array findByImportCategoryId(int $import_category_id) Return ChildImport objects filtered by the import_category_id column * @method array findByPosition(int $position) Return ChildImport objects filtered by the position column - * @method array findByHandleclass(string $handleClass) Return ChildImport objects filtered by the handleClass column + * @method array findByHandleClass(string $handle_class) Return ChildImport objects filtered by the handle_class column * @method array findByCreatedAt(string $created_at) Return ChildImport objects filtered by the created_at column * @method array findByUpdatedAt(string $updated_at) Return ChildImport objects filtered by the updated_at column * @@ -152,7 +156,7 @@ abstract class ImportQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `IMPORT_CATEGORY_ID`, `POSITION`, `HANDLECLASS`, `CREATED_AT`, `UPDATED_AT` FROM `import` WHERE `ID` = :p0'; + $sql = 'SELECT `ID`, `REF`, `IMPORT_CATEGORY_ID`, `POSITION`, `HANDLE_CLASS`, `CREATED_AT`, `UPDATED_AT` FROM `import` WHERE `ID` = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -282,6 +286,35 @@ abstract class ImportQuery extends ModelCriteria return $this->addUsingAlias(ImportTableMap::ID, $id, $comparison); } + /** + * Filter the query on the ref column + * + * Example usage: + * + * $query->filterByRef('fooValue'); // WHERE ref = 'fooValue' + * $query->filterByRef('%fooValue%'); // WHERE ref LIKE '%fooValue%' + * + * + * @param string $ref The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildImportQuery The current query, for fluid interface + */ + public function filterByRef($ref = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($ref)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $ref)) { + $ref = str_replace('*', '%', $ref); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(ImportTableMap::REF, $ref, $comparison); + } + /** * Filter the query on the import_category_id column * @@ -367,32 +400,32 @@ abstract class ImportQuery extends ModelCriteria } /** - * Filter the query on the handleClass column + * Filter the query on the handle_class column * * Example usage: * - * $query->filterByHandleclass('fooValue'); // WHERE handleClass = 'fooValue' - * $query->filterByHandleclass('%fooValue%'); // WHERE handleClass LIKE '%fooValue%' + * $query->filterByHandleClass('fooValue'); // WHERE handle_class = 'fooValue' + * $query->filterByHandleClass('%fooValue%'); // WHERE handle_class LIKE '%fooValue%' * * - * @param string $handleclass The value to use as filter. + * @param string $handleClass The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildImportQuery The current query, for fluid interface */ - public function filterByHandleclass($handleclass = null, $comparison = null) + public function filterByHandleClass($handleClass = null, $comparison = null) { if (null === $comparison) { - if (is_array($handleclass)) { + if (is_array($handleClass)) { $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $handleclass)) { - $handleclass = str_replace('*', '%', $handleclass); + } elseif (preg_match('/[\%\*]/', $handleClass)) { + $handleClass = str_replace('*', '%', $handleClass); $comparison = Criteria::LIKE; } } - return $this->addUsingAlias(ImportTableMap::HANDLECLASS, $handleclass, $comparison); + return $this->addUsingAlias(ImportTableMap::HANDLE_CLASS, $handleClass, $comparison); } /** diff --git a/core/lib/Thelia/Model/Export.php b/core/lib/Thelia/Model/Export.php index f71dad85d..f07fbfeaf 100644 --- a/core/lib/Thelia/Model/Export.php +++ b/core/lib/Thelia/Model/Export.php @@ -5,12 +5,16 @@ namespace Thelia\Model; use Propel\Runtime\ActiveQuery\Criteria; use Symfony\Component\DependencyInjection\ContainerInterface; use Thelia\Core\Translation\Translator; +use Thelia\ImportExport\DocumentsExportInterface; use Thelia\ImportExport\ExportHandler; +use Thelia\ImportExport\ImagesExportInterface; use Thelia\Model\Base\Export as BaseExport; use Thelia\Model\Map\ExportTableMap; class Export extends BaseExport { + protected static $cache; + public function upPosition() { @@ -75,8 +79,25 @@ class Export extends BaseExport $this->setPosition($position)->save(); } + public function setPositionToLast() + { + $max = ExportQuery::create() + ->orderByPosition(Criteria::DESC) + ->select(ExportTableMap::POSITION) + ->findOne() + ; + + if (null === $max) { + $this->setPosition(1); + } else { + $this->setPosition($max+1); + } + + return $this; + } + /** - * @param ContainerInterface $container + * @param ContainerInterface $container * @return ExportHandler * @throws \ErrorException */ @@ -113,6 +134,24 @@ class Export extends BaseExport ); } - return $instance; + return static::$cache = $instance; + } + + public function hasImages(ContainerInterface $container) + { + if (static::$cache === null) { + $this->getHandleClassInstance($container); + } + + return static::$cache instanceof ImagesExportInterface; + } + + public function hasDocuments(ContainerInterface $container) + { + if (static::$cache === null) { + $this->getHandleClassInstance($container); + } + + return static::$cache instanceof DocumentsExportInterface; } } diff --git a/core/lib/Thelia/Model/ExportCategory.php b/core/lib/Thelia/Model/ExportCategory.php index 2e3726e31..44f8dce9a 100644 --- a/core/lib/Thelia/Model/ExportCategory.php +++ b/core/lib/Thelia/Model/ExportCategory.php @@ -29,7 +29,7 @@ class ExportCategory extends BaseExportCategory public function downPosition() { - $max = CategoryQuery::create() + $max = ExportCategoryQuery::create() ->orderByPosition(Criteria::DESC) ->select(ExportCategoryTableMap::POSITION) ->findOne() @@ -71,4 +71,21 @@ class ExportCategory extends BaseExportCategory $this->setPosition($position)->save(); } -} \ No newline at end of file + + public function setPositionToLast() + { + $max = ExportCategoryQuery::create() + ->orderByPosition(Criteria::DESC) + ->select(ExportCategoryTableMap::POSITION) + ->findOne() + ; + + if (null === $max) { + $this->setPosition(1); + } else { + $this->setPosition($max+1); + } + + return $this; + } +} diff --git a/core/lib/Thelia/Model/ExportCategoryI18nQuery.php b/core/lib/Thelia/Model/ExportCategoryI18nQuery.php index f94fb50a7..d6b8ce7f7 100644 --- a/core/lib/Thelia/Model/ExportCategoryI18nQuery.php +++ b/core/lib/Thelia/Model/ExportCategoryI18nQuery.php @@ -4,7 +4,6 @@ namespace Thelia\Model; use Thelia\Model\Base\ExportCategoryI18nQuery as BaseExportCategoryI18nQuery; - /** * Skeleton subclass for performing query and update operations on the 'export_category_i18n' table. * diff --git a/core/lib/Thelia/Model/ExportCategoryQuery.php b/core/lib/Thelia/Model/ExportCategoryQuery.php index 6cc562245..44aae37d4 100644 --- a/core/lib/Thelia/Model/ExportCategoryQuery.php +++ b/core/lib/Thelia/Model/ExportCategoryQuery.php @@ -4,7 +4,6 @@ namespace Thelia\Model; use Thelia\Model\Base\ExportCategoryQuery as BaseExportCategoryQuery; - /** * Skeleton subclass for performing query and update operations on the 'export_category' table. * diff --git a/core/lib/Thelia/Model/ExportI18nQuery.php b/core/lib/Thelia/Model/ExportI18nQuery.php index d15febb24..a58a47783 100644 --- a/core/lib/Thelia/Model/ExportI18nQuery.php +++ b/core/lib/Thelia/Model/ExportI18nQuery.php @@ -4,7 +4,6 @@ namespace Thelia\Model; use Thelia\Model\Base\ExportI18nQuery as BaseExportI18nQuery; - /** * Skeleton subclass for performing query and update operations on the 'export_i18n' table. * diff --git a/core/lib/Thelia/Model/ExportQuery.php b/core/lib/Thelia/Model/ExportQuery.php index bec19d085..7273278a0 100644 --- a/core/lib/Thelia/Model/ExportQuery.php +++ b/core/lib/Thelia/Model/ExportQuery.php @@ -4,7 +4,6 @@ namespace Thelia\Model; use Thelia\Model\Base\ExportQuery as BaseExportQuery; - /** * Skeleton subclass for performing query and update operations on the 'export' table. * diff --git a/core/lib/Thelia/Model/ImportCategoryI18nQuery.php b/core/lib/Thelia/Model/ImportCategoryI18nQuery.php index fda0c35c5..be424d022 100644 --- a/core/lib/Thelia/Model/ImportCategoryI18nQuery.php +++ b/core/lib/Thelia/Model/ImportCategoryI18nQuery.php @@ -4,7 +4,6 @@ namespace Thelia\Model; use Thelia\Model\Base\ImportCategoryI18nQuery as BaseImportCategoryI18nQuery; - /** * Skeleton subclass for performing query and update operations on the 'import_category_i18n' table. * diff --git a/core/lib/Thelia/Model/ImportCategoryQuery.php b/core/lib/Thelia/Model/ImportCategoryQuery.php index 9169d9659..ff7cb3d19 100644 --- a/core/lib/Thelia/Model/ImportCategoryQuery.php +++ b/core/lib/Thelia/Model/ImportCategoryQuery.php @@ -4,7 +4,6 @@ namespace Thelia\Model; use Thelia\Model\Base\ImportCategoryQuery as BaseImportCategoryQuery; - /** * Skeleton subclass for performing query and update operations on the 'import_category' table. * diff --git a/core/lib/Thelia/Model/ImportI18nQuery.php b/core/lib/Thelia/Model/ImportI18nQuery.php index 274b8e893..522b1cf69 100644 --- a/core/lib/Thelia/Model/ImportI18nQuery.php +++ b/core/lib/Thelia/Model/ImportI18nQuery.php @@ -4,7 +4,6 @@ namespace Thelia\Model; use Thelia\Model\Base\ImportI18nQuery as BaseImportI18nQuery; - /** * Skeleton subclass for performing query and update operations on the 'import_i18n' table. * diff --git a/core/lib/Thelia/Model/ImportQuery.php b/core/lib/Thelia/Model/ImportQuery.php index d1219b1bc..3d5d6d3af 100644 --- a/core/lib/Thelia/Model/ImportQuery.php +++ b/core/lib/Thelia/Model/ImportQuery.php @@ -4,7 +4,6 @@ namespace Thelia\Model; use Thelia\Model\Base\ImportQuery as BaseImportQuery; - /** * Skeleton subclass for performing query and update operations on the 'import' table. * diff --git a/core/lib/Thelia/Model/Map/ExportCategoryTableMap.php b/core/lib/Thelia/Model/Map/ExportCategoryTableMap.php index 1d5f32451..b5888f849 100644 --- a/core/lib/Thelia/Model/Map/ExportCategoryTableMap.php +++ b/core/lib/Thelia/Model/Map/ExportCategoryTableMap.php @@ -58,7 +58,7 @@ class ExportCategoryTableMap extends TableMap /** * The total number of columns */ - const NUM_COLUMNS = 4; + const NUM_COLUMNS = 5; /** * The number of lazy-loaded columns @@ -68,13 +68,18 @@ class ExportCategoryTableMap extends TableMap /** * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 4; + const NUM_HYDRATE_COLUMNS = 5; /** * the column name for the ID field */ const ID = 'export_category.ID'; + /** + * the column name for the REF field + */ + const REF = 'export_category.REF'; + /** * the column name for the POSITION field */ @@ -111,12 +116,12 @@ class ExportCategoryTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('Id', 'Position', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'position', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(ExportCategoryTableMap::ID, ExportCategoryTableMap::POSITION, ExportCategoryTableMap::CREATED_AT, ExportCategoryTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'position', 'created_at', 'updated_at', ), - self::TYPE_NUM => array(0, 1, 2, 3, ) + self::TYPE_PHPNAME => array('Id', 'Ref', 'Position', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'position', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(ExportCategoryTableMap::ID, ExportCategoryTableMap::REF, ExportCategoryTableMap::POSITION, ExportCategoryTableMap::CREATED_AT, ExportCategoryTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'REF', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'ref', 'position', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -126,12 +131,12 @@ class ExportCategoryTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'Position' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'position' => 1, 'createdAt' => 2, 'updatedAt' => 3, ), - self::TYPE_COLNAME => array(ExportCategoryTableMap::ID => 0, ExportCategoryTableMap::POSITION => 1, ExportCategoryTableMap::CREATED_AT => 2, ExportCategoryTableMap::UPDATED_AT => 3, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'POSITION' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ), - self::TYPE_FIELDNAME => array('id' => 0, 'position' => 1, 'created_at' => 2, 'updated_at' => 3, ), - self::TYPE_NUM => array(0, 1, 2, 3, ) + self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'Position' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'position' => 2, 'createdAt' => 3, 'updatedAt' => 4, ), + self::TYPE_COLNAME => array(ExportCategoryTableMap::ID => 0, ExportCategoryTableMap::REF => 1, ExportCategoryTableMap::POSITION => 2, ExportCategoryTableMap::CREATED_AT => 3, ExportCategoryTableMap::UPDATED_AT => 4, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'POSITION' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ), + self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'position' => 2, 'created_at' => 3, 'updated_at' => 4, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -151,6 +156,7 @@ class ExportCategoryTableMap extends TableMap $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); + $this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null); $this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); @@ -328,11 +334,13 @@ class ExportCategoryTableMap extends TableMap { if (null === $alias) { $criteria->addSelectColumn(ExportCategoryTableMap::ID); + $criteria->addSelectColumn(ExportCategoryTableMap::REF); $criteria->addSelectColumn(ExportCategoryTableMap::POSITION); $criteria->addSelectColumn(ExportCategoryTableMap::CREATED_AT); $criteria->addSelectColumn(ExportCategoryTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.ID'); + $criteria->addSelectColumn($alias . '.REF'); $criteria->addSelectColumn($alias . '.POSITION'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); diff --git a/core/lib/Thelia/Model/Map/ExportTableMap.php b/core/lib/Thelia/Model/Map/ExportTableMap.php index 58b667b9d..27293ab25 100644 --- a/core/lib/Thelia/Model/Map/ExportTableMap.php +++ b/core/lib/Thelia/Model/Map/ExportTableMap.php @@ -58,7 +58,7 @@ class ExportTableMap extends TableMap /** * The total number of columns */ - const NUM_COLUMNS = 6; + const NUM_COLUMNS = 7; /** * The number of lazy-loaded columns @@ -68,13 +68,18 @@ class ExportTableMap extends TableMap /** * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 6; + const NUM_HYDRATE_COLUMNS = 7; /** * the column name for the ID field */ const ID = 'export.ID'; + /** + * the column name for the REF field + */ + const REF = 'export.REF'; + /** * the column name for the EXPORT_CATEGORY_ID field */ @@ -86,9 +91,9 @@ class ExportTableMap extends TableMap const POSITION = 'export.POSITION'; /** - * the column name for the HANDLECLASS field + * the column name for the HANDLE_CLASS field */ - const HANDLECLASS = 'export.HANDLECLASS'; + const HANDLE_CLASS = 'export.HANDLE_CLASS'; /** * the column name for the CREATED_AT field @@ -121,12 +126,12 @@ class ExportTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('Id', 'ExportCategoryId', 'Position', 'Handleclass', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'exportCategoryId', 'position', 'handleclass', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(ExportTableMap::ID, ExportTableMap::EXPORT_CATEGORY_ID, ExportTableMap::POSITION, ExportTableMap::HANDLECLASS, ExportTableMap::CREATED_AT, ExportTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'EXPORT_CATEGORY_ID', 'POSITION', 'HANDLECLASS', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'export_category_id', 'position', 'handleClass', 'created_at', 'updated_at', ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, ) + self::TYPE_PHPNAME => array('Id', 'Ref', 'ExportCategoryId', 'Position', 'HandleClass', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'exportCategoryId', 'position', 'handleClass', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(ExportTableMap::ID, ExportTableMap::REF, ExportTableMap::EXPORT_CATEGORY_ID, ExportTableMap::POSITION, ExportTableMap::HANDLE_CLASS, ExportTableMap::CREATED_AT, ExportTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'REF', 'EXPORT_CATEGORY_ID', 'POSITION', 'HANDLE_CLASS', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'ref', 'export_category_id', 'position', 'handle_class', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) ); /** @@ -136,12 +141,12 @@ class ExportTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'ExportCategoryId' => 1, 'Position' => 2, 'Handleclass' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'exportCategoryId' => 1, 'position' => 2, 'handleclass' => 3, 'createdAt' => 4, 'updatedAt' => 5, ), - self::TYPE_COLNAME => array(ExportTableMap::ID => 0, ExportTableMap::EXPORT_CATEGORY_ID => 1, ExportTableMap::POSITION => 2, ExportTableMap::HANDLECLASS => 3, ExportTableMap::CREATED_AT => 4, ExportTableMap::UPDATED_AT => 5, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'EXPORT_CATEGORY_ID' => 1, 'POSITION' => 2, 'HANDLECLASS' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ), - self::TYPE_FIELDNAME => array('id' => 0, 'export_category_id' => 1, 'position' => 2, 'handleClass' => 3, 'created_at' => 4, 'updated_at' => 5, ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, ) + self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'ExportCategoryId' => 2, 'Position' => 3, 'HandleClass' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'exportCategoryId' => 2, 'position' => 3, 'handleClass' => 4, 'createdAt' => 5, 'updatedAt' => 6, ), + self::TYPE_COLNAME => array(ExportTableMap::ID => 0, ExportTableMap::REF => 1, ExportTableMap::EXPORT_CATEGORY_ID => 2, ExportTableMap::POSITION => 3, ExportTableMap::HANDLE_CLASS => 4, ExportTableMap::CREATED_AT => 5, ExportTableMap::UPDATED_AT => 6, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'EXPORT_CATEGORY_ID' => 2, 'POSITION' => 3, 'HANDLE_CLASS' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ), + self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'export_category_id' => 2, 'position' => 3, 'handle_class' => 4, 'created_at' => 5, 'updated_at' => 6, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) ); /** @@ -161,9 +166,10 @@ class ExportTableMap extends TableMap $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); + $this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null); $this->addForeignKey('EXPORT_CATEGORY_ID', 'ExportCategoryId', 'INTEGER', 'export_category', 'ID', true, null, null); $this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null); - $this->addColumn('HANDLECLASS', 'Handleclass', 'CLOB', true, null, null); + $this->addColumn('HANDLE_CLASS', 'HandleClass', 'CLOB', true, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); } // initialize() @@ -339,16 +345,18 @@ class ExportTableMap extends TableMap { if (null === $alias) { $criteria->addSelectColumn(ExportTableMap::ID); + $criteria->addSelectColumn(ExportTableMap::REF); $criteria->addSelectColumn(ExportTableMap::EXPORT_CATEGORY_ID); $criteria->addSelectColumn(ExportTableMap::POSITION); - $criteria->addSelectColumn(ExportTableMap::HANDLECLASS); + $criteria->addSelectColumn(ExportTableMap::HANDLE_CLASS); $criteria->addSelectColumn(ExportTableMap::CREATED_AT); $criteria->addSelectColumn(ExportTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.ID'); + $criteria->addSelectColumn($alias . '.REF'); $criteria->addSelectColumn($alias . '.EXPORT_CATEGORY_ID'); $criteria->addSelectColumn($alias . '.POSITION'); - $criteria->addSelectColumn($alias . '.HANDLECLASS'); + $criteria->addSelectColumn($alias . '.HANDLE_CLASS'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); } diff --git a/core/lib/Thelia/Model/Map/ImportCategoryTableMap.php b/core/lib/Thelia/Model/Map/ImportCategoryTableMap.php index e75ddf2ba..82966e1b1 100644 --- a/core/lib/Thelia/Model/Map/ImportCategoryTableMap.php +++ b/core/lib/Thelia/Model/Map/ImportCategoryTableMap.php @@ -58,7 +58,7 @@ class ImportCategoryTableMap extends TableMap /** * The total number of columns */ - const NUM_COLUMNS = 4; + const NUM_COLUMNS = 5; /** * The number of lazy-loaded columns @@ -68,13 +68,18 @@ class ImportCategoryTableMap extends TableMap /** * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 4; + const NUM_HYDRATE_COLUMNS = 5; /** * the column name for the ID field */ const ID = 'import_category.ID'; + /** + * the column name for the REF field + */ + const REF = 'import_category.REF'; + /** * the column name for the POSITION field */ @@ -111,12 +116,12 @@ class ImportCategoryTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('Id', 'Position', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'position', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(ImportCategoryTableMap::ID, ImportCategoryTableMap::POSITION, ImportCategoryTableMap::CREATED_AT, ImportCategoryTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'position', 'created_at', 'updated_at', ), - self::TYPE_NUM => array(0, 1, 2, 3, ) + self::TYPE_PHPNAME => array('Id', 'Ref', 'Position', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'position', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(ImportCategoryTableMap::ID, ImportCategoryTableMap::REF, ImportCategoryTableMap::POSITION, ImportCategoryTableMap::CREATED_AT, ImportCategoryTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'REF', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'ref', 'position', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -126,12 +131,12 @@ class ImportCategoryTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'Position' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'position' => 1, 'createdAt' => 2, 'updatedAt' => 3, ), - self::TYPE_COLNAME => array(ImportCategoryTableMap::ID => 0, ImportCategoryTableMap::POSITION => 1, ImportCategoryTableMap::CREATED_AT => 2, ImportCategoryTableMap::UPDATED_AT => 3, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'POSITION' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ), - self::TYPE_FIELDNAME => array('id' => 0, 'position' => 1, 'created_at' => 2, 'updated_at' => 3, ), - self::TYPE_NUM => array(0, 1, 2, 3, ) + self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'Position' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'position' => 2, 'createdAt' => 3, 'updatedAt' => 4, ), + self::TYPE_COLNAME => array(ImportCategoryTableMap::ID => 0, ImportCategoryTableMap::REF => 1, ImportCategoryTableMap::POSITION => 2, ImportCategoryTableMap::CREATED_AT => 3, ImportCategoryTableMap::UPDATED_AT => 4, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'POSITION' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ), + self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'position' => 2, 'created_at' => 3, 'updated_at' => 4, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -151,6 +156,7 @@ class ImportCategoryTableMap extends TableMap $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); + $this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null); $this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); @@ -328,11 +334,13 @@ class ImportCategoryTableMap extends TableMap { if (null === $alias) { $criteria->addSelectColumn(ImportCategoryTableMap::ID); + $criteria->addSelectColumn(ImportCategoryTableMap::REF); $criteria->addSelectColumn(ImportCategoryTableMap::POSITION); $criteria->addSelectColumn(ImportCategoryTableMap::CREATED_AT); $criteria->addSelectColumn(ImportCategoryTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.ID'); + $criteria->addSelectColumn($alias . '.REF'); $criteria->addSelectColumn($alias . '.POSITION'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); diff --git a/core/lib/Thelia/Model/Map/ImportTableMap.php b/core/lib/Thelia/Model/Map/ImportTableMap.php index 735c20236..56cbe3592 100644 --- a/core/lib/Thelia/Model/Map/ImportTableMap.php +++ b/core/lib/Thelia/Model/Map/ImportTableMap.php @@ -58,7 +58,7 @@ class ImportTableMap extends TableMap /** * The total number of columns */ - const NUM_COLUMNS = 6; + const NUM_COLUMNS = 7; /** * The number of lazy-loaded columns @@ -68,13 +68,18 @@ class ImportTableMap extends TableMap /** * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 6; + const NUM_HYDRATE_COLUMNS = 7; /** * the column name for the ID field */ const ID = 'import.ID'; + /** + * the column name for the REF field + */ + const REF = 'import.REF'; + /** * the column name for the IMPORT_CATEGORY_ID field */ @@ -86,9 +91,9 @@ class ImportTableMap extends TableMap const POSITION = 'import.POSITION'; /** - * the column name for the HANDLECLASS field + * the column name for the HANDLE_CLASS field */ - const HANDLECLASS = 'import.HANDLECLASS'; + const HANDLE_CLASS = 'import.HANDLE_CLASS'; /** * the column name for the CREATED_AT field @@ -121,12 +126,12 @@ class ImportTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('Id', 'ImportCategoryId', 'Position', 'Handleclass', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'importCategoryId', 'position', 'handleclass', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(ImportTableMap::ID, ImportTableMap::IMPORT_CATEGORY_ID, ImportTableMap::POSITION, ImportTableMap::HANDLECLASS, ImportTableMap::CREATED_AT, ImportTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'IMPORT_CATEGORY_ID', 'POSITION', 'HANDLECLASS', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'import_category_id', 'position', 'handleClass', 'created_at', 'updated_at', ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, ) + self::TYPE_PHPNAME => array('Id', 'Ref', 'ImportCategoryId', 'Position', 'HandleClass', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'importCategoryId', 'position', 'handleClass', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(ImportTableMap::ID, ImportTableMap::REF, ImportTableMap::IMPORT_CATEGORY_ID, ImportTableMap::POSITION, ImportTableMap::HANDLE_CLASS, ImportTableMap::CREATED_AT, ImportTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'REF', 'IMPORT_CATEGORY_ID', 'POSITION', 'HANDLE_CLASS', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'ref', 'import_category_id', 'position', 'handle_class', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) ); /** @@ -136,12 +141,12 @@ class ImportTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'ImportCategoryId' => 1, 'Position' => 2, 'Handleclass' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'importCategoryId' => 1, 'position' => 2, 'handleclass' => 3, 'createdAt' => 4, 'updatedAt' => 5, ), - self::TYPE_COLNAME => array(ImportTableMap::ID => 0, ImportTableMap::IMPORT_CATEGORY_ID => 1, ImportTableMap::POSITION => 2, ImportTableMap::HANDLECLASS => 3, ImportTableMap::CREATED_AT => 4, ImportTableMap::UPDATED_AT => 5, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'IMPORT_CATEGORY_ID' => 1, 'POSITION' => 2, 'HANDLECLASS' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ), - self::TYPE_FIELDNAME => array('id' => 0, 'import_category_id' => 1, 'position' => 2, 'handleClass' => 3, 'created_at' => 4, 'updated_at' => 5, ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, ) + self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'ImportCategoryId' => 2, 'Position' => 3, 'HandleClass' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'importCategoryId' => 2, 'position' => 3, 'handleClass' => 4, 'createdAt' => 5, 'updatedAt' => 6, ), + self::TYPE_COLNAME => array(ImportTableMap::ID => 0, ImportTableMap::REF => 1, ImportTableMap::IMPORT_CATEGORY_ID => 2, ImportTableMap::POSITION => 3, ImportTableMap::HANDLE_CLASS => 4, ImportTableMap::CREATED_AT => 5, ImportTableMap::UPDATED_AT => 6, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'IMPORT_CATEGORY_ID' => 2, 'POSITION' => 3, 'HANDLE_CLASS' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ), + self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'import_category_id' => 2, 'position' => 3, 'handle_class' => 4, 'created_at' => 5, 'updated_at' => 6, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) ); /** @@ -161,9 +166,10 @@ class ImportTableMap extends TableMap $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); + $this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null); $this->addForeignKey('IMPORT_CATEGORY_ID', 'ImportCategoryId', 'INTEGER', 'import_category', 'ID', true, null, null); $this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null); - $this->addColumn('HANDLECLASS', 'Handleclass', 'CLOB', true, null, null); + $this->addColumn('HANDLE_CLASS', 'HandleClass', 'CLOB', true, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); } // initialize() @@ -339,16 +345,18 @@ class ImportTableMap extends TableMap { if (null === $alias) { $criteria->addSelectColumn(ImportTableMap::ID); + $criteria->addSelectColumn(ImportTableMap::REF); $criteria->addSelectColumn(ImportTableMap::IMPORT_CATEGORY_ID); $criteria->addSelectColumn(ImportTableMap::POSITION); - $criteria->addSelectColumn(ImportTableMap::HANDLECLASS); + $criteria->addSelectColumn(ImportTableMap::HANDLE_CLASS); $criteria->addSelectColumn(ImportTableMap::CREATED_AT); $criteria->addSelectColumn(ImportTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.ID'); + $criteria->addSelectColumn($alias . '.REF'); $criteria->addSelectColumn($alias . '.IMPORT_CATEGORY_ID'); $criteria->addSelectColumn($alias . '.POSITION'); - $criteria->addSelectColumn($alias . '.HANDLECLASS'); + $criteria->addSelectColumn($alias . '.HANDLE_CLASS'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); } diff --git a/local/config/schema.xml b/local/config/schema.xml index b21b9526e..74cbe189c 100644 --- a/local/config/schema.xml +++ b/local/config/schema.xml @@ -1513,33 +1513,45 @@ - + + + + +
- + + + + +
- + + - + + + + @@ -1549,15 +1561,19 @@
- + + - + + + + diff --git a/setup/thelia.sql b/setup/thelia.sql index 92456c51b..38f5f61bf 100644 --- a/setup/thelia.sql +++ b/setup/thelia.sql @@ -1882,10 +1882,12 @@ DROP TABLE IF EXISTS `import_category`; CREATE TABLE `import_category` ( `id` INTEGER NOT NULL AUTO_INCREMENT, + `ref` VARCHAR(255) NOT NULL, `position` INTEGER NOT NULL, `created_at` DATETIME, `updated_at` DATETIME, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + UNIQUE INDEX `ref_UNIQUE` (`ref`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- @@ -1897,10 +1899,12 @@ DROP TABLE IF EXISTS `export_category`; CREATE TABLE `export_category` ( `id` INTEGER NOT NULL AUTO_INCREMENT, + `ref` VARCHAR(255) NOT NULL, `position` INTEGER NOT NULL, `created_at` DATETIME, `updated_at` DATETIME, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + UNIQUE INDEX `ref_UNIQUE` (`ref`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- @@ -1912,12 +1916,14 @@ DROP TABLE IF EXISTS `import`; CREATE TABLE `import` ( `id` INTEGER NOT NULL AUTO_INCREMENT, + `ref` VARCHAR(255) NOT NULL, `import_category_id` INTEGER NOT NULL, `position` INTEGER NOT NULL, - `handleClass` LONGTEXT NOT NULL, + `handle_class` LONGTEXT NOT NULL, `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`), + UNIQUE INDEX `ref_UNIQUE` (`ref`), INDEX `idx_import_import_category_id` (`import_category_id`), CONSTRAINT `fk_import_import_category_id` FOREIGN KEY (`import_category_id`) @@ -1935,12 +1941,14 @@ DROP TABLE IF EXISTS `export`; CREATE TABLE `export` ( `id` INTEGER NOT NULL AUTO_INCREMENT, + `ref` VARCHAR(255) NOT NULL, `export_category_id` INTEGER NOT NULL, `position` INTEGER NOT NULL, - `handleClass` LONGTEXT NOT NULL, + `handle_class` LONGTEXT NOT NULL, `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`), + UNIQUE INDEX `ref_UNIQUE` (`ref`), INDEX `idx_export_export_category_id` (`export_category_id`), CONSTRAINT `fk_export_export_category_id` FOREIGN KEY (`export_category_id`) diff --git a/templates/backOffice/default/ajax/export-modal.html b/templates/backOffice/default/ajax/export-modal.html index 9b6936f91..18fcf5fd2 100644 --- a/templates/backOffice/default/ajax/export-modal.html +++ b/templates/backOffice/default/ajax/export-modal.html @@ -53,6 +53,7 @@ {/form_field} + {if $HAS_IMAGES}
{form_field form=$form field="images"}
{/form_field} + {/if} + {if $HAS_DOCUMENTS}
{form_field form=$form field="documents"}
{/form_field} + {/if} {/ifloop} {elseloop rel="export-formatters"} diff --git a/templates/backOffice/default/export-page.html b/templates/backOffice/default/export-page.html index 671e1e49a..e5496ec78 100644 --- a/templates/backOffice/default/export-page.html +++ b/templates/backOffice/default/export-page.html @@ -97,6 +97,7 @@ {/form_field} + {if $HAS_IMAGES}
{form_field form=$form field="images"}
{/form_field} + {/if} + {if $HAS_DOCUMENTS}
{form_field form=$form field="documents"}
{/form_field} + {/if} {/ifloop} {elseloop rel="export-formatters"}