From 17cc6faec38c4f23712e6392d537f462002cc0a0 Mon Sep 17 00:00:00 2001 From: Etienne Roudeix Date: Thu, 22 Aug 2013 15:03:31 +0200 Subject: [PATCH] front end translation management in loops apply propel patch https://github.com/propelorm/Propel2/commit/6be7fa1c394712dcfd146004452c99757b81bf10 --- .../Thelia/Core/Template/Loop/Attribute.php | 31 ++++---- .../Template/Loop/AttributeAvailability.php | 31 ++++---- .../Template/Loop/AttributeCombination.php | 61 ++++++++++------ .../Thelia/Core/Template/Loop/Category.php | 51 ++++--------- .../lib/Thelia/Core/Template/Loop/Content.php | 29 +++----- .../lib/Thelia/Core/Template/Loop/Country.php | 30 +++----- .../lib/Thelia/Core/Template/Loop/Feature.php | 31 ++++---- .../Template/Loop/FeatureAvailability.php | 31 ++++---- .../Core/Template/Loop/FeatureValue.php | 41 ++++++----- core/lib/Thelia/Core/Template/Loop/Folder.php | 35 +++++---- .../lib/Thelia/Core/Template/Loop/Product.php | 27 +++---- .../Core/Template/Loop/ProductSaleElement.php | 10 --- core/lib/Thelia/Core/Template/Loop/Title.php | 25 +++---- core/lib/Thelia/Model/Base/Accessory.php | 2 +- core/lib/Thelia/Model/Base/Address.php | 2 +- core/lib/Thelia/Model/Base/Admin.php | 2 +- core/lib/Thelia/Model/Base/AdminGroup.php | 2 +- core/lib/Thelia/Model/Base/AdminLog.php | 2 +- core/lib/Thelia/Model/Base/Area.php | 2 +- core/lib/Thelia/Model/Base/Attribute.php | 12 +-- core/lib/Thelia/Model/Base/AttributeAv.php | 12 +-- .../lib/Thelia/Model/Base/AttributeAvI18n.php | 8 +- .../Thelia/Model/Base/AttributeAvQuery.php | 6 +- .../Thelia/Model/Base/AttributeCategory.php | 2 +- .../Model/Base/AttributeCombination.php | 2 +- core/lib/Thelia/Model/Base/AttributeI18n.php | 8 +- core/lib/Thelia/Model/Base/AttributeQuery.php | 6 +- core/lib/Thelia/Model/Base/Cart.php | 2 +- core/lib/Thelia/Model/Base/CartItem.php | 2 +- core/lib/Thelia/Model/Base/Category.php | 12 +-- .../Thelia/Model/Base/CategoryDocument.php | 12 +-- .../Model/Base/CategoryDocumentI18n.php | 8 +- .../Model/Base/CategoryDocumentQuery.php | 6 +- core/lib/Thelia/Model/Base/CategoryI18n.php | 8 +- core/lib/Thelia/Model/Base/CategoryImage.php | 12 +-- .../Thelia/Model/Base/CategoryImageI18n.php | 8 +- .../Thelia/Model/Base/CategoryImageQuery.php | 6 +- core/lib/Thelia/Model/Base/CategoryQuery.php | 6 +- .../lib/Thelia/Model/Base/CategoryVersion.php | 2 +- core/lib/Thelia/Model/Base/Config.php | 12 +-- core/lib/Thelia/Model/Base/ConfigI18n.php | 8 +- core/lib/Thelia/Model/Base/ConfigQuery.php | 6 +- core/lib/Thelia/Model/Base/Content.php | 12 +-- core/lib/Thelia/Model/Base/ContentAssoc.php | 2 +- .../lib/Thelia/Model/Base/ContentDocument.php | 12 +-- .../Thelia/Model/Base/ContentDocumentI18n.php | 8 +- .../Model/Base/ContentDocumentQuery.php | 6 +- core/lib/Thelia/Model/Base/ContentFolder.php | 2 +- core/lib/Thelia/Model/Base/ContentI18n.php | 8 +- core/lib/Thelia/Model/Base/ContentImage.php | 12 +-- .../Thelia/Model/Base/ContentImageI18n.php | 8 +- .../Thelia/Model/Base/ContentImageQuery.php | 6 +- core/lib/Thelia/Model/Base/ContentQuery.php | 6 +- core/lib/Thelia/Model/Base/ContentVersion.php | 2 +- core/lib/Thelia/Model/Base/Country.php | 12 +-- core/lib/Thelia/Model/Base/CountryI18n.php | 8 +- core/lib/Thelia/Model/Base/CountryQuery.php | 6 +- core/lib/Thelia/Model/Base/Coupon.php | 2 +- core/lib/Thelia/Model/Base/CouponOrder.php | 2 +- core/lib/Thelia/Model/Base/CouponRule.php | 2 +- core/lib/Thelia/Model/Base/Currency.php | 12 +-- core/lib/Thelia/Model/Base/CurrencyI18n.php | 8 +- core/lib/Thelia/Model/Base/CurrencyQuery.php | 6 +- core/lib/Thelia/Model/Base/Customer.php | 2 +- core/lib/Thelia/Model/Base/CustomerTitle.php | 12 +-- .../Thelia/Model/Base/CustomerTitleI18n.php | 8 +- .../Thelia/Model/Base/CustomerTitleQuery.php | 6 +- core/lib/Thelia/Model/Base/Delivzone.php | 2 +- core/lib/Thelia/Model/Base/Feature.php | 12 +-- core/lib/Thelia/Model/Base/FeatureAv.php | 12 +-- core/lib/Thelia/Model/Base/FeatureAvI18n.php | 8 +- core/lib/Thelia/Model/Base/FeatureAvQuery.php | 6 +- .../lib/Thelia/Model/Base/FeatureCategory.php | 2 +- core/lib/Thelia/Model/Base/FeatureI18n.php | 8 +- core/lib/Thelia/Model/Base/FeatureProduct.php | 2 +- core/lib/Thelia/Model/Base/FeatureQuery.php | 6 +- core/lib/Thelia/Model/Base/Folder.php | 12 +-- core/lib/Thelia/Model/Base/FolderDocument.php | 12 +-- .../Thelia/Model/Base/FolderDocumentI18n.php | 8 +- .../Thelia/Model/Base/FolderDocumentQuery.php | 6 +- core/lib/Thelia/Model/Base/FolderI18n.php | 8 +- core/lib/Thelia/Model/Base/FolderImage.php | 12 +-- .../lib/Thelia/Model/Base/FolderImageI18n.php | 8 +- .../Thelia/Model/Base/FolderImageQuery.php | 6 +- core/lib/Thelia/Model/Base/FolderQuery.php | 6 +- core/lib/Thelia/Model/Base/FolderVersion.php | 2 +- core/lib/Thelia/Model/Base/Group.php | 12 +-- core/lib/Thelia/Model/Base/GroupI18n.php | 8 +- core/lib/Thelia/Model/Base/GroupModule.php | 2 +- core/lib/Thelia/Model/Base/GroupQuery.php | 6 +- core/lib/Thelia/Model/Base/GroupResource.php | 2 +- core/lib/Thelia/Model/Base/Lang.php | 2 +- core/lib/Thelia/Model/Base/Message.php | 12 +-- core/lib/Thelia/Model/Base/MessageI18n.php | 8 +- core/lib/Thelia/Model/Base/MessageQuery.php | 6 +- core/lib/Thelia/Model/Base/MessageVersion.php | 2 +- core/lib/Thelia/Model/Base/Module.php | 12 +-- core/lib/Thelia/Model/Base/ModuleI18n.php | 8 +- core/lib/Thelia/Model/Base/ModuleQuery.php | 6 +- core/lib/Thelia/Model/Base/Order.php | 2 +- core/lib/Thelia/Model/Base/OrderAddress.php | 2 +- core/lib/Thelia/Model/Base/OrderFeature.php | 2 +- core/lib/Thelia/Model/Base/OrderProduct.php | 2 +- core/lib/Thelia/Model/Base/OrderStatus.php | 12 +-- .../lib/Thelia/Model/Base/OrderStatusI18n.php | 8 +- .../Thelia/Model/Base/OrderStatusQuery.php | 6 +- core/lib/Thelia/Model/Base/Product.php | 12 +-- .../lib/Thelia/Model/Base/ProductCategory.php | 2 +- .../lib/Thelia/Model/Base/ProductDocument.php | 12 +-- .../Thelia/Model/Base/ProductDocumentI18n.php | 8 +- .../Model/Base/ProductDocumentQuery.php | 6 +- core/lib/Thelia/Model/Base/ProductI18n.php | 8 +- core/lib/Thelia/Model/Base/ProductImage.php | 12 +-- .../Thelia/Model/Base/ProductImageI18n.php | 8 +- .../Thelia/Model/Base/ProductImageQuery.php | 6 +- core/lib/Thelia/Model/Base/ProductPrice.php | 2 +- core/lib/Thelia/Model/Base/ProductQuery.php | 6 +- .../Thelia/Model/Base/ProductSaleElements.php | 2 +- core/lib/Thelia/Model/Base/ProductVersion.php | 2 +- core/lib/Thelia/Model/Base/Resource.php | 12 +-- core/lib/Thelia/Model/Base/ResourceI18n.php | 8 +- core/lib/Thelia/Model/Base/ResourceQuery.php | 6 +- core/lib/Thelia/Model/Base/Rewriting.php | 2 +- core/lib/Thelia/Model/Base/Tax.php | 12 +-- core/lib/Thelia/Model/Base/TaxI18n.php | 8 +- core/lib/Thelia/Model/Base/TaxQuery.php | 6 +- core/lib/Thelia/Model/Base/TaxRule.php | 12 +-- core/lib/Thelia/Model/Base/TaxRuleCountry.php | 2 +- core/lib/Thelia/Model/Base/TaxRuleI18n.php | 8 +- core/lib/Thelia/Model/Base/TaxRuleQuery.php | 6 +- .../Model/Map/AttributeAvI18nTableMap.php | 2 +- .../Thelia/Model/Map/AttributeAvTableMap.php | 2 +- .../Model/Map/AttributeI18nTableMap.php | 2 +- .../Thelia/Model/Map/AttributeTableMap.php | 2 +- .../Map/CategoryDocumentI18nTableMap.php | 2 +- .../Model/Map/CategoryDocumentTableMap.php | 2 +- .../Thelia/Model/Map/CategoryI18nTableMap.php | 2 +- .../Model/Map/CategoryImageI18nTableMap.php | 2 +- .../Model/Map/CategoryImageTableMap.php | 2 +- .../lib/Thelia/Model/Map/CategoryTableMap.php | 2 +- .../Thelia/Model/Map/ConfigI18nTableMap.php | 2 +- core/lib/Thelia/Model/Map/ConfigTableMap.php | 2 +- .../Model/Map/ContentDocumentI18nTableMap.php | 2 +- .../Model/Map/ContentDocumentTableMap.php | 2 +- .../Thelia/Model/Map/ContentI18nTableMap.php | 2 +- .../Model/Map/ContentImageI18nTableMap.php | 2 +- .../Thelia/Model/Map/ContentImageTableMap.php | 2 +- core/lib/Thelia/Model/Map/ContentTableMap.php | 2 +- .../Thelia/Model/Map/CountryI18nTableMap.php | 2 +- core/lib/Thelia/Model/Map/CountryTableMap.php | 2 +- .../Thelia/Model/Map/CurrencyI18nTableMap.php | 2 +- .../lib/Thelia/Model/Map/CurrencyTableMap.php | 2 +- .../Model/Map/CustomerTitleI18nTableMap.php | 2 +- .../Model/Map/CustomerTitleTableMap.php | 2 +- .../Model/Map/FeatureAvI18nTableMap.php | 2 +- .../Thelia/Model/Map/FeatureAvTableMap.php | 2 +- .../Thelia/Model/Map/FeatureI18nTableMap.php | 2 +- core/lib/Thelia/Model/Map/FeatureTableMap.php | 2 +- .../Model/Map/FolderDocumentI18nTableMap.php | 2 +- .../Model/Map/FolderDocumentTableMap.php | 2 +- .../Thelia/Model/Map/FolderI18nTableMap.php | 2 +- .../Model/Map/FolderImageI18nTableMap.php | 2 +- .../Thelia/Model/Map/FolderImageTableMap.php | 2 +- core/lib/Thelia/Model/Map/FolderTableMap.php | 2 +- .../Thelia/Model/Map/GroupI18nTableMap.php | 2 +- core/lib/Thelia/Model/Map/GroupTableMap.php | 2 +- .../Thelia/Model/Map/MessageI18nTableMap.php | 2 +- core/lib/Thelia/Model/Map/MessageTableMap.php | 2 +- .../Thelia/Model/Map/ModuleI18nTableMap.php | 2 +- core/lib/Thelia/Model/Map/ModuleTableMap.php | 2 +- .../Model/Map/OrderStatusI18nTableMap.php | 2 +- .../Thelia/Model/Map/OrderStatusTableMap.php | 2 +- .../Model/Map/ProductDocumentI18nTableMap.php | 2 +- .../Model/Map/ProductDocumentTableMap.php | 2 +- .../Thelia/Model/Map/ProductI18nTableMap.php | 2 +- .../Model/Map/ProductImageI18nTableMap.php | 2 +- .../Thelia/Model/Map/ProductImageTableMap.php | 2 +- core/lib/Thelia/Model/Map/ProductTableMap.php | 2 +- .../Thelia/Model/Map/ResourceI18nTableMap.php | 2 +- .../lib/Thelia/Model/Map/ResourceTableMap.php | 2 +- core/lib/Thelia/Model/Map/TaxI18nTableMap.php | 2 +- .../Thelia/Model/Map/TaxRuleI18nTableMap.php | 2 +- core/lib/Thelia/Model/Map/TaxRuleTableMap.php | 2 +- core/lib/Thelia/Model/Map/TaxTableMap.php | 2 +- .../Thelia/Model/Tools/ModelCriteriaTools.php | 73 +++++++++++++++++++ 185 files changed, 702 insertions(+), 686 deletions(-) create mode 100755 core/lib/Thelia/Model/Tools/ModelCriteriaTools.php diff --git a/core/lib/Thelia/Core/Template/Loop/Attribute.php b/core/lib/Thelia/Core/Template/Loop/Attribute.php index 1c7b23acf..84549aaa5 100755 --- a/core/lib/Thelia/Core/Template/Loop/Attribute.php +++ b/core/lib/Thelia/Core/Template/Loop/Attribute.php @@ -33,6 +33,8 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Log\Tlog; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\Base\CategoryQuery; use Thelia\Model\Base\ProductCategoryQuery; use Thelia\Model\Base\AttributeQuery; @@ -83,6 +85,9 @@ class Attribute extends BaseLoop { $search = AttributeQuery::create(); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale()); + $id = $this->getId(); if (null !== $id) { @@ -124,10 +129,10 @@ class Attribute extends BaseLoop foreach($orders as $order) { switch ($order) { case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\Map\AttributeI18nTableMap::TITLE); + $search->addAscendingOrderByColumn('i18n_TITLE'); break; case "alpha_reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\Map\AttributeI18nTableMap::TITLE); + $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "manual": $search->orderByPosition(Criteria::ASC); @@ -138,28 +143,18 @@ class Attribute extends BaseLoop } } - /** - * Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - $search->joinWithI18n( - $this->request->getSession()->getLocale(), - (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN - ); - + /* perform search */ $attributes = $this->search($search, $pagination); $loopResult = new LoopResult(); foreach ($attributes as $attribute) { $loopResultRow = new LoopResultRow(); - $loopResultRow->set("ID", $attribute->getId()); - $loopResultRow->set("TITLE",$attribute->getTitle()); - $loopResultRow->set("CHAPO", $attribute->getChapo()); - $loopResultRow->set("DESCRIPTION", $attribute->getDescription()); - $loopResultRow->set("POSTSCRIPTUM", $attribute->getPostscriptum()); + $loopResultRow->set("ID", $attribute->getId()) + ->set("TITLE",$attribute->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO", $attribute->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION", $attribute->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM", $attribute->getVirtualColumn('i18n_POSTSCRIPTUM')); $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php b/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php index 1033bf450..ade493efa 100755 --- a/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php +++ b/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php @@ -33,6 +33,8 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Log\Tlog; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\Base\AttributeAvQuery; use Thelia\Model\ConfigQuery; use Thelia\Type\TypeCollection; @@ -76,6 +78,9 @@ class AttributeAvailability extends BaseLoop { $search = AttributeAvQuery::create(); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale()); + $id = $this->getId(); if (null !== $id) { @@ -99,10 +104,10 @@ class AttributeAvailability extends BaseLoop foreach($orders as $order) { switch ($order) { case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\Map\AttributeAvI18nTableMap::TITLE); + $search->addAscendingOrderByColumn('i18n_TITLE'); break; case "alpha_reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\Map\AttributeAvI18nTableMap::TITLE); + $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "manual": $search->orderByPosition(Criteria::ASC); @@ -113,28 +118,18 @@ class AttributeAvailability extends BaseLoop } } - /** - * Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - $search->joinWithI18n( - $this->request->getSession()->getLocale(), - (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN - ); - + /* perform search */ $attributesAv = $this->search($search, $pagination); $loopResult = new LoopResult(); foreach ($attributesAv as $attributeAv) { $loopResultRow = new LoopResultRow(); - $loopResultRow->set("ID", $attributeAv->getId()); - $loopResultRow->set("TITLE",$attributeAv->getTitle()); - $loopResultRow->set("CHAPO", $attributeAv->getChapo()); - $loopResultRow->set("DESCRIPTION", $attributeAv->getDescription()); - $loopResultRow->set("POSTSCRIPTUM", $attributeAv->getPostscriptum()); + $loopResultRow->set("ID", $attributeAv->getId()) + ->set("TITLE",$attributeAv->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO", $attributeAv->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION", $attributeAv->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM", $attributeAv->getVirtualColumn('i18n_POSTSCRIPTUM')); $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php index f0b54c4f3..e6cc804da 100755 --- a/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php +++ b/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php @@ -33,7 +33,11 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Log\Tlog; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\Base\AttributeCombinationQuery; +use Thelia\Model\Map\AttributeAvTableMap; +use Thelia\Model\Map\AttributeTableMap; use Thelia\Model\ConfigQuery; use Thelia\Type\TypeCollection; use Thelia\Type; @@ -58,9 +62,9 @@ class AttributeCombination extends BaseLoop new Argument( 'order', new TypeCollection( - new Type\EnumListType(array('attribute_availability', 'attribute_availability_reverse', 'attribute', 'attribute_reverse')) + new Type\EnumListType(array('alpha', 'alpha_reverse')) ), - 'attribute' + 'alpha' ) ); } @@ -74,6 +78,26 @@ class AttributeCombination extends BaseLoop { $search = AttributeCombinationQuery::create(); + /* manage attribute translations */ + ModelCriteriaTools::getI18n( + $search, + ConfigQuery::read("default_lang_without_translation", 1), + $this->request->getSession()->getLocale(), + array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM'), + AttributeTableMap::TABLE_NAME, + 'ATTRIBUTE_ID' + ); + + /* manage attributeAv translations */ + ModelCriteriaTools::getI18n( + $search, + ConfigQuery::read("default_lang_without_translation", 1), + $this->request->getSession()->getLocale(), + array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM'), + AttributeAvTableMap::TABLE_NAME, + 'ATTRIBUTE_AV_ID' + ); + $productSaleElement = $this->getProduct_sale_element(); $search->filterByProductSaleElementsId($productSaleElement, Criteria::EQUAL); @@ -82,17 +106,11 @@ class AttributeCombination extends BaseLoop foreach($orders as $order) { switch ($order) { - case "attribute_availability": - //$search->addAscendingOrderByColumn(\Thelia\Model\Map\AttributeI18nTableMap::TITLE); + case "alpha": + $search->addAscendingOrderByColumn(AttributeTableMap::TABLE_NAME . '_i18n_TITLE'); break; - case "attribute_availability_reverse": - //$search->addDescendingOrderByColumn(\Thelia\Model\Map\AttributeI18nTableMap::TITLE); - break; - case "attribute": - //$search->orderByPosition(Criteria::ASC); - break; - case "attribute_reverse": - //$search->orderByPosition(Criteria::DESC); + case "alpha_reverse": + $search->addDescendingOrderByColumn(AttributeTableMap::TABLE_NAME . '_i18n_TITLE'); break; } } @@ -104,18 +122,15 @@ class AttributeCombination extends BaseLoop foreach ($attributeCombinations as $attributeCombination) { $loopResultRow = new LoopResultRow(); - $attribute = $attributeCombination->getAttribute(); - $attributeAvailability = $attributeCombination->getAttributeAv(); - $loopResultRow - ->set("ATTRIBUTE_TITLE", $attribute->getTitle()) - ->set("ATTRIBUTE_CHAPO", $attribute->getChapo()) - ->set("ATTRIBUTE_DESCRIPTION", $attribute->getDescription()) - ->set("ATTRIBUTE_POSTSCRIPTUM", $attribute->getPostscriptum()) - ->set("ATTRIBUTE_AVAILABILITY_TITLE", $attributeAvailability->getTitle()) - ->set("ATTRIBUTE_AVAILABILITY_CHAPO", $attributeAvailability->getChapo()) - ->set("ATTRIBUTE_AVAILABILITY_DESCRIPTION", $attributeAvailability->getDescription()) - ->set("ATTRIBUTE_AVAILABILITY_POSTSCRIPTUM", $attributeAvailability->getPostscriptum()); + ->set("ATTRIBUTE_TITLE", $attributeCombination->getVirtualColumn(AttributeTableMap::TABLE_NAME . '_i18n_TITLE')) + ->set("ATTRIBUTE_CHAPO", $attributeCombination->getVirtualColumn(AttributeTableMap::TABLE_NAME . '_i18n_CHAPO')) + ->set("ATTRIBUTE_DESCRIPTION", $attributeCombination->getVirtualColumn(AttributeTableMap::TABLE_NAME . '_i18n_DESCRIPTION')) + ->set("ATTRIBUTE_POSTSCRIPTUM", $attributeCombination->getVirtualColumn(AttributeTableMap::TABLE_NAME . '_i18n_POSTSCRIPTUM')) + ->set("ATTRIBUTE_AVAILABILITY_TITLE", $attributeCombination->getVirtualColumn(AttributeAvTableMap::TABLE_NAME . '_i18n_TITLE')) + ->set("ATTRIBUTE_AVAILABILITY_CHAPO", $attributeCombination->getVirtualColumn(AttributeAvTableMap::TABLE_NAME . '_i18n_CHAPO')) + ->set("ATTRIBUTE_AVAILABILITY_DESCRIPTION", $attributeCombination->getVirtualColumn(AttributeAvTableMap::TABLE_NAME . '_i18n_DESCRIPTION')) + ->set("ATTRIBUTE_AVAILABILITY_POSTSCRIPTUM", $attributeCombination->getVirtualColumn(AttributeAvTableMap::TABLE_NAME . '_i18n_POSTSCRIPTUM')); $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index b0f9e2862..1233ccd4e 100755 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -32,6 +32,8 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Log\Tlog; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\CategoryQuery; use Thelia\Model\ConfigQuery; use Thelia\Type\TypeCollection; @@ -95,6 +97,9 @@ class Category extends BaseLoop { $search = CategoryQuery::create(); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale()); + $id = $this->getId(); if (!is_null($id)) { @@ -131,10 +136,10 @@ class Category extends BaseLoop foreach($orders as $order) { switch ($order) { case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\Map\CategoryI18nTableMap::TITLE); + $search->addAscendingOrderByColumn('i18n_TITLE'); break; case "alpha_reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\Map\CategoryI18nTableMap::TITLE); + $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "manual_reverse": $search->orderByPosition(Criteria::DESC); @@ -150,50 +155,20 @@ class Category extends BaseLoop } } - /** - * \Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - if(ConfigQuery::read("default_lang_without_translation", 1) == 0) { - /* - * don't use the following to be able to use the same getter than below - * $search->joinWithI18n( $this->request->getSession()->getLocale(), Criteria::INNER_JOIN ); - */ - $search->joinCategoryI18n('asked_locale_i18n', Criteria::INNER_JOIN) - ->addJoinCondition('asked_locale_i18n' ,'`asked_locale_i18n`.LOCALE = ?', 'en_EN', null, \PDO::PARAM_STR); - - $search->withColumn('`asked_locale_i18n`.TITLE', 'i18n_TITLE'); - $search->withColumn('`asked_locale_i18n`.CHAPO', 'i18n_CHAPO'); - $search->withColumn('`asked_locale_i18n`.DESCRIPTION', 'i18n_DESCRIPTION'); - $search->withColumn('`asked_locale_i18n`.POSTSCRIPTUM', 'i18n_POSTSCRIPTUM'); - } else { - $search->joinCategoryI18n('default_locale_i18n') - ->addJoinCondition('default_locale_i18n' ,'`default_locale_i18n`.LOCALE = ?', 'fr_FR', null, \PDO::PARAM_STR); - - $search->joinCategoryI18n('asked_locale_i18n') - ->addJoinCondition('asked_locale_i18n' ,'`asked_locale_i18n`.LOCALE = ?', 'en_EN', null, \PDO::PARAM_STR); - - $search->where('NOT ISNULL(`asked_locale_i18n`.ID)')->_or()->where('NOT ISNULL(`default_locale_i18n`.ID)'); - - $search->withColumn('CASE WHEN ISNULL(`asked_locale_i18n`.ID) THEN `asked_locale_i18n`.TITLE ELSE `asked_locale_i18n`.TITLE END', 'i18n_TITLE'); - $search->withColumn('CASE WHEN ISNULL(`asked_locale_i18n`.ID) THEN `asked_locale_i18n`.CHAPO ELSE `asked_locale_i18n`.CHAPO END', 'i18n_CHAPO'); - $search->withColumn('CASE WHEN ISNULL(`asked_locale_i18n`.ID) THEN `asked_locale_i18n`.DESCRIPTION ELSE `asked_locale_i18n`.DESCRIPTION END', 'i18n_DESCRIPTION'); - $search->withColumn('CASE WHEN ISNULL(`asked_locale_i18n`.ID) THEN `asked_locale_i18n`.POSTSCRIPTUM ELSE `asked_locale_i18n`.POSTSCRIPTUM END', 'i18n_POSTSCRIPTUM'); - } - + /* perform search */ $categories = $this->search($search, $pagination); + /* @todo */ $notEmpty = $this->getNot_empty(); $loopResult = new LoopResult(); foreach ($categories as $category) { - if ($this->getNotEmpty() && $category->countAllProducts() == 0) continue; - - $x = $category->getTitle(); + /* + * no cause pagination lost : + * if ($this->getNotEmpty() && $category->countAllProducts() == 0) continue; + */ $loopResultRow = new LoopResultRow(); diff --git a/core/lib/Thelia/Core/Template/Loop/Content.php b/core/lib/Thelia/Core/Template/Loop/Content.php index 15bb2068c..3a81ff9f2 100755 --- a/core/lib/Thelia/Core/Template/Loop/Content.php +++ b/core/lib/Thelia/Core/Template/Loop/Content.php @@ -31,6 +31,8 @@ use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\FolderQuery; use Thelia\Model\Map\ContentTableMap; use Thelia\Model\ContentFolderQuery; @@ -85,6 +87,9 @@ class Content extends BaseLoop { $search = ContentQuery::create(); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale()); + $id = $this->getId(); if (!is_null($id)) { @@ -153,10 +158,10 @@ class Content extends BaseLoop foreach ($orders as $order) { switch ($order) { case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\Map\ContentI18nTableMap::TITLE); + $search->addAscendingOrderByColumn('i18n_TITLE'); break; case "alpha-reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\Map\ContentI18nTableMap::TITLE); + $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "manual": if(null === $folder || count($folder) != 1) @@ -199,17 +204,7 @@ class Content extends BaseLoop ); } - /** - * Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - $search->joinWithI18n( - $this->request->getSession()->getLocale(), - (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN - ); - + /* perform search */ $search->groupBy(ContentTableMap::ID); $contents = $this->search($search, $pagination); @@ -220,10 +215,10 @@ class Content extends BaseLoop $loopResultRow = new LoopResultRow(); $loopResultRow->set("ID", $content->getId()) - ->set("TITLE",$content->getTitle()) - ->set("CHAPO", $content->getChapo()) - ->set("DESCRIPTION", $content->getDescription()) - ->set("POSTSCRIPTUM", $content->getPostscriptum()) + ->set("TITLE",$content->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO", $content->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION", $content->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM", $content->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("POSITION", $content->getPosition()) ; diff --git a/core/lib/Thelia/Core/Template/Loop/Country.php b/core/lib/Thelia/Core/Template/Loop/Country.php index 475a4608b..73e1fd410 100755 --- a/core/lib/Thelia/Core/Template/Loop/Country.php +++ b/core/lib/Thelia/Core/Template/Loop/Country.php @@ -31,6 +31,8 @@ use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\CountryQuery; use Thelia\Model\ConfigQuery; @@ -68,6 +70,9 @@ class Country extends BaseLoop { $search = CountryQuery::create(); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale()); + $id = $this->getId(); if (null !== $id) { @@ -94,31 +99,20 @@ class Country extends BaseLoop $search->filterById($exclude, Criteria::NOT_IN); } - /** - * Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - $search->joinWithI18n( - $this->request->getSession()->getLocale(), - (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN - ); - - $search->addAscendingOrderByColumn(\Thelia\Model\Map\CountryI18nTableMap::TITLE); + $search->addAscendingOrderByColumn('i18n_TITLE'); + /* perform search */ $countries = $this->search($search, $pagination); $loopResult = new LoopResult(); foreach ($countries as $country) { $loopResultRow = new LoopResultRow(); - $loopResultRow->set("ID", $country->getId()); - $loopResultRow->set("AREA", $country->getAreaId()); - $loopResultRow->set("TITLE", $country->getTitle()); - $loopResultRow->set("CHAPO", $country->getChapo()); - $loopResultRow->set("DESCRIPTION", $country->getDescription()); - $loopResultRow->set("POSTSCRIPTUM", $country->getPostscriptum()); + $loopResultRow->set("ID", $country->getId()) + ->set("TITLE",$country->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO", $country->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION", $country->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM", $country->getVirtualColumn('i18n_POSTSCRIPTUM')); $loopResultRow->set("ISOCODE", $country->getIsocode()); $loopResultRow->set("ISOALPHA2", $country->getIsoalpha2()); $loopResultRow->set("ISOALPHA3", $country->getIsoalpha3()); diff --git a/core/lib/Thelia/Core/Template/Loop/Feature.php b/core/lib/Thelia/Core/Template/Loop/Feature.php index cf8dcc563..0693a303a 100755 --- a/core/lib/Thelia/Core/Template/Loop/Feature.php +++ b/core/lib/Thelia/Core/Template/Loop/Feature.php @@ -31,6 +31,8 @@ use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\Base\CategoryQuery; use Thelia\Model\Base\ProductCategoryQuery; use Thelia\Model\Base\FeatureQuery; @@ -81,6 +83,9 @@ class Feature extends BaseLoop { $search = FeatureQuery::create(); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale()); + $id = $this->getId(); if (null !== $id) { @@ -122,10 +127,10 @@ class Feature extends BaseLoop foreach ($orders as $order) { switch ($order) { case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\Map\FeatureI18nTableMap::TITLE); + $search->addAscendingOrderByColumn('i18n_TITLE'); break; case "alpha-reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\Map\FeatureI18nTableMap::TITLE); + $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "manual": $search->orderByPosition(Criteria::ASC); @@ -136,28 +141,18 @@ class Feature extends BaseLoop } } - /** - * Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - $search->joinWithI18n( - $this->request->getSession()->getLocale(), - (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN - ); - + /* perform search */ $features = $this->search($search, $pagination); $loopResult = new LoopResult(); foreach ($features as $feature) { $loopResultRow = new LoopResultRow(); - $loopResultRow->set("ID", $feature->getId()); - $loopResultRow->set("TITLE",$feature->getTitle()); - $loopResultRow->set("CHAPO", $feature->getChapo()); - $loopResultRow->set("DESCRIPTION", $feature->getDescription()); - $loopResultRow->set("POSTSCRIPTUM", $feature->getPostscriptum()); + $loopResultRow->set("ID", $feature->getId()) + ->set("TITLE",$feature->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO", $feature->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION", $feature->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM", $feature->getVirtualColumn('i18n_POSTSCRIPTUM')); $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php b/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php index 35e586df1..272bb5211 100755 --- a/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php +++ b/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php @@ -31,6 +31,8 @@ use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\Base\FeatureAvQuery; use Thelia\Model\ConfigQuery; use Thelia\Type\TypeCollection; @@ -74,6 +76,9 @@ class FeatureAvailability extends BaseLoop { $search = FeatureAvQuery::create(); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale()); + $id = $this->getId(); if (null !== $id) { @@ -97,10 +102,10 @@ class FeatureAvailability extends BaseLoop foreach ($orders as $order) { switch ($order) { case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\Map\FeatureAvI18nTableMap::TITLE); + $search->addAscendingOrderByColumn('i18n_TITLE'); break; case "alpha-reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\Map\FeatureAvI18nTableMap::TITLE); + $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "manual": $search->orderByPosition(Criteria::ASC); @@ -111,28 +116,18 @@ class FeatureAvailability extends BaseLoop } } - /** - * Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - $search->joinWithI18n( - $this->request->getSession()->getLocale(), - (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN - ); - + /* perform search */ $featuresAv = $this->search($search, $pagination); $loopResult = new LoopResult(); foreach ($featuresAv as $featureAv) { $loopResultRow = new LoopResultRow(); - $loopResultRow->set("ID", $featureAv->getId()); - $loopResultRow->set("TITLE",$featureAv->getTitle()); - $loopResultRow->set("CHAPO", $featureAv->getChapo()); - $loopResultRow->set("DESCRIPTION", $featureAv->getDescription()); - $loopResultRow->set("POSTSCRIPTUM", $featureAv->getPostscriptum()); + $loopResultRow->set("ID", $featureAv->getId()) + ->set("TITLE",$featureAv->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO", $featureAv->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION", $featureAv->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM", $featureAv->getVirtualColumn('i18n_POSTSCRIPTUM')); $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/FeatureValue.php b/core/lib/Thelia/Core/Template/Loop/FeatureValue.php index 1eaf926e0..358b8d339 100755 --- a/core/lib/Thelia/Core/Template/Loop/FeatureValue.php +++ b/core/lib/Thelia/Core/Template/Loop/FeatureValue.php @@ -33,9 +33,12 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Log\Tlog; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\Base\FeatureProductQuery; use Thelia\Model\ConfigQuery; -use Thelia\Model\FeatureAvQuery; +use Thelia\Model\Map\FeatureAvTableMap; +use Thelia\Model\Map\FeatureProductTableMap; use Thelia\Type\TypeCollection; use Thelia\Type; @@ -80,6 +83,16 @@ class FeatureValue extends BaseLoop { $search = FeatureProductQuery::create(); + /* manage featureAv translations */ + ModelCriteriaTools::getI18n( + $search, + ConfigQuery::read("default_lang_without_translation", 1), + $this->request->getSession()->getLocale(), + array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM'), + FeatureAvTableMap::TABLE_NAME, + 'FEATURE_AV_ID' + ); + $feature = $this->getFeature(); $search->filterByFeatureId($feature, Criteria::EQUAL); @@ -109,16 +122,16 @@ class FeatureValue extends BaseLoop foreach($orders as $order) { switch ($order) { case "alpha": - //$search->addAscendingOrderByColumn(\Thelia\Model\Map\FeatureI18nTableMap::TITLE); + $search->addAscendingOrderByColumn(FeatureAvTableMap::TABLE_NAME . '_i18n_TITLE'); break; case "alpha_reverse": - //$search->addDescendingOrderByColumn(\Thelia\Model\Map\FeatureI18nTableMap::TITLE); + $search->addDescendingOrderByColumn(FeatureAvTableMap::TABLE_NAME . '_i18n_TITLE'); break; case "manual": - //$search->orderByPosition(Criteria::ASC); + $search->orderByPosition(Criteria::ASC); break; case "manual_reverse": - //$search->orderByPosition(Criteria::DESC); + $search->orderByPosition(Criteria::DESC); break; } } @@ -131,19 +144,11 @@ class FeatureValue extends BaseLoop $loopResultRow = new LoopResultRow(); $loopResultRow->set("ID", $featureValue->getId()); - $loopResultRow->set("PERSONAL_VALUE", $featureValue->getByDefault()); - - $featureAvailability = null; - if($featureValue->getFeatureAvId() !== null) { - $featureAvailability = FeatureAvQuery::create() - ->joinWithI18n('fr_FR') - ->findPk($featureValue->getFeatureAvId()); - } - - $loopResultRow->set("TITLE", ($featureAvailability === null ? '' : $featureAvailability->getTitle())); - $loopResultRow->set("CHAPO", ($featureAvailability === null ? '' : $featureAvailability->getChapo())); - $loopResultRow->set("DESCRIPTION", ($featureAvailability === null ? '' : $featureAvailability->getDescription())); - $loopResultRow->set("POSTSCRIPTUM", ($featureAvailability === null ? '' : $featureAvailability->getPostscriptum())); + $loopResultRow->set("PERSONAL_VALUE", $featureValue->getByDefault()) + ->set("TITLE",$featureValue->getVirtualColumn(FeatureAvTableMap::TABLE_NAME . '_i18n_TITLE')) + ->set("CHAPO", $featureValue->getVirtualColumn(FeatureAvTableMap::TABLE_NAME . '_i18n_CHAPO')) + ->set("DESCRIPTION", $featureValue->getVirtualColumn(FeatureAvTableMap::TABLE_NAME . '_i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM", $featureValue->getVirtualColumn(FeatureAvTableMap::TABLE_NAME . '_i18n_POSTSCRIPTUM')); $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index e41361d0a..7062a55b4 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -32,6 +32,8 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Log\Tlog; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\FolderQuery; use Thelia\Model\ConfigQuery; use Thelia\Type\TypeCollection; @@ -77,6 +79,9 @@ class Folder extends BaseLoop { $search = FolderQuery::create(); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale()); + $id = $this->getId(); if (!is_null($id)) { @@ -114,10 +119,10 @@ class Folder extends BaseLoop foreach($orders as $order) { switch ($order) { case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\Map\FolderI18nTableMap::TITLE); + $search->addAscendingOrderByColumn('i18n_TITLE'); break; case "alpha_reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\Map\FolderI18nTableMap::TITLE); + $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "manual_reverse": $search->orderByPosition(Criteria::DESC); @@ -133,35 +138,29 @@ class Folder extends BaseLoop } } - /** - * \Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - $search->joinWithI18n( - $this->request->getSession()->getLocale(), - (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN - ); - + /* perform search */ $folders = $this->search($search, $pagination); + /* @todo */ $notEmpty = $this->getNot_empty(); $loopResult = new LoopResult(); foreach ($folders as $folder) { - if ($notEmpty && $folder->countAllProducts() == 0) continue; + /* + * no cause pagination lost : + * if ($notEmpty && $folder->countAllProducts() == 0) continue; + */ $loopResultRow = new LoopResultRow(); $loopResultRow ->set("ID", $folder->getId()) - ->set("TITLE",$folder->getTitle()) - ->set("CHAPO", $folder->getChapo()) - ->set("DESCRIPTION", $folder->getDescription()) - ->set("POSTSCRIPTUM", $folder->getPostscriptum()) + ->set("TITLE",$folder->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO", $folder->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION", $folder->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM", $folder->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("PARENT", $folder->getParent()) ->set("CONTENT_COUNT", $folder->countChild()) ->set("VISIBLE", $folder->getVisible() ? "1" : "0") diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 74eda3a00..9c22a4987 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -33,6 +33,8 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Log\Tlog; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\CategoryQuery; use Thelia\Model\Map\FeatureProductTableMap; use Thelia\Model\Map\ProductPriceTableMap; @@ -135,16 +137,8 @@ class Product extends BaseLoop { $search = ProductQuery::create(); - /** - * Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - $search->joinWithI18n( - $this->request->getSession()->getLocale(), - (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN - ); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale()); $attributeNonStrictMatch = $this->getAttribute_non_strict_match(); $isPSELeftJoinList = array(); @@ -460,10 +454,10 @@ class Product extends BaseLoop foreach($orders as $order) { switch ($order) { case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\Map\ProductI18nTableMap::TITLE); + $search->addAscendingOrderByColumn('i18n_TITLE'); break; case "alpha_reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\Map\ProductI18nTableMap::TITLE); + $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "min_price": $search->addAscendingOrderByColumn('real_lowest_price', Criteria::ASC); @@ -506,6 +500,7 @@ class Product extends BaseLoop } } + /* perform search */ $products = $this->search($search, $pagination); $loopResult = new LoopResult(); @@ -515,10 +510,10 @@ class Product extends BaseLoop $loopResultRow->set("ID", $product->getId()) ->set("REF",$product->getRef()) - ->set("TITLE",$product->getTitle()) - ->set("CHAPO", $product->getChapo()) - ->set("DESCRIPTION", $product->getDescription()) - ->set("POSTSCRIPTUM", $product->getPostscriptum()) + ->set("TITLE",$product->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO", $product->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION", $product->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM", $product->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("BEST_PRICE", $product->getVirtualColumn('real_lowest_price')) ->set("IS_PROMO", $product->getVirtualColumn('main_product_is_promo')) ->set("IS_NEW", $product->getVirtualColumn('main_product_is_new')) diff --git a/core/lib/Thelia/Core/Template/Loop/ProductSaleElement.php b/core/lib/Thelia/Core/Template/Loop/ProductSaleElement.php index 36b234c33..1db2bcda2 100755 --- a/core/lib/Thelia/Core/Template/Loop/ProductSaleElement.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductSaleElement.php @@ -132,16 +132,6 @@ class ProductSaleElements extends BaseLoop ->set("PRICE", $PSEValue->getVirtualColumn('price_PRICE')) ->set("PROMO_PRICE", $PSEValue->getVirtualColumn('price_PROMO_PRICE')); - //$price = $PSEValue->getAttributeAv(); - - /* - $attributeAvailability = $PSEValue->getAttributeAv(); - - $loopResultRow->set("TITLE", ($attributeAvailability === null ? '' : $attributeAvailability->getTitle())); - $loopResultRow->set("CHAPO", ($attributeAvailability === null ? '' : $attributeAvailability->getChapo())); - $loopResultRow->set("DESCRIPTION", ($attributeAvailability === null ? '' : $attributeAvailability->getDescription())); - $loopResultRow->set("POSTSCRIPTUM", ($attributeAvailability === null ? '' : $attributeAvailability->getPostscriptum()));*/ - $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/Title.php b/core/lib/Thelia/Core/Template/Loop/Title.php index b4b7c5421..843e29334 100755 --- a/core/lib/Thelia/Core/Template/Loop/Title.php +++ b/core/lib/Thelia/Core/Template/Loop/Title.php @@ -31,6 +31,8 @@ use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Model\Tools\ModelCriteriaTools; + use Thelia\Model\CustomerTitleQuery; use Thelia\Model\ConfigQuery; @@ -64,35 +66,28 @@ class Title extends BaseLoop { $search = CustomerTitleQuery::create(); + /* manage translations */ + ModelCriteriaTools::getI18n($search, ConfigQuery::read("default_lang_without_translation", 1), $this->request->getSession()->getLocale(), array('SHORT', 'LONG')); + $id = $this->getId(); if (null !== $id) { $search->filterById($id, Criteria::IN); } - /** - * Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation. - * - * @todo : verify here if we want results for row without translations. - */ - - $search->joinWithI18n( - $this->request->getSession()->getLocale(), - (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN - ); - $search->orderByPosition(); + /* perform search */ $titles = $this->search($search, $pagination); $loopResult = new LoopResult(); foreach ($titles as $title) { $loopResultRow = new LoopResultRow(); - $loopResultRow->set("ID", $title->getId()); - $loopResultRow->set("DEFAULT", $title->getByDefault()); - $loopResultRow->set("SHORT", $title->getShort()); - $loopResultRow->set("LONG", $title->getLong()); + $loopResultRow->set("ID", $title->getId()) + ->set("DEFAULT", $title->getByDefault()) + ->set("SHORT", $title->getVirtualColumn('i18n_SHORT')) + ->set("LONG", $title->getVirtualColumn('i18n_LONG')); $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Model/Base/Accessory.php b/core/lib/Thelia/Model/Base/Accessory.php index f4110b19e..183f59947 100755 --- a/core/lib/Thelia/Model/Base/Accessory.php +++ b/core/lib/Thelia/Model/Base/Accessory.php @@ -266,7 +266,7 @@ abstract class Accessory implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Address.php b/core/lib/Thelia/Model/Base/Address.php index 45cad61aa..a6ab068d1 100755 --- a/core/lib/Thelia/Model/Base/Address.php +++ b/core/lib/Thelia/Model/Base/Address.php @@ -388,7 +388,7 @@ abstract class Address implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Admin.php b/core/lib/Thelia/Model/Base/Admin.php index b1241473e..6110aee7a 100755 --- a/core/lib/Thelia/Model/Base/Admin.php +++ b/core/lib/Thelia/Model/Base/Admin.php @@ -300,7 +300,7 @@ abstract class Admin implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/AdminGroup.php b/core/lib/Thelia/Model/Base/AdminGroup.php index 60141e3f8..9eadbb107 100755 --- a/core/lib/Thelia/Model/Base/AdminGroup.php +++ b/core/lib/Thelia/Model/Base/AdminGroup.php @@ -262,7 +262,7 @@ abstract class AdminGroup implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/AdminLog.php b/core/lib/Thelia/Model/Base/AdminLog.php index c83be20ee..ae828e4bb 100755 --- a/core/lib/Thelia/Model/Base/AdminLog.php +++ b/core/lib/Thelia/Model/Base/AdminLog.php @@ -266,7 +266,7 @@ abstract class AdminLog implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Area.php b/core/lib/Thelia/Model/Base/Area.php index fbd3199f4..08fc8be42 100755 --- a/core/lib/Thelia/Model/Base/Area.php +++ b/core/lib/Thelia/Model/Base/Area.php @@ -277,7 +277,7 @@ abstract class Area implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Attribute.php b/core/lib/Thelia/Model/Base/Attribute.php index efe4a631d..21fb3389a 100755 --- a/core/lib/Thelia/Model/Base/Attribute.php +++ b/core/lib/Thelia/Model/Base/Attribute.php @@ -132,7 +132,7 @@ abstract class Attribute implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -326,7 +326,7 @@ abstract class Attribute implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -2554,7 +2554,7 @@ abstract class Attribute implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collAttributeAvs instanceof Collection) { @@ -2612,7 +2612,7 @@ abstract class Attribute implements ActiveRecordInterface * * @return ChildAttribute The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -2636,7 +2636,7 @@ abstract class Attribute implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildAttributeI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collAttributeI18ns) { @@ -2671,7 +2671,7 @@ abstract class Attribute implements ActiveRecordInterface * * @return ChildAttribute The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildAttributeI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/AttributeAv.php b/core/lib/Thelia/Model/Base/AttributeAv.php index 43a1be294..817c9738d 100755 --- a/core/lib/Thelia/Model/Base/AttributeAv.php +++ b/core/lib/Thelia/Model/Base/AttributeAv.php @@ -122,7 +122,7 @@ abstract class AttributeAv implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -298,7 +298,7 @@ abstract class AttributeAv implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1903,7 +1903,7 @@ abstract class AttributeAv implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collAttributeCombinations instanceof Collection) { @@ -1950,7 +1950,7 @@ abstract class AttributeAv implements ActiveRecordInterface * * @return ChildAttributeAv The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1974,7 +1974,7 @@ abstract class AttributeAv implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildAttributeAvI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collAttributeAvI18ns) { @@ -2009,7 +2009,7 @@ abstract class AttributeAv implements ActiveRecordInterface * * @return ChildAttributeAv The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildAttributeAvI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/AttributeAvI18n.php b/core/lib/Thelia/Model/Base/AttributeAvI18n.php index 3e7b9afcd..8b2b14a32 100755 --- a/core/lib/Thelia/Model/Base/AttributeAvI18n.php +++ b/core/lib/Thelia/Model/Base/AttributeAvI18n.php @@ -61,7 +61,7 @@ abstract class AttributeAvI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class AttributeAvI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class AttributeAvI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class AttributeAvI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/AttributeAvQuery.php b/core/lib/Thelia/Model/Base/AttributeAvQuery.php index 8ebfaa8c9..4f724b4f4 100755 --- a/core/lib/Thelia/Model/Base/AttributeAvQuery.php +++ b/core/lib/Thelia/Model/Base/AttributeAvQuery.php @@ -841,7 +841,7 @@ abstract class AttributeAvQuery extends ModelCriteria * * @return ChildAttributeAvQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'AttributeAvI18n'; @@ -859,7 +859,7 @@ abstract class AttributeAvQuery extends ModelCriteria * * @return ChildAttributeAvQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -880,7 +880,7 @@ abstract class AttributeAvQuery extends ModelCriteria * * @return ChildAttributeAvI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/AttributeCategory.php b/core/lib/Thelia/Model/Base/AttributeCategory.php index 691fa43ad..da702559a 100755 --- a/core/lib/Thelia/Model/Base/AttributeCategory.php +++ b/core/lib/Thelia/Model/Base/AttributeCategory.php @@ -262,7 +262,7 @@ abstract class AttributeCategory implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/AttributeCombination.php b/core/lib/Thelia/Model/Base/AttributeCombination.php index ea2ade03c..ef840a5a1 100755 --- a/core/lib/Thelia/Model/Base/AttributeCombination.php +++ b/core/lib/Thelia/Model/Base/AttributeCombination.php @@ -269,7 +269,7 @@ abstract class AttributeCombination implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/AttributeI18n.php b/core/lib/Thelia/Model/Base/AttributeI18n.php index 0e4a1db8f..8a0456192 100755 --- a/core/lib/Thelia/Model/Base/AttributeI18n.php +++ b/core/lib/Thelia/Model/Base/AttributeI18n.php @@ -61,7 +61,7 @@ abstract class AttributeI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class AttributeI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class AttributeI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class AttributeI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/AttributeQuery.php b/core/lib/Thelia/Model/Base/AttributeQuery.php index cabbaf7ac..cbb690efb 100755 --- a/core/lib/Thelia/Model/Base/AttributeQuery.php +++ b/core/lib/Thelia/Model/Base/AttributeQuery.php @@ -886,7 +886,7 @@ abstract class AttributeQuery extends ModelCriteria * * @return ChildAttributeQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'AttributeI18n'; @@ -904,7 +904,7 @@ abstract class AttributeQuery extends ModelCriteria * * @return ChildAttributeQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -925,7 +925,7 @@ abstract class AttributeQuery extends ModelCriteria * * @return ChildAttributeI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Cart.php b/core/lib/Thelia/Model/Base/Cart.php index 910bdf0e0..20a2d9a5c 100755 --- a/core/lib/Thelia/Model/Base/Cart.php +++ b/core/lib/Thelia/Model/Base/Cart.php @@ -307,7 +307,7 @@ abstract class Cart implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/CartItem.php b/core/lib/Thelia/Model/Base/CartItem.php index 3c5711022..827a4c5ec 100755 --- a/core/lib/Thelia/Model/Base/CartItem.php +++ b/core/lib/Thelia/Model/Base/CartItem.php @@ -313,7 +313,7 @@ abstract class CartItem implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Category.php b/core/lib/Thelia/Model/Base/Category.php index 85a77a061..6a4445db4 100755 --- a/core/lib/Thelia/Model/Base/Category.php +++ b/core/lib/Thelia/Model/Base/Category.php @@ -218,7 +218,7 @@ abstract class Category implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -475,7 +475,7 @@ abstract class Category implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -4822,7 +4822,7 @@ abstract class Category implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collProductCategories instanceof Collection) { @@ -4894,7 +4894,7 @@ abstract class Category implements ActiveRecordInterface * * @return ChildCategory The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -4918,7 +4918,7 @@ abstract class Category implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildCategoryI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collCategoryI18ns) { @@ -4953,7 +4953,7 @@ abstract class Category implements ActiveRecordInterface * * @return ChildCategory The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildCategoryI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/CategoryDocument.php b/core/lib/Thelia/Model/Base/CategoryDocument.php index 165bfa492..a5493815d 100755 --- a/core/lib/Thelia/Model/Base/CategoryDocument.php +++ b/core/lib/Thelia/Model/Base/CategoryDocument.php @@ -120,7 +120,7 @@ abstract class CategoryDocument implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -290,7 +290,7 @@ abstract class CategoryDocument implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1640,7 +1640,7 @@ abstract class CategoryDocument implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collCategoryDocumentI18ns instanceof Collection) { @@ -1683,7 +1683,7 @@ abstract class CategoryDocument implements ActiveRecordInterface * * @return ChildCategoryDocument The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1707,7 +1707,7 @@ abstract class CategoryDocument implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildCategoryDocumentI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collCategoryDocumentI18ns) { @@ -1742,7 +1742,7 @@ abstract class CategoryDocument implements ActiveRecordInterface * * @return ChildCategoryDocument The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildCategoryDocumentI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/CategoryDocumentI18n.php b/core/lib/Thelia/Model/Base/CategoryDocumentI18n.php index db3189cc3..2d5f76fcf 100755 --- a/core/lib/Thelia/Model/Base/CategoryDocumentI18n.php +++ b/core/lib/Thelia/Model/Base/CategoryDocumentI18n.php @@ -61,7 +61,7 @@ abstract class CategoryDocumentI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class CategoryDocumentI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class CategoryDocumentI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class CategoryDocumentI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/CategoryDocumentQuery.php b/core/lib/Thelia/Model/Base/CategoryDocumentQuery.php index 8c0a177ac..239ec6c83 100755 --- a/core/lib/Thelia/Model/Base/CategoryDocumentQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryDocumentQuery.php @@ -797,7 +797,7 @@ abstract class CategoryDocumentQuery extends ModelCriteria * * @return ChildCategoryDocumentQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'CategoryDocumentI18n'; @@ -815,7 +815,7 @@ abstract class CategoryDocumentQuery extends ModelCriteria * * @return ChildCategoryDocumentQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -836,7 +836,7 @@ abstract class CategoryDocumentQuery extends ModelCriteria * * @return ChildCategoryDocumentI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/CategoryI18n.php b/core/lib/Thelia/Model/Base/CategoryI18n.php index 83d62572d..3e3d36521 100755 --- a/core/lib/Thelia/Model/Base/CategoryI18n.php +++ b/core/lib/Thelia/Model/Base/CategoryI18n.php @@ -61,7 +61,7 @@ abstract class CategoryI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class CategoryI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class CategoryI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class CategoryI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/CategoryImage.php b/core/lib/Thelia/Model/Base/CategoryImage.php index efde7b64a..6fd905453 100755 --- a/core/lib/Thelia/Model/Base/CategoryImage.php +++ b/core/lib/Thelia/Model/Base/CategoryImage.php @@ -120,7 +120,7 @@ abstract class CategoryImage implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -290,7 +290,7 @@ abstract class CategoryImage implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1640,7 +1640,7 @@ abstract class CategoryImage implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collCategoryImageI18ns instanceof Collection) { @@ -1683,7 +1683,7 @@ abstract class CategoryImage implements ActiveRecordInterface * * @return ChildCategoryImage The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1707,7 +1707,7 @@ abstract class CategoryImage implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildCategoryImageI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collCategoryImageI18ns) { @@ -1742,7 +1742,7 @@ abstract class CategoryImage implements ActiveRecordInterface * * @return ChildCategoryImage The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildCategoryImageI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/CategoryImageI18n.php b/core/lib/Thelia/Model/Base/CategoryImageI18n.php index ce61e9836..0c65b8036 100755 --- a/core/lib/Thelia/Model/Base/CategoryImageI18n.php +++ b/core/lib/Thelia/Model/Base/CategoryImageI18n.php @@ -61,7 +61,7 @@ abstract class CategoryImageI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class CategoryImageI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class CategoryImageI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class CategoryImageI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/CategoryImageQuery.php b/core/lib/Thelia/Model/Base/CategoryImageQuery.php index 2130e757b..305b01755 100755 --- a/core/lib/Thelia/Model/Base/CategoryImageQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryImageQuery.php @@ -797,7 +797,7 @@ abstract class CategoryImageQuery extends ModelCriteria * * @return ChildCategoryImageQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'CategoryImageI18n'; @@ -815,7 +815,7 @@ abstract class CategoryImageQuery extends ModelCriteria * * @return ChildCategoryImageQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -836,7 +836,7 @@ abstract class CategoryImageQuery extends ModelCriteria * * @return ChildCategoryImageI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/CategoryQuery.php b/core/lib/Thelia/Model/Base/CategoryQuery.php index 0b7df33dd..5a9c1165f 100755 --- a/core/lib/Thelia/Model/Base/CategoryQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryQuery.php @@ -1461,7 +1461,7 @@ abstract class CategoryQuery extends ModelCriteria * * @return ChildCategoryQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'CategoryI18n'; @@ -1479,7 +1479,7 @@ abstract class CategoryQuery extends ModelCriteria * * @return ChildCategoryQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -1500,7 +1500,7 @@ abstract class CategoryQuery extends ModelCriteria * * @return ChildCategoryI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/CategoryVersion.php b/core/lib/Thelia/Model/Base/CategoryVersion.php index d8dfe76e0..416ad95d5 100755 --- a/core/lib/Thelia/Model/Base/CategoryVersion.php +++ b/core/lib/Thelia/Model/Base/CategoryVersion.php @@ -292,7 +292,7 @@ abstract class CategoryVersion implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Config.php b/core/lib/Thelia/Model/Base/Config.php index d687ffefe..b4d909de4 100755 --- a/core/lib/Thelia/Model/Base/Config.php +++ b/core/lib/Thelia/Model/Base/Config.php @@ -121,7 +121,7 @@ abstract class Config implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -305,7 +305,7 @@ abstract class Config implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1642,7 +1642,7 @@ abstract class Config implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collConfigI18ns instanceof Collection) { @@ -1684,7 +1684,7 @@ abstract class Config implements ActiveRecordInterface * * @return ChildConfig The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1708,7 +1708,7 @@ abstract class Config implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildConfigI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collConfigI18ns) { @@ -1743,7 +1743,7 @@ abstract class Config implements ActiveRecordInterface * * @return ChildConfig The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildConfigI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/ConfigI18n.php b/core/lib/Thelia/Model/Base/ConfigI18n.php index 6247e15d1..57c72ace8 100755 --- a/core/lib/Thelia/Model/Base/ConfigI18n.php +++ b/core/lib/Thelia/Model/Base/ConfigI18n.php @@ -61,7 +61,7 @@ abstract class ConfigI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class ConfigI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class ConfigI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class ConfigI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/ConfigQuery.php b/core/lib/Thelia/Model/Base/ConfigQuery.php index ef47308a4..b2ddc3409 100755 --- a/core/lib/Thelia/Model/Base/ConfigQuery.php +++ b/core/lib/Thelia/Model/Base/ConfigQuery.php @@ -749,7 +749,7 @@ abstract class ConfigQuery extends ModelCriteria * * @return ChildConfigQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'ConfigI18n'; @@ -767,7 +767,7 @@ abstract class ConfigQuery extends ModelCriteria * * @return ChildConfigQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -788,7 +788,7 @@ abstract class ConfigQuery extends ModelCriteria * * @return ChildConfigI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Content.php b/core/lib/Thelia/Model/Base/Content.php index 96ea69eef..59745e39c 100755 --- a/core/lib/Thelia/Model/Base/Content.php +++ b/core/lib/Thelia/Model/Base/Content.php @@ -182,7 +182,7 @@ abstract class Content implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -415,7 +415,7 @@ abstract class Content implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -3720,7 +3720,7 @@ abstract class Content implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collContentAssocs instanceof Collection) { @@ -3790,7 +3790,7 @@ abstract class Content implements ActiveRecordInterface * * @return ChildContent The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -3814,7 +3814,7 @@ abstract class Content implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildContentI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collContentI18ns) { @@ -3849,7 +3849,7 @@ abstract class Content implements ActiveRecordInterface * * @return ChildContent The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildContentI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/ContentAssoc.php b/core/lib/Thelia/Model/Base/ContentAssoc.php index eaa1cb9b7..eb3645c0b 100755 --- a/core/lib/Thelia/Model/Base/ContentAssoc.php +++ b/core/lib/Thelia/Model/Base/ContentAssoc.php @@ -281,7 +281,7 @@ abstract class ContentAssoc implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/ContentDocument.php b/core/lib/Thelia/Model/Base/ContentDocument.php index 990fc4a9f..01f631208 100755 --- a/core/lib/Thelia/Model/Base/ContentDocument.php +++ b/core/lib/Thelia/Model/Base/ContentDocument.php @@ -120,7 +120,7 @@ abstract class ContentDocument implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -290,7 +290,7 @@ abstract class ContentDocument implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1640,7 +1640,7 @@ abstract class ContentDocument implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collContentDocumentI18ns instanceof Collection) { @@ -1683,7 +1683,7 @@ abstract class ContentDocument implements ActiveRecordInterface * * @return ChildContentDocument The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1707,7 +1707,7 @@ abstract class ContentDocument implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildContentDocumentI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collContentDocumentI18ns) { @@ -1742,7 +1742,7 @@ abstract class ContentDocument implements ActiveRecordInterface * * @return ChildContentDocument The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildContentDocumentI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/ContentDocumentI18n.php b/core/lib/Thelia/Model/Base/ContentDocumentI18n.php index 2cfc367b0..f11cd8a08 100755 --- a/core/lib/Thelia/Model/Base/ContentDocumentI18n.php +++ b/core/lib/Thelia/Model/Base/ContentDocumentI18n.php @@ -61,7 +61,7 @@ abstract class ContentDocumentI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class ContentDocumentI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class ContentDocumentI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class ContentDocumentI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/ContentDocumentQuery.php b/core/lib/Thelia/Model/Base/ContentDocumentQuery.php index 89cf5d48b..72cc8cae4 100755 --- a/core/lib/Thelia/Model/Base/ContentDocumentQuery.php +++ b/core/lib/Thelia/Model/Base/ContentDocumentQuery.php @@ -797,7 +797,7 @@ abstract class ContentDocumentQuery extends ModelCriteria * * @return ChildContentDocumentQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'ContentDocumentI18n'; @@ -815,7 +815,7 @@ abstract class ContentDocumentQuery extends ModelCriteria * * @return ChildContentDocumentQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -836,7 +836,7 @@ abstract class ContentDocumentQuery extends ModelCriteria * * @return ChildContentDocumentI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/ContentFolder.php b/core/lib/Thelia/Model/Base/ContentFolder.php index 52f5fa88a..51d72b974 100755 --- a/core/lib/Thelia/Model/Base/ContentFolder.php +++ b/core/lib/Thelia/Model/Base/ContentFolder.php @@ -256,7 +256,7 @@ abstract class ContentFolder implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/ContentI18n.php b/core/lib/Thelia/Model/Base/ContentI18n.php index d3974522b..244862800 100755 --- a/core/lib/Thelia/Model/Base/ContentI18n.php +++ b/core/lib/Thelia/Model/Base/ContentI18n.php @@ -61,7 +61,7 @@ abstract class ContentI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class ContentI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class ContentI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class ContentI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/ContentImage.php b/core/lib/Thelia/Model/Base/ContentImage.php index 22c4bed10..33e1eca09 100755 --- a/core/lib/Thelia/Model/Base/ContentImage.php +++ b/core/lib/Thelia/Model/Base/ContentImage.php @@ -120,7 +120,7 @@ abstract class ContentImage implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -290,7 +290,7 @@ abstract class ContentImage implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1640,7 +1640,7 @@ abstract class ContentImage implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collContentImageI18ns instanceof Collection) { @@ -1683,7 +1683,7 @@ abstract class ContentImage implements ActiveRecordInterface * * @return ChildContentImage The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1707,7 +1707,7 @@ abstract class ContentImage implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildContentImageI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collContentImageI18ns) { @@ -1742,7 +1742,7 @@ abstract class ContentImage implements ActiveRecordInterface * * @return ChildContentImage The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildContentImageI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/ContentImageI18n.php b/core/lib/Thelia/Model/Base/ContentImageI18n.php index d655dec53..cba4fba17 100755 --- a/core/lib/Thelia/Model/Base/ContentImageI18n.php +++ b/core/lib/Thelia/Model/Base/ContentImageI18n.php @@ -61,7 +61,7 @@ abstract class ContentImageI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class ContentImageI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class ContentImageI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class ContentImageI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/ContentImageQuery.php b/core/lib/Thelia/Model/Base/ContentImageQuery.php index f69464dd7..26e0ffe5c 100755 --- a/core/lib/Thelia/Model/Base/ContentImageQuery.php +++ b/core/lib/Thelia/Model/Base/ContentImageQuery.php @@ -797,7 +797,7 @@ abstract class ContentImageQuery extends ModelCriteria * * @return ChildContentImageQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'ContentImageI18n'; @@ -815,7 +815,7 @@ abstract class ContentImageQuery extends ModelCriteria * * @return ChildContentImageQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -836,7 +836,7 @@ abstract class ContentImageQuery extends ModelCriteria * * @return ChildContentImageI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/ContentQuery.php b/core/lib/Thelia/Model/Base/ContentQuery.php index 2cbbe109b..28d32cbe6 100755 --- a/core/lib/Thelia/Model/Base/ContentQuery.php +++ b/core/lib/Thelia/Model/Base/ContentQuery.php @@ -1294,7 +1294,7 @@ abstract class ContentQuery extends ModelCriteria * * @return ChildContentQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'ContentI18n'; @@ -1312,7 +1312,7 @@ abstract class ContentQuery extends ModelCriteria * * @return ChildContentQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -1333,7 +1333,7 @@ abstract class ContentQuery extends ModelCriteria * * @return ChildContentI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/ContentVersion.php b/core/lib/Thelia/Model/Base/ContentVersion.php index ca9189608..ef2897030 100755 --- a/core/lib/Thelia/Model/Base/ContentVersion.php +++ b/core/lib/Thelia/Model/Base/ContentVersion.php @@ -286,7 +286,7 @@ abstract class ContentVersion implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Country.php b/core/lib/Thelia/Model/Base/Country.php index 704375de2..3794bff3c 100755 --- a/core/lib/Thelia/Model/Base/Country.php +++ b/core/lib/Thelia/Model/Base/Country.php @@ -142,7 +142,7 @@ abstract class Country implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -324,7 +324,7 @@ abstract class Country implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -2323,7 +2323,7 @@ abstract class Country implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collTaxRuleCountries instanceof Collection) { @@ -2374,7 +2374,7 @@ abstract class Country implements ActiveRecordInterface * * @return ChildCountry The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -2398,7 +2398,7 @@ abstract class Country implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildCountryI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collCountryI18ns) { @@ -2433,7 +2433,7 @@ abstract class Country implements ActiveRecordInterface * * @return ChildCountry The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildCountryI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/CountryI18n.php b/core/lib/Thelia/Model/Base/CountryI18n.php index be63955ca..fbba979a1 100755 --- a/core/lib/Thelia/Model/Base/CountryI18n.php +++ b/core/lib/Thelia/Model/Base/CountryI18n.php @@ -61,7 +61,7 @@ abstract class CountryI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class CountryI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class CountryI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class CountryI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/CountryQuery.php b/core/lib/Thelia/Model/Base/CountryQuery.php index 6c3a1c950..2c709f800 100755 --- a/core/lib/Thelia/Model/Base/CountryQuery.php +++ b/core/lib/Thelia/Model/Base/CountryQuery.php @@ -972,7 +972,7 @@ abstract class CountryQuery extends ModelCriteria * * @return ChildCountryQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'CountryI18n'; @@ -990,7 +990,7 @@ abstract class CountryQuery extends ModelCriteria * * @return ChildCountryQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -1011,7 +1011,7 @@ abstract class CountryQuery extends ModelCriteria * * @return ChildCountryI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Coupon.php b/core/lib/Thelia/Model/Base/Coupon.php index 2c3dae5c9..a339fa835 100755 --- a/core/lib/Thelia/Model/Base/Coupon.php +++ b/core/lib/Thelia/Model/Base/Coupon.php @@ -293,7 +293,7 @@ abstract class Coupon implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/CouponOrder.php b/core/lib/Thelia/Model/Base/CouponOrder.php index 32ae68fde..71a71f673 100755 --- a/core/lib/Thelia/Model/Base/CouponOrder.php +++ b/core/lib/Thelia/Model/Base/CouponOrder.php @@ -261,7 +261,7 @@ abstract class CouponOrder implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/CouponRule.php b/core/lib/Thelia/Model/Base/CouponRule.php index 5602b0044..8a34f5d0b 100755 --- a/core/lib/Thelia/Model/Base/CouponRule.php +++ b/core/lib/Thelia/Model/Base/CouponRule.php @@ -267,7 +267,7 @@ abstract class CouponRule implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Currency.php b/core/lib/Thelia/Model/Base/Currency.php index 77718992f..f99288679 100755 --- a/core/lib/Thelia/Model/Base/Currency.php +++ b/core/lib/Thelia/Model/Base/Currency.php @@ -149,7 +149,7 @@ abstract class Currency implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -337,7 +337,7 @@ abstract class Currency implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -2681,7 +2681,7 @@ abstract class Currency implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collOrders instanceof Collection) { @@ -2735,7 +2735,7 @@ abstract class Currency implements ActiveRecordInterface * * @return ChildCurrency The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -2759,7 +2759,7 @@ abstract class Currency implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildCurrencyI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collCurrencyI18ns) { @@ -2794,7 +2794,7 @@ abstract class Currency implements ActiveRecordInterface * * @return ChildCurrency The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildCurrencyI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/CurrencyI18n.php b/core/lib/Thelia/Model/Base/CurrencyI18n.php index eb86a87c4..931c3acbf 100755 --- a/core/lib/Thelia/Model/Base/CurrencyI18n.php +++ b/core/lib/Thelia/Model/Base/CurrencyI18n.php @@ -61,7 +61,7 @@ abstract class CurrencyI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -93,7 +93,7 @@ abstract class CurrencyI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -254,7 +254,7 @@ abstract class CurrencyI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -462,7 +462,7 @@ abstract class CurrencyI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/CurrencyQuery.php b/core/lib/Thelia/Model/Base/CurrencyQuery.php index eb4b1b2f7..9b4ecf51e 100755 --- a/core/lib/Thelia/Model/Base/CurrencyQuery.php +++ b/core/lib/Thelia/Model/Base/CurrencyQuery.php @@ -1025,7 +1025,7 @@ abstract class CurrencyQuery extends ModelCriteria * * @return ChildCurrencyQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'CurrencyI18n'; @@ -1043,7 +1043,7 @@ abstract class CurrencyQuery extends ModelCriteria * * @return ChildCurrencyQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -1064,7 +1064,7 @@ abstract class CurrencyQuery extends ModelCriteria * * @return ChildCurrencyI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Customer.php b/core/lib/Thelia/Model/Base/Customer.php index c3315ac6f..3d87f3e28 100755 --- a/core/lib/Thelia/Model/Base/Customer.php +++ b/core/lib/Thelia/Model/Base/Customer.php @@ -352,7 +352,7 @@ abstract class Customer implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/CustomerTitle.php b/core/lib/Thelia/Model/Base/CustomerTitle.php index 5f8b11dd9..dcf271206 100755 --- a/core/lib/Thelia/Model/Base/CustomerTitle.php +++ b/core/lib/Thelia/Model/Base/CustomerTitle.php @@ -124,7 +124,7 @@ abstract class CustomerTitle implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -319,7 +319,7 @@ abstract class CustomerTitle implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -2106,7 +2106,7 @@ abstract class CustomerTitle implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collCustomers instanceof Collection) { @@ -2156,7 +2156,7 @@ abstract class CustomerTitle implements ActiveRecordInterface * * @return ChildCustomerTitle The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -2180,7 +2180,7 @@ abstract class CustomerTitle implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildCustomerTitleI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collCustomerTitleI18ns) { @@ -2215,7 +2215,7 @@ abstract class CustomerTitle implements ActiveRecordInterface * * @return ChildCustomerTitle The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildCustomerTitleI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/CustomerTitleI18n.php b/core/lib/Thelia/Model/Base/CustomerTitleI18n.php index c68b87123..4ea186061 100755 --- a/core/lib/Thelia/Model/Base/CustomerTitleI18n.php +++ b/core/lib/Thelia/Model/Base/CustomerTitleI18n.php @@ -61,7 +61,7 @@ abstract class CustomerTitleI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -99,7 +99,7 @@ abstract class CustomerTitleI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -260,7 +260,7 @@ abstract class CustomerTitleI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -500,7 +500,7 @@ abstract class CustomerTitleI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/CustomerTitleQuery.php b/core/lib/Thelia/Model/Base/CustomerTitleQuery.php index ea34c8c91..1c4be4081 100755 --- a/core/lib/Thelia/Model/Base/CustomerTitleQuery.php +++ b/core/lib/Thelia/Model/Base/CustomerTitleQuery.php @@ -825,7 +825,7 @@ abstract class CustomerTitleQuery extends ModelCriteria * * @return ChildCustomerTitleQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'CustomerTitleI18n'; @@ -843,7 +843,7 @@ abstract class CustomerTitleQuery extends ModelCriteria * * @return ChildCustomerTitleQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -864,7 +864,7 @@ abstract class CustomerTitleQuery extends ModelCriteria * * @return ChildCustomerTitleI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Delivzone.php b/core/lib/Thelia/Model/Base/Delivzone.php index 08125044e..deb21997e 100755 --- a/core/lib/Thelia/Model/Base/Delivzone.php +++ b/core/lib/Thelia/Model/Base/Delivzone.php @@ -255,7 +255,7 @@ abstract class Delivzone implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Feature.php b/core/lib/Thelia/Model/Base/Feature.php index 0dddd14e0..070bac50b 100755 --- a/core/lib/Thelia/Model/Base/Feature.php +++ b/core/lib/Thelia/Model/Base/Feature.php @@ -139,7 +139,7 @@ abstract class Feature implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -346,7 +346,7 @@ abstract class Feature implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -2628,7 +2628,7 @@ abstract class Feature implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collFeatureAvs instanceof Collection) { @@ -2686,7 +2686,7 @@ abstract class Feature implements ActiveRecordInterface * * @return ChildFeature The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -2710,7 +2710,7 @@ abstract class Feature implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildFeatureI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collFeatureI18ns) { @@ -2745,7 +2745,7 @@ abstract class Feature implements ActiveRecordInterface * * @return ChildFeature The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildFeatureI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/FeatureAv.php b/core/lib/Thelia/Model/Base/FeatureAv.php index b09a27cec..14e6cd35c 100755 --- a/core/lib/Thelia/Model/Base/FeatureAv.php +++ b/core/lib/Thelia/Model/Base/FeatureAv.php @@ -122,7 +122,7 @@ abstract class FeatureAv implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -298,7 +298,7 @@ abstract class FeatureAv implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1900,7 +1900,7 @@ abstract class FeatureAv implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collFeatureProducts instanceof Collection) { @@ -1947,7 +1947,7 @@ abstract class FeatureAv implements ActiveRecordInterface * * @return ChildFeatureAv The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1971,7 +1971,7 @@ abstract class FeatureAv implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildFeatureAvI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collFeatureAvI18ns) { @@ -2006,7 +2006,7 @@ abstract class FeatureAv implements ActiveRecordInterface * * @return ChildFeatureAv The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildFeatureAvI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/FeatureAvI18n.php b/core/lib/Thelia/Model/Base/FeatureAvI18n.php index 7cbca8129..a508d6075 100755 --- a/core/lib/Thelia/Model/Base/FeatureAvI18n.php +++ b/core/lib/Thelia/Model/Base/FeatureAvI18n.php @@ -61,7 +61,7 @@ abstract class FeatureAvI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class FeatureAvI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class FeatureAvI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class FeatureAvI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/FeatureAvQuery.php b/core/lib/Thelia/Model/Base/FeatureAvQuery.php index fb3796c97..6b3af4ed9 100755 --- a/core/lib/Thelia/Model/Base/FeatureAvQuery.php +++ b/core/lib/Thelia/Model/Base/FeatureAvQuery.php @@ -841,7 +841,7 @@ abstract class FeatureAvQuery extends ModelCriteria * * @return ChildFeatureAvQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'FeatureAvI18n'; @@ -859,7 +859,7 @@ abstract class FeatureAvQuery extends ModelCriteria * * @return ChildFeatureAvQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -880,7 +880,7 @@ abstract class FeatureAvQuery extends ModelCriteria * * @return ChildFeatureAvI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/FeatureCategory.php b/core/lib/Thelia/Model/Base/FeatureCategory.php index f3ce14349..035e077d2 100755 --- a/core/lib/Thelia/Model/Base/FeatureCategory.php +++ b/core/lib/Thelia/Model/Base/FeatureCategory.php @@ -262,7 +262,7 @@ abstract class FeatureCategory implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/FeatureI18n.php b/core/lib/Thelia/Model/Base/FeatureI18n.php index 0ede8eddb..06964ee19 100755 --- a/core/lib/Thelia/Model/Base/FeatureI18n.php +++ b/core/lib/Thelia/Model/Base/FeatureI18n.php @@ -61,7 +61,7 @@ abstract class FeatureI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class FeatureI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class FeatureI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class FeatureI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/FeatureProduct.php b/core/lib/Thelia/Model/Base/FeatureProduct.php index b68f4acd2..4af200d51 100755 --- a/core/lib/Thelia/Model/Base/FeatureProduct.php +++ b/core/lib/Thelia/Model/Base/FeatureProduct.php @@ -287,7 +287,7 @@ abstract class FeatureProduct implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/FeatureQuery.php b/core/lib/Thelia/Model/Base/FeatureQuery.php index 9b00e812e..f1fc81a3f 100755 --- a/core/lib/Thelia/Model/Base/FeatureQuery.php +++ b/core/lib/Thelia/Model/Base/FeatureQuery.php @@ -931,7 +931,7 @@ abstract class FeatureQuery extends ModelCriteria * * @return ChildFeatureQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'FeatureI18n'; @@ -949,7 +949,7 @@ abstract class FeatureQuery extends ModelCriteria * * @return ChildFeatureQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -970,7 +970,7 @@ abstract class FeatureQuery extends ModelCriteria * * @return ChildFeatureI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Folder.php b/core/lib/Thelia/Model/Base/Folder.php index 6ee28e7ff..8899ae6be 100755 --- a/core/lib/Thelia/Model/Base/Folder.php +++ b/core/lib/Thelia/Model/Base/Folder.php @@ -180,7 +180,7 @@ abstract class Folder implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -407,7 +407,7 @@ abstract class Folder implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -3460,7 +3460,7 @@ abstract class Folder implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collRewritings instanceof Collection) { @@ -3526,7 +3526,7 @@ abstract class Folder implements ActiveRecordInterface * * @return ChildFolder The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -3550,7 +3550,7 @@ abstract class Folder implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildFolderI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collFolderI18ns) { @@ -3585,7 +3585,7 @@ abstract class Folder implements ActiveRecordInterface * * @return ChildFolder The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildFolderI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/FolderDocument.php b/core/lib/Thelia/Model/Base/FolderDocument.php index 31e7c57a6..fbe0c91b1 100755 --- a/core/lib/Thelia/Model/Base/FolderDocument.php +++ b/core/lib/Thelia/Model/Base/FolderDocument.php @@ -120,7 +120,7 @@ abstract class FolderDocument implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -290,7 +290,7 @@ abstract class FolderDocument implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1640,7 +1640,7 @@ abstract class FolderDocument implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collFolderDocumentI18ns instanceof Collection) { @@ -1683,7 +1683,7 @@ abstract class FolderDocument implements ActiveRecordInterface * * @return ChildFolderDocument The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1707,7 +1707,7 @@ abstract class FolderDocument implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildFolderDocumentI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collFolderDocumentI18ns) { @@ -1742,7 +1742,7 @@ abstract class FolderDocument implements ActiveRecordInterface * * @return ChildFolderDocument The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildFolderDocumentI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/FolderDocumentI18n.php b/core/lib/Thelia/Model/Base/FolderDocumentI18n.php index d39a49af7..57a38034f 100755 --- a/core/lib/Thelia/Model/Base/FolderDocumentI18n.php +++ b/core/lib/Thelia/Model/Base/FolderDocumentI18n.php @@ -61,7 +61,7 @@ abstract class FolderDocumentI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class FolderDocumentI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class FolderDocumentI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class FolderDocumentI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/FolderDocumentQuery.php b/core/lib/Thelia/Model/Base/FolderDocumentQuery.php index b1c41a29e..85ed5c241 100755 --- a/core/lib/Thelia/Model/Base/FolderDocumentQuery.php +++ b/core/lib/Thelia/Model/Base/FolderDocumentQuery.php @@ -797,7 +797,7 @@ abstract class FolderDocumentQuery extends ModelCriteria * * @return ChildFolderDocumentQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'FolderDocumentI18n'; @@ -815,7 +815,7 @@ abstract class FolderDocumentQuery extends ModelCriteria * * @return ChildFolderDocumentQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -836,7 +836,7 @@ abstract class FolderDocumentQuery extends ModelCriteria * * @return ChildFolderDocumentI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/FolderI18n.php b/core/lib/Thelia/Model/Base/FolderI18n.php index fcdc66705..12d627cac 100755 --- a/core/lib/Thelia/Model/Base/FolderI18n.php +++ b/core/lib/Thelia/Model/Base/FolderI18n.php @@ -61,7 +61,7 @@ abstract class FolderI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class FolderI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class FolderI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class FolderI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/FolderImage.php b/core/lib/Thelia/Model/Base/FolderImage.php index 46c39060d..f1eb8a5ab 100755 --- a/core/lib/Thelia/Model/Base/FolderImage.php +++ b/core/lib/Thelia/Model/Base/FolderImage.php @@ -120,7 +120,7 @@ abstract class FolderImage implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -290,7 +290,7 @@ abstract class FolderImage implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1640,7 +1640,7 @@ abstract class FolderImage implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collFolderImageI18ns instanceof Collection) { @@ -1683,7 +1683,7 @@ abstract class FolderImage implements ActiveRecordInterface * * @return ChildFolderImage The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1707,7 +1707,7 @@ abstract class FolderImage implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildFolderImageI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collFolderImageI18ns) { @@ -1742,7 +1742,7 @@ abstract class FolderImage implements ActiveRecordInterface * * @return ChildFolderImage The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildFolderImageI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/FolderImageI18n.php b/core/lib/Thelia/Model/Base/FolderImageI18n.php index d5cc004d1..894b6ec0f 100755 --- a/core/lib/Thelia/Model/Base/FolderImageI18n.php +++ b/core/lib/Thelia/Model/Base/FolderImageI18n.php @@ -61,7 +61,7 @@ abstract class FolderImageI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class FolderImageI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class FolderImageI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class FolderImageI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/FolderImageQuery.php b/core/lib/Thelia/Model/Base/FolderImageQuery.php index ca12e098e..4ea930e20 100755 --- a/core/lib/Thelia/Model/Base/FolderImageQuery.php +++ b/core/lib/Thelia/Model/Base/FolderImageQuery.php @@ -797,7 +797,7 @@ abstract class FolderImageQuery extends ModelCriteria * * @return ChildFolderImageQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'FolderImageI18n'; @@ -815,7 +815,7 @@ abstract class FolderImageQuery extends ModelCriteria * * @return ChildFolderImageQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -836,7 +836,7 @@ abstract class FolderImageQuery extends ModelCriteria * * @return ChildFolderImageI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/FolderQuery.php b/core/lib/Thelia/Model/Base/FolderQuery.php index 893bb9819..22d2f3735 100755 --- a/core/lib/Thelia/Model/Base/FolderQuery.php +++ b/core/lib/Thelia/Model/Base/FolderQuery.php @@ -1262,7 +1262,7 @@ abstract class FolderQuery extends ModelCriteria * * @return ChildFolderQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'FolderI18n'; @@ -1280,7 +1280,7 @@ abstract class FolderQuery extends ModelCriteria * * @return ChildFolderQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -1301,7 +1301,7 @@ abstract class FolderQuery extends ModelCriteria * * @return ChildFolderI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/FolderVersion.php b/core/lib/Thelia/Model/Base/FolderVersion.php index 4f6305b7e..ec588dcbd 100755 --- a/core/lib/Thelia/Model/Base/FolderVersion.php +++ b/core/lib/Thelia/Model/Base/FolderVersion.php @@ -292,7 +292,7 @@ abstract class FolderVersion implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Group.php b/core/lib/Thelia/Model/Base/Group.php index 9cfde2bdc..eed65d778 100755 --- a/core/lib/Thelia/Model/Base/Group.php +++ b/core/lib/Thelia/Model/Base/Group.php @@ -139,7 +139,7 @@ abstract class Group implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -339,7 +339,7 @@ abstract class Group implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -2786,7 +2786,7 @@ abstract class Group implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collAdminGroups instanceof Collection) { @@ -2848,7 +2848,7 @@ abstract class Group implements ActiveRecordInterface * * @return ChildGroup The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -2872,7 +2872,7 @@ abstract class Group implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildGroupI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collGroupI18ns) { @@ -2907,7 +2907,7 @@ abstract class Group implements ActiveRecordInterface * * @return ChildGroup The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildGroupI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/GroupI18n.php b/core/lib/Thelia/Model/Base/GroupI18n.php index 4de63ea63..4ba0aac29 100755 --- a/core/lib/Thelia/Model/Base/GroupI18n.php +++ b/core/lib/Thelia/Model/Base/GroupI18n.php @@ -61,7 +61,7 @@ abstract class GroupI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class GroupI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class GroupI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class GroupI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/GroupModule.php b/core/lib/Thelia/Model/Base/GroupModule.php index 620ca9c91..82d6056f2 100755 --- a/core/lib/Thelia/Model/Base/GroupModule.php +++ b/core/lib/Thelia/Model/Base/GroupModule.php @@ -282,7 +282,7 @@ abstract class GroupModule implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/GroupQuery.php b/core/lib/Thelia/Model/Base/GroupQuery.php index d0eded79b..8ca963848 100755 --- a/core/lib/Thelia/Model/Base/GroupQuery.php +++ b/core/lib/Thelia/Model/Base/GroupQuery.php @@ -891,7 +891,7 @@ abstract class GroupQuery extends ModelCriteria * * @return ChildGroupQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'GroupI18n'; @@ -909,7 +909,7 @@ abstract class GroupQuery extends ModelCriteria * * @return ChildGroupQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -930,7 +930,7 @@ abstract class GroupQuery extends ModelCriteria * * @return ChildGroupI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/GroupResource.php b/core/lib/Thelia/Model/Base/GroupResource.php index 84d6006b0..ea6c0ff47 100755 --- a/core/lib/Thelia/Model/Base/GroupResource.php +++ b/core/lib/Thelia/Model/Base/GroupResource.php @@ -290,7 +290,7 @@ abstract class GroupResource implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Lang.php b/core/lib/Thelia/Model/Base/Lang.php index 3379594ef..293b0f3a7 100755 --- a/core/lib/Thelia/Model/Base/Lang.php +++ b/core/lib/Thelia/Model/Base/Lang.php @@ -272,7 +272,7 @@ abstract class Lang implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Message.php b/core/lib/Thelia/Model/Base/Message.php index a2327f388..5245c3765 100755 --- a/core/lib/Thelia/Model/Base/Message.php +++ b/core/lib/Thelia/Model/Base/Message.php @@ -141,7 +141,7 @@ abstract class Message implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -338,7 +338,7 @@ abstract class Message implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -2056,7 +2056,7 @@ abstract class Message implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collMessageI18ns instanceof Collection) { @@ -2102,7 +2102,7 @@ abstract class Message implements ActiveRecordInterface * * @return ChildMessage The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -2126,7 +2126,7 @@ abstract class Message implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildMessageI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collMessageI18ns) { @@ -2161,7 +2161,7 @@ abstract class Message implements ActiveRecordInterface * * @return ChildMessage The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildMessageI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/MessageI18n.php b/core/lib/Thelia/Model/Base/MessageI18n.php index 4d1a532fe..575e22907 100755 --- a/core/lib/Thelia/Model/Base/MessageI18n.php +++ b/core/lib/Thelia/Model/Base/MessageI18n.php @@ -61,7 +61,7 @@ abstract class MessageI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -105,7 +105,7 @@ abstract class MessageI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -266,7 +266,7 @@ abstract class MessageI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -538,7 +538,7 @@ abstract class MessageI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/MessageQuery.php b/core/lib/Thelia/Model/Base/MessageQuery.php index cf0155f36..938a16aab 100755 --- a/core/lib/Thelia/Model/Base/MessageQuery.php +++ b/core/lib/Thelia/Model/Base/MessageQuery.php @@ -913,7 +913,7 @@ abstract class MessageQuery extends ModelCriteria * * @return ChildMessageQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'MessageI18n'; @@ -931,7 +931,7 @@ abstract class MessageQuery extends ModelCriteria * * @return ChildMessageQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -952,7 +952,7 @@ abstract class MessageQuery extends ModelCriteria * * @return ChildMessageI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/MessageVersion.php b/core/lib/Thelia/Model/Base/MessageVersion.php index 0781a503a..e425b5c50 100755 --- a/core/lib/Thelia/Model/Base/MessageVersion.php +++ b/core/lib/Thelia/Model/Base/MessageVersion.php @@ -292,7 +292,7 @@ abstract class MessageVersion implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Module.php b/core/lib/Thelia/Model/Base/Module.php index c1ee2ed8d..76c391207 100755 --- a/core/lib/Thelia/Model/Base/Module.php +++ b/core/lib/Thelia/Model/Base/Module.php @@ -127,7 +127,7 @@ abstract class Module implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -303,7 +303,7 @@ abstract class Module implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1910,7 +1910,7 @@ abstract class Module implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collGroupModules instanceof Collection) { @@ -1956,7 +1956,7 @@ abstract class Module implements ActiveRecordInterface * * @return ChildModule The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1980,7 +1980,7 @@ abstract class Module implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildModuleI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collModuleI18ns) { @@ -2015,7 +2015,7 @@ abstract class Module implements ActiveRecordInterface * * @return ChildModule The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildModuleI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/ModuleI18n.php b/core/lib/Thelia/Model/Base/ModuleI18n.php index fbb4293ba..d31dda0ba 100755 --- a/core/lib/Thelia/Model/Base/ModuleI18n.php +++ b/core/lib/Thelia/Model/Base/ModuleI18n.php @@ -61,7 +61,7 @@ abstract class ModuleI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class ModuleI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class ModuleI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class ModuleI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/ModuleQuery.php b/core/lib/Thelia/Model/Base/ModuleQuery.php index e1bd9de68..7db21ca22 100755 --- a/core/lib/Thelia/Model/Base/ModuleQuery.php +++ b/core/lib/Thelia/Model/Base/ModuleQuery.php @@ -838,7 +838,7 @@ abstract class ModuleQuery extends ModelCriteria * * @return ChildModuleQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'ModuleI18n'; @@ -856,7 +856,7 @@ abstract class ModuleQuery extends ModelCriteria * * @return ChildModuleQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -877,7 +877,7 @@ abstract class ModuleQuery extends ModelCriteria * * @return ChildModuleI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Order.php b/core/lib/Thelia/Model/Base/Order.php index b815aff34..6932ec6c4 100755 --- a/core/lib/Thelia/Model/Base/Order.php +++ b/core/lib/Thelia/Model/Base/Order.php @@ -388,7 +388,7 @@ abstract class Order implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/OrderAddress.php b/core/lib/Thelia/Model/Base/OrderAddress.php index b5ff32951..d0220d4e0 100755 --- a/core/lib/Thelia/Model/Base/OrderAddress.php +++ b/core/lib/Thelia/Model/Base/OrderAddress.php @@ -329,7 +329,7 @@ abstract class OrderAddress implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/OrderFeature.php b/core/lib/Thelia/Model/Base/OrderFeature.php index 49c1a0911..e2b52e6b1 100755 --- a/core/lib/Thelia/Model/Base/OrderFeature.php +++ b/core/lib/Thelia/Model/Base/OrderFeature.php @@ -261,7 +261,7 @@ abstract class OrderFeature implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/OrderProduct.php b/core/lib/Thelia/Model/Base/OrderProduct.php index b448e4e0c..2bf9c7ace 100755 --- a/core/lib/Thelia/Model/Base/OrderProduct.php +++ b/core/lib/Thelia/Model/Base/OrderProduct.php @@ -312,7 +312,7 @@ abstract class OrderProduct implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/OrderStatus.php b/core/lib/Thelia/Model/Base/OrderStatus.php index fc4a224d1..99bb87879 100755 --- a/core/lib/Thelia/Model/Base/OrderStatus.php +++ b/core/lib/Thelia/Model/Base/OrderStatus.php @@ -109,7 +109,7 @@ abstract class OrderStatus implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -285,7 +285,7 @@ abstract class OrderStatus implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1812,7 +1812,7 @@ abstract class OrderStatus implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collOrders instanceof Collection) { @@ -1858,7 +1858,7 @@ abstract class OrderStatus implements ActiveRecordInterface * * @return ChildOrderStatus The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1882,7 +1882,7 @@ abstract class OrderStatus implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildOrderStatusI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collOrderStatusI18ns) { @@ -1917,7 +1917,7 @@ abstract class OrderStatus implements ActiveRecordInterface * * @return ChildOrderStatus The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildOrderStatusI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/OrderStatusI18n.php b/core/lib/Thelia/Model/Base/OrderStatusI18n.php index 76ec4a28a..249944854 100755 --- a/core/lib/Thelia/Model/Base/OrderStatusI18n.php +++ b/core/lib/Thelia/Model/Base/OrderStatusI18n.php @@ -61,7 +61,7 @@ abstract class OrderStatusI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class OrderStatusI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class OrderStatusI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class OrderStatusI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/OrderStatusQuery.php b/core/lib/Thelia/Model/Base/OrderStatusQuery.php index 908efd6b6..07fcdb8dc 100755 --- a/core/lib/Thelia/Model/Base/OrderStatusQuery.php +++ b/core/lib/Thelia/Model/Base/OrderStatusQuery.php @@ -703,7 +703,7 @@ abstract class OrderStatusQuery extends ModelCriteria * * @return ChildOrderStatusQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'OrderStatusI18n'; @@ -721,7 +721,7 @@ abstract class OrderStatusQuery extends ModelCriteria * * @return ChildOrderStatusQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -742,7 +742,7 @@ abstract class OrderStatusQuery extends ModelCriteria * * @return ChildOrderStatusI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Product.php b/core/lib/Thelia/Model/Base/Product.php index 9a1828e25..867f7dd50 100755 --- a/core/lib/Thelia/Model/Base/Product.php +++ b/core/lib/Thelia/Model/Base/Product.php @@ -250,7 +250,7 @@ abstract class Product implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -526,7 +526,7 @@ abstract class Product implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -5815,7 +5815,7 @@ abstract class Product implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collProductCategories instanceof Collection) { @@ -5914,7 +5914,7 @@ abstract class Product implements ActiveRecordInterface * * @return ChildProduct The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -5938,7 +5938,7 @@ abstract class Product implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildProductI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collProductI18ns) { @@ -5973,7 +5973,7 @@ abstract class Product implements ActiveRecordInterface * * @return ChildProduct The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildProductI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/ProductCategory.php b/core/lib/Thelia/Model/Base/ProductCategory.php index 74affb0c0..62a6ea425 100755 --- a/core/lib/Thelia/Model/Base/ProductCategory.php +++ b/core/lib/Thelia/Model/Base/ProductCategory.php @@ -256,7 +256,7 @@ abstract class ProductCategory implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/ProductDocument.php b/core/lib/Thelia/Model/Base/ProductDocument.php index 58c9999ed..96a584dab 100755 --- a/core/lib/Thelia/Model/Base/ProductDocument.php +++ b/core/lib/Thelia/Model/Base/ProductDocument.php @@ -120,7 +120,7 @@ abstract class ProductDocument implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -290,7 +290,7 @@ abstract class ProductDocument implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1640,7 +1640,7 @@ abstract class ProductDocument implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collProductDocumentI18ns instanceof Collection) { @@ -1683,7 +1683,7 @@ abstract class ProductDocument implements ActiveRecordInterface * * @return ChildProductDocument The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1707,7 +1707,7 @@ abstract class ProductDocument implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildProductDocumentI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collProductDocumentI18ns) { @@ -1742,7 +1742,7 @@ abstract class ProductDocument implements ActiveRecordInterface * * @return ChildProductDocument The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildProductDocumentI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/ProductDocumentI18n.php b/core/lib/Thelia/Model/Base/ProductDocumentI18n.php index 2c5ca4d0c..ba04b5ccc 100755 --- a/core/lib/Thelia/Model/Base/ProductDocumentI18n.php +++ b/core/lib/Thelia/Model/Base/ProductDocumentI18n.php @@ -61,7 +61,7 @@ abstract class ProductDocumentI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class ProductDocumentI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class ProductDocumentI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class ProductDocumentI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/ProductDocumentQuery.php b/core/lib/Thelia/Model/Base/ProductDocumentQuery.php index 06af05a9c..32321554d 100755 --- a/core/lib/Thelia/Model/Base/ProductDocumentQuery.php +++ b/core/lib/Thelia/Model/Base/ProductDocumentQuery.php @@ -797,7 +797,7 @@ abstract class ProductDocumentQuery extends ModelCriteria * * @return ChildProductDocumentQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'ProductDocumentI18n'; @@ -815,7 +815,7 @@ abstract class ProductDocumentQuery extends ModelCriteria * * @return ChildProductDocumentQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -836,7 +836,7 @@ abstract class ProductDocumentQuery extends ModelCriteria * * @return ChildProductDocumentI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/ProductI18n.php b/core/lib/Thelia/Model/Base/ProductI18n.php index b0c74bb54..ee7514fd4 100755 --- a/core/lib/Thelia/Model/Base/ProductI18n.php +++ b/core/lib/Thelia/Model/Base/ProductI18n.php @@ -61,7 +61,7 @@ abstract class ProductI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class ProductI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class ProductI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class ProductI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/ProductImage.php b/core/lib/Thelia/Model/Base/ProductImage.php index 0b4030ccb..152a298a5 100755 --- a/core/lib/Thelia/Model/Base/ProductImage.php +++ b/core/lib/Thelia/Model/Base/ProductImage.php @@ -120,7 +120,7 @@ abstract class ProductImage implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -290,7 +290,7 @@ abstract class ProductImage implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1640,7 +1640,7 @@ abstract class ProductImage implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collProductImageI18ns instanceof Collection) { @@ -1683,7 +1683,7 @@ abstract class ProductImage implements ActiveRecordInterface * * @return ChildProductImage The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1707,7 +1707,7 @@ abstract class ProductImage implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildProductImageI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collProductImageI18ns) { @@ -1742,7 +1742,7 @@ abstract class ProductImage implements ActiveRecordInterface * * @return ChildProductImage The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildProductImageI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/ProductImageI18n.php b/core/lib/Thelia/Model/Base/ProductImageI18n.php index 634f726a3..c84f99af2 100755 --- a/core/lib/Thelia/Model/Base/ProductImageI18n.php +++ b/core/lib/Thelia/Model/Base/ProductImageI18n.php @@ -61,7 +61,7 @@ abstract class ProductImageI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class ProductImageI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class ProductImageI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class ProductImageI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/ProductImageQuery.php b/core/lib/Thelia/Model/Base/ProductImageQuery.php index 94cb1b361..e351c6f40 100755 --- a/core/lib/Thelia/Model/Base/ProductImageQuery.php +++ b/core/lib/Thelia/Model/Base/ProductImageQuery.php @@ -797,7 +797,7 @@ abstract class ProductImageQuery extends ModelCriteria * * @return ChildProductImageQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'ProductImageI18n'; @@ -815,7 +815,7 @@ abstract class ProductImageQuery extends ModelCriteria * * @return ChildProductImageQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -836,7 +836,7 @@ abstract class ProductImageQuery extends ModelCriteria * * @return ChildProductImageI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/ProductPrice.php b/core/lib/Thelia/Model/Base/ProductPrice.php index dab6e47a4..15502a385 100755 --- a/core/lib/Thelia/Model/Base/ProductPrice.php +++ b/core/lib/Thelia/Model/Base/ProductPrice.php @@ -274,7 +274,7 @@ abstract class ProductPrice implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/ProductQuery.php b/core/lib/Thelia/Model/Base/ProductQuery.php index 3df8ecbae..9d4685f38 100755 --- a/core/lib/Thelia/Model/Base/ProductQuery.php +++ b/core/lib/Thelia/Model/Base/ProductQuery.php @@ -1872,7 +1872,7 @@ abstract class ProductQuery extends ModelCriteria * * @return ChildProductQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'ProductI18n'; @@ -1890,7 +1890,7 @@ abstract class ProductQuery extends ModelCriteria * * @return ChildProductQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -1911,7 +1911,7 @@ abstract class ProductQuery extends ModelCriteria * * @return ChildProductI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/ProductSaleElements.php b/core/lib/Thelia/Model/Base/ProductSaleElements.php index 22a8c9752..f79d9a246 100755 --- a/core/lib/Thelia/Model/Base/ProductSaleElements.php +++ b/core/lib/Thelia/Model/Base/ProductSaleElements.php @@ -332,7 +332,7 @@ abstract class ProductSaleElements implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/ProductVersion.php b/core/lib/Thelia/Model/Base/ProductVersion.php index 1779cee20..071dfc742 100755 --- a/core/lib/Thelia/Model/Base/ProductVersion.php +++ b/core/lib/Thelia/Model/Base/ProductVersion.php @@ -300,7 +300,7 @@ abstract class ProductVersion implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Resource.php b/core/lib/Thelia/Model/Base/Resource.php index c6c527134..b513ea326 100755 --- a/core/lib/Thelia/Model/Base/Resource.php +++ b/core/lib/Thelia/Model/Base/Resource.php @@ -116,7 +116,7 @@ abstract class Resource implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -298,7 +298,7 @@ abstract class Resource implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1968,7 +1968,7 @@ abstract class Resource implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collGroupResources instanceof Collection) { @@ -2018,7 +2018,7 @@ abstract class Resource implements ActiveRecordInterface * * @return ChildResource The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -2042,7 +2042,7 @@ abstract class Resource implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildResourceI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collResourceI18ns) { @@ -2077,7 +2077,7 @@ abstract class Resource implements ActiveRecordInterface * * @return ChildResource The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildResourceI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/ResourceI18n.php b/core/lib/Thelia/Model/Base/ResourceI18n.php index c060e8776..4419f7fc8 100755 --- a/core/lib/Thelia/Model/Base/ResourceI18n.php +++ b/core/lib/Thelia/Model/Base/ResourceI18n.php @@ -61,7 +61,7 @@ abstract class ResourceI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -111,7 +111,7 @@ abstract class ResourceI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -272,7 +272,7 @@ abstract class ResourceI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -576,7 +576,7 @@ abstract class ResourceI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/ResourceQuery.php b/core/lib/Thelia/Model/Base/ResourceQuery.php index 6559d6522..e12ee8f53 100755 --- a/core/lib/Thelia/Model/Base/ResourceQuery.php +++ b/core/lib/Thelia/Model/Base/ResourceQuery.php @@ -720,7 +720,7 @@ abstract class ResourceQuery extends ModelCriteria * * @return ChildResourceQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'ResourceI18n'; @@ -738,7 +738,7 @@ abstract class ResourceQuery extends ModelCriteria * * @return ChildResourceQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -759,7 +759,7 @@ abstract class ResourceQuery extends ModelCriteria * * @return ChildResourceI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Rewriting.php b/core/lib/Thelia/Model/Base/Rewriting.php index 12229c438..c8109458d 100755 --- a/core/lib/Thelia/Model/Base/Rewriting.php +++ b/core/lib/Thelia/Model/Base/Rewriting.php @@ -294,7 +294,7 @@ abstract class Rewriting implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/Tax.php b/core/lib/Thelia/Model/Base/Tax.php index 3e405414c..c1ddbf23a 100755 --- a/core/lib/Thelia/Model/Base/Tax.php +++ b/core/lib/Thelia/Model/Base/Tax.php @@ -109,7 +109,7 @@ abstract class Tax implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -285,7 +285,7 @@ abstract class Tax implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -1762,7 +1762,7 @@ abstract class Tax implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collTaxRuleCountries instanceof Collection) { @@ -1808,7 +1808,7 @@ abstract class Tax implements ActiveRecordInterface * * @return ChildTax The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -1832,7 +1832,7 @@ abstract class Tax implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildTaxI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collTaxI18ns) { @@ -1867,7 +1867,7 @@ abstract class Tax implements ActiveRecordInterface * * @return ChildTax The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildTaxI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/TaxI18n.php b/core/lib/Thelia/Model/Base/TaxI18n.php index f8577e860..a066fe4a8 100755 --- a/core/lib/Thelia/Model/Base/TaxI18n.php +++ b/core/lib/Thelia/Model/Base/TaxI18n.php @@ -61,7 +61,7 @@ abstract class TaxI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -99,7 +99,7 @@ abstract class TaxI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -260,7 +260,7 @@ abstract class TaxI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -500,7 +500,7 @@ abstract class TaxI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/TaxQuery.php b/core/lib/Thelia/Model/Base/TaxQuery.php index 307ace57c..0a61cbb3c 100755 --- a/core/lib/Thelia/Model/Base/TaxQuery.php +++ b/core/lib/Thelia/Model/Base/TaxQuery.php @@ -715,7 +715,7 @@ abstract class TaxQuery extends ModelCriteria * * @return ChildTaxQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'TaxI18n'; @@ -733,7 +733,7 @@ abstract class TaxQuery extends ModelCriteria * * @return ChildTaxQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -754,7 +754,7 @@ abstract class TaxQuery extends ModelCriteria * * @return ChildTaxI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/TaxRule.php b/core/lib/Thelia/Model/Base/TaxRule.php index bf318498c..e363541d7 100755 --- a/core/lib/Thelia/Model/Base/TaxRule.php +++ b/core/lib/Thelia/Model/Base/TaxRule.php @@ -129,7 +129,7 @@ abstract class TaxRule implements ActiveRecordInterface * Current locale * @var string */ - protected $currentLocale = 'en_US'; + protected $currentLocale = 'en_EN'; /** * Current translation objects @@ -311,7 +311,7 @@ abstract class TaxRule implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -2146,7 +2146,7 @@ abstract class TaxRule implements ActiveRecordInterface } // if ($deep) // i18n behavior - $this->currentLocale = 'en_US'; + $this->currentLocale = 'en_EN'; $this->currentTranslations = null; if ($this->collProducts instanceof Collection) { @@ -2196,7 +2196,7 @@ abstract class TaxRule implements ActiveRecordInterface * * @return ChildTaxRule The current object (for fluent API support) */ - public function setLocale($locale = 'en_US') + public function setLocale($locale = 'en_EN') { $this->currentLocale = $locale; @@ -2220,7 +2220,7 @@ abstract class TaxRule implements ActiveRecordInterface * @param ConnectionInterface $con an optional connection object * * @return ChildTaxRuleI18n */ - public function getTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function getTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!isset($this->currentTranslations[$locale])) { if (null !== $this->collTaxRuleI18ns) { @@ -2255,7 +2255,7 @@ abstract class TaxRule implements ActiveRecordInterface * * @return ChildTaxRule The current object (for fluent API support) */ - public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null) + public function removeTranslation($locale = 'en_EN', ConnectionInterface $con = null) { if (!$this->isNew()) { ChildTaxRuleI18nQuery::create() diff --git a/core/lib/Thelia/Model/Base/TaxRuleCountry.php b/core/lib/Thelia/Model/Base/TaxRuleCountry.php index b5ae7941b..66f6f585b 100755 --- a/core/lib/Thelia/Model/Base/TaxRuleCountry.php +++ b/core/lib/Thelia/Model/Base/TaxRuleCountry.php @@ -281,7 +281,7 @@ abstract class TaxRuleCountry implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** diff --git a/core/lib/Thelia/Model/Base/TaxRuleI18n.php b/core/lib/Thelia/Model/Base/TaxRuleI18n.php index 51bab6a77..f685dd3cc 100755 --- a/core/lib/Thelia/Model/Base/TaxRuleI18n.php +++ b/core/lib/Thelia/Model/Base/TaxRuleI18n.php @@ -61,7 +61,7 @@ abstract class TaxRuleI18n implements ActiveRecordInterface /** * The value for the locale field. - * Note: this column has a database default value of: 'en_US' + * Note: this column has a database default value of: 'en_EN' * @var string */ protected $locale; @@ -87,7 +87,7 @@ abstract class TaxRuleI18n implements ActiveRecordInterface */ public function applyDefaultValues() { - $this->locale = 'en_US'; + $this->locale = 'en_EN'; } /** @@ -248,7 +248,7 @@ abstract class TaxRuleI18n implements ActiveRecordInterface */ public function hasVirtualColumn($name) { - return isset($this->virtualColumns[$name]); + return array_key_exists($name, $this->virtualColumns); } /** @@ -424,7 +424,7 @@ abstract class TaxRuleI18n implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { - if ($this->locale !== 'en_US') { + if ($this->locale !== 'en_EN') { return false; } diff --git a/core/lib/Thelia/Model/Base/TaxRuleQuery.php b/core/lib/Thelia/Model/Base/TaxRuleQuery.php index 2fb478b7a..36f2edd99 100755 --- a/core/lib/Thelia/Model/Base/TaxRuleQuery.php +++ b/core/lib/Thelia/Model/Base/TaxRuleQuery.php @@ -846,7 +846,7 @@ abstract class TaxRuleQuery extends ModelCriteria * * @return ChildTaxRuleQuery The current query, for fluid interface */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $relationName = $relationAlias ? $relationAlias : 'TaxRuleI18n'; @@ -864,7 +864,7 @@ abstract class TaxRuleQuery extends ModelCriteria * * @return ChildTaxRuleQuery The current query, for fluid interface */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN) { $this ->joinI18n($locale, null, $joinType) @@ -885,7 +885,7 @@ abstract class TaxRuleQuery extends ModelCriteria * * @return ChildTaxRuleI18nQuery A secondary query class using the current class as primary query */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinI18n($locale, $relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php b/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php index 02a20540e..14fc79eeb 100755 --- a/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php @@ -151,7 +151,7 @@ class AttributeAvI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'attribute_av', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/AttributeAvTableMap.php b/core/lib/Thelia/Model/Map/AttributeAvTableMap.php index 0c5c2e1c9..138f0fa9c 100755 --- a/core/lib/Thelia/Model/Map/AttributeAvTableMap.php +++ b/core/lib/Thelia/Model/Map/AttributeAvTableMap.php @@ -106,7 +106,7 @@ class AttributeAvTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php b/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php index 8471d3e26..b60cae5b8 100755 --- a/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php @@ -151,7 +151,7 @@ class AttributeI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'attribute', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/AttributeTableMap.php b/core/lib/Thelia/Model/Map/AttributeTableMap.php index 773e13cab..dca811cbc 100755 --- a/core/lib/Thelia/Model/Map/AttributeTableMap.php +++ b/core/lib/Thelia/Model/Map/AttributeTableMap.php @@ -101,7 +101,7 @@ class AttributeTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/CategoryDocumentI18nTableMap.php b/core/lib/Thelia/Model/Map/CategoryDocumentI18nTableMap.php index 956afae4a..1ad7dfe2f 100755 --- a/core/lib/Thelia/Model/Map/CategoryDocumentI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/CategoryDocumentI18nTableMap.php @@ -151,7 +151,7 @@ class CategoryDocumentI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'category_document', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/CategoryDocumentTableMap.php b/core/lib/Thelia/Model/Map/CategoryDocumentTableMap.php index 8b307ea1e..83e748a1e 100755 --- a/core/lib/Thelia/Model/Map/CategoryDocumentTableMap.php +++ b/core/lib/Thelia/Model/Map/CategoryDocumentTableMap.php @@ -111,7 +111,7 @@ class CategoryDocumentTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php b/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php index 8c52aa7b2..1611b2ebf 100755 --- a/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php @@ -151,7 +151,7 @@ class CategoryI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'category', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/CategoryImageI18nTableMap.php b/core/lib/Thelia/Model/Map/CategoryImageI18nTableMap.php index 1d27e16ad..1c59c9db2 100755 --- a/core/lib/Thelia/Model/Map/CategoryImageI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/CategoryImageI18nTableMap.php @@ -151,7 +151,7 @@ class CategoryImageI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'category_image', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/CategoryImageTableMap.php b/core/lib/Thelia/Model/Map/CategoryImageTableMap.php index 1c7694d05..9eafe2ade 100755 --- a/core/lib/Thelia/Model/Map/CategoryImageTableMap.php +++ b/core/lib/Thelia/Model/Map/CategoryImageTableMap.php @@ -111,7 +111,7 @@ class CategoryImageTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/CategoryTableMap.php b/core/lib/Thelia/Model/Map/CategoryTableMap.php index 5e02d04c5..c3526ec5d 100755 --- a/core/lib/Thelia/Model/Map/CategoryTableMap.php +++ b/core/lib/Thelia/Model/Map/CategoryTableMap.php @@ -126,7 +126,7 @@ class CategoryTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php b/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php index b953b0ac9..a83f87b76 100755 --- a/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php @@ -151,7 +151,7 @@ class ConfigI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'config', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ConfigTableMap.php b/core/lib/Thelia/Model/Map/ConfigTableMap.php index ebd5d6edf..8bd68a964 100755 --- a/core/lib/Thelia/Model/Map/ConfigTableMap.php +++ b/core/lib/Thelia/Model/Map/ConfigTableMap.php @@ -116,7 +116,7 @@ class ConfigTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ContentDocumentI18nTableMap.php b/core/lib/Thelia/Model/Map/ContentDocumentI18nTableMap.php index 7ebde93e6..a6ff890d7 100755 --- a/core/lib/Thelia/Model/Map/ContentDocumentI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ContentDocumentI18nTableMap.php @@ -151,7 +151,7 @@ class ContentDocumentI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'content_document', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ContentDocumentTableMap.php b/core/lib/Thelia/Model/Map/ContentDocumentTableMap.php index 3d876a570..4344b70ae 100755 --- a/core/lib/Thelia/Model/Map/ContentDocumentTableMap.php +++ b/core/lib/Thelia/Model/Map/ContentDocumentTableMap.php @@ -111,7 +111,7 @@ class ContentDocumentTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ContentI18nTableMap.php b/core/lib/Thelia/Model/Map/ContentI18nTableMap.php index f718623b0..ee9122a6c 100755 --- a/core/lib/Thelia/Model/Map/ContentI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ContentI18nTableMap.php @@ -151,7 +151,7 @@ class ContentI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'content', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ContentImageI18nTableMap.php b/core/lib/Thelia/Model/Map/ContentImageI18nTableMap.php index 759349d27..6ff343d16 100755 --- a/core/lib/Thelia/Model/Map/ContentImageI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ContentImageI18nTableMap.php @@ -151,7 +151,7 @@ class ContentImageI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'content_image', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ContentImageTableMap.php b/core/lib/Thelia/Model/Map/ContentImageTableMap.php index f731c51a8..c95761ab2 100755 --- a/core/lib/Thelia/Model/Map/ContentImageTableMap.php +++ b/core/lib/Thelia/Model/Map/ContentImageTableMap.php @@ -111,7 +111,7 @@ class ContentImageTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ContentTableMap.php b/core/lib/Thelia/Model/Map/ContentTableMap.php index 4a489cedb..724c839a1 100755 --- a/core/lib/Thelia/Model/Map/ContentTableMap.php +++ b/core/lib/Thelia/Model/Map/ContentTableMap.php @@ -121,7 +121,7 @@ class ContentTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/CountryI18nTableMap.php b/core/lib/Thelia/Model/Map/CountryI18nTableMap.php index 272231464..cc60b09d2 100755 --- a/core/lib/Thelia/Model/Map/CountryI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/CountryI18nTableMap.php @@ -151,7 +151,7 @@ class CountryI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'country', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/CountryTableMap.php b/core/lib/Thelia/Model/Map/CountryTableMap.php index e7c356f08..2e4931e37 100755 --- a/core/lib/Thelia/Model/Map/CountryTableMap.php +++ b/core/lib/Thelia/Model/Map/CountryTableMap.php @@ -116,7 +116,7 @@ class CountryTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/CurrencyI18nTableMap.php b/core/lib/Thelia/Model/Map/CurrencyI18nTableMap.php index c7e4725c1..d280f8601 100755 --- a/core/lib/Thelia/Model/Map/CurrencyI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/CurrencyI18nTableMap.php @@ -136,7 +136,7 @@ class CurrencyI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'currency', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('NAME', 'Name', 'VARCHAR', false, 45, null); } // initialize() diff --git a/core/lib/Thelia/Model/Map/CurrencyTableMap.php b/core/lib/Thelia/Model/Map/CurrencyTableMap.php index b37a6b30a..08ecf6966 100755 --- a/core/lib/Thelia/Model/Map/CurrencyTableMap.php +++ b/core/lib/Thelia/Model/Map/CurrencyTableMap.php @@ -121,7 +121,7 @@ class CurrencyTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php b/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php index 5344099c5..d403756fa 100755 --- a/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php @@ -141,7 +141,7 @@ class CustomerTitleI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'customer_title', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('SHORT', 'Short', 'VARCHAR', false, 10, null); $this->addColumn('LONG', 'Long', 'VARCHAR', false, 45, null); } // initialize() diff --git a/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php b/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php index c10ce2500..2769f365e 100755 --- a/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php +++ b/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php @@ -106,7 +106,7 @@ class CustomerTitleTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php b/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php index ba592b4b0..b3114e7ba 100755 --- a/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php @@ -151,7 +151,7 @@ class FeatureAvI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'feature_av', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/FeatureAvTableMap.php b/core/lib/Thelia/Model/Map/FeatureAvTableMap.php index 4dd944bb7..0559f7ce6 100755 --- a/core/lib/Thelia/Model/Map/FeatureAvTableMap.php +++ b/core/lib/Thelia/Model/Map/FeatureAvTableMap.php @@ -106,7 +106,7 @@ class FeatureAvTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php b/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php index dba05fb67..af0dfc263 100755 --- a/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php @@ -151,7 +151,7 @@ class FeatureI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'feature', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/FeatureTableMap.php b/core/lib/Thelia/Model/Map/FeatureTableMap.php index 76c2fe724..7d0af0d45 100755 --- a/core/lib/Thelia/Model/Map/FeatureTableMap.php +++ b/core/lib/Thelia/Model/Map/FeatureTableMap.php @@ -106,7 +106,7 @@ class FeatureTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/FolderDocumentI18nTableMap.php b/core/lib/Thelia/Model/Map/FolderDocumentI18nTableMap.php index 28dab9d8f..5875031fb 100755 --- a/core/lib/Thelia/Model/Map/FolderDocumentI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/FolderDocumentI18nTableMap.php @@ -151,7 +151,7 @@ class FolderDocumentI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'folder_document', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/FolderDocumentTableMap.php b/core/lib/Thelia/Model/Map/FolderDocumentTableMap.php index 1d0e3b74a..467b7a65b 100755 --- a/core/lib/Thelia/Model/Map/FolderDocumentTableMap.php +++ b/core/lib/Thelia/Model/Map/FolderDocumentTableMap.php @@ -111,7 +111,7 @@ class FolderDocumentTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/FolderI18nTableMap.php b/core/lib/Thelia/Model/Map/FolderI18nTableMap.php index d10344811..fc85b17ec 100755 --- a/core/lib/Thelia/Model/Map/FolderI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/FolderI18nTableMap.php @@ -151,7 +151,7 @@ class FolderI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'folder', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/FolderImageI18nTableMap.php b/core/lib/Thelia/Model/Map/FolderImageI18nTableMap.php index f0f87fd85..1c89165a4 100755 --- a/core/lib/Thelia/Model/Map/FolderImageI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/FolderImageI18nTableMap.php @@ -151,7 +151,7 @@ class FolderImageI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'folder_image', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/FolderImageTableMap.php b/core/lib/Thelia/Model/Map/FolderImageTableMap.php index 6dc186658..c559f9437 100755 --- a/core/lib/Thelia/Model/Map/FolderImageTableMap.php +++ b/core/lib/Thelia/Model/Map/FolderImageTableMap.php @@ -111,7 +111,7 @@ class FolderImageTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/FolderTableMap.php b/core/lib/Thelia/Model/Map/FolderTableMap.php index 1bfe2cd6e..08871715b 100755 --- a/core/lib/Thelia/Model/Map/FolderTableMap.php +++ b/core/lib/Thelia/Model/Map/FolderTableMap.php @@ -126,7 +126,7 @@ class FolderTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/GroupI18nTableMap.php b/core/lib/Thelia/Model/Map/GroupI18nTableMap.php index 57788593a..585127821 100755 --- a/core/lib/Thelia/Model/Map/GroupI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/GroupI18nTableMap.php @@ -151,7 +151,7 @@ class GroupI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'group', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/GroupTableMap.php b/core/lib/Thelia/Model/Map/GroupTableMap.php index 881a2fa84..a8c830005 100755 --- a/core/lib/Thelia/Model/Map/GroupTableMap.php +++ b/core/lib/Thelia/Model/Map/GroupTableMap.php @@ -101,7 +101,7 @@ class GroupTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/MessageI18nTableMap.php b/core/lib/Thelia/Model/Map/MessageI18nTableMap.php index bb9bfdd2e..f084515c0 100755 --- a/core/lib/Thelia/Model/Map/MessageI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/MessageI18nTableMap.php @@ -146,7 +146,7 @@ class MessageI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'message', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'LONGVARCHAR', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION_HTML', 'DescriptionHtml', 'CLOB', false, null, null); diff --git a/core/lib/Thelia/Model/Map/MessageTableMap.php b/core/lib/Thelia/Model/Map/MessageTableMap.php index 392dac824..de2a205f9 100755 --- a/core/lib/Thelia/Model/Map/MessageTableMap.php +++ b/core/lib/Thelia/Model/Map/MessageTableMap.php @@ -126,7 +126,7 @@ class MessageTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php b/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php index a8e680f1c..67b7a34ef 100755 --- a/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php @@ -151,7 +151,7 @@ class ModuleI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'module', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ModuleTableMap.php b/core/lib/Thelia/Model/Map/ModuleTableMap.php index cccaa890a..5370c1da1 100755 --- a/core/lib/Thelia/Model/Map/ModuleTableMap.php +++ b/core/lib/Thelia/Model/Map/ModuleTableMap.php @@ -116,7 +116,7 @@ class ModuleTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php b/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php index 1b2052c2e..5d78c474c 100755 --- a/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php @@ -151,7 +151,7 @@ class OrderStatusI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'order_status', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/OrderStatusTableMap.php b/core/lib/Thelia/Model/Map/OrderStatusTableMap.php index 18406d9aa..eecfe5a03 100755 --- a/core/lib/Thelia/Model/Map/OrderStatusTableMap.php +++ b/core/lib/Thelia/Model/Map/OrderStatusTableMap.php @@ -101,7 +101,7 @@ class OrderStatusTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ProductDocumentI18nTableMap.php b/core/lib/Thelia/Model/Map/ProductDocumentI18nTableMap.php index 09e1dc0e4..103914ee6 100755 --- a/core/lib/Thelia/Model/Map/ProductDocumentI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductDocumentI18nTableMap.php @@ -151,7 +151,7 @@ class ProductDocumentI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product_document', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ProductDocumentTableMap.php b/core/lib/Thelia/Model/Map/ProductDocumentTableMap.php index ff50bad77..f1420cc43 100755 --- a/core/lib/Thelia/Model/Map/ProductDocumentTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductDocumentTableMap.php @@ -111,7 +111,7 @@ class ProductDocumentTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ProductI18nTableMap.php b/core/lib/Thelia/Model/Map/ProductI18nTableMap.php index 79a01514a..8da33f15d 100755 --- a/core/lib/Thelia/Model/Map/ProductI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductI18nTableMap.php @@ -151,7 +151,7 @@ class ProductI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ProductImageI18nTableMap.php b/core/lib/Thelia/Model/Map/ProductImageI18nTableMap.php index 39ad567f9..de3455c07 100755 --- a/core/lib/Thelia/Model/Map/ProductImageI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductImageI18nTableMap.php @@ -151,7 +151,7 @@ class ProductImageI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product_image', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ProductImageTableMap.php b/core/lib/Thelia/Model/Map/ProductImageTableMap.php index 36aabed3e..945799020 100755 --- a/core/lib/Thelia/Model/Map/ProductImageTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductImageTableMap.php @@ -111,7 +111,7 @@ class ProductImageTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ProductTableMap.php b/core/lib/Thelia/Model/Map/ProductTableMap.php index 75bf5e4e6..ef2cc7ca0 100755 --- a/core/lib/Thelia/Model/Map/ProductTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductTableMap.php @@ -131,7 +131,7 @@ class ProductTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php b/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php index ec22e2fd3..8a8ce501a 100755 --- a/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php @@ -151,7 +151,7 @@ class ResourceI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'resource', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ResourceTableMap.php b/core/lib/Thelia/Model/Map/ResourceTableMap.php index 8d7708ddd..e56960892 100755 --- a/core/lib/Thelia/Model/Map/ResourceTableMap.php +++ b/core/lib/Thelia/Model/Map/ResourceTableMap.php @@ -101,7 +101,7 @@ class ResourceTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/TaxI18nTableMap.php b/core/lib/Thelia/Model/Map/TaxI18nTableMap.php index a06230c37..2c4c92f4f 100755 --- a/core/lib/Thelia/Model/Map/TaxI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/TaxI18nTableMap.php @@ -141,7 +141,7 @@ class TaxI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null); } // initialize() diff --git a/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php b/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php index 1f0ed1e96..689f30728 100755 --- a/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php @@ -131,7 +131,7 @@ class TaxRuleI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax_rule', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); } // initialize() /** diff --git a/core/lib/Thelia/Model/Map/TaxRuleTableMap.php b/core/lib/Thelia/Model/Map/TaxRuleTableMap.php index cc5f628b9..9b862de99 100755 --- a/core/lib/Thelia/Model/Map/TaxRuleTableMap.php +++ b/core/lib/Thelia/Model/Map/TaxRuleTableMap.php @@ -111,7 +111,7 @@ class TaxRuleTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/TaxTableMap.php b/core/lib/Thelia/Model/Map/TaxTableMap.php index 6d43f20e9..b941e7b52 100755 --- a/core/lib/Thelia/Model/Map/TaxTableMap.php +++ b/core/lib/Thelia/Model/Map/TaxTableMap.php @@ -101,7 +101,7 @@ class TaxTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Tools/ModelCriteriaTools.php b/core/lib/Thelia/Model/Tools/ModelCriteriaTools.php new file mode 100755 index 000000000..fd04ef3d9 --- /dev/null +++ b/core/lib/Thelia/Model/Tools/ModelCriteriaTools.php @@ -0,0 +1,73 @@ + + */ +class ModelCriteriaTools +{ + /** + * @param ModelCriteria $search + * @param $defaultLangWithoutTranslation + * @param $askedLocale + * @param array $columns + * @param null $foreignTable + * @param string $foreignKey + */ + public static function getI18n(ModelCriteria &$search, $defaultLangWithoutTranslation, $askedLocale, $columns = array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM'), $foreignTable = null, $foreignKey = 'ID') + { + if($foreignTable === null) { + $foreignTable = $search->getTableMap()->getName(); + $aliasPrefix = ''; + } else { + $aliasPrefix = $foreignTable . '_'; + } + + $askedLocaleI18nAlias = 'asked_locale_i18n'; + $defaultLocaleI18nAlias = 'default_locale_i18n'; + + if($defaultLangWithoutTranslation == 0) { + $askedLocaleJoin = new Join(); + $askedLocaleJoin->addExplicitCondition($search->getTableMap()->getName(), $foreignKey, null, $foreignTable . '_i18n', 'ID', $askedLocaleI18nAlias); + $askedLocaleJoin->setJoinType(Criteria::INNER_JOIN); + + $search->addJoinObject($askedLocaleJoin, $askedLocaleI18nAlias) + ->addJoinCondition($askedLocaleI18nAlias ,'`' . $askedLocaleI18nAlias . '`.LOCALE = ?', $askedLocale, null, \PDO::PARAM_STR); + + foreach($columns as $column) { + $search->withColumn('`' . $askedLocaleI18nAlias . '`.`' . $column . '`', $aliasPrefix . 'i18n_' . $column); + } + } else { + $defaultLocale = LangQuery::create()->findOneById($defaultLangWithoutTranslation)->getLocale(); + + $defaultLocaleJoin = new Join(); + $defaultLocaleJoin->addExplicitCondition($search->getTableMap()->getName(), $foreignKey, null, $foreignTable . '_i18n', 'ID', $defaultLocaleI18nAlias); + $defaultLocaleJoin->setJoinType(Criteria::LEFT_JOIN); + + $search->addJoinObject($defaultLocaleJoin, $defaultLocaleI18nAlias) + ->addJoinCondition($defaultLocaleI18nAlias ,'`' . $defaultLocaleI18nAlias . '`.LOCALE = ?', $defaultLocale, null, \PDO::PARAM_STR); + + $askedLocaleJoin = new Join(); + $askedLocaleJoin->addExplicitCondition($search->getTableMap()->getName(), $foreignKey, null, $foreignTable . '_i18n', 'ID', $askedLocaleI18nAlias); + $askedLocaleJoin->setJoinType(Criteria::LEFT_JOIN); + + $search->addJoinObject($askedLocaleJoin, $askedLocaleI18nAlias) + ->addJoinCondition($askedLocaleI18nAlias ,'`' . $askedLocaleI18nAlias . '`.LOCALE = ?', $askedLocale, null, \PDO::PARAM_STR); + + $search->where('NOT ISNULL(`' . $askedLocaleI18nAlias . '`.ID)')->_or()->where('NOT ISNULL(`' . $defaultLocaleI18nAlias . '`.ID)'); + + foreach($columns as $column) { + $search->withColumn('CASE WHEN NOT ISNULL(`' . $askedLocaleI18nAlias . '`.ID) THEN `' . $askedLocaleI18nAlias . '`.`' . $column . '` ELSE `' . $defaultLocaleI18nAlias . '`.`' . $column . '` END', $aliasPrefix . 'i18n_' . $column); + } + } + } +}