From 67060c6367dc7911011d15e2984603788e589df6 Mon Sep 17 00:00:00 2001 From: gmorel Date: Tue, 17 Sep 2013 11:56:46 +0200 Subject: [PATCH] Working : Updating model schema.xml --- core/lib/Thelia/Model/Base/ContentFolder.php | 84 +- .../Thelia/Model/Base/ContentFolderQuery.php | 33 +- core/lib/Thelia/Model/Base/Currency.php | 92 +- core/lib/Thelia/Model/Base/CurrencyQuery.php | 4 +- core/lib/Thelia/Model/Base/Customer.php | 83 +- core/lib/Thelia/Model/Base/Lang.php | 474 +++- core/lib/Thelia/Model/Base/LangQuery.php | 80 + core/lib/Thelia/Model/Base/Module.php | 842 ++++++ core/lib/Thelia/Model/Base/ModuleQuery.php | 154 ++ core/lib/Thelia/Model/Base/Order.php | 741 ++++-- core/lib/Thelia/Model/Base/OrderAddress.php | 568 ++-- .../Thelia/Model/Base/OrderAddressQuery.php | 60 +- core/lib/Thelia/Model/Base/OrderQuery.php | 591 +++-- core/lib/Thelia/Model/Base/OrderStatus.php | 92 +- .../Thelia/Model/Base/OrderStatusQuery.php | 4 +- .../lib/Thelia/Model/Base/ProductCategory.php | 84 +- .../Model/Base/ProductCategoryQuery.php | 33 +- .../Model/Map/ContentFolderTableMap.php | 36 +- .../lib/Thelia/Model/Map/CurrencyTableMap.php | 3 +- .../lib/Thelia/Model/Map/CustomerTableMap.php | 3 +- core/lib/Thelia/Model/Map/LangTableMap.php | 1 + core/lib/Thelia/Model/Map/ModuleTableMap.php | 2 + .../Thelia/Model/Map/OrderAddressTableMap.php | 13 +- .../Thelia/Model/Map/OrderStatusTableMap.php | 3 +- core/lib/Thelia/Model/Map/OrderTableMap.php | 123 +- .../Model/Map/ProductCategoryTableMap.php | 36 +- install/thelia.sql | 261 +- local/config/schema.xml | 2359 +++++++++-------- 28 files changed, 4773 insertions(+), 2086 deletions(-) diff --git a/core/lib/Thelia/Model/Base/ContentFolder.php b/core/lib/Thelia/Model/Base/ContentFolder.php index 51d72b974..809825d51 100644 --- a/core/lib/Thelia/Model/Base/ContentFolder.php +++ b/core/lib/Thelia/Model/Base/ContentFolder.php @@ -70,6 +70,12 @@ abstract class ContentFolder implements ActiveRecordInterface */ protected $folder_id; + /** + * The value for the default_folder field. + * @var boolean + */ + protected $default_folder; + /** * The value for the created_at field. * @var string @@ -376,6 +382,17 @@ abstract class ContentFolder implements ActiveRecordInterface return $this->folder_id; } + /** + * Get the [default_folder] column value. + * + * @return boolean + */ + public function getDefaultFolder() + { + + return $this->default_folder; + } + /** * Get the [optionally formatted] temporal [created_at] column value. * @@ -466,6 +483,35 @@ abstract class ContentFolder implements ActiveRecordInterface return $this; } // setFolderId() + /** + * Sets the value of the [default_folder] column. + * Non-boolean arguments are converted using the following rules: + * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true + * * 0, '0', 'false', 'off', and 'no' are converted to boolean false + * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). + * + * @param boolean|integer|string $v The new value + * @return \Thelia\Model\ContentFolder The current object (for fluent API support) + */ + public function setDefaultFolder($v) + { + if ($v !== null) { + if (is_string($v)) { + $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; + } else { + $v = (boolean) $v; + } + } + + if ($this->default_folder !== $v) { + $this->default_folder = $v; + $this->modifiedColumns[] = ContentFolderTableMap::DEFAULT_FOLDER; + } + + + return $this; + } // setDefaultFolder() + /** * Sets the value of [created_at] column to a normalized version of the date/time value specified. * @@ -551,13 +597,16 @@ abstract class ContentFolder implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ContentFolderTableMap::translateFieldName('FolderId', TableMap::TYPE_PHPNAME, $indexType)]; $this->folder_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ContentFolderTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ContentFolderTableMap::translateFieldName('DefaultFolder', TableMap::TYPE_PHPNAME, $indexType)]; + $this->default_folder = (null !== $col) ? (boolean) $col : null; + + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ContentFolderTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ContentFolderTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ContentFolderTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -570,7 +619,7 @@ abstract class ContentFolder implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 4; // 4 = ContentFolderTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 5; // 5 = ContentFolderTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating \Thelia\Model\ContentFolder object", 0, $e); @@ -819,6 +868,9 @@ abstract class ContentFolder implements ActiveRecordInterface if ($this->isColumnModified(ContentFolderTableMap::FOLDER_ID)) { $modifiedColumns[':p' . $index++] = 'FOLDER_ID'; } + if ($this->isColumnModified(ContentFolderTableMap::DEFAULT_FOLDER)) { + $modifiedColumns[':p' . $index++] = 'DEFAULT_FOLDER'; + } if ($this->isColumnModified(ContentFolderTableMap::CREATED_AT)) { $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } @@ -842,6 +894,9 @@ abstract class ContentFolder implements ActiveRecordInterface case 'FOLDER_ID': $stmt->bindValue($identifier, $this->folder_id, PDO::PARAM_INT); break; + case 'DEFAULT_FOLDER': + $stmt->bindValue($identifier, (int) $this->default_folder, PDO::PARAM_INT); + break; case 'CREATED_AT': $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); break; @@ -910,9 +965,12 @@ abstract class ContentFolder implements ActiveRecordInterface return $this->getFolderId(); break; case 2: - return $this->getCreatedAt(); + return $this->getDefaultFolder(); break; case 3: + return $this->getCreatedAt(); + break; + case 4: return $this->getUpdatedAt(); break; default: @@ -946,8 +1004,9 @@ abstract class ContentFolder implements ActiveRecordInterface $result = array( $keys[0] => $this->getContentId(), $keys[1] => $this->getFolderId(), - $keys[2] => $this->getCreatedAt(), - $keys[3] => $this->getUpdatedAt(), + $keys[2] => $this->getDefaultFolder(), + $keys[3] => $this->getCreatedAt(), + $keys[4] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach($virtualColumns as $key => $virtualColumn) @@ -1003,9 +1062,12 @@ abstract class ContentFolder implements ActiveRecordInterface $this->setFolderId($value); break; case 2: - $this->setCreatedAt($value); + $this->setDefaultFolder($value); break; case 3: + $this->setCreatedAt($value); + break; + case 4: $this->setUpdatedAt($value); break; } // switch() @@ -1034,8 +1096,9 @@ abstract class ContentFolder implements ActiveRecordInterface if (array_key_exists($keys[0], $arr)) $this->setContentId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setFolderId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setCreatedAt($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]); + if (array_key_exists($keys[2], $arr)) $this->setDefaultFolder($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]); } /** @@ -1049,6 +1112,7 @@ abstract class ContentFolder implements ActiveRecordInterface if ($this->isColumnModified(ContentFolderTableMap::CONTENT_ID)) $criteria->add(ContentFolderTableMap::CONTENT_ID, $this->content_id); if ($this->isColumnModified(ContentFolderTableMap::FOLDER_ID)) $criteria->add(ContentFolderTableMap::FOLDER_ID, $this->folder_id); + if ($this->isColumnModified(ContentFolderTableMap::DEFAULT_FOLDER)) $criteria->add(ContentFolderTableMap::DEFAULT_FOLDER, $this->default_folder); if ($this->isColumnModified(ContentFolderTableMap::CREATED_AT)) $criteria->add(ContentFolderTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(ContentFolderTableMap::UPDATED_AT)) $criteria->add(ContentFolderTableMap::UPDATED_AT, $this->updated_at); @@ -1123,6 +1187,7 @@ abstract class ContentFolder implements ActiveRecordInterface { $copyObj->setContentId($this->getContentId()); $copyObj->setFolderId($this->getFolderId()); + $copyObj->setDefaultFolder($this->getDefaultFolder()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); if ($makeNew) { @@ -1261,6 +1326,7 @@ abstract class ContentFolder implements ActiveRecordInterface { $this->content_id = null; $this->folder_id = null; + $this->default_folder = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; diff --git a/core/lib/Thelia/Model/Base/ContentFolderQuery.php b/core/lib/Thelia/Model/Base/ContentFolderQuery.php index 208ba80cf..72561ae77 100644 --- a/core/lib/Thelia/Model/Base/ContentFolderQuery.php +++ b/core/lib/Thelia/Model/Base/ContentFolderQuery.php @@ -23,11 +23,13 @@ use Thelia\Model\Map\ContentFolderTableMap; * * @method ChildContentFolderQuery orderByContentId($order = Criteria::ASC) Order by the content_id column * @method ChildContentFolderQuery orderByFolderId($order = Criteria::ASC) Order by the folder_id column + * @method ChildContentFolderQuery orderByDefaultFolder($order = Criteria::ASC) Order by the default_folder column * @method ChildContentFolderQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildContentFolderQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * * @method ChildContentFolderQuery groupByContentId() Group by the content_id column * @method ChildContentFolderQuery groupByFolderId() Group by the folder_id column + * @method ChildContentFolderQuery groupByDefaultFolder() Group by the default_folder column * @method ChildContentFolderQuery groupByCreatedAt() Group by the created_at column * @method ChildContentFolderQuery groupByUpdatedAt() Group by the updated_at column * @@ -48,11 +50,13 @@ use Thelia\Model\Map\ContentFolderTableMap; * * @method ChildContentFolder findOneByContentId(int $content_id) Return the first ChildContentFolder filtered by the content_id column * @method ChildContentFolder findOneByFolderId(int $folder_id) Return the first ChildContentFolder filtered by the folder_id column + * @method ChildContentFolder findOneByDefaultFolder(boolean $default_folder) Return the first ChildContentFolder filtered by the default_folder column * @method ChildContentFolder findOneByCreatedAt(string $created_at) Return the first ChildContentFolder filtered by the created_at column * @method ChildContentFolder findOneByUpdatedAt(string $updated_at) Return the first ChildContentFolder filtered by the updated_at column * * @method array findByContentId(int $content_id) Return ChildContentFolder objects filtered by the content_id column * @method array findByFolderId(int $folder_id) Return ChildContentFolder objects filtered by the folder_id column + * @method array findByDefaultFolder(boolean $default_folder) Return ChildContentFolder objects filtered by the default_folder column * @method array findByCreatedAt(string $created_at) Return ChildContentFolder objects filtered by the created_at column * @method array findByUpdatedAt(string $updated_at) Return ChildContentFolder objects filtered by the updated_at column * @@ -143,7 +147,7 @@ abstract class ContentFolderQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT CONTENT_ID, FOLDER_ID, CREATED_AT, UPDATED_AT FROM content_folder WHERE CONTENT_ID = :p0 AND FOLDER_ID = :p1'; + $sql = 'SELECT CONTENT_ID, FOLDER_ID, DEFAULT_FOLDER, CREATED_AT, UPDATED_AT FROM content_folder WHERE CONTENT_ID = :p0 AND FOLDER_ID = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); @@ -330,6 +334,33 @@ abstract class ContentFolderQuery extends ModelCriteria return $this->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folderId, $comparison); } + /** + * Filter the query on the default_folder column + * + * Example usage: + * + * $query->filterByDefaultFolder(true); // WHERE default_folder = true + * $query->filterByDefaultFolder('yes'); // WHERE default_folder = true + * + * + * @param boolean|string $defaultFolder The value to use as filter. + * Non-boolean arguments are converted using the following rules: + * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true + * * 0, '0', 'false', 'off', and 'no' are converted to boolean false + * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildContentFolderQuery The current query, for fluid interface + */ + public function filterByDefaultFolder($defaultFolder = null, $comparison = null) + { + if (is_string($defaultFolder)) { + $default_folder = in_array(strtolower($defaultFolder), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; + } + + return $this->addUsingAlias(ContentFolderTableMap::DEFAULT_FOLDER, $defaultFolder, $comparison); + } + /** * Filter the query on the created_at column * diff --git a/core/lib/Thelia/Model/Base/Currency.php b/core/lib/Thelia/Model/Base/Currency.php index 26d6573a9..e46176739 100644 --- a/core/lib/Thelia/Model/Base/Currency.php +++ b/core/lib/Thelia/Model/Base/Currency.php @@ -987,10 +987,9 @@ abstract class Currency implements ActiveRecordInterface if ($this->ordersScheduledForDeletion !== null) { if (!$this->ordersScheduledForDeletion->isEmpty()) { - foreach ($this->ordersScheduledForDeletion as $order) { - // need to save related object because we set the relation to null - $order->save($con); - } + \Thelia\Model\OrderQuery::create() + ->filterByPrimaryKeys($this->ordersScheduledForDeletion->getPrimaryKeys(false)) + ->delete($con); $this->ordersScheduledForDeletion = null; } } @@ -1758,7 +1757,7 @@ abstract class Currency implements ActiveRecordInterface $this->ordersScheduledForDeletion = clone $this->collOrders; $this->ordersScheduledForDeletion->clear(); } - $this->ordersScheduledForDeletion[]= $order; + $this->ordersScheduledForDeletion[]= clone $order; $order->setCurrency(null); } @@ -1807,10 +1806,10 @@ abstract class Currency implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersJoinOrderAddressRelatedByAddressInvoice($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); - $query->joinWith('OrderAddressRelatedByAddressInvoice', $joinBehavior); + $query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior); return $this->getOrders($query, $con); } @@ -1832,10 +1831,10 @@ abstract class Currency implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersJoinOrderAddressRelatedByAddressDelivery($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); - $query->joinWith('OrderAddressRelatedByAddressDelivery', $joinBehavior); + $query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior); return $this->getOrders($query, $con); } @@ -1865,6 +1864,81 @@ abstract class Currency implements ActiveRecordInterface return $this->getOrders($query, $con); } + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Currency is new, it will return + * an empty collection; or if this Currency has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Currency. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Currency is new, it will return + * an empty collection; or if this Currency has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Currency. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Currency is new, it will return + * an empty collection; or if this Currency has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Currency. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Lang', $joinBehavior); + + return $this->getOrders($query, $con); + } + /** * Clears out the collCarts collection * diff --git a/core/lib/Thelia/Model/Base/CurrencyQuery.php b/core/lib/Thelia/Model/Base/CurrencyQuery.php index eb4b1b2f7..4276000a1 100644 --- a/core/lib/Thelia/Model/Base/CurrencyQuery.php +++ b/core/lib/Thelia/Model/Base/CurrencyQuery.php @@ -596,7 +596,7 @@ abstract class CurrencyQuery extends ModelCriteria * * @return ChildCurrencyQuery The current query, for fluid interface */ - public function joinOrder($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Order'); @@ -631,7 +631,7 @@ abstract class CurrencyQuery extends ModelCriteria * * @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query */ - public function useOrderQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinOrder($relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/Customer.php b/core/lib/Thelia/Model/Base/Customer.php index 06553ecfe..e7bd688af 100644 --- a/core/lib/Thelia/Model/Base/Customer.php +++ b/core/lib/Thelia/Model/Base/Customer.php @@ -2552,10 +2552,10 @@ abstract class Customer implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersJoinOrderAddressRelatedByAddressInvoice($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); - $query->joinWith('OrderAddressRelatedByAddressInvoice', $joinBehavior); + $query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior); return $this->getOrders($query, $con); } @@ -2577,10 +2577,10 @@ abstract class Customer implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersJoinOrderAddressRelatedByAddressDelivery($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); - $query->joinWith('OrderAddressRelatedByAddressDelivery', $joinBehavior); + $query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior); return $this->getOrders($query, $con); } @@ -2610,6 +2610,81 @@ abstract class Customer implements ActiveRecordInterface return $this->getOrders($query, $con); } + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Customer is new, it will return + * an empty collection; or if this Customer has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Customer. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Customer is new, it will return + * an empty collection; or if this Customer has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Customer. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Customer is new, it will return + * an empty collection; or if this Customer has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Customer. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Lang', $joinBehavior); + + return $this->getOrders($query, $con); + } + /** * Clears out the collCarts collection * diff --git a/core/lib/Thelia/Model/Base/Lang.php b/core/lib/Thelia/Model/Base/Lang.php index 1c11103af..59836e27d 100644 --- a/core/lib/Thelia/Model/Base/Lang.php +++ b/core/lib/Thelia/Model/Base/Lang.php @@ -10,6 +10,7 @@ use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\ModelCriteria; use Propel\Runtime\ActiveRecord\ActiveRecordInterface; use Propel\Runtime\Collection\Collection; +use Propel\Runtime\Collection\ObjectCollection; use Propel\Runtime\Connection\ConnectionInterface; use Propel\Runtime\Exception\BadMethodCallException; use Propel\Runtime\Exception\PropelException; @@ -18,6 +19,8 @@ use Propel\Runtime\Parser\AbstractParser; use Propel\Runtime\Util\PropelDateTime; use Thelia\Model\Lang as ChildLang; use Thelia\Model\LangQuery as ChildLangQuery; +use Thelia\Model\Order as ChildOrder; +use Thelia\Model\OrderQuery as ChildOrderQuery; use Thelia\Model\Map\LangTableMap; abstract class Lang implements ActiveRecordInterface @@ -144,6 +147,12 @@ abstract class Lang implements ActiveRecordInterface */ protected $updated_at; + /** + * @var ObjectCollection|ChildOrder[] Collection to store aggregation of ChildOrder objects. + */ + protected $collOrders; + protected $collOrdersPartial; + /** * Flag to prevent endless save loop, if this object is referenced * by another object which falls in this transaction. @@ -152,6 +161,12 @@ abstract class Lang implements ActiveRecordInterface */ protected $alreadyInSave = false; + /** + * An array of objects scheduled for deletion. + * @var ObjectCollection + */ + protected $ordersScheduledForDeletion = null; + /** * Initializes internal state of Thelia\Model\Base\Lang object. */ @@ -1060,6 +1075,8 @@ abstract class Lang implements ActiveRecordInterface if ($deep) { // also de-associate any related objects? + $this->collOrders = null; + } // if (deep) } @@ -1193,6 +1210,23 @@ abstract class Lang implements ActiveRecordInterface $this->resetModified(); } + if ($this->ordersScheduledForDeletion !== null) { + if (!$this->ordersScheduledForDeletion->isEmpty()) { + \Thelia\Model\OrderQuery::create() + ->filterByPrimaryKeys($this->ordersScheduledForDeletion->getPrimaryKeys(false)) + ->delete($con); + $this->ordersScheduledForDeletion = null; + } + } + + if ($this->collOrders !== null) { + foreach ($this->collOrders as $referrerFK) { + if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { + $affectedRows += $referrerFK->save($con); + } + } + } + $this->alreadyInSave = false; } @@ -1444,10 +1478,11 @@ abstract class Lang implements ActiveRecordInterface * Defaults to TableMap::TYPE_PHPNAME. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion + * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE. * * @return array an associative array containing the field names (as keys) and field values */ - public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array()) + public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { if (isset($alreadyDumpedObjects['Lang'][$this->getPrimaryKey()])) { return '*RECURSION*'; @@ -1477,6 +1512,11 @@ abstract class Lang implements ActiveRecordInterface $result[$key] = $virtualColumn; } + if ($includeForeignObjects) { + if (null !== $this->collOrders) { + $result['Orders'] = $this->collOrders->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); + } + } return $result; } @@ -1697,6 +1737,20 @@ abstract class Lang implements ActiveRecordInterface $copyObj->setPosition($this->getPosition()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); + + if ($deepCopy) { + // important: temporarily setNew(false) because this affects the behavior of + // the getter/setter methods for fkey referrer objects. + $copyObj->setNew(false); + + foreach ($this->getOrders() as $relObj) { + if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves + $copyObj->addOrder($relObj->copy($deepCopy)); + } + } + + } // if ($deepCopy) + if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value @@ -1725,6 +1779,415 @@ abstract class Lang implements ActiveRecordInterface return $copyObj; } + + /** + * Initializes a collection based on the name of a relation. + * Avoids crafting an 'init[$relationName]s' method name + * that wouldn't work when StandardEnglishPluralizer is used. + * + * @param string $relationName The name of the relation to initialize + * @return void + */ + public function initRelation($relationName) + { + if ('Order' == $relationName) { + return $this->initOrders(); + } + } + + /** + * Clears out the collOrders collection + * + * This does not modify the database; however, it will remove any associated objects, causing + * them to be refetched by subsequent calls to accessor method. + * + * @return void + * @see addOrders() + */ + public function clearOrders() + { + $this->collOrders = null; // important to set this to NULL since that means it is uninitialized + } + + /** + * Reset is the collOrders collection loaded partially. + */ + public function resetPartialOrders($v = true) + { + $this->collOrdersPartial = $v; + } + + /** + * Initializes the collOrders collection. + * + * By default this just sets the collOrders collection to an empty array (like clearcollOrders()); + * however, you may wish to override this method in your stub class to provide setting appropriate + * to your application -- for example, setting the initial array to the values stored in database. + * + * @param boolean $overrideExisting If set to true, the method call initializes + * the collection even if it is not empty + * + * @return void + */ + public function initOrders($overrideExisting = true) + { + if (null !== $this->collOrders && !$overrideExisting) { + return; + } + $this->collOrders = new ObjectCollection(); + $this->collOrders->setModel('\Thelia\Model\Order'); + } + + /** + * Gets an array of ChildOrder objects which contain a foreign key that references this object. + * + * If the $criteria is not null, it is used to always fetch the results from the database. + * Otherwise the results are fetched from the database the first time, then cached. + * Next time the same method is called without $criteria, the cached collection is returned. + * If this ChildLang is new, it will return + * an empty collection or the current collection; the criteria is ignored on a new object. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @return Collection|ChildOrder[] List of ChildOrder objects + * @throws PropelException + */ + public function getOrders($criteria = null, ConnectionInterface $con = null) + { + $partial = $this->collOrdersPartial && !$this->isNew(); + if (null === $this->collOrders || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrders) { + // return empty collection + $this->initOrders(); + } else { + $collOrders = ChildOrderQuery::create(null, $criteria) + ->filterByLang($this) + ->find($con); + + if (null !== $criteria) { + if (false !== $this->collOrdersPartial && count($collOrders)) { + $this->initOrders(false); + + foreach ($collOrders as $obj) { + if (false == $this->collOrders->contains($obj)) { + $this->collOrders->append($obj); + } + } + + $this->collOrdersPartial = true; + } + + $collOrders->getInternalIterator()->rewind(); + + return $collOrders; + } + + if ($partial && $this->collOrders) { + foreach ($this->collOrders as $obj) { + if ($obj->isNew()) { + $collOrders[] = $obj; + } + } + } + + $this->collOrders = $collOrders; + $this->collOrdersPartial = false; + } + } + + return $this->collOrders; + } + + /** + * Sets a collection of Order objects related by a one-to-many relationship + * to the current object. + * It will also schedule objects for deletion based on a diff between old objects (aka persisted) + * and new objects from the given Propel collection. + * + * @param Collection $orders A Propel collection. + * @param ConnectionInterface $con Optional connection object + * @return ChildLang The current object (for fluent API support) + */ + public function setOrders(Collection $orders, ConnectionInterface $con = null) + { + $ordersToDelete = $this->getOrders(new Criteria(), $con)->diff($orders); + + + $this->ordersScheduledForDeletion = $ordersToDelete; + + foreach ($ordersToDelete as $orderRemoved) { + $orderRemoved->setLang(null); + } + + $this->collOrders = null; + foreach ($orders as $order) { + $this->addOrder($order); + } + + $this->collOrders = $orders; + $this->collOrdersPartial = false; + + return $this; + } + + /** + * Returns the number of related Order objects. + * + * @param Criteria $criteria + * @param boolean $distinct + * @param ConnectionInterface $con + * @return int Count of related Order objects. + * @throws PropelException + */ + public function countOrders(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) + { + $partial = $this->collOrdersPartial && !$this->isNew(); + if (null === $this->collOrders || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrders) { + return 0; + } + + if ($partial && !$criteria) { + return count($this->getOrders()); + } + + $query = ChildOrderQuery::create(null, $criteria); + if ($distinct) { + $query->distinct(); + } + + return $query + ->filterByLang($this) + ->count($con); + } + + return count($this->collOrders); + } + + /** + * Method called to associate a ChildOrder object to this object + * through the ChildOrder foreign key attribute. + * + * @param ChildOrder $l ChildOrder + * @return \Thelia\Model\Lang The current object (for fluent API support) + */ + public function addOrder(ChildOrder $l) + { + if ($this->collOrders === null) { + $this->initOrders(); + $this->collOrdersPartial = true; + } + + if (!in_array($l, $this->collOrders->getArrayCopy(), true)) { // only add it if the **same** object is not already associated + $this->doAddOrder($l); + } + + return $this; + } + + /** + * @param Order $order The order object to add. + */ + protected function doAddOrder($order) + { + $this->collOrders[]= $order; + $order->setLang($this); + } + + /** + * @param Order $order The order object to remove. + * @return ChildLang The current object (for fluent API support) + */ + public function removeOrder($order) + { + if ($this->getOrders()->contains($order)) { + $this->collOrders->remove($this->collOrders->search($order)); + if (null === $this->ordersScheduledForDeletion) { + $this->ordersScheduledForDeletion = clone $this->collOrders; + $this->ordersScheduledForDeletion->clear(); + } + $this->ordersScheduledForDeletion[]= clone $order; + $order->setLang(null); + } + + return $this; + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Lang is new, it will return + * an empty collection; or if this Lang has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Lang. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Currency', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Lang is new, it will return + * an empty collection; or if this Lang has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Lang. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Customer', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Lang is new, it will return + * an empty collection; or if this Lang has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Lang. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Lang is new, it will return + * an empty collection; or if this Lang has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Lang. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Lang is new, it will return + * an empty collection; or if this Lang has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Lang. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('OrderStatus', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Lang is new, it will return + * an empty collection; or if this Lang has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Lang. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Lang is new, it will return + * an empty collection; or if this Lang has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Lang. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior); + + return $this->getOrders($query, $con); + } + /** * Clears the current object and sets all attributes to their default values */ @@ -1764,8 +2227,17 @@ abstract class Lang implements ActiveRecordInterface public function clearAllReferences($deep = false) { if ($deep) { + if ($this->collOrders) { + foreach ($this->collOrders as $o) { + $o->clearAllReferences($deep); + } + } } // if ($deep) + if ($this->collOrders instanceof Collection) { + $this->collOrders->clearIterator(); + } + $this->collOrders = null; } /** diff --git a/core/lib/Thelia/Model/Base/LangQuery.php b/core/lib/Thelia/Model/Base/LangQuery.php index 2fabec9ee..045ee0887 100644 --- a/core/lib/Thelia/Model/Base/LangQuery.php +++ b/core/lib/Thelia/Model/Base/LangQuery.php @@ -7,6 +7,9 @@ use \PDO; use Propel\Runtime\Propel; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\ModelCriteria; +use Propel\Runtime\ActiveQuery\ModelJoin; +use Propel\Runtime\Collection\Collection; +use Propel\Runtime\Collection\ObjectCollection; use Propel\Runtime\Connection\ConnectionInterface; use Propel\Runtime\Exception\PropelException; use Thelia\Model\Lang as ChildLang; @@ -54,6 +57,10 @@ use Thelia\Model\Map\LangTableMap; * @method ChildLangQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method ChildLangQuery innerJoin($relation) Adds a INNER JOIN clause to the query * + * @method ChildLangQuery leftJoinOrder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Order relation + * @method ChildLangQuery rightJoinOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Order relation + * @method ChildLangQuery innerJoinOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the Order relation + * * @method ChildLang findOne(ConnectionInterface $con = null) Return the first ChildLang matching the query * @method ChildLang findOneOrCreate(ConnectionInterface $con = null) Return the first ChildLang matching the query, or a new ChildLang object populated from the query conditions when no match is found * @@ -764,6 +771,79 @@ abstract class LangQuery extends ModelCriteria return $this->addUsingAlias(LangTableMap::UPDATED_AT, $updatedAt, $comparison); } + /** + * Filter the query by a related \Thelia\Model\Order object + * + * @param \Thelia\Model\Order|ObjectCollection $order the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildLangQuery The current query, for fluid interface + */ + public function filterByOrder($order, $comparison = null) + { + if ($order instanceof \Thelia\Model\Order) { + return $this + ->addUsingAlias(LangTableMap::ID, $order->getLangId(), $comparison); + } elseif ($order instanceof ObjectCollection) { + return $this + ->useOrderQuery() + ->filterByPrimaryKeys($order->getPrimaryKeys()) + ->endUse(); + } else { + throw new PropelException('filterByOrder() only accepts arguments of type \Thelia\Model\Order or Collection'); + } + } + + /** + * Adds a JOIN clause to the query using the Order relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return ChildLangQuery The current query, for fluid interface + */ + public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('Order'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'Order'); + } + + return $this; + } + + /** + * Use the Order relation Order object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query + */ + public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + return $this + ->joinOrder($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'Order', '\Thelia\Model\OrderQuery'); + } + /** * Exclude object from result * diff --git a/core/lib/Thelia/Model/Base/Module.php b/core/lib/Thelia/Model/Base/Module.php index 9cc89381a..a154c382d 100644 --- a/core/lib/Thelia/Model/Base/Module.php +++ b/core/lib/Thelia/Model/Base/Module.php @@ -23,6 +23,8 @@ use Thelia\Model\Module as ChildModule; use Thelia\Model\ModuleI18n as ChildModuleI18n; use Thelia\Model\ModuleI18nQuery as ChildModuleI18nQuery; use Thelia\Model\ModuleQuery as ChildModuleQuery; +use Thelia\Model\Order as ChildOrder; +use Thelia\Model\OrderQuery as ChildOrderQuery; use Thelia\Model\Map\ModuleTableMap; abstract class Module implements ActiveRecordInterface @@ -107,6 +109,18 @@ abstract class Module implements ActiveRecordInterface */ protected $updated_at; + /** + * @var ObjectCollection|ChildOrder[] Collection to store aggregation of ChildOrder objects. + */ + protected $collOrdersRelatedByPaymentModuleId; + protected $collOrdersRelatedByPaymentModuleIdPartial; + + /** + * @var ObjectCollection|ChildOrder[] Collection to store aggregation of ChildOrder objects. + */ + protected $collOrdersRelatedByDeliveryModuleId; + protected $collOrdersRelatedByDeliveryModuleIdPartial; + /** * @var ObjectCollection|ChildGroupModule[] Collection to store aggregation of ChildGroupModule objects. */ @@ -141,6 +155,18 @@ abstract class Module implements ActiveRecordInterface */ protected $currentTranslations; + /** + * An array of objects scheduled for deletion. + * @var ObjectCollection + */ + protected $ordersRelatedByPaymentModuleIdScheduledForDeletion = null; + + /** + * An array of objects scheduled for deletion. + * @var ObjectCollection + */ + protected $ordersRelatedByDeliveryModuleIdScheduledForDeletion = null; + /** * An array of objects scheduled for deletion. * @var ObjectCollection @@ -816,6 +842,10 @@ abstract class Module implements ActiveRecordInterface if ($deep) { // also de-associate any related objects? + $this->collOrdersRelatedByPaymentModuleId = null; + + $this->collOrdersRelatedByDeliveryModuleId = null; + $this->collGroupModules = null; $this->collModuleI18ns = null; @@ -953,6 +983,40 @@ abstract class Module implements ActiveRecordInterface $this->resetModified(); } + if ($this->ordersRelatedByPaymentModuleIdScheduledForDeletion !== null) { + if (!$this->ordersRelatedByPaymentModuleIdScheduledForDeletion->isEmpty()) { + \Thelia\Model\OrderQuery::create() + ->filterByPrimaryKeys($this->ordersRelatedByPaymentModuleIdScheduledForDeletion->getPrimaryKeys(false)) + ->delete($con); + $this->ordersRelatedByPaymentModuleIdScheduledForDeletion = null; + } + } + + if ($this->collOrdersRelatedByPaymentModuleId !== null) { + foreach ($this->collOrdersRelatedByPaymentModuleId as $referrerFK) { + if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->ordersRelatedByDeliveryModuleIdScheduledForDeletion !== null) { + if (!$this->ordersRelatedByDeliveryModuleIdScheduledForDeletion->isEmpty()) { + \Thelia\Model\OrderQuery::create() + ->filterByPrimaryKeys($this->ordersRelatedByDeliveryModuleIdScheduledForDeletion->getPrimaryKeys(false)) + ->delete($con); + $this->ordersRelatedByDeliveryModuleIdScheduledForDeletion = null; + } + } + + if ($this->collOrdersRelatedByDeliveryModuleId !== null) { + foreach ($this->collOrdersRelatedByDeliveryModuleId as $referrerFK) { + if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { + $affectedRows += $referrerFK->save($con); + } + } + } + if ($this->groupModulesScheduledForDeletion !== null) { if (!$this->groupModulesScheduledForDeletion->isEmpty()) { \Thelia\Model\GroupModuleQuery::create() @@ -1203,6 +1267,12 @@ abstract class Module implements ActiveRecordInterface } if ($includeForeignObjects) { + if (null !== $this->collOrdersRelatedByPaymentModuleId) { + $result['OrdersRelatedByPaymentModuleId'] = $this->collOrdersRelatedByPaymentModuleId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); + } + if (null !== $this->collOrdersRelatedByDeliveryModuleId) { + $result['OrdersRelatedByDeliveryModuleId'] = $this->collOrdersRelatedByDeliveryModuleId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); + } if (null !== $this->collGroupModules) { $result['GroupModules'] = $this->collGroupModules->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } @@ -1394,6 +1464,18 @@ abstract class Module implements ActiveRecordInterface // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); + foreach ($this->getOrdersRelatedByPaymentModuleId() as $relObj) { + if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves + $copyObj->addOrderRelatedByPaymentModuleId($relObj->copy($deepCopy)); + } + } + + foreach ($this->getOrdersRelatedByDeliveryModuleId() as $relObj) { + if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves + $copyObj->addOrderRelatedByDeliveryModuleId($relObj->copy($deepCopy)); + } + } + foreach ($this->getGroupModules() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addGroupModule($relObj->copy($deepCopy)); @@ -1447,6 +1529,12 @@ abstract class Module implements ActiveRecordInterface */ public function initRelation($relationName) { + if ('OrderRelatedByPaymentModuleId' == $relationName) { + return $this->initOrdersRelatedByPaymentModuleId(); + } + if ('OrderRelatedByDeliveryModuleId' == $relationName) { + return $this->initOrdersRelatedByDeliveryModuleId(); + } if ('GroupModule' == $relationName) { return $this->initGroupModules(); } @@ -1455,6 +1543,742 @@ abstract class Module implements ActiveRecordInterface } } + /** + * Clears out the collOrdersRelatedByPaymentModuleId collection + * + * This does not modify the database; however, it will remove any associated objects, causing + * them to be refetched by subsequent calls to accessor method. + * + * @return void + * @see addOrdersRelatedByPaymentModuleId() + */ + public function clearOrdersRelatedByPaymentModuleId() + { + $this->collOrdersRelatedByPaymentModuleId = null; // important to set this to NULL since that means it is uninitialized + } + + /** + * Reset is the collOrdersRelatedByPaymentModuleId collection loaded partially. + */ + public function resetPartialOrdersRelatedByPaymentModuleId($v = true) + { + $this->collOrdersRelatedByPaymentModuleIdPartial = $v; + } + + /** + * Initializes the collOrdersRelatedByPaymentModuleId collection. + * + * By default this just sets the collOrdersRelatedByPaymentModuleId collection to an empty array (like clearcollOrdersRelatedByPaymentModuleId()); + * however, you may wish to override this method in your stub class to provide setting appropriate + * to your application -- for example, setting the initial array to the values stored in database. + * + * @param boolean $overrideExisting If set to true, the method call initializes + * the collection even if it is not empty + * + * @return void + */ + public function initOrdersRelatedByPaymentModuleId($overrideExisting = true) + { + if (null !== $this->collOrdersRelatedByPaymentModuleId && !$overrideExisting) { + return; + } + $this->collOrdersRelatedByPaymentModuleId = new ObjectCollection(); + $this->collOrdersRelatedByPaymentModuleId->setModel('\Thelia\Model\Order'); + } + + /** + * Gets an array of ChildOrder objects which contain a foreign key that references this object. + * + * If the $criteria is not null, it is used to always fetch the results from the database. + * Otherwise the results are fetched from the database the first time, then cached. + * Next time the same method is called without $criteria, the cached collection is returned. + * If this ChildModule is new, it will return + * an empty collection or the current collection; the criteria is ignored on a new object. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @return Collection|ChildOrder[] List of ChildOrder objects + * @throws PropelException + */ + public function getOrdersRelatedByPaymentModuleId($criteria = null, ConnectionInterface $con = null) + { + $partial = $this->collOrdersRelatedByPaymentModuleIdPartial && !$this->isNew(); + if (null === $this->collOrdersRelatedByPaymentModuleId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrdersRelatedByPaymentModuleId) { + // return empty collection + $this->initOrdersRelatedByPaymentModuleId(); + } else { + $collOrdersRelatedByPaymentModuleId = ChildOrderQuery::create(null, $criteria) + ->filterByModuleRelatedByPaymentModuleId($this) + ->find($con); + + if (null !== $criteria) { + if (false !== $this->collOrdersRelatedByPaymentModuleIdPartial && count($collOrdersRelatedByPaymentModuleId)) { + $this->initOrdersRelatedByPaymentModuleId(false); + + foreach ($collOrdersRelatedByPaymentModuleId as $obj) { + if (false == $this->collOrdersRelatedByPaymentModuleId->contains($obj)) { + $this->collOrdersRelatedByPaymentModuleId->append($obj); + } + } + + $this->collOrdersRelatedByPaymentModuleIdPartial = true; + } + + $collOrdersRelatedByPaymentModuleId->getInternalIterator()->rewind(); + + return $collOrdersRelatedByPaymentModuleId; + } + + if ($partial && $this->collOrdersRelatedByPaymentModuleId) { + foreach ($this->collOrdersRelatedByPaymentModuleId as $obj) { + if ($obj->isNew()) { + $collOrdersRelatedByPaymentModuleId[] = $obj; + } + } + } + + $this->collOrdersRelatedByPaymentModuleId = $collOrdersRelatedByPaymentModuleId; + $this->collOrdersRelatedByPaymentModuleIdPartial = false; + } + } + + return $this->collOrdersRelatedByPaymentModuleId; + } + + /** + * Sets a collection of OrderRelatedByPaymentModuleId objects related by a one-to-many relationship + * to the current object. + * It will also schedule objects for deletion based on a diff between old objects (aka persisted) + * and new objects from the given Propel collection. + * + * @param Collection $ordersRelatedByPaymentModuleId A Propel collection. + * @param ConnectionInterface $con Optional connection object + * @return ChildModule The current object (for fluent API support) + */ + public function setOrdersRelatedByPaymentModuleId(Collection $ordersRelatedByPaymentModuleId, ConnectionInterface $con = null) + { + $ordersRelatedByPaymentModuleIdToDelete = $this->getOrdersRelatedByPaymentModuleId(new Criteria(), $con)->diff($ordersRelatedByPaymentModuleId); + + + $this->ordersRelatedByPaymentModuleIdScheduledForDeletion = $ordersRelatedByPaymentModuleIdToDelete; + + foreach ($ordersRelatedByPaymentModuleIdToDelete as $orderRelatedByPaymentModuleIdRemoved) { + $orderRelatedByPaymentModuleIdRemoved->setModuleRelatedByPaymentModuleId(null); + } + + $this->collOrdersRelatedByPaymentModuleId = null; + foreach ($ordersRelatedByPaymentModuleId as $orderRelatedByPaymentModuleId) { + $this->addOrderRelatedByPaymentModuleId($orderRelatedByPaymentModuleId); + } + + $this->collOrdersRelatedByPaymentModuleId = $ordersRelatedByPaymentModuleId; + $this->collOrdersRelatedByPaymentModuleIdPartial = false; + + return $this; + } + + /** + * Returns the number of related Order objects. + * + * @param Criteria $criteria + * @param boolean $distinct + * @param ConnectionInterface $con + * @return int Count of related Order objects. + * @throws PropelException + */ + public function countOrdersRelatedByPaymentModuleId(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) + { + $partial = $this->collOrdersRelatedByPaymentModuleIdPartial && !$this->isNew(); + if (null === $this->collOrdersRelatedByPaymentModuleId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrdersRelatedByPaymentModuleId) { + return 0; + } + + if ($partial && !$criteria) { + return count($this->getOrdersRelatedByPaymentModuleId()); + } + + $query = ChildOrderQuery::create(null, $criteria); + if ($distinct) { + $query->distinct(); + } + + return $query + ->filterByModuleRelatedByPaymentModuleId($this) + ->count($con); + } + + return count($this->collOrdersRelatedByPaymentModuleId); + } + + /** + * Method called to associate a ChildOrder object to this object + * through the ChildOrder foreign key attribute. + * + * @param ChildOrder $l ChildOrder + * @return \Thelia\Model\Module The current object (for fluent API support) + */ + public function addOrderRelatedByPaymentModuleId(ChildOrder $l) + { + if ($this->collOrdersRelatedByPaymentModuleId === null) { + $this->initOrdersRelatedByPaymentModuleId(); + $this->collOrdersRelatedByPaymentModuleIdPartial = true; + } + + if (!in_array($l, $this->collOrdersRelatedByPaymentModuleId->getArrayCopy(), true)) { // only add it if the **same** object is not already associated + $this->doAddOrderRelatedByPaymentModuleId($l); + } + + return $this; + } + + /** + * @param OrderRelatedByPaymentModuleId $orderRelatedByPaymentModuleId The orderRelatedByPaymentModuleId object to add. + */ + protected function doAddOrderRelatedByPaymentModuleId($orderRelatedByPaymentModuleId) + { + $this->collOrdersRelatedByPaymentModuleId[]= $orderRelatedByPaymentModuleId; + $orderRelatedByPaymentModuleId->setModuleRelatedByPaymentModuleId($this); + } + + /** + * @param OrderRelatedByPaymentModuleId $orderRelatedByPaymentModuleId The orderRelatedByPaymentModuleId object to remove. + * @return ChildModule The current object (for fluent API support) + */ + public function removeOrderRelatedByPaymentModuleId($orderRelatedByPaymentModuleId) + { + if ($this->getOrdersRelatedByPaymentModuleId()->contains($orderRelatedByPaymentModuleId)) { + $this->collOrdersRelatedByPaymentModuleId->remove($this->collOrdersRelatedByPaymentModuleId->search($orderRelatedByPaymentModuleId)); + if (null === $this->ordersRelatedByPaymentModuleIdScheduledForDeletion) { + $this->ordersRelatedByPaymentModuleIdScheduledForDeletion = clone $this->collOrdersRelatedByPaymentModuleId; + $this->ordersRelatedByPaymentModuleIdScheduledForDeletion->clear(); + } + $this->ordersRelatedByPaymentModuleIdScheduledForDeletion[]= clone $orderRelatedByPaymentModuleId; + $orderRelatedByPaymentModuleId->setModuleRelatedByPaymentModuleId(null); + } + + return $this; + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByPaymentModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByPaymentModuleIdJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Currency', $joinBehavior); + + return $this->getOrdersRelatedByPaymentModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByPaymentModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByPaymentModuleIdJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Customer', $joinBehavior); + + return $this->getOrdersRelatedByPaymentModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByPaymentModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByPaymentModuleIdJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior); + + return $this->getOrdersRelatedByPaymentModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByPaymentModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByPaymentModuleIdJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior); + + return $this->getOrdersRelatedByPaymentModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByPaymentModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByPaymentModuleIdJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('OrderStatus', $joinBehavior); + + return $this->getOrdersRelatedByPaymentModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByPaymentModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByPaymentModuleIdJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Lang', $joinBehavior); + + return $this->getOrdersRelatedByPaymentModuleId($query, $con); + } + + /** + * Clears out the collOrdersRelatedByDeliveryModuleId collection + * + * This does not modify the database; however, it will remove any associated objects, causing + * them to be refetched by subsequent calls to accessor method. + * + * @return void + * @see addOrdersRelatedByDeliveryModuleId() + */ + public function clearOrdersRelatedByDeliveryModuleId() + { + $this->collOrdersRelatedByDeliveryModuleId = null; // important to set this to NULL since that means it is uninitialized + } + + /** + * Reset is the collOrdersRelatedByDeliveryModuleId collection loaded partially. + */ + public function resetPartialOrdersRelatedByDeliveryModuleId($v = true) + { + $this->collOrdersRelatedByDeliveryModuleIdPartial = $v; + } + + /** + * Initializes the collOrdersRelatedByDeliveryModuleId collection. + * + * By default this just sets the collOrdersRelatedByDeliveryModuleId collection to an empty array (like clearcollOrdersRelatedByDeliveryModuleId()); + * however, you may wish to override this method in your stub class to provide setting appropriate + * to your application -- for example, setting the initial array to the values stored in database. + * + * @param boolean $overrideExisting If set to true, the method call initializes + * the collection even if it is not empty + * + * @return void + */ + public function initOrdersRelatedByDeliveryModuleId($overrideExisting = true) + { + if (null !== $this->collOrdersRelatedByDeliveryModuleId && !$overrideExisting) { + return; + } + $this->collOrdersRelatedByDeliveryModuleId = new ObjectCollection(); + $this->collOrdersRelatedByDeliveryModuleId->setModel('\Thelia\Model\Order'); + } + + /** + * Gets an array of ChildOrder objects which contain a foreign key that references this object. + * + * If the $criteria is not null, it is used to always fetch the results from the database. + * Otherwise the results are fetched from the database the first time, then cached. + * Next time the same method is called without $criteria, the cached collection is returned. + * If this ChildModule is new, it will return + * an empty collection or the current collection; the criteria is ignored on a new object. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @return Collection|ChildOrder[] List of ChildOrder objects + * @throws PropelException + */ + public function getOrdersRelatedByDeliveryModuleId($criteria = null, ConnectionInterface $con = null) + { + $partial = $this->collOrdersRelatedByDeliveryModuleIdPartial && !$this->isNew(); + if (null === $this->collOrdersRelatedByDeliveryModuleId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrdersRelatedByDeliveryModuleId) { + // return empty collection + $this->initOrdersRelatedByDeliveryModuleId(); + } else { + $collOrdersRelatedByDeliveryModuleId = ChildOrderQuery::create(null, $criteria) + ->filterByModuleRelatedByDeliveryModuleId($this) + ->find($con); + + if (null !== $criteria) { + if (false !== $this->collOrdersRelatedByDeliveryModuleIdPartial && count($collOrdersRelatedByDeliveryModuleId)) { + $this->initOrdersRelatedByDeliveryModuleId(false); + + foreach ($collOrdersRelatedByDeliveryModuleId as $obj) { + if (false == $this->collOrdersRelatedByDeliveryModuleId->contains($obj)) { + $this->collOrdersRelatedByDeliveryModuleId->append($obj); + } + } + + $this->collOrdersRelatedByDeliveryModuleIdPartial = true; + } + + $collOrdersRelatedByDeliveryModuleId->getInternalIterator()->rewind(); + + return $collOrdersRelatedByDeliveryModuleId; + } + + if ($partial && $this->collOrdersRelatedByDeliveryModuleId) { + foreach ($this->collOrdersRelatedByDeliveryModuleId as $obj) { + if ($obj->isNew()) { + $collOrdersRelatedByDeliveryModuleId[] = $obj; + } + } + } + + $this->collOrdersRelatedByDeliveryModuleId = $collOrdersRelatedByDeliveryModuleId; + $this->collOrdersRelatedByDeliveryModuleIdPartial = false; + } + } + + return $this->collOrdersRelatedByDeliveryModuleId; + } + + /** + * Sets a collection of OrderRelatedByDeliveryModuleId objects related by a one-to-many relationship + * to the current object. + * It will also schedule objects for deletion based on a diff between old objects (aka persisted) + * and new objects from the given Propel collection. + * + * @param Collection $ordersRelatedByDeliveryModuleId A Propel collection. + * @param ConnectionInterface $con Optional connection object + * @return ChildModule The current object (for fluent API support) + */ + public function setOrdersRelatedByDeliveryModuleId(Collection $ordersRelatedByDeliveryModuleId, ConnectionInterface $con = null) + { + $ordersRelatedByDeliveryModuleIdToDelete = $this->getOrdersRelatedByDeliveryModuleId(new Criteria(), $con)->diff($ordersRelatedByDeliveryModuleId); + + + $this->ordersRelatedByDeliveryModuleIdScheduledForDeletion = $ordersRelatedByDeliveryModuleIdToDelete; + + foreach ($ordersRelatedByDeliveryModuleIdToDelete as $orderRelatedByDeliveryModuleIdRemoved) { + $orderRelatedByDeliveryModuleIdRemoved->setModuleRelatedByDeliveryModuleId(null); + } + + $this->collOrdersRelatedByDeliveryModuleId = null; + foreach ($ordersRelatedByDeliveryModuleId as $orderRelatedByDeliveryModuleId) { + $this->addOrderRelatedByDeliveryModuleId($orderRelatedByDeliveryModuleId); + } + + $this->collOrdersRelatedByDeliveryModuleId = $ordersRelatedByDeliveryModuleId; + $this->collOrdersRelatedByDeliveryModuleIdPartial = false; + + return $this; + } + + /** + * Returns the number of related Order objects. + * + * @param Criteria $criteria + * @param boolean $distinct + * @param ConnectionInterface $con + * @return int Count of related Order objects. + * @throws PropelException + */ + public function countOrdersRelatedByDeliveryModuleId(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) + { + $partial = $this->collOrdersRelatedByDeliveryModuleIdPartial && !$this->isNew(); + if (null === $this->collOrdersRelatedByDeliveryModuleId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrdersRelatedByDeliveryModuleId) { + return 0; + } + + if ($partial && !$criteria) { + return count($this->getOrdersRelatedByDeliveryModuleId()); + } + + $query = ChildOrderQuery::create(null, $criteria); + if ($distinct) { + $query->distinct(); + } + + return $query + ->filterByModuleRelatedByDeliveryModuleId($this) + ->count($con); + } + + return count($this->collOrdersRelatedByDeliveryModuleId); + } + + /** + * Method called to associate a ChildOrder object to this object + * through the ChildOrder foreign key attribute. + * + * @param ChildOrder $l ChildOrder + * @return \Thelia\Model\Module The current object (for fluent API support) + */ + public function addOrderRelatedByDeliveryModuleId(ChildOrder $l) + { + if ($this->collOrdersRelatedByDeliveryModuleId === null) { + $this->initOrdersRelatedByDeliveryModuleId(); + $this->collOrdersRelatedByDeliveryModuleIdPartial = true; + } + + if (!in_array($l, $this->collOrdersRelatedByDeliveryModuleId->getArrayCopy(), true)) { // only add it if the **same** object is not already associated + $this->doAddOrderRelatedByDeliveryModuleId($l); + } + + return $this; + } + + /** + * @param OrderRelatedByDeliveryModuleId $orderRelatedByDeliveryModuleId The orderRelatedByDeliveryModuleId object to add. + */ + protected function doAddOrderRelatedByDeliveryModuleId($orderRelatedByDeliveryModuleId) + { + $this->collOrdersRelatedByDeliveryModuleId[]= $orderRelatedByDeliveryModuleId; + $orderRelatedByDeliveryModuleId->setModuleRelatedByDeliveryModuleId($this); + } + + /** + * @param OrderRelatedByDeliveryModuleId $orderRelatedByDeliveryModuleId The orderRelatedByDeliveryModuleId object to remove. + * @return ChildModule The current object (for fluent API support) + */ + public function removeOrderRelatedByDeliveryModuleId($orderRelatedByDeliveryModuleId) + { + if ($this->getOrdersRelatedByDeliveryModuleId()->contains($orderRelatedByDeliveryModuleId)) { + $this->collOrdersRelatedByDeliveryModuleId->remove($this->collOrdersRelatedByDeliveryModuleId->search($orderRelatedByDeliveryModuleId)); + if (null === $this->ordersRelatedByDeliveryModuleIdScheduledForDeletion) { + $this->ordersRelatedByDeliveryModuleIdScheduledForDeletion = clone $this->collOrdersRelatedByDeliveryModuleId; + $this->ordersRelatedByDeliveryModuleIdScheduledForDeletion->clear(); + } + $this->ordersRelatedByDeliveryModuleIdScheduledForDeletion[]= clone $orderRelatedByDeliveryModuleId; + $orderRelatedByDeliveryModuleId->setModuleRelatedByDeliveryModuleId(null); + } + + return $this; + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByDeliveryModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByDeliveryModuleIdJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Currency', $joinBehavior); + + return $this->getOrdersRelatedByDeliveryModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByDeliveryModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByDeliveryModuleIdJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Customer', $joinBehavior); + + return $this->getOrdersRelatedByDeliveryModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByDeliveryModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByDeliveryModuleIdJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior); + + return $this->getOrdersRelatedByDeliveryModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByDeliveryModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByDeliveryModuleIdJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior); + + return $this->getOrdersRelatedByDeliveryModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByDeliveryModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByDeliveryModuleIdJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('OrderStatus', $joinBehavior); + + return $this->getOrdersRelatedByDeliveryModuleId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this Module is new, it will return + * an empty collection; or if this Module has previously + * been saved, it will retrieve related OrdersRelatedByDeliveryModuleId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in Module. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByDeliveryModuleIdJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Lang', $joinBehavior); + + return $this->getOrdersRelatedByDeliveryModuleId($query, $con); + } + /** * Clears out the collGroupModules collection * @@ -1955,6 +2779,16 @@ abstract class Module implements ActiveRecordInterface public function clearAllReferences($deep = false) { if ($deep) { + if ($this->collOrdersRelatedByPaymentModuleId) { + foreach ($this->collOrdersRelatedByPaymentModuleId as $o) { + $o->clearAllReferences($deep); + } + } + if ($this->collOrdersRelatedByDeliveryModuleId) { + foreach ($this->collOrdersRelatedByDeliveryModuleId as $o) { + $o->clearAllReferences($deep); + } + } if ($this->collGroupModules) { foreach ($this->collGroupModules as $o) { $o->clearAllReferences($deep); @@ -1971,6 +2805,14 @@ abstract class Module implements ActiveRecordInterface $this->currentLocale = 'en_US'; $this->currentTranslations = null; + if ($this->collOrdersRelatedByPaymentModuleId instanceof Collection) { + $this->collOrdersRelatedByPaymentModuleId->clearIterator(); + } + $this->collOrdersRelatedByPaymentModuleId = null; + if ($this->collOrdersRelatedByDeliveryModuleId instanceof Collection) { + $this->collOrdersRelatedByDeliveryModuleId->clearIterator(); + } + $this->collOrdersRelatedByDeliveryModuleId = null; if ($this->collGroupModules instanceof Collection) { $this->collGroupModules->clearIterator(); } diff --git a/core/lib/Thelia/Model/Base/ModuleQuery.php b/core/lib/Thelia/Model/Base/ModuleQuery.php index 6f8d4b551..30bdd9178 100644 --- a/core/lib/Thelia/Model/Base/ModuleQuery.php +++ b/core/lib/Thelia/Model/Base/ModuleQuery.php @@ -44,6 +44,14 @@ use Thelia\Model\Map\ModuleTableMap; * @method ChildModuleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method ChildModuleQuery innerJoin($relation) Adds a INNER JOIN clause to the query * + * @method ChildModuleQuery leftJoinOrderRelatedByPaymentModuleId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByPaymentModuleId relation + * @method ChildModuleQuery rightJoinOrderRelatedByPaymentModuleId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByPaymentModuleId relation + * @method ChildModuleQuery innerJoinOrderRelatedByPaymentModuleId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByPaymentModuleId relation + * + * @method ChildModuleQuery leftJoinOrderRelatedByDeliveryModuleId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByDeliveryModuleId relation + * @method ChildModuleQuery rightJoinOrderRelatedByDeliveryModuleId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByDeliveryModuleId relation + * @method ChildModuleQuery innerJoinOrderRelatedByDeliveryModuleId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByDeliveryModuleId relation + * * @method ChildModuleQuery leftJoinGroupModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the GroupModule relation * @method ChildModuleQuery rightJoinGroupModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupModule relation * @method ChildModuleQuery innerJoinGroupModule($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupModule relation @@ -557,6 +565,152 @@ abstract class ModuleQuery extends ModelCriteria return $this->addUsingAlias(ModuleTableMap::UPDATED_AT, $updatedAt, $comparison); } + /** + * Filter the query by a related \Thelia\Model\Order object + * + * @param \Thelia\Model\Order|ObjectCollection $order the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildModuleQuery The current query, for fluid interface + */ + public function filterByOrderRelatedByPaymentModuleId($order, $comparison = null) + { + if ($order instanceof \Thelia\Model\Order) { + return $this + ->addUsingAlias(ModuleTableMap::ID, $order->getPaymentModuleId(), $comparison); + } elseif ($order instanceof ObjectCollection) { + return $this + ->useOrderRelatedByPaymentModuleIdQuery() + ->filterByPrimaryKeys($order->getPrimaryKeys()) + ->endUse(); + } else { + throw new PropelException('filterByOrderRelatedByPaymentModuleId() only accepts arguments of type \Thelia\Model\Order or Collection'); + } + } + + /** + * Adds a JOIN clause to the query using the OrderRelatedByPaymentModuleId relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return ChildModuleQuery The current query, for fluid interface + */ + public function joinOrderRelatedByPaymentModuleId($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('OrderRelatedByPaymentModuleId'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'OrderRelatedByPaymentModuleId'); + } + + return $this; + } + + /** + * Use the OrderRelatedByPaymentModuleId relation Order object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query + */ + public function useOrderRelatedByPaymentModuleIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + return $this + ->joinOrderRelatedByPaymentModuleId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByPaymentModuleId', '\Thelia\Model\OrderQuery'); + } + + /** + * Filter the query by a related \Thelia\Model\Order object + * + * @param \Thelia\Model\Order|ObjectCollection $order the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildModuleQuery The current query, for fluid interface + */ + public function filterByOrderRelatedByDeliveryModuleId($order, $comparison = null) + { + if ($order instanceof \Thelia\Model\Order) { + return $this + ->addUsingAlias(ModuleTableMap::ID, $order->getDeliveryModuleId(), $comparison); + } elseif ($order instanceof ObjectCollection) { + return $this + ->useOrderRelatedByDeliveryModuleIdQuery() + ->filterByPrimaryKeys($order->getPrimaryKeys()) + ->endUse(); + } else { + throw new PropelException('filterByOrderRelatedByDeliveryModuleId() only accepts arguments of type \Thelia\Model\Order or Collection'); + } + } + + /** + * Adds a JOIN clause to the query using the OrderRelatedByDeliveryModuleId relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return ChildModuleQuery The current query, for fluid interface + */ + public function joinOrderRelatedByDeliveryModuleId($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('OrderRelatedByDeliveryModuleId'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'OrderRelatedByDeliveryModuleId'); + } + + return $this; + } + + /** + * Use the OrderRelatedByDeliveryModuleId relation Order object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query + */ + public function useOrderRelatedByDeliveryModuleIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + return $this + ->joinOrderRelatedByDeliveryModuleId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByDeliveryModuleId', '\Thelia\Model\OrderQuery'); + } + /** * Filter the query by a related \Thelia\Model\GroupModule object * diff --git a/core/lib/Thelia/Model/Base/Order.php b/core/lib/Thelia/Model/Base/Order.php index 6932ec6c4..a2cd3f829 100644 --- a/core/lib/Thelia/Model/Base/Order.php +++ b/core/lib/Thelia/Model/Base/Order.php @@ -23,6 +23,10 @@ use Thelia\Model\Currency as ChildCurrency; use Thelia\Model\CurrencyQuery as ChildCurrencyQuery; use Thelia\Model\Customer as ChildCustomer; use Thelia\Model\CustomerQuery as ChildCustomerQuery; +use Thelia\Model\Lang as ChildLang; +use Thelia\Model\LangQuery as ChildLangQuery; +use Thelia\Model\Module as ChildModule; +use Thelia\Model\ModuleQuery as ChildModuleQuery; use Thelia\Model\Order as ChildOrder; use Thelia\Model\OrderAddress as ChildOrderAddress; use Thelia\Model\OrderAddressQuery as ChildOrderAddressQuery; @@ -86,16 +90,16 @@ abstract class Order implements ActiveRecordInterface protected $customer_id; /** - * The value for the address_invoice field. + * The value for the invoice_order_address_id field. * @var int */ - protected $address_invoice; + protected $invoice_order_address_id; /** - * The value for the address_delivery field. + * The value for the delivery_order_address_id field. * @var int */ - protected $address_delivery; + protected $delivery_order_address_id; /** * The value for the invoice_date field. @@ -116,22 +120,22 @@ abstract class Order implements ActiveRecordInterface protected $currency_rate; /** - * The value for the transaction field. + * The value for the transaction_ref field. * @var string */ - protected $transaction; + protected $transaction_ref; /** - * The value for the delivery_num field. + * The value for the delivery_ref field. * @var string */ - protected $delivery_num; + protected $delivery_ref; /** - * The value for the invoice field. + * The value for the invoice_ref field. * @var string */ - protected $invoice; + protected $invoice_ref; /** * The value for the postage field. @@ -140,16 +144,16 @@ abstract class Order implements ActiveRecordInterface protected $postage; /** - * The value for the payment field. - * @var string + * The value for the payment_module_id field. + * @var int */ - protected $payment; + protected $payment_module_id; /** - * The value for the carrier field. - * @var string + * The value for the delivery_module_id field. + * @var int */ - protected $carrier; + protected $delivery_module_id; /** * The value for the status_id field. @@ -158,10 +162,10 @@ abstract class Order implements ActiveRecordInterface protected $status_id; /** - * The value for the lang field. - * @var string + * The value for the lang_id field. + * @var int */ - protected $lang; + protected $lang_id; /** * The value for the created_at field. @@ -188,18 +192,33 @@ abstract class Order implements ActiveRecordInterface /** * @var OrderAddress */ - protected $aOrderAddressRelatedByAddressInvoice; + protected $aOrderAddressRelatedByInvoiceOrderAddressId; /** * @var OrderAddress */ - protected $aOrderAddressRelatedByAddressDelivery; + protected $aOrderAddressRelatedByDeliveryOrderAddressId; /** * @var OrderStatus */ protected $aOrderStatus; + /** + * @var Module + */ + protected $aModuleRelatedByPaymentModuleId; + + /** + * @var Module + */ + protected $aModuleRelatedByDeliveryModuleId; + + /** + * @var Lang + */ + protected $aLang; + /** * @var ObjectCollection|ChildOrderProduct[] Collection to store aggregation of ChildOrderProduct objects. */ @@ -520,25 +539,25 @@ abstract class Order implements ActiveRecordInterface } /** - * Get the [address_invoice] column value. + * Get the [invoice_order_address_id] column value. * * @return int */ - public function getAddressInvoice() + public function getInvoiceOrderAddressId() { - return $this->address_invoice; + return $this->invoice_order_address_id; } /** - * Get the [address_delivery] column value. + * Get the [delivery_order_address_id] column value. * * @return int */ - public function getAddressDelivery() + public function getDeliveryOrderAddressId() { - return $this->address_delivery; + return $this->delivery_order_address_id; } /** @@ -584,36 +603,36 @@ abstract class Order implements ActiveRecordInterface } /** - * Get the [transaction] column value. - * + * Get the [transaction_ref] column value. + * transaction reference - usually use to identify a transaction with banking modules * @return string */ - public function getTransaction() + public function getTransactionRef() { - return $this->transaction; + return $this->transaction_ref; } /** - * Get the [delivery_num] column value. - * + * Get the [delivery_ref] column value. + * delivery reference - usually use to identify a delivery progress on a distant delivery tracker website * @return string */ - public function getDeliveryNum() + public function getDeliveryRef() { - return $this->delivery_num; + return $this->delivery_ref; } /** - * Get the [invoice] column value. - * + * Get the [invoice_ref] column value. + * the invoice reference * @return string */ - public function getInvoice() + public function getInvoiceRef() { - return $this->invoice; + return $this->invoice_ref; } /** @@ -628,25 +647,25 @@ abstract class Order implements ActiveRecordInterface } /** - * Get the [payment] column value. + * Get the [payment_module_id] column value. * - * @return string + * @return int */ - public function getPayment() + public function getPaymentModuleId() { - return $this->payment; + return $this->payment_module_id; } /** - * Get the [carrier] column value. + * Get the [delivery_module_id] column value. * - * @return string + * @return int */ - public function getCarrier() + public function getDeliveryModuleId() { - return $this->carrier; + return $this->delivery_module_id; } /** @@ -661,14 +680,14 @@ abstract class Order implements ActiveRecordInterface } /** - * Get the [lang] column value. + * Get the [lang_id] column value. * - * @return string + * @return int */ - public function getLang() + public function getLangId() { - return $this->lang; + return $this->lang_id; } /** @@ -779,54 +798,54 @@ abstract class Order implements ActiveRecordInterface } // setCustomerId() /** - * Set the value of [address_invoice] column. + * Set the value of [invoice_order_address_id] column. * * @param int $v new value * @return \Thelia\Model\Order The current object (for fluent API support) */ - public function setAddressInvoice($v) + public function setInvoiceOrderAddressId($v) { if ($v !== null) { $v = (int) $v; } - if ($this->address_invoice !== $v) { - $this->address_invoice = $v; - $this->modifiedColumns[] = OrderTableMap::ADDRESS_INVOICE; + if ($this->invoice_order_address_id !== $v) { + $this->invoice_order_address_id = $v; + $this->modifiedColumns[] = OrderTableMap::INVOICE_ORDER_ADDRESS_ID; } - if ($this->aOrderAddressRelatedByAddressInvoice !== null && $this->aOrderAddressRelatedByAddressInvoice->getId() !== $v) { - $this->aOrderAddressRelatedByAddressInvoice = null; + if ($this->aOrderAddressRelatedByInvoiceOrderAddressId !== null && $this->aOrderAddressRelatedByInvoiceOrderAddressId->getId() !== $v) { + $this->aOrderAddressRelatedByInvoiceOrderAddressId = null; } return $this; - } // setAddressInvoice() + } // setInvoiceOrderAddressId() /** - * Set the value of [address_delivery] column. + * Set the value of [delivery_order_address_id] column. * * @param int $v new value * @return \Thelia\Model\Order The current object (for fluent API support) */ - public function setAddressDelivery($v) + public function setDeliveryOrderAddressId($v) { if ($v !== null) { $v = (int) $v; } - if ($this->address_delivery !== $v) { - $this->address_delivery = $v; - $this->modifiedColumns[] = OrderTableMap::ADDRESS_DELIVERY; + if ($this->delivery_order_address_id !== $v) { + $this->delivery_order_address_id = $v; + $this->modifiedColumns[] = OrderTableMap::DELIVERY_ORDER_ADDRESS_ID; } - if ($this->aOrderAddressRelatedByAddressDelivery !== null && $this->aOrderAddressRelatedByAddressDelivery->getId() !== $v) { - $this->aOrderAddressRelatedByAddressDelivery = null; + if ($this->aOrderAddressRelatedByDeliveryOrderAddressId !== null && $this->aOrderAddressRelatedByDeliveryOrderAddressId->getId() !== $v) { + $this->aOrderAddressRelatedByDeliveryOrderAddressId = null; } return $this; - } // setAddressDelivery() + } // setDeliveryOrderAddressId() /** * Sets the value of [invoice_date] column to a normalized version of the date/time value specified. @@ -896,67 +915,67 @@ abstract class Order implements ActiveRecordInterface } // setCurrencyRate() /** - * Set the value of [transaction] column. - * + * Set the value of [transaction_ref] column. + * transaction reference - usually use to identify a transaction with banking modules * @param string $v new value * @return \Thelia\Model\Order The current object (for fluent API support) */ - public function setTransaction($v) + public function setTransactionRef($v) { if ($v !== null) { $v = (string) $v; } - if ($this->transaction !== $v) { - $this->transaction = $v; - $this->modifiedColumns[] = OrderTableMap::TRANSACTION; + if ($this->transaction_ref !== $v) { + $this->transaction_ref = $v; + $this->modifiedColumns[] = OrderTableMap::TRANSACTION_REF; } return $this; - } // setTransaction() + } // setTransactionRef() /** - * Set the value of [delivery_num] column. - * + * Set the value of [delivery_ref] column. + * delivery reference - usually use to identify a delivery progress on a distant delivery tracker website * @param string $v new value * @return \Thelia\Model\Order The current object (for fluent API support) */ - public function setDeliveryNum($v) + public function setDeliveryRef($v) { if ($v !== null) { $v = (string) $v; } - if ($this->delivery_num !== $v) { - $this->delivery_num = $v; - $this->modifiedColumns[] = OrderTableMap::DELIVERY_NUM; + if ($this->delivery_ref !== $v) { + $this->delivery_ref = $v; + $this->modifiedColumns[] = OrderTableMap::DELIVERY_REF; } return $this; - } // setDeliveryNum() + } // setDeliveryRef() /** - * Set the value of [invoice] column. - * + * Set the value of [invoice_ref] column. + * the invoice reference * @param string $v new value * @return \Thelia\Model\Order The current object (for fluent API support) */ - public function setInvoice($v) + public function setInvoiceRef($v) { if ($v !== null) { $v = (string) $v; } - if ($this->invoice !== $v) { - $this->invoice = $v; - $this->modifiedColumns[] = OrderTableMap::INVOICE; + if ($this->invoice_ref !== $v) { + $this->invoice_ref = $v; + $this->modifiedColumns[] = OrderTableMap::INVOICE_REF; } return $this; - } // setInvoice() + } // setInvoiceRef() /** * Set the value of [postage] column. @@ -980,46 +999,54 @@ abstract class Order implements ActiveRecordInterface } // setPostage() /** - * Set the value of [payment] column. + * Set the value of [payment_module_id] column. * - * @param string $v new value + * @param int $v new value * @return \Thelia\Model\Order The current object (for fluent API support) */ - public function setPayment($v) + public function setPaymentModuleId($v) { if ($v !== null) { - $v = (string) $v; + $v = (int) $v; } - if ($this->payment !== $v) { - $this->payment = $v; - $this->modifiedColumns[] = OrderTableMap::PAYMENT; + if ($this->payment_module_id !== $v) { + $this->payment_module_id = $v; + $this->modifiedColumns[] = OrderTableMap::PAYMENT_MODULE_ID; + } + + if ($this->aModuleRelatedByPaymentModuleId !== null && $this->aModuleRelatedByPaymentModuleId->getId() !== $v) { + $this->aModuleRelatedByPaymentModuleId = null; } return $this; - } // setPayment() + } // setPaymentModuleId() /** - * Set the value of [carrier] column. + * Set the value of [delivery_module_id] column. * - * @param string $v new value + * @param int $v new value * @return \Thelia\Model\Order The current object (for fluent API support) */ - public function setCarrier($v) + public function setDeliveryModuleId($v) { if ($v !== null) { - $v = (string) $v; + $v = (int) $v; } - if ($this->carrier !== $v) { - $this->carrier = $v; - $this->modifiedColumns[] = OrderTableMap::CARRIER; + if ($this->delivery_module_id !== $v) { + $this->delivery_module_id = $v; + $this->modifiedColumns[] = OrderTableMap::DELIVERY_MODULE_ID; + } + + if ($this->aModuleRelatedByDeliveryModuleId !== null && $this->aModuleRelatedByDeliveryModuleId->getId() !== $v) { + $this->aModuleRelatedByDeliveryModuleId = null; } return $this; - } // setCarrier() + } // setDeliveryModuleId() /** * Set the value of [status_id] column. @@ -1047,25 +1074,29 @@ abstract class Order implements ActiveRecordInterface } // setStatusId() /** - * Set the value of [lang] column. + * Set the value of [lang_id] column. * - * @param string $v new value + * @param int $v new value * @return \Thelia\Model\Order The current object (for fluent API support) */ - public function setLang($v) + public function setLangId($v) { if ($v !== null) { - $v = (string) $v; + $v = (int) $v; } - if ($this->lang !== $v) { - $this->lang = $v; - $this->modifiedColumns[] = OrderTableMap::LANG; + if ($this->lang_id !== $v) { + $this->lang_id = $v; + $this->modifiedColumns[] = OrderTableMap::LANG_ID; + } + + if ($this->aLang !== null && $this->aLang->getId() !== $v) { + $this->aLang = null; } return $this; - } // setLang() + } // setLangId() /** * Sets the value of [created_at] column to a normalized version of the date/time value specified. @@ -1155,11 +1186,11 @@ abstract class Order implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : OrderTableMap::translateFieldName('CustomerId', TableMap::TYPE_PHPNAME, $indexType)]; $this->customer_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : OrderTableMap::translateFieldName('AddressInvoice', TableMap::TYPE_PHPNAME, $indexType)]; - $this->address_invoice = (null !== $col) ? (int) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : OrderTableMap::translateFieldName('InvoiceOrderAddressId', TableMap::TYPE_PHPNAME, $indexType)]; + $this->invoice_order_address_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : OrderTableMap::translateFieldName('AddressDelivery', TableMap::TYPE_PHPNAME, $indexType)]; - $this->address_delivery = (null !== $col) ? (int) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : OrderTableMap::translateFieldName('DeliveryOrderAddressId', TableMap::TYPE_PHPNAME, $indexType)]; + $this->delivery_order_address_id = (null !== $col) ? (int) $col : null; $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : OrderTableMap::translateFieldName('InvoiceDate', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00') { @@ -1173,29 +1204,29 @@ abstract class Order implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : OrderTableMap::translateFieldName('CurrencyRate', TableMap::TYPE_PHPNAME, $indexType)]; $this->currency_rate = (null !== $col) ? (double) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : OrderTableMap::translateFieldName('Transaction', TableMap::TYPE_PHPNAME, $indexType)]; - $this->transaction = (null !== $col) ? (string) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : OrderTableMap::translateFieldName('TransactionRef', TableMap::TYPE_PHPNAME, $indexType)]; + $this->transaction_ref = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : OrderTableMap::translateFieldName('DeliveryNum', TableMap::TYPE_PHPNAME, $indexType)]; - $this->delivery_num = (null !== $col) ? (string) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : OrderTableMap::translateFieldName('DeliveryRef', TableMap::TYPE_PHPNAME, $indexType)]; + $this->delivery_ref = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : OrderTableMap::translateFieldName('Invoice', TableMap::TYPE_PHPNAME, $indexType)]; - $this->invoice = (null !== $col) ? (string) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : OrderTableMap::translateFieldName('InvoiceRef', TableMap::TYPE_PHPNAME, $indexType)]; + $this->invoice_ref = (null !== $col) ? (string) $col : null; $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : OrderTableMap::translateFieldName('Postage', TableMap::TYPE_PHPNAME, $indexType)]; $this->postage = (null !== $col) ? (double) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : OrderTableMap::translateFieldName('Payment', TableMap::TYPE_PHPNAME, $indexType)]; - $this->payment = (null !== $col) ? (string) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : OrderTableMap::translateFieldName('PaymentModuleId', TableMap::TYPE_PHPNAME, $indexType)]; + $this->payment_module_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : OrderTableMap::translateFieldName('Carrier', TableMap::TYPE_PHPNAME, $indexType)]; - $this->carrier = (null !== $col) ? (string) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : OrderTableMap::translateFieldName('DeliveryModuleId', TableMap::TYPE_PHPNAME, $indexType)]; + $this->delivery_module_id = (null !== $col) ? (int) $col : null; $col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : OrderTableMap::translateFieldName('StatusId', TableMap::TYPE_PHPNAME, $indexType)]; $this->status_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : OrderTableMap::translateFieldName('Lang', TableMap::TYPE_PHPNAME, $indexType)]; - $this->lang = (null !== $col) ? (string) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : OrderTableMap::translateFieldName('LangId', TableMap::TYPE_PHPNAME, $indexType)]; + $this->lang_id = (null !== $col) ? (int) $col : null; $col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : OrderTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { @@ -1241,18 +1272,27 @@ abstract class Order implements ActiveRecordInterface if ($this->aCustomer !== null && $this->customer_id !== $this->aCustomer->getId()) { $this->aCustomer = null; } - if ($this->aOrderAddressRelatedByAddressInvoice !== null && $this->address_invoice !== $this->aOrderAddressRelatedByAddressInvoice->getId()) { - $this->aOrderAddressRelatedByAddressInvoice = null; + if ($this->aOrderAddressRelatedByInvoiceOrderAddressId !== null && $this->invoice_order_address_id !== $this->aOrderAddressRelatedByInvoiceOrderAddressId->getId()) { + $this->aOrderAddressRelatedByInvoiceOrderAddressId = null; } - if ($this->aOrderAddressRelatedByAddressDelivery !== null && $this->address_delivery !== $this->aOrderAddressRelatedByAddressDelivery->getId()) { - $this->aOrderAddressRelatedByAddressDelivery = null; + if ($this->aOrderAddressRelatedByDeliveryOrderAddressId !== null && $this->delivery_order_address_id !== $this->aOrderAddressRelatedByDeliveryOrderAddressId->getId()) { + $this->aOrderAddressRelatedByDeliveryOrderAddressId = null; } if ($this->aCurrency !== null && $this->currency_id !== $this->aCurrency->getId()) { $this->aCurrency = null; } + if ($this->aModuleRelatedByPaymentModuleId !== null && $this->payment_module_id !== $this->aModuleRelatedByPaymentModuleId->getId()) { + $this->aModuleRelatedByPaymentModuleId = null; + } + if ($this->aModuleRelatedByDeliveryModuleId !== null && $this->delivery_module_id !== $this->aModuleRelatedByDeliveryModuleId->getId()) { + $this->aModuleRelatedByDeliveryModuleId = null; + } if ($this->aOrderStatus !== null && $this->status_id !== $this->aOrderStatus->getId()) { $this->aOrderStatus = null; } + if ($this->aLang !== null && $this->lang_id !== $this->aLang->getId()) { + $this->aLang = null; + } } // ensureConsistency /** @@ -1294,9 +1334,12 @@ abstract class Order implements ActiveRecordInterface $this->aCurrency = null; $this->aCustomer = null; - $this->aOrderAddressRelatedByAddressInvoice = null; - $this->aOrderAddressRelatedByAddressDelivery = null; + $this->aOrderAddressRelatedByInvoiceOrderAddressId = null; + $this->aOrderAddressRelatedByDeliveryOrderAddressId = null; $this->aOrderStatus = null; + $this->aModuleRelatedByPaymentModuleId = null; + $this->aModuleRelatedByDeliveryModuleId = null; + $this->aLang = null; $this->collOrderProducts = null; $this->collCouponOrders = null; @@ -1442,18 +1485,18 @@ abstract class Order implements ActiveRecordInterface $this->setCustomer($this->aCustomer); } - if ($this->aOrderAddressRelatedByAddressInvoice !== null) { - if ($this->aOrderAddressRelatedByAddressInvoice->isModified() || $this->aOrderAddressRelatedByAddressInvoice->isNew()) { - $affectedRows += $this->aOrderAddressRelatedByAddressInvoice->save($con); + if ($this->aOrderAddressRelatedByInvoiceOrderAddressId !== null) { + if ($this->aOrderAddressRelatedByInvoiceOrderAddressId->isModified() || $this->aOrderAddressRelatedByInvoiceOrderAddressId->isNew()) { + $affectedRows += $this->aOrderAddressRelatedByInvoiceOrderAddressId->save($con); } - $this->setOrderAddressRelatedByAddressInvoice($this->aOrderAddressRelatedByAddressInvoice); + $this->setOrderAddressRelatedByInvoiceOrderAddressId($this->aOrderAddressRelatedByInvoiceOrderAddressId); } - if ($this->aOrderAddressRelatedByAddressDelivery !== null) { - if ($this->aOrderAddressRelatedByAddressDelivery->isModified() || $this->aOrderAddressRelatedByAddressDelivery->isNew()) { - $affectedRows += $this->aOrderAddressRelatedByAddressDelivery->save($con); + if ($this->aOrderAddressRelatedByDeliveryOrderAddressId !== null) { + if ($this->aOrderAddressRelatedByDeliveryOrderAddressId->isModified() || $this->aOrderAddressRelatedByDeliveryOrderAddressId->isNew()) { + $affectedRows += $this->aOrderAddressRelatedByDeliveryOrderAddressId->save($con); } - $this->setOrderAddressRelatedByAddressDelivery($this->aOrderAddressRelatedByAddressDelivery); + $this->setOrderAddressRelatedByDeliveryOrderAddressId($this->aOrderAddressRelatedByDeliveryOrderAddressId); } if ($this->aOrderStatus !== null) { @@ -1463,6 +1506,27 @@ abstract class Order implements ActiveRecordInterface $this->setOrderStatus($this->aOrderStatus); } + if ($this->aModuleRelatedByPaymentModuleId !== null) { + if ($this->aModuleRelatedByPaymentModuleId->isModified() || $this->aModuleRelatedByPaymentModuleId->isNew()) { + $affectedRows += $this->aModuleRelatedByPaymentModuleId->save($con); + } + $this->setModuleRelatedByPaymentModuleId($this->aModuleRelatedByPaymentModuleId); + } + + if ($this->aModuleRelatedByDeliveryModuleId !== null) { + if ($this->aModuleRelatedByDeliveryModuleId->isModified() || $this->aModuleRelatedByDeliveryModuleId->isNew()) { + $affectedRows += $this->aModuleRelatedByDeliveryModuleId->save($con); + } + $this->setModuleRelatedByDeliveryModuleId($this->aModuleRelatedByDeliveryModuleId); + } + + if ($this->aLang !== null) { + if ($this->aLang->isModified() || $this->aLang->isNew()) { + $affectedRows += $this->aLang->save($con); + } + $this->setLang($this->aLang); + } + if ($this->isNew() || $this->isModified()) { // persist changes if ($this->isNew()) { @@ -1543,11 +1607,11 @@ abstract class Order implements ActiveRecordInterface if ($this->isColumnModified(OrderTableMap::CUSTOMER_ID)) { $modifiedColumns[':p' . $index++] = 'CUSTOMER_ID'; } - if ($this->isColumnModified(OrderTableMap::ADDRESS_INVOICE)) { - $modifiedColumns[':p' . $index++] = 'ADDRESS_INVOICE'; + if ($this->isColumnModified(OrderTableMap::INVOICE_ORDER_ADDRESS_ID)) { + $modifiedColumns[':p' . $index++] = 'INVOICE_ORDER_ADDRESS_ID'; } - if ($this->isColumnModified(OrderTableMap::ADDRESS_DELIVERY)) { - $modifiedColumns[':p' . $index++] = 'ADDRESS_DELIVERY'; + if ($this->isColumnModified(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID)) { + $modifiedColumns[':p' . $index++] = 'DELIVERY_ORDER_ADDRESS_ID'; } if ($this->isColumnModified(OrderTableMap::INVOICE_DATE)) { $modifiedColumns[':p' . $index++] = 'INVOICE_DATE'; @@ -1558,29 +1622,29 @@ abstract class Order implements ActiveRecordInterface if ($this->isColumnModified(OrderTableMap::CURRENCY_RATE)) { $modifiedColumns[':p' . $index++] = 'CURRENCY_RATE'; } - if ($this->isColumnModified(OrderTableMap::TRANSACTION)) { - $modifiedColumns[':p' . $index++] = 'TRANSACTION'; + if ($this->isColumnModified(OrderTableMap::TRANSACTION_REF)) { + $modifiedColumns[':p' . $index++] = 'TRANSACTION_REF'; } - if ($this->isColumnModified(OrderTableMap::DELIVERY_NUM)) { - $modifiedColumns[':p' . $index++] = 'DELIVERY_NUM'; + if ($this->isColumnModified(OrderTableMap::DELIVERY_REF)) { + $modifiedColumns[':p' . $index++] = 'DELIVERY_REF'; } - if ($this->isColumnModified(OrderTableMap::INVOICE)) { - $modifiedColumns[':p' . $index++] = 'INVOICE'; + if ($this->isColumnModified(OrderTableMap::INVOICE_REF)) { + $modifiedColumns[':p' . $index++] = 'INVOICE_REF'; } if ($this->isColumnModified(OrderTableMap::POSTAGE)) { $modifiedColumns[':p' . $index++] = 'POSTAGE'; } - if ($this->isColumnModified(OrderTableMap::PAYMENT)) { - $modifiedColumns[':p' . $index++] = 'PAYMENT'; + if ($this->isColumnModified(OrderTableMap::PAYMENT_MODULE_ID)) { + $modifiedColumns[':p' . $index++] = 'PAYMENT_MODULE_ID'; } - if ($this->isColumnModified(OrderTableMap::CARRIER)) { - $modifiedColumns[':p' . $index++] = 'CARRIER'; + if ($this->isColumnModified(OrderTableMap::DELIVERY_MODULE_ID)) { + $modifiedColumns[':p' . $index++] = 'DELIVERY_MODULE_ID'; } if ($this->isColumnModified(OrderTableMap::STATUS_ID)) { $modifiedColumns[':p' . $index++] = 'STATUS_ID'; } - if ($this->isColumnModified(OrderTableMap::LANG)) { - $modifiedColumns[':p' . $index++] = 'LANG'; + if ($this->isColumnModified(OrderTableMap::LANG_ID)) { + $modifiedColumns[':p' . $index++] = 'LANG_ID'; } if ($this->isColumnModified(OrderTableMap::CREATED_AT)) { $modifiedColumns[':p' . $index++] = 'CREATED_AT'; @@ -1608,11 +1672,11 @@ abstract class Order implements ActiveRecordInterface case 'CUSTOMER_ID': $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT); break; - case 'ADDRESS_INVOICE': - $stmt->bindValue($identifier, $this->address_invoice, PDO::PARAM_INT); + case 'INVOICE_ORDER_ADDRESS_ID': + $stmt->bindValue($identifier, $this->invoice_order_address_id, PDO::PARAM_INT); break; - case 'ADDRESS_DELIVERY': - $stmt->bindValue($identifier, $this->address_delivery, PDO::PARAM_INT); + case 'DELIVERY_ORDER_ADDRESS_ID': + $stmt->bindValue($identifier, $this->delivery_order_address_id, PDO::PARAM_INT); break; case 'INVOICE_DATE': $stmt->bindValue($identifier, $this->invoice_date ? $this->invoice_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); @@ -1623,29 +1687,29 @@ abstract class Order implements ActiveRecordInterface case 'CURRENCY_RATE': $stmt->bindValue($identifier, $this->currency_rate, PDO::PARAM_STR); break; - case 'TRANSACTION': - $stmt->bindValue($identifier, $this->transaction, PDO::PARAM_STR); + case 'TRANSACTION_REF': + $stmt->bindValue($identifier, $this->transaction_ref, PDO::PARAM_STR); break; - case 'DELIVERY_NUM': - $stmt->bindValue($identifier, $this->delivery_num, PDO::PARAM_STR); + case 'DELIVERY_REF': + $stmt->bindValue($identifier, $this->delivery_ref, PDO::PARAM_STR); break; - case 'INVOICE': - $stmt->bindValue($identifier, $this->invoice, PDO::PARAM_STR); + case 'INVOICE_REF': + $stmt->bindValue($identifier, $this->invoice_ref, PDO::PARAM_STR); break; case 'POSTAGE': $stmt->bindValue($identifier, $this->postage, PDO::PARAM_STR); break; - case 'PAYMENT': - $stmt->bindValue($identifier, $this->payment, PDO::PARAM_STR); + case 'PAYMENT_MODULE_ID': + $stmt->bindValue($identifier, $this->payment_module_id, PDO::PARAM_INT); break; - case 'CARRIER': - $stmt->bindValue($identifier, $this->carrier, PDO::PARAM_STR); + case 'DELIVERY_MODULE_ID': + $stmt->bindValue($identifier, $this->delivery_module_id, PDO::PARAM_INT); break; case 'STATUS_ID': $stmt->bindValue($identifier, $this->status_id, PDO::PARAM_INT); break; - case 'LANG': - $stmt->bindValue($identifier, $this->lang, PDO::PARAM_STR); + case 'LANG_ID': + $stmt->bindValue($identifier, $this->lang_id, PDO::PARAM_INT); break; case 'CREATED_AT': $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); @@ -1725,10 +1789,10 @@ abstract class Order implements ActiveRecordInterface return $this->getCustomerId(); break; case 3: - return $this->getAddressInvoice(); + return $this->getInvoiceOrderAddressId(); break; case 4: - return $this->getAddressDelivery(); + return $this->getDeliveryOrderAddressId(); break; case 5: return $this->getInvoiceDate(); @@ -1740,28 +1804,28 @@ abstract class Order implements ActiveRecordInterface return $this->getCurrencyRate(); break; case 8: - return $this->getTransaction(); + return $this->getTransactionRef(); break; case 9: - return $this->getDeliveryNum(); + return $this->getDeliveryRef(); break; case 10: - return $this->getInvoice(); + return $this->getInvoiceRef(); break; case 11: return $this->getPostage(); break; case 12: - return $this->getPayment(); + return $this->getPaymentModuleId(); break; case 13: - return $this->getCarrier(); + return $this->getDeliveryModuleId(); break; case 14: return $this->getStatusId(); break; case 15: - return $this->getLang(); + return $this->getLangId(); break; case 16: return $this->getCreatedAt(); @@ -1801,19 +1865,19 @@ abstract class Order implements ActiveRecordInterface $keys[0] => $this->getId(), $keys[1] => $this->getRef(), $keys[2] => $this->getCustomerId(), - $keys[3] => $this->getAddressInvoice(), - $keys[4] => $this->getAddressDelivery(), + $keys[3] => $this->getInvoiceOrderAddressId(), + $keys[4] => $this->getDeliveryOrderAddressId(), $keys[5] => $this->getInvoiceDate(), $keys[6] => $this->getCurrencyId(), $keys[7] => $this->getCurrencyRate(), - $keys[8] => $this->getTransaction(), - $keys[9] => $this->getDeliveryNum(), - $keys[10] => $this->getInvoice(), + $keys[8] => $this->getTransactionRef(), + $keys[9] => $this->getDeliveryRef(), + $keys[10] => $this->getInvoiceRef(), $keys[11] => $this->getPostage(), - $keys[12] => $this->getPayment(), - $keys[13] => $this->getCarrier(), + $keys[12] => $this->getPaymentModuleId(), + $keys[13] => $this->getDeliveryModuleId(), $keys[14] => $this->getStatusId(), - $keys[15] => $this->getLang(), + $keys[15] => $this->getLangId(), $keys[16] => $this->getCreatedAt(), $keys[17] => $this->getUpdatedAt(), ); @@ -1830,15 +1894,24 @@ abstract class Order implements ActiveRecordInterface if (null !== $this->aCustomer) { $result['Customer'] = $this->aCustomer->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } - if (null !== $this->aOrderAddressRelatedByAddressInvoice) { - $result['OrderAddressRelatedByAddressInvoice'] = $this->aOrderAddressRelatedByAddressInvoice->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); + if (null !== $this->aOrderAddressRelatedByInvoiceOrderAddressId) { + $result['OrderAddressRelatedByInvoiceOrderAddressId'] = $this->aOrderAddressRelatedByInvoiceOrderAddressId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } - if (null !== $this->aOrderAddressRelatedByAddressDelivery) { - $result['OrderAddressRelatedByAddressDelivery'] = $this->aOrderAddressRelatedByAddressDelivery->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); + if (null !== $this->aOrderAddressRelatedByDeliveryOrderAddressId) { + $result['OrderAddressRelatedByDeliveryOrderAddressId'] = $this->aOrderAddressRelatedByDeliveryOrderAddressId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aOrderStatus) { $result['OrderStatus'] = $this->aOrderStatus->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } + if (null !== $this->aModuleRelatedByPaymentModuleId) { + $result['ModuleRelatedByPaymentModuleId'] = $this->aModuleRelatedByPaymentModuleId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); + } + if (null !== $this->aModuleRelatedByDeliveryModuleId) { + $result['ModuleRelatedByDeliveryModuleId'] = $this->aModuleRelatedByDeliveryModuleId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); + } + if (null !== $this->aLang) { + $result['Lang'] = $this->aLang->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); + } if (null !== $this->collOrderProducts) { $result['OrderProducts'] = $this->collOrderProducts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } @@ -1889,10 +1962,10 @@ abstract class Order implements ActiveRecordInterface $this->setCustomerId($value); break; case 3: - $this->setAddressInvoice($value); + $this->setInvoiceOrderAddressId($value); break; case 4: - $this->setAddressDelivery($value); + $this->setDeliveryOrderAddressId($value); break; case 5: $this->setInvoiceDate($value); @@ -1904,28 +1977,28 @@ abstract class Order implements ActiveRecordInterface $this->setCurrencyRate($value); break; case 8: - $this->setTransaction($value); + $this->setTransactionRef($value); break; case 9: - $this->setDeliveryNum($value); + $this->setDeliveryRef($value); break; case 10: - $this->setInvoice($value); + $this->setInvoiceRef($value); break; case 11: $this->setPostage($value); break; case 12: - $this->setPayment($value); + $this->setPaymentModuleId($value); break; case 13: - $this->setCarrier($value); + $this->setDeliveryModuleId($value); break; case 14: $this->setStatusId($value); break; case 15: - $this->setLang($value); + $this->setLangId($value); break; case 16: $this->setCreatedAt($value); @@ -1960,19 +2033,19 @@ abstract class Order implements ActiveRecordInterface if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setRef($arr[$keys[1]]); if (array_key_exists($keys[2], $arr)) $this->setCustomerId($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setAddressInvoice($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setAddressDelivery($arr[$keys[4]]); + if (array_key_exists($keys[3], $arr)) $this->setInvoiceOrderAddressId($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setDeliveryOrderAddressId($arr[$keys[4]]); if (array_key_exists($keys[5], $arr)) $this->setInvoiceDate($arr[$keys[5]]); if (array_key_exists($keys[6], $arr)) $this->setCurrencyId($arr[$keys[6]]); if (array_key_exists($keys[7], $arr)) $this->setCurrencyRate($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setTransaction($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDeliveryNum($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setInvoice($arr[$keys[10]]); + if (array_key_exists($keys[8], $arr)) $this->setTransactionRef($arr[$keys[8]]); + if (array_key_exists($keys[9], $arr)) $this->setDeliveryRef($arr[$keys[9]]); + if (array_key_exists($keys[10], $arr)) $this->setInvoiceRef($arr[$keys[10]]); if (array_key_exists($keys[11], $arr)) $this->setPostage($arr[$keys[11]]); - if (array_key_exists($keys[12], $arr)) $this->setPayment($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setCarrier($arr[$keys[13]]); + if (array_key_exists($keys[12], $arr)) $this->setPaymentModuleId($arr[$keys[12]]); + if (array_key_exists($keys[13], $arr)) $this->setDeliveryModuleId($arr[$keys[13]]); if (array_key_exists($keys[14], $arr)) $this->setStatusId($arr[$keys[14]]); - if (array_key_exists($keys[15], $arr)) $this->setLang($arr[$keys[15]]); + if (array_key_exists($keys[15], $arr)) $this->setLangId($arr[$keys[15]]); if (array_key_exists($keys[16], $arr)) $this->setCreatedAt($arr[$keys[16]]); if (array_key_exists($keys[17], $arr)) $this->setUpdatedAt($arr[$keys[17]]); } @@ -1989,19 +2062,19 @@ abstract class Order implements ActiveRecordInterface if ($this->isColumnModified(OrderTableMap::ID)) $criteria->add(OrderTableMap::ID, $this->id); if ($this->isColumnModified(OrderTableMap::REF)) $criteria->add(OrderTableMap::REF, $this->ref); if ($this->isColumnModified(OrderTableMap::CUSTOMER_ID)) $criteria->add(OrderTableMap::CUSTOMER_ID, $this->customer_id); - if ($this->isColumnModified(OrderTableMap::ADDRESS_INVOICE)) $criteria->add(OrderTableMap::ADDRESS_INVOICE, $this->address_invoice); - if ($this->isColumnModified(OrderTableMap::ADDRESS_DELIVERY)) $criteria->add(OrderTableMap::ADDRESS_DELIVERY, $this->address_delivery); + if ($this->isColumnModified(OrderTableMap::INVOICE_ORDER_ADDRESS_ID)) $criteria->add(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $this->invoice_order_address_id); + if ($this->isColumnModified(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID)) $criteria->add(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $this->delivery_order_address_id); if ($this->isColumnModified(OrderTableMap::INVOICE_DATE)) $criteria->add(OrderTableMap::INVOICE_DATE, $this->invoice_date); if ($this->isColumnModified(OrderTableMap::CURRENCY_ID)) $criteria->add(OrderTableMap::CURRENCY_ID, $this->currency_id); if ($this->isColumnModified(OrderTableMap::CURRENCY_RATE)) $criteria->add(OrderTableMap::CURRENCY_RATE, $this->currency_rate); - if ($this->isColumnModified(OrderTableMap::TRANSACTION)) $criteria->add(OrderTableMap::TRANSACTION, $this->transaction); - if ($this->isColumnModified(OrderTableMap::DELIVERY_NUM)) $criteria->add(OrderTableMap::DELIVERY_NUM, $this->delivery_num); - if ($this->isColumnModified(OrderTableMap::INVOICE)) $criteria->add(OrderTableMap::INVOICE, $this->invoice); + if ($this->isColumnModified(OrderTableMap::TRANSACTION_REF)) $criteria->add(OrderTableMap::TRANSACTION_REF, $this->transaction_ref); + if ($this->isColumnModified(OrderTableMap::DELIVERY_REF)) $criteria->add(OrderTableMap::DELIVERY_REF, $this->delivery_ref); + if ($this->isColumnModified(OrderTableMap::INVOICE_REF)) $criteria->add(OrderTableMap::INVOICE_REF, $this->invoice_ref); if ($this->isColumnModified(OrderTableMap::POSTAGE)) $criteria->add(OrderTableMap::POSTAGE, $this->postage); - if ($this->isColumnModified(OrderTableMap::PAYMENT)) $criteria->add(OrderTableMap::PAYMENT, $this->payment); - if ($this->isColumnModified(OrderTableMap::CARRIER)) $criteria->add(OrderTableMap::CARRIER, $this->carrier); + if ($this->isColumnModified(OrderTableMap::PAYMENT_MODULE_ID)) $criteria->add(OrderTableMap::PAYMENT_MODULE_ID, $this->payment_module_id); + if ($this->isColumnModified(OrderTableMap::DELIVERY_MODULE_ID)) $criteria->add(OrderTableMap::DELIVERY_MODULE_ID, $this->delivery_module_id); if ($this->isColumnModified(OrderTableMap::STATUS_ID)) $criteria->add(OrderTableMap::STATUS_ID, $this->status_id); - if ($this->isColumnModified(OrderTableMap::LANG)) $criteria->add(OrderTableMap::LANG, $this->lang); + if ($this->isColumnModified(OrderTableMap::LANG_ID)) $criteria->add(OrderTableMap::LANG_ID, $this->lang_id); if ($this->isColumnModified(OrderTableMap::CREATED_AT)) $criteria->add(OrderTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(OrderTableMap::UPDATED_AT)) $criteria->add(OrderTableMap::UPDATED_AT, $this->updated_at); @@ -2069,19 +2142,19 @@ abstract class Order implements ActiveRecordInterface { $copyObj->setRef($this->getRef()); $copyObj->setCustomerId($this->getCustomerId()); - $copyObj->setAddressInvoice($this->getAddressInvoice()); - $copyObj->setAddressDelivery($this->getAddressDelivery()); + $copyObj->setInvoiceOrderAddressId($this->getInvoiceOrderAddressId()); + $copyObj->setDeliveryOrderAddressId($this->getDeliveryOrderAddressId()); $copyObj->setInvoiceDate($this->getInvoiceDate()); $copyObj->setCurrencyId($this->getCurrencyId()); $copyObj->setCurrencyRate($this->getCurrencyRate()); - $copyObj->setTransaction($this->getTransaction()); - $copyObj->setDeliveryNum($this->getDeliveryNum()); - $copyObj->setInvoice($this->getInvoice()); + $copyObj->setTransactionRef($this->getTransactionRef()); + $copyObj->setDeliveryRef($this->getDeliveryRef()); + $copyObj->setInvoiceRef($this->getInvoiceRef()); $copyObj->setPostage($this->getPostage()); - $copyObj->setPayment($this->getPayment()); - $copyObj->setCarrier($this->getCarrier()); + $copyObj->setPaymentModuleId($this->getPaymentModuleId()); + $copyObj->setDeliveryModuleId($this->getDeliveryModuleId()); $copyObj->setStatusId($this->getStatusId()); - $copyObj->setLang($this->getLang()); + $copyObj->setLangId($this->getLangId()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); @@ -2241,20 +2314,20 @@ abstract class Order implements ActiveRecordInterface * @return \Thelia\Model\Order The current object (for fluent API support) * @throws PropelException */ - public function setOrderAddressRelatedByAddressInvoice(ChildOrderAddress $v = null) + public function setOrderAddressRelatedByInvoiceOrderAddressId(ChildOrderAddress $v = null) { if ($v === null) { - $this->setAddressInvoice(NULL); + $this->setInvoiceOrderAddressId(NULL); } else { - $this->setAddressInvoice($v->getId()); + $this->setInvoiceOrderAddressId($v->getId()); } - $this->aOrderAddressRelatedByAddressInvoice = $v; + $this->aOrderAddressRelatedByInvoiceOrderAddressId = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildOrderAddress object, it will not be re-added. if ($v !== null) { - $v->addOrderRelatedByAddressInvoice($this); + $v->addOrderRelatedByInvoiceOrderAddressId($this); } @@ -2269,20 +2342,20 @@ abstract class Order implements ActiveRecordInterface * @return ChildOrderAddress The associated ChildOrderAddress object. * @throws PropelException */ - public function getOrderAddressRelatedByAddressInvoice(ConnectionInterface $con = null) + public function getOrderAddressRelatedByInvoiceOrderAddressId(ConnectionInterface $con = null) { - if ($this->aOrderAddressRelatedByAddressInvoice === null && ($this->address_invoice !== null)) { - $this->aOrderAddressRelatedByAddressInvoice = ChildOrderAddressQuery::create()->findPk($this->address_invoice, $con); + if ($this->aOrderAddressRelatedByInvoiceOrderAddressId === null && ($this->invoice_order_address_id !== null)) { + $this->aOrderAddressRelatedByInvoiceOrderAddressId = ChildOrderAddressQuery::create()->findPk($this->invoice_order_address_id, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. - $this->aOrderAddressRelatedByAddressInvoice->addOrdersRelatedByAddressInvoice($this); + $this->aOrderAddressRelatedByInvoiceOrderAddressId->addOrdersRelatedByInvoiceOrderAddressId($this); */ } - return $this->aOrderAddressRelatedByAddressInvoice; + return $this->aOrderAddressRelatedByInvoiceOrderAddressId; } /** @@ -2292,20 +2365,20 @@ abstract class Order implements ActiveRecordInterface * @return \Thelia\Model\Order The current object (for fluent API support) * @throws PropelException */ - public function setOrderAddressRelatedByAddressDelivery(ChildOrderAddress $v = null) + public function setOrderAddressRelatedByDeliveryOrderAddressId(ChildOrderAddress $v = null) { if ($v === null) { - $this->setAddressDelivery(NULL); + $this->setDeliveryOrderAddressId(NULL); } else { - $this->setAddressDelivery($v->getId()); + $this->setDeliveryOrderAddressId($v->getId()); } - $this->aOrderAddressRelatedByAddressDelivery = $v; + $this->aOrderAddressRelatedByDeliveryOrderAddressId = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildOrderAddress object, it will not be re-added. if ($v !== null) { - $v->addOrderRelatedByAddressDelivery($this); + $v->addOrderRelatedByDeliveryOrderAddressId($this); } @@ -2320,20 +2393,20 @@ abstract class Order implements ActiveRecordInterface * @return ChildOrderAddress The associated ChildOrderAddress object. * @throws PropelException */ - public function getOrderAddressRelatedByAddressDelivery(ConnectionInterface $con = null) + public function getOrderAddressRelatedByDeliveryOrderAddressId(ConnectionInterface $con = null) { - if ($this->aOrderAddressRelatedByAddressDelivery === null && ($this->address_delivery !== null)) { - $this->aOrderAddressRelatedByAddressDelivery = ChildOrderAddressQuery::create()->findPk($this->address_delivery, $con); + if ($this->aOrderAddressRelatedByDeliveryOrderAddressId === null && ($this->delivery_order_address_id !== null)) { + $this->aOrderAddressRelatedByDeliveryOrderAddressId = ChildOrderAddressQuery::create()->findPk($this->delivery_order_address_id, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. - $this->aOrderAddressRelatedByAddressDelivery->addOrdersRelatedByAddressDelivery($this); + $this->aOrderAddressRelatedByDeliveryOrderAddressId->addOrdersRelatedByDeliveryOrderAddressId($this); */ } - return $this->aOrderAddressRelatedByAddressDelivery; + return $this->aOrderAddressRelatedByDeliveryOrderAddressId; } /** @@ -2387,6 +2460,159 @@ abstract class Order implements ActiveRecordInterface return $this->aOrderStatus; } + /** + * Declares an association between this object and a ChildModule object. + * + * @param ChildModule $v + * @return \Thelia\Model\Order The current object (for fluent API support) + * @throws PropelException + */ + public function setModuleRelatedByPaymentModuleId(ChildModule $v = null) + { + if ($v === null) { + $this->setPaymentModuleId(NULL); + } else { + $this->setPaymentModuleId($v->getId()); + } + + $this->aModuleRelatedByPaymentModuleId = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the ChildModule object, it will not be re-added. + if ($v !== null) { + $v->addOrderRelatedByPaymentModuleId($this); + } + + + return $this; + } + + + /** + * Get the associated ChildModule object + * + * @param ConnectionInterface $con Optional Connection object. + * @return ChildModule The associated ChildModule object. + * @throws PropelException + */ + public function getModuleRelatedByPaymentModuleId(ConnectionInterface $con = null) + { + if ($this->aModuleRelatedByPaymentModuleId === null && ($this->payment_module_id !== null)) { + $this->aModuleRelatedByPaymentModuleId = ChildModuleQuery::create()->findPk($this->payment_module_id, $con); + /* The following can be used additionally to + guarantee the related object contains a reference + to this object. This level of coupling may, however, be + undesirable since it could result in an only partially populated collection + in the referenced object. + $this->aModuleRelatedByPaymentModuleId->addOrdersRelatedByPaymentModuleId($this); + */ + } + + return $this->aModuleRelatedByPaymentModuleId; + } + + /** + * Declares an association between this object and a ChildModule object. + * + * @param ChildModule $v + * @return \Thelia\Model\Order The current object (for fluent API support) + * @throws PropelException + */ + public function setModuleRelatedByDeliveryModuleId(ChildModule $v = null) + { + if ($v === null) { + $this->setDeliveryModuleId(NULL); + } else { + $this->setDeliveryModuleId($v->getId()); + } + + $this->aModuleRelatedByDeliveryModuleId = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the ChildModule object, it will not be re-added. + if ($v !== null) { + $v->addOrderRelatedByDeliveryModuleId($this); + } + + + return $this; + } + + + /** + * Get the associated ChildModule object + * + * @param ConnectionInterface $con Optional Connection object. + * @return ChildModule The associated ChildModule object. + * @throws PropelException + */ + public function getModuleRelatedByDeliveryModuleId(ConnectionInterface $con = null) + { + if ($this->aModuleRelatedByDeliveryModuleId === null && ($this->delivery_module_id !== null)) { + $this->aModuleRelatedByDeliveryModuleId = ChildModuleQuery::create()->findPk($this->delivery_module_id, $con); + /* The following can be used additionally to + guarantee the related object contains a reference + to this object. This level of coupling may, however, be + undesirable since it could result in an only partially populated collection + in the referenced object. + $this->aModuleRelatedByDeliveryModuleId->addOrdersRelatedByDeliveryModuleId($this); + */ + } + + return $this->aModuleRelatedByDeliveryModuleId; + } + + /** + * Declares an association between this object and a ChildLang object. + * + * @param ChildLang $v + * @return \Thelia\Model\Order The current object (for fluent API support) + * @throws PropelException + */ + public function setLang(ChildLang $v = null) + { + if ($v === null) { + $this->setLangId(NULL); + } else { + $this->setLangId($v->getId()); + } + + $this->aLang = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the ChildLang object, it will not be re-added. + if ($v !== null) { + $v->addOrder($this); + } + + + return $this; + } + + + /** + * Get the associated ChildLang object + * + * @param ConnectionInterface $con Optional Connection object. + * @return ChildLang The associated ChildLang object. + * @throws PropelException + */ + public function getLang(ConnectionInterface $con = null) + { + if ($this->aLang === null && ($this->lang_id !== null)) { + $this->aLang = ChildLangQuery::create()->findPk($this->lang_id, $con); + /* The following can be used additionally to + guarantee the related object contains a reference + to this object. This level of coupling may, however, be + undesirable since it could result in an only partially populated collection + in the referenced object. + $this->aLang->addOrders($this); + */ + } + + return $this->aLang; + } + /** * Initializes a collection based on the name of a relation. @@ -2850,19 +3076,19 @@ abstract class Order implements ActiveRecordInterface $this->id = null; $this->ref = null; $this->customer_id = null; - $this->address_invoice = null; - $this->address_delivery = null; + $this->invoice_order_address_id = null; + $this->delivery_order_address_id = null; $this->invoice_date = null; $this->currency_id = null; $this->currency_rate = null; - $this->transaction = null; - $this->delivery_num = null; - $this->invoice = null; + $this->transaction_ref = null; + $this->delivery_ref = null; + $this->invoice_ref = null; $this->postage = null; - $this->payment = null; - $this->carrier = null; + $this->payment_module_id = null; + $this->delivery_module_id = null; $this->status_id = null; - $this->lang = null; + $this->lang_id = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; @@ -2906,9 +3132,12 @@ abstract class Order implements ActiveRecordInterface $this->collCouponOrders = null; $this->aCurrency = null; $this->aCustomer = null; - $this->aOrderAddressRelatedByAddressInvoice = null; - $this->aOrderAddressRelatedByAddressDelivery = null; + $this->aOrderAddressRelatedByInvoiceOrderAddressId = null; + $this->aOrderAddressRelatedByDeliveryOrderAddressId = null; $this->aOrderStatus = null; + $this->aModuleRelatedByPaymentModuleId = null; + $this->aModuleRelatedByDeliveryModuleId = null; + $this->aLang = null; } /** diff --git a/core/lib/Thelia/Model/Base/OrderAddress.php b/core/lib/Thelia/Model/Base/OrderAddress.php index d0220d4e0..c5502321a 100644 --- a/core/lib/Thelia/Model/Base/OrderAddress.php +++ b/core/lib/Thelia/Model/Base/OrderAddress.php @@ -144,14 +144,14 @@ abstract class OrderAddress implements ActiveRecordInterface /** * @var ObjectCollection|ChildOrder[] Collection to store aggregation of ChildOrder objects. */ - protected $collOrdersRelatedByAddressInvoice; - protected $collOrdersRelatedByAddressInvoicePartial; + protected $collOrdersRelatedByInvoiceOrderAddressId; + protected $collOrdersRelatedByInvoiceOrderAddressIdPartial; /** * @var ObjectCollection|ChildOrder[] Collection to store aggregation of ChildOrder objects. */ - protected $collOrdersRelatedByAddressDelivery; - protected $collOrdersRelatedByAddressDeliveryPartial; + protected $collOrdersRelatedByDeliveryOrderAddressId; + protected $collOrdersRelatedByDeliveryOrderAddressIdPartial; /** * Flag to prevent endless save loop, if this object is referenced @@ -165,13 +165,13 @@ abstract class OrderAddress implements ActiveRecordInterface * An array of objects scheduled for deletion. * @var ObjectCollection */ - protected $ordersRelatedByAddressInvoiceScheduledForDeletion = null; + protected $ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion = null; /** * An array of objects scheduled for deletion. * @var ObjectCollection */ - protected $ordersRelatedByAddressDeliveryScheduledForDeletion = null; + protected $ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion = null; /** * Initializes internal state of Thelia\Model\Base\OrderAddress object. @@ -1046,9 +1046,9 @@ abstract class OrderAddress implements ActiveRecordInterface if ($deep) { // also de-associate any related objects? - $this->collOrdersRelatedByAddressInvoice = null; + $this->collOrdersRelatedByInvoiceOrderAddressId = null; - $this->collOrdersRelatedByAddressDelivery = null; + $this->collOrdersRelatedByDeliveryOrderAddressId = null; } // if (deep) } @@ -1183,36 +1183,34 @@ abstract class OrderAddress implements ActiveRecordInterface $this->resetModified(); } - if ($this->ordersRelatedByAddressInvoiceScheduledForDeletion !== null) { - if (!$this->ordersRelatedByAddressInvoiceScheduledForDeletion->isEmpty()) { - foreach ($this->ordersRelatedByAddressInvoiceScheduledForDeletion as $orderRelatedByAddressInvoice) { - // need to save related object because we set the relation to null - $orderRelatedByAddressInvoice->save($con); - } - $this->ordersRelatedByAddressInvoiceScheduledForDeletion = null; + if ($this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion !== null) { + if (!$this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion->isEmpty()) { + \Thelia\Model\OrderQuery::create() + ->filterByPrimaryKeys($this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion->getPrimaryKeys(false)) + ->delete($con); + $this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion = null; } } - if ($this->collOrdersRelatedByAddressInvoice !== null) { - foreach ($this->collOrdersRelatedByAddressInvoice as $referrerFK) { + if ($this->collOrdersRelatedByInvoiceOrderAddressId !== null) { + foreach ($this->collOrdersRelatedByInvoiceOrderAddressId as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } - if ($this->ordersRelatedByAddressDeliveryScheduledForDeletion !== null) { - if (!$this->ordersRelatedByAddressDeliveryScheduledForDeletion->isEmpty()) { - foreach ($this->ordersRelatedByAddressDeliveryScheduledForDeletion as $orderRelatedByAddressDelivery) { - // need to save related object because we set the relation to null - $orderRelatedByAddressDelivery->save($con); - } - $this->ordersRelatedByAddressDeliveryScheduledForDeletion = null; + if ($this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion !== null) { + if (!$this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion->isEmpty()) { + \Thelia\Model\OrderQuery::create() + ->filterByPrimaryKeys($this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion->getPrimaryKeys(false)) + ->delete($con); + $this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion = null; } } - if ($this->collOrdersRelatedByAddressDelivery !== null) { - foreach ($this->collOrdersRelatedByAddressDelivery as $referrerFK) { + if ($this->collOrdersRelatedByDeliveryOrderAddressId !== null) { + foreach ($this->collOrdersRelatedByDeliveryOrderAddressId as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } @@ -1495,11 +1493,11 @@ abstract class OrderAddress implements ActiveRecordInterface } if ($includeForeignObjects) { - if (null !== $this->collOrdersRelatedByAddressInvoice) { - $result['OrdersRelatedByAddressInvoice'] = $this->collOrdersRelatedByAddressInvoice->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); + if (null !== $this->collOrdersRelatedByInvoiceOrderAddressId) { + $result['OrdersRelatedByInvoiceOrderAddressId'] = $this->collOrdersRelatedByInvoiceOrderAddressId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } - if (null !== $this->collOrdersRelatedByAddressDelivery) { - $result['OrdersRelatedByAddressDelivery'] = $this->collOrdersRelatedByAddressDelivery->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); + if (null !== $this->collOrdersRelatedByDeliveryOrderAddressId) { + $result['OrdersRelatedByDeliveryOrderAddressId'] = $this->collOrdersRelatedByDeliveryOrderAddressId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } } @@ -1722,15 +1720,15 @@ abstract class OrderAddress implements ActiveRecordInterface // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); - foreach ($this->getOrdersRelatedByAddressInvoice() as $relObj) { + foreach ($this->getOrdersRelatedByInvoiceOrderAddressId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addOrderRelatedByAddressInvoice($relObj->copy($deepCopy)); + $copyObj->addOrderRelatedByInvoiceOrderAddressId($relObj->copy($deepCopy)); } } - foreach ($this->getOrdersRelatedByAddressDelivery() as $relObj) { + foreach ($this->getOrdersRelatedByDeliveryOrderAddressId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addOrderRelatedByAddressDelivery($relObj->copy($deepCopy)); + $copyObj->addOrderRelatedByDeliveryOrderAddressId($relObj->copy($deepCopy)); } } @@ -1775,40 +1773,40 @@ abstract class OrderAddress implements ActiveRecordInterface */ public function initRelation($relationName) { - if ('OrderRelatedByAddressInvoice' == $relationName) { - return $this->initOrdersRelatedByAddressInvoice(); + if ('OrderRelatedByInvoiceOrderAddressId' == $relationName) { + return $this->initOrdersRelatedByInvoiceOrderAddressId(); } - if ('OrderRelatedByAddressDelivery' == $relationName) { - return $this->initOrdersRelatedByAddressDelivery(); + if ('OrderRelatedByDeliveryOrderAddressId' == $relationName) { + return $this->initOrdersRelatedByDeliveryOrderAddressId(); } } /** - * Clears out the collOrdersRelatedByAddressInvoice collection + * Clears out the collOrdersRelatedByInvoiceOrderAddressId collection * * This does not modify the database; however, it will remove any associated objects, causing * them to be refetched by subsequent calls to accessor method. * * @return void - * @see addOrdersRelatedByAddressInvoice() + * @see addOrdersRelatedByInvoiceOrderAddressId() */ - public function clearOrdersRelatedByAddressInvoice() + public function clearOrdersRelatedByInvoiceOrderAddressId() { - $this->collOrdersRelatedByAddressInvoice = null; // important to set this to NULL since that means it is uninitialized + $this->collOrdersRelatedByInvoiceOrderAddressId = null; // important to set this to NULL since that means it is uninitialized } /** - * Reset is the collOrdersRelatedByAddressInvoice collection loaded partially. + * Reset is the collOrdersRelatedByInvoiceOrderAddressId collection loaded partially. */ - public function resetPartialOrdersRelatedByAddressInvoice($v = true) + public function resetPartialOrdersRelatedByInvoiceOrderAddressId($v = true) { - $this->collOrdersRelatedByAddressInvoicePartial = $v; + $this->collOrdersRelatedByInvoiceOrderAddressIdPartial = $v; } /** - * Initializes the collOrdersRelatedByAddressInvoice collection. + * Initializes the collOrdersRelatedByInvoiceOrderAddressId collection. * - * By default this just sets the collOrdersRelatedByAddressInvoice collection to an empty array (like clearcollOrdersRelatedByAddressInvoice()); + * By default this just sets the collOrdersRelatedByInvoiceOrderAddressId collection to an empty array (like clearcollOrdersRelatedByInvoiceOrderAddressId()); * however, you may wish to override this method in your stub class to provide setting appropriate * to your application -- for example, setting the initial array to the values stored in database. * @@ -1817,13 +1815,13 @@ abstract class OrderAddress implements ActiveRecordInterface * * @return void */ - public function initOrdersRelatedByAddressInvoice($overrideExisting = true) + public function initOrdersRelatedByInvoiceOrderAddressId($overrideExisting = true) { - if (null !== $this->collOrdersRelatedByAddressInvoice && !$overrideExisting) { + if (null !== $this->collOrdersRelatedByInvoiceOrderAddressId && !$overrideExisting) { return; } - $this->collOrdersRelatedByAddressInvoice = new ObjectCollection(); - $this->collOrdersRelatedByAddressInvoice->setModel('\Thelia\Model\Order'); + $this->collOrdersRelatedByInvoiceOrderAddressId = new ObjectCollection(); + $this->collOrdersRelatedByInvoiceOrderAddressId->setModel('\Thelia\Model\Order'); } /** @@ -1840,80 +1838,80 @@ abstract class OrderAddress implements ActiveRecordInterface * @return Collection|ChildOrder[] List of ChildOrder objects * @throws PropelException */ - public function getOrdersRelatedByAddressInvoice($criteria = null, ConnectionInterface $con = null) + public function getOrdersRelatedByInvoiceOrderAddressId($criteria = null, ConnectionInterface $con = null) { - $partial = $this->collOrdersRelatedByAddressInvoicePartial && !$this->isNew(); - if (null === $this->collOrdersRelatedByAddressInvoice || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collOrdersRelatedByAddressInvoice) { + $partial = $this->collOrdersRelatedByInvoiceOrderAddressIdPartial && !$this->isNew(); + if (null === $this->collOrdersRelatedByInvoiceOrderAddressId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrdersRelatedByInvoiceOrderAddressId) { // return empty collection - $this->initOrdersRelatedByAddressInvoice(); + $this->initOrdersRelatedByInvoiceOrderAddressId(); } else { - $collOrdersRelatedByAddressInvoice = ChildOrderQuery::create(null, $criteria) - ->filterByOrderAddressRelatedByAddressInvoice($this) + $collOrdersRelatedByInvoiceOrderAddressId = ChildOrderQuery::create(null, $criteria) + ->filterByOrderAddressRelatedByInvoiceOrderAddressId($this) ->find($con); if (null !== $criteria) { - if (false !== $this->collOrdersRelatedByAddressInvoicePartial && count($collOrdersRelatedByAddressInvoice)) { - $this->initOrdersRelatedByAddressInvoice(false); + if (false !== $this->collOrdersRelatedByInvoiceOrderAddressIdPartial && count($collOrdersRelatedByInvoiceOrderAddressId)) { + $this->initOrdersRelatedByInvoiceOrderAddressId(false); - foreach ($collOrdersRelatedByAddressInvoice as $obj) { - if (false == $this->collOrdersRelatedByAddressInvoice->contains($obj)) { - $this->collOrdersRelatedByAddressInvoice->append($obj); + foreach ($collOrdersRelatedByInvoiceOrderAddressId as $obj) { + if (false == $this->collOrdersRelatedByInvoiceOrderAddressId->contains($obj)) { + $this->collOrdersRelatedByInvoiceOrderAddressId->append($obj); } } - $this->collOrdersRelatedByAddressInvoicePartial = true; + $this->collOrdersRelatedByInvoiceOrderAddressIdPartial = true; } - $collOrdersRelatedByAddressInvoice->getInternalIterator()->rewind(); + $collOrdersRelatedByInvoiceOrderAddressId->getInternalIterator()->rewind(); - return $collOrdersRelatedByAddressInvoice; + return $collOrdersRelatedByInvoiceOrderAddressId; } - if ($partial && $this->collOrdersRelatedByAddressInvoice) { - foreach ($this->collOrdersRelatedByAddressInvoice as $obj) { + if ($partial && $this->collOrdersRelatedByInvoiceOrderAddressId) { + foreach ($this->collOrdersRelatedByInvoiceOrderAddressId as $obj) { if ($obj->isNew()) { - $collOrdersRelatedByAddressInvoice[] = $obj; + $collOrdersRelatedByInvoiceOrderAddressId[] = $obj; } } } - $this->collOrdersRelatedByAddressInvoice = $collOrdersRelatedByAddressInvoice; - $this->collOrdersRelatedByAddressInvoicePartial = false; + $this->collOrdersRelatedByInvoiceOrderAddressId = $collOrdersRelatedByInvoiceOrderAddressId; + $this->collOrdersRelatedByInvoiceOrderAddressIdPartial = false; } } - return $this->collOrdersRelatedByAddressInvoice; + return $this->collOrdersRelatedByInvoiceOrderAddressId; } /** - * Sets a collection of OrderRelatedByAddressInvoice objects related by a one-to-many relationship + * Sets a collection of OrderRelatedByInvoiceOrderAddressId objects related by a one-to-many relationship * to the current object. * It will also schedule objects for deletion based on a diff between old objects (aka persisted) * and new objects from the given Propel collection. * - * @param Collection $ordersRelatedByAddressInvoice A Propel collection. + * @param Collection $ordersRelatedByInvoiceOrderAddressId A Propel collection. * @param ConnectionInterface $con Optional connection object * @return ChildOrderAddress The current object (for fluent API support) */ - public function setOrdersRelatedByAddressInvoice(Collection $ordersRelatedByAddressInvoice, ConnectionInterface $con = null) + public function setOrdersRelatedByInvoiceOrderAddressId(Collection $ordersRelatedByInvoiceOrderAddressId, ConnectionInterface $con = null) { - $ordersRelatedByAddressInvoiceToDelete = $this->getOrdersRelatedByAddressInvoice(new Criteria(), $con)->diff($ordersRelatedByAddressInvoice); + $ordersRelatedByInvoiceOrderAddressIdToDelete = $this->getOrdersRelatedByInvoiceOrderAddressId(new Criteria(), $con)->diff($ordersRelatedByInvoiceOrderAddressId); - $this->ordersRelatedByAddressInvoiceScheduledForDeletion = $ordersRelatedByAddressInvoiceToDelete; + $this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion = $ordersRelatedByInvoiceOrderAddressIdToDelete; - foreach ($ordersRelatedByAddressInvoiceToDelete as $orderRelatedByAddressInvoiceRemoved) { - $orderRelatedByAddressInvoiceRemoved->setOrderAddressRelatedByAddressInvoice(null); + foreach ($ordersRelatedByInvoiceOrderAddressIdToDelete as $orderRelatedByInvoiceOrderAddressIdRemoved) { + $orderRelatedByInvoiceOrderAddressIdRemoved->setOrderAddressRelatedByInvoiceOrderAddressId(null); } - $this->collOrdersRelatedByAddressInvoice = null; - foreach ($ordersRelatedByAddressInvoice as $orderRelatedByAddressInvoice) { - $this->addOrderRelatedByAddressInvoice($orderRelatedByAddressInvoice); + $this->collOrdersRelatedByInvoiceOrderAddressId = null; + foreach ($ordersRelatedByInvoiceOrderAddressId as $orderRelatedByInvoiceOrderAddressId) { + $this->addOrderRelatedByInvoiceOrderAddressId($orderRelatedByInvoiceOrderAddressId); } - $this->collOrdersRelatedByAddressInvoice = $ordersRelatedByAddressInvoice; - $this->collOrdersRelatedByAddressInvoicePartial = false; + $this->collOrdersRelatedByInvoiceOrderAddressId = $ordersRelatedByInvoiceOrderAddressId; + $this->collOrdersRelatedByInvoiceOrderAddressIdPartial = false; return $this; } @@ -1927,16 +1925,16 @@ abstract class OrderAddress implements ActiveRecordInterface * @return int Count of related Order objects. * @throws PropelException */ - public function countOrdersRelatedByAddressInvoice(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) + public function countOrdersRelatedByInvoiceOrderAddressId(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { - $partial = $this->collOrdersRelatedByAddressInvoicePartial && !$this->isNew(); - if (null === $this->collOrdersRelatedByAddressInvoice || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collOrdersRelatedByAddressInvoice) { + $partial = $this->collOrdersRelatedByInvoiceOrderAddressIdPartial && !$this->isNew(); + if (null === $this->collOrdersRelatedByInvoiceOrderAddressId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrdersRelatedByInvoiceOrderAddressId) { return 0; } if ($partial && !$criteria) { - return count($this->getOrdersRelatedByAddressInvoice()); + return count($this->getOrdersRelatedByInvoiceOrderAddressId()); } $query = ChildOrderQuery::create(null, $criteria); @@ -1945,11 +1943,11 @@ abstract class OrderAddress implements ActiveRecordInterface } return $query - ->filterByOrderAddressRelatedByAddressInvoice($this) + ->filterByOrderAddressRelatedByInvoiceOrderAddressId($this) ->count($con); } - return count($this->collOrdersRelatedByAddressInvoice); + return count($this->collOrdersRelatedByInvoiceOrderAddressId); } /** @@ -1959,43 +1957,43 @@ abstract class OrderAddress implements ActiveRecordInterface * @param ChildOrder $l ChildOrder * @return \Thelia\Model\OrderAddress The current object (for fluent API support) */ - public function addOrderRelatedByAddressInvoice(ChildOrder $l) + public function addOrderRelatedByInvoiceOrderAddressId(ChildOrder $l) { - if ($this->collOrdersRelatedByAddressInvoice === null) { - $this->initOrdersRelatedByAddressInvoice(); - $this->collOrdersRelatedByAddressInvoicePartial = true; + if ($this->collOrdersRelatedByInvoiceOrderAddressId === null) { + $this->initOrdersRelatedByInvoiceOrderAddressId(); + $this->collOrdersRelatedByInvoiceOrderAddressIdPartial = true; } - if (!in_array($l, $this->collOrdersRelatedByAddressInvoice->getArrayCopy(), true)) { // only add it if the **same** object is not already associated - $this->doAddOrderRelatedByAddressInvoice($l); + if (!in_array($l, $this->collOrdersRelatedByInvoiceOrderAddressId->getArrayCopy(), true)) { // only add it if the **same** object is not already associated + $this->doAddOrderRelatedByInvoiceOrderAddressId($l); } return $this; } /** - * @param OrderRelatedByAddressInvoice $orderRelatedByAddressInvoice The orderRelatedByAddressInvoice object to add. + * @param OrderRelatedByInvoiceOrderAddressId $orderRelatedByInvoiceOrderAddressId The orderRelatedByInvoiceOrderAddressId object to add. */ - protected function doAddOrderRelatedByAddressInvoice($orderRelatedByAddressInvoice) + protected function doAddOrderRelatedByInvoiceOrderAddressId($orderRelatedByInvoiceOrderAddressId) { - $this->collOrdersRelatedByAddressInvoice[]= $orderRelatedByAddressInvoice; - $orderRelatedByAddressInvoice->setOrderAddressRelatedByAddressInvoice($this); + $this->collOrdersRelatedByInvoiceOrderAddressId[]= $orderRelatedByInvoiceOrderAddressId; + $orderRelatedByInvoiceOrderAddressId->setOrderAddressRelatedByInvoiceOrderAddressId($this); } /** - * @param OrderRelatedByAddressInvoice $orderRelatedByAddressInvoice The orderRelatedByAddressInvoice object to remove. + * @param OrderRelatedByInvoiceOrderAddressId $orderRelatedByInvoiceOrderAddressId The orderRelatedByInvoiceOrderAddressId object to remove. * @return ChildOrderAddress The current object (for fluent API support) */ - public function removeOrderRelatedByAddressInvoice($orderRelatedByAddressInvoice) + public function removeOrderRelatedByInvoiceOrderAddressId($orderRelatedByInvoiceOrderAddressId) { - if ($this->getOrdersRelatedByAddressInvoice()->contains($orderRelatedByAddressInvoice)) { - $this->collOrdersRelatedByAddressInvoice->remove($this->collOrdersRelatedByAddressInvoice->search($orderRelatedByAddressInvoice)); - if (null === $this->ordersRelatedByAddressInvoiceScheduledForDeletion) { - $this->ordersRelatedByAddressInvoiceScheduledForDeletion = clone $this->collOrdersRelatedByAddressInvoice; - $this->ordersRelatedByAddressInvoiceScheduledForDeletion->clear(); + if ($this->getOrdersRelatedByInvoiceOrderAddressId()->contains($orderRelatedByInvoiceOrderAddressId)) { + $this->collOrdersRelatedByInvoiceOrderAddressId->remove($this->collOrdersRelatedByInvoiceOrderAddressId->search($orderRelatedByInvoiceOrderAddressId)); + if (null === $this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion) { + $this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion = clone $this->collOrdersRelatedByInvoiceOrderAddressId; + $this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion->clear(); } - $this->ordersRelatedByAddressInvoiceScheduledForDeletion[]= $orderRelatedByAddressInvoice; - $orderRelatedByAddressInvoice->setOrderAddressRelatedByAddressInvoice(null); + $this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion[]= clone $orderRelatedByInvoiceOrderAddressId; + $orderRelatedByInvoiceOrderAddressId->setOrderAddressRelatedByInvoiceOrderAddressId(null); } return $this; @@ -2007,7 +2005,7 @@ abstract class OrderAddress implements ActiveRecordInterface * an identical criteria, it returns the collection. * Otherwise if this OrderAddress is new, it will return * an empty collection; or if this OrderAddress has previously - * been saved, it will retrieve related OrdersRelatedByAddressInvoice from storage. + * been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -2018,12 +2016,12 @@ abstract class OrderAddress implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersRelatedByAddressInvoiceJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersRelatedByInvoiceOrderAddressIdJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); $query->joinWith('Currency', $joinBehavior); - return $this->getOrdersRelatedByAddressInvoice($query, $con); + return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con); } @@ -2032,7 +2030,7 @@ abstract class OrderAddress implements ActiveRecordInterface * an identical criteria, it returns the collection. * Otherwise if this OrderAddress is new, it will return * an empty collection; or if this OrderAddress has previously - * been saved, it will retrieve related OrdersRelatedByAddressInvoice from storage. + * been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -2043,12 +2041,12 @@ abstract class OrderAddress implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersRelatedByAddressInvoiceJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersRelatedByInvoiceOrderAddressIdJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); $query->joinWith('Customer', $joinBehavior); - return $this->getOrdersRelatedByAddressInvoice($query, $con); + return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con); } @@ -2057,7 +2055,7 @@ abstract class OrderAddress implements ActiveRecordInterface * an identical criteria, it returns the collection. * Otherwise if this OrderAddress is new, it will return * an empty collection; or if this OrderAddress has previously - * been saved, it will retrieve related OrdersRelatedByAddressInvoice from storage. + * been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -2068,40 +2066,115 @@ abstract class OrderAddress implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersRelatedByAddressInvoiceJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersRelatedByInvoiceOrderAddressIdJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); $query->joinWith('OrderStatus', $joinBehavior); - return $this->getOrdersRelatedByAddressInvoice($query, $con); + return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this OrderAddress is new, it will return + * an empty collection; or if this OrderAddress has previously + * been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in OrderAddress. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByInvoiceOrderAddressIdJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior); + + return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this OrderAddress is new, it will return + * an empty collection; or if this OrderAddress has previously + * been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in OrderAddress. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByInvoiceOrderAddressIdJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior); + + return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this OrderAddress is new, it will return + * an empty collection; or if this OrderAddress has previously + * been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in OrderAddress. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByInvoiceOrderAddressIdJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Lang', $joinBehavior); + + return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con); } /** - * Clears out the collOrdersRelatedByAddressDelivery collection + * Clears out the collOrdersRelatedByDeliveryOrderAddressId collection * * This does not modify the database; however, it will remove any associated objects, causing * them to be refetched by subsequent calls to accessor method. * * @return void - * @see addOrdersRelatedByAddressDelivery() + * @see addOrdersRelatedByDeliveryOrderAddressId() */ - public function clearOrdersRelatedByAddressDelivery() + public function clearOrdersRelatedByDeliveryOrderAddressId() { - $this->collOrdersRelatedByAddressDelivery = null; // important to set this to NULL since that means it is uninitialized + $this->collOrdersRelatedByDeliveryOrderAddressId = null; // important to set this to NULL since that means it is uninitialized } /** - * Reset is the collOrdersRelatedByAddressDelivery collection loaded partially. + * Reset is the collOrdersRelatedByDeliveryOrderAddressId collection loaded partially. */ - public function resetPartialOrdersRelatedByAddressDelivery($v = true) + public function resetPartialOrdersRelatedByDeliveryOrderAddressId($v = true) { - $this->collOrdersRelatedByAddressDeliveryPartial = $v; + $this->collOrdersRelatedByDeliveryOrderAddressIdPartial = $v; } /** - * Initializes the collOrdersRelatedByAddressDelivery collection. + * Initializes the collOrdersRelatedByDeliveryOrderAddressId collection. * - * By default this just sets the collOrdersRelatedByAddressDelivery collection to an empty array (like clearcollOrdersRelatedByAddressDelivery()); + * By default this just sets the collOrdersRelatedByDeliveryOrderAddressId collection to an empty array (like clearcollOrdersRelatedByDeliveryOrderAddressId()); * however, you may wish to override this method in your stub class to provide setting appropriate * to your application -- for example, setting the initial array to the values stored in database. * @@ -2110,13 +2183,13 @@ abstract class OrderAddress implements ActiveRecordInterface * * @return void */ - public function initOrdersRelatedByAddressDelivery($overrideExisting = true) + public function initOrdersRelatedByDeliveryOrderAddressId($overrideExisting = true) { - if (null !== $this->collOrdersRelatedByAddressDelivery && !$overrideExisting) { + if (null !== $this->collOrdersRelatedByDeliveryOrderAddressId && !$overrideExisting) { return; } - $this->collOrdersRelatedByAddressDelivery = new ObjectCollection(); - $this->collOrdersRelatedByAddressDelivery->setModel('\Thelia\Model\Order'); + $this->collOrdersRelatedByDeliveryOrderAddressId = new ObjectCollection(); + $this->collOrdersRelatedByDeliveryOrderAddressId->setModel('\Thelia\Model\Order'); } /** @@ -2133,80 +2206,80 @@ abstract class OrderAddress implements ActiveRecordInterface * @return Collection|ChildOrder[] List of ChildOrder objects * @throws PropelException */ - public function getOrdersRelatedByAddressDelivery($criteria = null, ConnectionInterface $con = null) + public function getOrdersRelatedByDeliveryOrderAddressId($criteria = null, ConnectionInterface $con = null) { - $partial = $this->collOrdersRelatedByAddressDeliveryPartial && !$this->isNew(); - if (null === $this->collOrdersRelatedByAddressDelivery || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collOrdersRelatedByAddressDelivery) { + $partial = $this->collOrdersRelatedByDeliveryOrderAddressIdPartial && !$this->isNew(); + if (null === $this->collOrdersRelatedByDeliveryOrderAddressId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrdersRelatedByDeliveryOrderAddressId) { // return empty collection - $this->initOrdersRelatedByAddressDelivery(); + $this->initOrdersRelatedByDeliveryOrderAddressId(); } else { - $collOrdersRelatedByAddressDelivery = ChildOrderQuery::create(null, $criteria) - ->filterByOrderAddressRelatedByAddressDelivery($this) + $collOrdersRelatedByDeliveryOrderAddressId = ChildOrderQuery::create(null, $criteria) + ->filterByOrderAddressRelatedByDeliveryOrderAddressId($this) ->find($con); if (null !== $criteria) { - if (false !== $this->collOrdersRelatedByAddressDeliveryPartial && count($collOrdersRelatedByAddressDelivery)) { - $this->initOrdersRelatedByAddressDelivery(false); + if (false !== $this->collOrdersRelatedByDeliveryOrderAddressIdPartial && count($collOrdersRelatedByDeliveryOrderAddressId)) { + $this->initOrdersRelatedByDeliveryOrderAddressId(false); - foreach ($collOrdersRelatedByAddressDelivery as $obj) { - if (false == $this->collOrdersRelatedByAddressDelivery->contains($obj)) { - $this->collOrdersRelatedByAddressDelivery->append($obj); + foreach ($collOrdersRelatedByDeliveryOrderAddressId as $obj) { + if (false == $this->collOrdersRelatedByDeliveryOrderAddressId->contains($obj)) { + $this->collOrdersRelatedByDeliveryOrderAddressId->append($obj); } } - $this->collOrdersRelatedByAddressDeliveryPartial = true; + $this->collOrdersRelatedByDeliveryOrderAddressIdPartial = true; } - $collOrdersRelatedByAddressDelivery->getInternalIterator()->rewind(); + $collOrdersRelatedByDeliveryOrderAddressId->getInternalIterator()->rewind(); - return $collOrdersRelatedByAddressDelivery; + return $collOrdersRelatedByDeliveryOrderAddressId; } - if ($partial && $this->collOrdersRelatedByAddressDelivery) { - foreach ($this->collOrdersRelatedByAddressDelivery as $obj) { + if ($partial && $this->collOrdersRelatedByDeliveryOrderAddressId) { + foreach ($this->collOrdersRelatedByDeliveryOrderAddressId as $obj) { if ($obj->isNew()) { - $collOrdersRelatedByAddressDelivery[] = $obj; + $collOrdersRelatedByDeliveryOrderAddressId[] = $obj; } } } - $this->collOrdersRelatedByAddressDelivery = $collOrdersRelatedByAddressDelivery; - $this->collOrdersRelatedByAddressDeliveryPartial = false; + $this->collOrdersRelatedByDeliveryOrderAddressId = $collOrdersRelatedByDeliveryOrderAddressId; + $this->collOrdersRelatedByDeliveryOrderAddressIdPartial = false; } } - return $this->collOrdersRelatedByAddressDelivery; + return $this->collOrdersRelatedByDeliveryOrderAddressId; } /** - * Sets a collection of OrderRelatedByAddressDelivery objects related by a one-to-many relationship + * Sets a collection of OrderRelatedByDeliveryOrderAddressId objects related by a one-to-many relationship * to the current object. * It will also schedule objects for deletion based on a diff between old objects (aka persisted) * and new objects from the given Propel collection. * - * @param Collection $ordersRelatedByAddressDelivery A Propel collection. + * @param Collection $ordersRelatedByDeliveryOrderAddressId A Propel collection. * @param ConnectionInterface $con Optional connection object * @return ChildOrderAddress The current object (for fluent API support) */ - public function setOrdersRelatedByAddressDelivery(Collection $ordersRelatedByAddressDelivery, ConnectionInterface $con = null) + public function setOrdersRelatedByDeliveryOrderAddressId(Collection $ordersRelatedByDeliveryOrderAddressId, ConnectionInterface $con = null) { - $ordersRelatedByAddressDeliveryToDelete = $this->getOrdersRelatedByAddressDelivery(new Criteria(), $con)->diff($ordersRelatedByAddressDelivery); + $ordersRelatedByDeliveryOrderAddressIdToDelete = $this->getOrdersRelatedByDeliveryOrderAddressId(new Criteria(), $con)->diff($ordersRelatedByDeliveryOrderAddressId); - $this->ordersRelatedByAddressDeliveryScheduledForDeletion = $ordersRelatedByAddressDeliveryToDelete; + $this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion = $ordersRelatedByDeliveryOrderAddressIdToDelete; - foreach ($ordersRelatedByAddressDeliveryToDelete as $orderRelatedByAddressDeliveryRemoved) { - $orderRelatedByAddressDeliveryRemoved->setOrderAddressRelatedByAddressDelivery(null); + foreach ($ordersRelatedByDeliveryOrderAddressIdToDelete as $orderRelatedByDeliveryOrderAddressIdRemoved) { + $orderRelatedByDeliveryOrderAddressIdRemoved->setOrderAddressRelatedByDeliveryOrderAddressId(null); } - $this->collOrdersRelatedByAddressDelivery = null; - foreach ($ordersRelatedByAddressDelivery as $orderRelatedByAddressDelivery) { - $this->addOrderRelatedByAddressDelivery($orderRelatedByAddressDelivery); + $this->collOrdersRelatedByDeliveryOrderAddressId = null; + foreach ($ordersRelatedByDeliveryOrderAddressId as $orderRelatedByDeliveryOrderAddressId) { + $this->addOrderRelatedByDeliveryOrderAddressId($orderRelatedByDeliveryOrderAddressId); } - $this->collOrdersRelatedByAddressDelivery = $ordersRelatedByAddressDelivery; - $this->collOrdersRelatedByAddressDeliveryPartial = false; + $this->collOrdersRelatedByDeliveryOrderAddressId = $ordersRelatedByDeliveryOrderAddressId; + $this->collOrdersRelatedByDeliveryOrderAddressIdPartial = false; return $this; } @@ -2220,16 +2293,16 @@ abstract class OrderAddress implements ActiveRecordInterface * @return int Count of related Order objects. * @throws PropelException */ - public function countOrdersRelatedByAddressDelivery(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) + public function countOrdersRelatedByDeliveryOrderAddressId(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { - $partial = $this->collOrdersRelatedByAddressDeliveryPartial && !$this->isNew(); - if (null === $this->collOrdersRelatedByAddressDelivery || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collOrdersRelatedByAddressDelivery) { + $partial = $this->collOrdersRelatedByDeliveryOrderAddressIdPartial && !$this->isNew(); + if (null === $this->collOrdersRelatedByDeliveryOrderAddressId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collOrdersRelatedByDeliveryOrderAddressId) { return 0; } if ($partial && !$criteria) { - return count($this->getOrdersRelatedByAddressDelivery()); + return count($this->getOrdersRelatedByDeliveryOrderAddressId()); } $query = ChildOrderQuery::create(null, $criteria); @@ -2238,11 +2311,11 @@ abstract class OrderAddress implements ActiveRecordInterface } return $query - ->filterByOrderAddressRelatedByAddressDelivery($this) + ->filterByOrderAddressRelatedByDeliveryOrderAddressId($this) ->count($con); } - return count($this->collOrdersRelatedByAddressDelivery); + return count($this->collOrdersRelatedByDeliveryOrderAddressId); } /** @@ -2252,43 +2325,43 @@ abstract class OrderAddress implements ActiveRecordInterface * @param ChildOrder $l ChildOrder * @return \Thelia\Model\OrderAddress The current object (for fluent API support) */ - public function addOrderRelatedByAddressDelivery(ChildOrder $l) + public function addOrderRelatedByDeliveryOrderAddressId(ChildOrder $l) { - if ($this->collOrdersRelatedByAddressDelivery === null) { - $this->initOrdersRelatedByAddressDelivery(); - $this->collOrdersRelatedByAddressDeliveryPartial = true; + if ($this->collOrdersRelatedByDeliveryOrderAddressId === null) { + $this->initOrdersRelatedByDeliveryOrderAddressId(); + $this->collOrdersRelatedByDeliveryOrderAddressIdPartial = true; } - if (!in_array($l, $this->collOrdersRelatedByAddressDelivery->getArrayCopy(), true)) { // only add it if the **same** object is not already associated - $this->doAddOrderRelatedByAddressDelivery($l); + if (!in_array($l, $this->collOrdersRelatedByDeliveryOrderAddressId->getArrayCopy(), true)) { // only add it if the **same** object is not already associated + $this->doAddOrderRelatedByDeliveryOrderAddressId($l); } return $this; } /** - * @param OrderRelatedByAddressDelivery $orderRelatedByAddressDelivery The orderRelatedByAddressDelivery object to add. + * @param OrderRelatedByDeliveryOrderAddressId $orderRelatedByDeliveryOrderAddressId The orderRelatedByDeliveryOrderAddressId object to add. */ - protected function doAddOrderRelatedByAddressDelivery($orderRelatedByAddressDelivery) + protected function doAddOrderRelatedByDeliveryOrderAddressId($orderRelatedByDeliveryOrderAddressId) { - $this->collOrdersRelatedByAddressDelivery[]= $orderRelatedByAddressDelivery; - $orderRelatedByAddressDelivery->setOrderAddressRelatedByAddressDelivery($this); + $this->collOrdersRelatedByDeliveryOrderAddressId[]= $orderRelatedByDeliveryOrderAddressId; + $orderRelatedByDeliveryOrderAddressId->setOrderAddressRelatedByDeliveryOrderAddressId($this); } /** - * @param OrderRelatedByAddressDelivery $orderRelatedByAddressDelivery The orderRelatedByAddressDelivery object to remove. + * @param OrderRelatedByDeliveryOrderAddressId $orderRelatedByDeliveryOrderAddressId The orderRelatedByDeliveryOrderAddressId object to remove. * @return ChildOrderAddress The current object (for fluent API support) */ - public function removeOrderRelatedByAddressDelivery($orderRelatedByAddressDelivery) + public function removeOrderRelatedByDeliveryOrderAddressId($orderRelatedByDeliveryOrderAddressId) { - if ($this->getOrdersRelatedByAddressDelivery()->contains($orderRelatedByAddressDelivery)) { - $this->collOrdersRelatedByAddressDelivery->remove($this->collOrdersRelatedByAddressDelivery->search($orderRelatedByAddressDelivery)); - if (null === $this->ordersRelatedByAddressDeliveryScheduledForDeletion) { - $this->ordersRelatedByAddressDeliveryScheduledForDeletion = clone $this->collOrdersRelatedByAddressDelivery; - $this->ordersRelatedByAddressDeliveryScheduledForDeletion->clear(); + if ($this->getOrdersRelatedByDeliveryOrderAddressId()->contains($orderRelatedByDeliveryOrderAddressId)) { + $this->collOrdersRelatedByDeliveryOrderAddressId->remove($this->collOrdersRelatedByDeliveryOrderAddressId->search($orderRelatedByDeliveryOrderAddressId)); + if (null === $this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion) { + $this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion = clone $this->collOrdersRelatedByDeliveryOrderAddressId; + $this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion->clear(); } - $this->ordersRelatedByAddressDeliveryScheduledForDeletion[]= $orderRelatedByAddressDelivery; - $orderRelatedByAddressDelivery->setOrderAddressRelatedByAddressDelivery(null); + $this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion[]= clone $orderRelatedByDeliveryOrderAddressId; + $orderRelatedByDeliveryOrderAddressId->setOrderAddressRelatedByDeliveryOrderAddressId(null); } return $this; @@ -2300,7 +2373,7 @@ abstract class OrderAddress implements ActiveRecordInterface * an identical criteria, it returns the collection. * Otherwise if this OrderAddress is new, it will return * an empty collection; or if this OrderAddress has previously - * been saved, it will retrieve related OrdersRelatedByAddressDelivery from storage. + * been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -2311,12 +2384,12 @@ abstract class OrderAddress implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersRelatedByAddressDeliveryJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersRelatedByDeliveryOrderAddressIdJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); $query->joinWith('Currency', $joinBehavior); - return $this->getOrdersRelatedByAddressDelivery($query, $con); + return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con); } @@ -2325,7 +2398,7 @@ abstract class OrderAddress implements ActiveRecordInterface * an identical criteria, it returns the collection. * Otherwise if this OrderAddress is new, it will return * an empty collection; or if this OrderAddress has previously - * been saved, it will retrieve related OrdersRelatedByAddressDelivery from storage. + * been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -2336,12 +2409,12 @@ abstract class OrderAddress implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersRelatedByAddressDeliveryJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersRelatedByDeliveryOrderAddressIdJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); $query->joinWith('Customer', $joinBehavior); - return $this->getOrdersRelatedByAddressDelivery($query, $con); + return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con); } @@ -2350,7 +2423,7 @@ abstract class OrderAddress implements ActiveRecordInterface * an identical criteria, it returns the collection. * Otherwise if this OrderAddress is new, it will return * an empty collection; or if this OrderAddress has previously - * been saved, it will retrieve related OrdersRelatedByAddressDelivery from storage. + * been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -2361,12 +2434,87 @@ abstract class OrderAddress implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersRelatedByAddressDeliveryJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersRelatedByDeliveryOrderAddressIdJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); $query->joinWith('OrderStatus', $joinBehavior); - return $this->getOrdersRelatedByAddressDelivery($query, $con); + return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this OrderAddress is new, it will return + * an empty collection; or if this OrderAddress has previously + * been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in OrderAddress. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByDeliveryOrderAddressIdJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior); + + return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this OrderAddress is new, it will return + * an empty collection; or if this OrderAddress has previously + * been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in OrderAddress. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByDeliveryOrderAddressIdJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior); + + return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this OrderAddress is new, it will return + * an empty collection; or if this OrderAddress has previously + * been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in OrderAddress. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersRelatedByDeliveryOrderAddressIdJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Lang', $joinBehavior); + + return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con); } /** @@ -2407,26 +2555,26 @@ abstract class OrderAddress implements ActiveRecordInterface public function clearAllReferences($deep = false) { if ($deep) { - if ($this->collOrdersRelatedByAddressInvoice) { - foreach ($this->collOrdersRelatedByAddressInvoice as $o) { + if ($this->collOrdersRelatedByInvoiceOrderAddressId) { + foreach ($this->collOrdersRelatedByInvoiceOrderAddressId as $o) { $o->clearAllReferences($deep); } } - if ($this->collOrdersRelatedByAddressDelivery) { - foreach ($this->collOrdersRelatedByAddressDelivery as $o) { + if ($this->collOrdersRelatedByDeliveryOrderAddressId) { + foreach ($this->collOrdersRelatedByDeliveryOrderAddressId as $o) { $o->clearAllReferences($deep); } } } // if ($deep) - if ($this->collOrdersRelatedByAddressInvoice instanceof Collection) { - $this->collOrdersRelatedByAddressInvoice->clearIterator(); + if ($this->collOrdersRelatedByInvoiceOrderAddressId instanceof Collection) { + $this->collOrdersRelatedByInvoiceOrderAddressId->clearIterator(); } - $this->collOrdersRelatedByAddressInvoice = null; - if ($this->collOrdersRelatedByAddressDelivery instanceof Collection) { - $this->collOrdersRelatedByAddressDelivery->clearIterator(); + $this->collOrdersRelatedByInvoiceOrderAddressId = null; + if ($this->collOrdersRelatedByDeliveryOrderAddressId instanceof Collection) { + $this->collOrdersRelatedByDeliveryOrderAddressId->clearIterator(); } - $this->collOrdersRelatedByAddressDelivery = null; + $this->collOrdersRelatedByDeliveryOrderAddressId = null; } /** diff --git a/core/lib/Thelia/Model/Base/OrderAddressQuery.php b/core/lib/Thelia/Model/Base/OrderAddressQuery.php index 0552feb85..41f417872 100644 --- a/core/lib/Thelia/Model/Base/OrderAddressQuery.php +++ b/core/lib/Thelia/Model/Base/OrderAddressQuery.php @@ -55,13 +55,13 @@ use Thelia\Model\Map\OrderAddressTableMap; * @method ChildOrderAddressQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method ChildOrderAddressQuery innerJoin($relation) Adds a INNER JOIN clause to the query * - * @method ChildOrderAddressQuery leftJoinOrderRelatedByAddressInvoice($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByAddressInvoice relation - * @method ChildOrderAddressQuery rightJoinOrderRelatedByAddressInvoice($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByAddressInvoice relation - * @method ChildOrderAddressQuery innerJoinOrderRelatedByAddressInvoice($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByAddressInvoice relation + * @method ChildOrderAddressQuery leftJoinOrderRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByInvoiceOrderAddressId relation + * @method ChildOrderAddressQuery rightJoinOrderRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByInvoiceOrderAddressId relation + * @method ChildOrderAddressQuery innerJoinOrderRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByInvoiceOrderAddressId relation * - * @method ChildOrderAddressQuery leftJoinOrderRelatedByAddressDelivery($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByAddressDelivery relation - * @method ChildOrderAddressQuery rightJoinOrderRelatedByAddressDelivery($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByAddressDelivery relation - * @method ChildOrderAddressQuery innerJoinOrderRelatedByAddressDelivery($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByAddressDelivery relation + * @method ChildOrderAddressQuery leftJoinOrderRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByDeliveryOrderAddressId relation + * @method ChildOrderAddressQuery rightJoinOrderRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByDeliveryOrderAddressId relation + * @method ChildOrderAddressQuery innerJoinOrderRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByDeliveryOrderAddressId relation * * @method ChildOrderAddress findOne(ConnectionInterface $con = null) Return the first ChildOrderAddress matching the query * @method ChildOrderAddress findOneOrCreate(ConnectionInterface $con = null) Return the first ChildOrderAddress matching the query, or a new ChildOrderAddress object populated from the query conditions when no match is found @@ -750,33 +750,33 @@ abstract class OrderAddressQuery extends ModelCriteria * * @return ChildOrderAddressQuery The current query, for fluid interface */ - public function filterByOrderRelatedByAddressInvoice($order, $comparison = null) + public function filterByOrderRelatedByInvoiceOrderAddressId($order, $comparison = null) { if ($order instanceof \Thelia\Model\Order) { return $this - ->addUsingAlias(OrderAddressTableMap::ID, $order->getAddressInvoice(), $comparison); + ->addUsingAlias(OrderAddressTableMap::ID, $order->getInvoiceOrderAddressId(), $comparison); } elseif ($order instanceof ObjectCollection) { return $this - ->useOrderRelatedByAddressInvoiceQuery() + ->useOrderRelatedByInvoiceOrderAddressIdQuery() ->filterByPrimaryKeys($order->getPrimaryKeys()) ->endUse(); } else { - throw new PropelException('filterByOrderRelatedByAddressInvoice() only accepts arguments of type \Thelia\Model\Order or Collection'); + throw new PropelException('filterByOrderRelatedByInvoiceOrderAddressId() only accepts arguments of type \Thelia\Model\Order or Collection'); } } /** - * Adds a JOIN clause to the query using the OrderRelatedByAddressInvoice relation + * Adds a JOIN clause to the query using the OrderRelatedByInvoiceOrderAddressId relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return ChildOrderAddressQuery The current query, for fluid interface */ - public function joinOrderRelatedByAddressInvoice($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinOrderRelatedByInvoiceOrderAddressId($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('OrderRelatedByAddressInvoice'); + $relationMap = $tableMap->getRelation('OrderRelatedByInvoiceOrderAddressId'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -791,14 +791,14 @@ abstract class OrderAddressQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'OrderRelatedByAddressInvoice'); + $this->addJoinObject($join, 'OrderRelatedByInvoiceOrderAddressId'); } return $this; } /** - * Use the OrderRelatedByAddressInvoice relation Order object + * Use the OrderRelatedByInvoiceOrderAddressId relation Order object * * @see useQuery() * @@ -808,11 +808,11 @@ abstract class OrderAddressQuery extends ModelCriteria * * @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query */ - public function useOrderRelatedByAddressInvoiceQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useOrderRelatedByInvoiceOrderAddressIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this - ->joinOrderRelatedByAddressInvoice($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByAddressInvoice', '\Thelia\Model\OrderQuery'); + ->joinOrderRelatedByInvoiceOrderAddressId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByInvoiceOrderAddressId', '\Thelia\Model\OrderQuery'); } /** @@ -823,33 +823,33 @@ abstract class OrderAddressQuery extends ModelCriteria * * @return ChildOrderAddressQuery The current query, for fluid interface */ - public function filterByOrderRelatedByAddressDelivery($order, $comparison = null) + public function filterByOrderRelatedByDeliveryOrderAddressId($order, $comparison = null) { if ($order instanceof \Thelia\Model\Order) { return $this - ->addUsingAlias(OrderAddressTableMap::ID, $order->getAddressDelivery(), $comparison); + ->addUsingAlias(OrderAddressTableMap::ID, $order->getDeliveryOrderAddressId(), $comparison); } elseif ($order instanceof ObjectCollection) { return $this - ->useOrderRelatedByAddressDeliveryQuery() + ->useOrderRelatedByDeliveryOrderAddressIdQuery() ->filterByPrimaryKeys($order->getPrimaryKeys()) ->endUse(); } else { - throw new PropelException('filterByOrderRelatedByAddressDelivery() only accepts arguments of type \Thelia\Model\Order or Collection'); + throw new PropelException('filterByOrderRelatedByDeliveryOrderAddressId() only accepts arguments of type \Thelia\Model\Order or Collection'); } } /** - * Adds a JOIN clause to the query using the OrderRelatedByAddressDelivery relation + * Adds a JOIN clause to the query using the OrderRelatedByDeliveryOrderAddressId relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return ChildOrderAddressQuery The current query, for fluid interface */ - public function joinOrderRelatedByAddressDelivery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinOrderRelatedByDeliveryOrderAddressId($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('OrderRelatedByAddressDelivery'); + $relationMap = $tableMap->getRelation('OrderRelatedByDeliveryOrderAddressId'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -864,14 +864,14 @@ abstract class OrderAddressQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'OrderRelatedByAddressDelivery'); + $this->addJoinObject($join, 'OrderRelatedByDeliveryOrderAddressId'); } return $this; } /** - * Use the OrderRelatedByAddressDelivery relation Order object + * Use the OrderRelatedByDeliveryOrderAddressId relation Order object * * @see useQuery() * @@ -881,11 +881,11 @@ abstract class OrderAddressQuery extends ModelCriteria * * @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query */ - public function useOrderRelatedByAddressDeliveryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useOrderRelatedByDeliveryOrderAddressIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this - ->joinOrderRelatedByAddressDelivery($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByAddressDelivery', '\Thelia\Model\OrderQuery'); + ->joinOrderRelatedByDeliveryOrderAddressId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByDeliveryOrderAddressId', '\Thelia\Model\OrderQuery'); } /** diff --git a/core/lib/Thelia/Model/Base/OrderQuery.php b/core/lib/Thelia/Model/Base/OrderQuery.php index bdff793a8..592864f1f 100644 --- a/core/lib/Thelia/Model/Base/OrderQuery.php +++ b/core/lib/Thelia/Model/Base/OrderQuery.php @@ -24,38 +24,38 @@ use Thelia\Model\Map\OrderTableMap; * @method ChildOrderQuery orderById($order = Criteria::ASC) Order by the id column * @method ChildOrderQuery orderByRef($order = Criteria::ASC) Order by the ref column * @method ChildOrderQuery orderByCustomerId($order = Criteria::ASC) Order by the customer_id column - * @method ChildOrderQuery orderByAddressInvoice($order = Criteria::ASC) Order by the address_invoice column - * @method ChildOrderQuery orderByAddressDelivery($order = Criteria::ASC) Order by the address_delivery column + * @method ChildOrderQuery orderByInvoiceOrderAddressId($order = Criteria::ASC) Order by the invoice_order_address_id column + * @method ChildOrderQuery orderByDeliveryOrderAddressId($order = Criteria::ASC) Order by the delivery_order_address_id column * @method ChildOrderQuery orderByInvoiceDate($order = Criteria::ASC) Order by the invoice_date column * @method ChildOrderQuery orderByCurrencyId($order = Criteria::ASC) Order by the currency_id column * @method ChildOrderQuery orderByCurrencyRate($order = Criteria::ASC) Order by the currency_rate column - * @method ChildOrderQuery orderByTransaction($order = Criteria::ASC) Order by the transaction column - * @method ChildOrderQuery orderByDeliveryNum($order = Criteria::ASC) Order by the delivery_num column - * @method ChildOrderQuery orderByInvoice($order = Criteria::ASC) Order by the invoice column + * @method ChildOrderQuery orderByTransactionRef($order = Criteria::ASC) Order by the transaction_ref column + * @method ChildOrderQuery orderByDeliveryRef($order = Criteria::ASC) Order by the delivery_ref column + * @method ChildOrderQuery orderByInvoiceRef($order = Criteria::ASC) Order by the invoice_ref column * @method ChildOrderQuery orderByPostage($order = Criteria::ASC) Order by the postage column - * @method ChildOrderQuery orderByPayment($order = Criteria::ASC) Order by the payment column - * @method ChildOrderQuery orderByCarrier($order = Criteria::ASC) Order by the carrier column + * @method ChildOrderQuery orderByPaymentModuleId($order = Criteria::ASC) Order by the payment_module_id column + * @method ChildOrderQuery orderByDeliveryModuleId($order = Criteria::ASC) Order by the delivery_module_id column * @method ChildOrderQuery orderByStatusId($order = Criteria::ASC) Order by the status_id column - * @method ChildOrderQuery orderByLang($order = Criteria::ASC) Order by the lang column + * @method ChildOrderQuery orderByLangId($order = Criteria::ASC) Order by the lang_id column * @method ChildOrderQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildOrderQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * * @method ChildOrderQuery groupById() Group by the id column * @method ChildOrderQuery groupByRef() Group by the ref column * @method ChildOrderQuery groupByCustomerId() Group by the customer_id column - * @method ChildOrderQuery groupByAddressInvoice() Group by the address_invoice column - * @method ChildOrderQuery groupByAddressDelivery() Group by the address_delivery column + * @method ChildOrderQuery groupByInvoiceOrderAddressId() Group by the invoice_order_address_id column + * @method ChildOrderQuery groupByDeliveryOrderAddressId() Group by the delivery_order_address_id column * @method ChildOrderQuery groupByInvoiceDate() Group by the invoice_date column * @method ChildOrderQuery groupByCurrencyId() Group by the currency_id column * @method ChildOrderQuery groupByCurrencyRate() Group by the currency_rate column - * @method ChildOrderQuery groupByTransaction() Group by the transaction column - * @method ChildOrderQuery groupByDeliveryNum() Group by the delivery_num column - * @method ChildOrderQuery groupByInvoice() Group by the invoice column + * @method ChildOrderQuery groupByTransactionRef() Group by the transaction_ref column + * @method ChildOrderQuery groupByDeliveryRef() Group by the delivery_ref column + * @method ChildOrderQuery groupByInvoiceRef() Group by the invoice_ref column * @method ChildOrderQuery groupByPostage() Group by the postage column - * @method ChildOrderQuery groupByPayment() Group by the payment column - * @method ChildOrderQuery groupByCarrier() Group by the carrier column + * @method ChildOrderQuery groupByPaymentModuleId() Group by the payment_module_id column + * @method ChildOrderQuery groupByDeliveryModuleId() Group by the delivery_module_id column * @method ChildOrderQuery groupByStatusId() Group by the status_id column - * @method ChildOrderQuery groupByLang() Group by the lang column + * @method ChildOrderQuery groupByLangId() Group by the lang_id column * @method ChildOrderQuery groupByCreatedAt() Group by the created_at column * @method ChildOrderQuery groupByUpdatedAt() Group by the updated_at column * @@ -71,18 +71,30 @@ use Thelia\Model\Map\OrderTableMap; * @method ChildOrderQuery rightJoinCustomer($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Customer relation * @method ChildOrderQuery innerJoinCustomer($relationAlias = null) Adds a INNER JOIN clause to the query using the Customer relation * - * @method ChildOrderQuery leftJoinOrderAddressRelatedByAddressInvoice($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderAddressRelatedByAddressInvoice relation - * @method ChildOrderQuery rightJoinOrderAddressRelatedByAddressInvoice($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderAddressRelatedByAddressInvoice relation - * @method ChildOrderQuery innerJoinOrderAddressRelatedByAddressInvoice($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderAddressRelatedByAddressInvoice relation + * @method ChildOrderQuery leftJoinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderAddressRelatedByInvoiceOrderAddressId relation + * @method ChildOrderQuery rightJoinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderAddressRelatedByInvoiceOrderAddressId relation + * @method ChildOrderQuery innerJoinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderAddressRelatedByInvoiceOrderAddressId relation * - * @method ChildOrderQuery leftJoinOrderAddressRelatedByAddressDelivery($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderAddressRelatedByAddressDelivery relation - * @method ChildOrderQuery rightJoinOrderAddressRelatedByAddressDelivery($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderAddressRelatedByAddressDelivery relation - * @method ChildOrderQuery innerJoinOrderAddressRelatedByAddressDelivery($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderAddressRelatedByAddressDelivery relation + * @method ChildOrderQuery leftJoinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderAddressRelatedByDeliveryOrderAddressId relation + * @method ChildOrderQuery rightJoinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderAddressRelatedByDeliveryOrderAddressId relation + * @method ChildOrderQuery innerJoinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderAddressRelatedByDeliveryOrderAddressId relation * * @method ChildOrderQuery leftJoinOrderStatus($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderStatus relation * @method ChildOrderQuery rightJoinOrderStatus($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderStatus relation * @method ChildOrderQuery innerJoinOrderStatus($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderStatus relation * + * @method ChildOrderQuery leftJoinModuleRelatedByPaymentModuleId($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleRelatedByPaymentModuleId relation + * @method ChildOrderQuery rightJoinModuleRelatedByPaymentModuleId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleRelatedByPaymentModuleId relation + * @method ChildOrderQuery innerJoinModuleRelatedByPaymentModuleId($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleRelatedByPaymentModuleId relation + * + * @method ChildOrderQuery leftJoinModuleRelatedByDeliveryModuleId($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleRelatedByDeliveryModuleId relation + * @method ChildOrderQuery rightJoinModuleRelatedByDeliveryModuleId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleRelatedByDeliveryModuleId relation + * @method ChildOrderQuery innerJoinModuleRelatedByDeliveryModuleId($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleRelatedByDeliveryModuleId relation + * + * @method ChildOrderQuery leftJoinLang($relationAlias = null) Adds a LEFT JOIN clause to the query using the Lang relation + * @method ChildOrderQuery rightJoinLang($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Lang relation + * @method ChildOrderQuery innerJoinLang($relationAlias = null) Adds a INNER JOIN clause to the query using the Lang relation + * * @method ChildOrderQuery leftJoinOrderProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderProduct relation * @method ChildOrderQuery rightJoinOrderProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderProduct relation * @method ChildOrderQuery innerJoinOrderProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderProduct relation @@ -97,38 +109,38 @@ use Thelia\Model\Map\OrderTableMap; * @method ChildOrder findOneById(int $id) Return the first ChildOrder filtered by the id column * @method ChildOrder findOneByRef(string $ref) Return the first ChildOrder filtered by the ref column * @method ChildOrder findOneByCustomerId(int $customer_id) Return the first ChildOrder filtered by the customer_id column - * @method ChildOrder findOneByAddressInvoice(int $address_invoice) Return the first ChildOrder filtered by the address_invoice column - * @method ChildOrder findOneByAddressDelivery(int $address_delivery) Return the first ChildOrder filtered by the address_delivery column + * @method ChildOrder findOneByInvoiceOrderAddressId(int $invoice_order_address_id) Return the first ChildOrder filtered by the invoice_order_address_id column + * @method ChildOrder findOneByDeliveryOrderAddressId(int $delivery_order_address_id) Return the first ChildOrder filtered by the delivery_order_address_id column * @method ChildOrder findOneByInvoiceDate(string $invoice_date) Return the first ChildOrder filtered by the invoice_date column * @method ChildOrder findOneByCurrencyId(int $currency_id) Return the first ChildOrder filtered by the currency_id column * @method ChildOrder findOneByCurrencyRate(double $currency_rate) Return the first ChildOrder filtered by the currency_rate column - * @method ChildOrder findOneByTransaction(string $transaction) Return the first ChildOrder filtered by the transaction column - * @method ChildOrder findOneByDeliveryNum(string $delivery_num) Return the first ChildOrder filtered by the delivery_num column - * @method ChildOrder findOneByInvoice(string $invoice) Return the first ChildOrder filtered by the invoice column + * @method ChildOrder findOneByTransactionRef(string $transaction_ref) Return the first ChildOrder filtered by the transaction_ref column + * @method ChildOrder findOneByDeliveryRef(string $delivery_ref) Return the first ChildOrder filtered by the delivery_ref column + * @method ChildOrder findOneByInvoiceRef(string $invoice_ref) Return the first ChildOrder filtered by the invoice_ref column * @method ChildOrder findOneByPostage(double $postage) Return the first ChildOrder filtered by the postage column - * @method ChildOrder findOneByPayment(string $payment) Return the first ChildOrder filtered by the payment column - * @method ChildOrder findOneByCarrier(string $carrier) Return the first ChildOrder filtered by the carrier column + * @method ChildOrder findOneByPaymentModuleId(int $payment_module_id) Return the first ChildOrder filtered by the payment_module_id column + * @method ChildOrder findOneByDeliveryModuleId(int $delivery_module_id) Return the first ChildOrder filtered by the delivery_module_id column * @method ChildOrder findOneByStatusId(int $status_id) Return the first ChildOrder filtered by the status_id column - * @method ChildOrder findOneByLang(string $lang) Return the first ChildOrder filtered by the lang column + * @method ChildOrder findOneByLangId(int $lang_id) Return the first ChildOrder filtered by the lang_id column * @method ChildOrder findOneByCreatedAt(string $created_at) Return the first ChildOrder filtered by the created_at column * @method ChildOrder findOneByUpdatedAt(string $updated_at) Return the first ChildOrder filtered by the updated_at column * * @method array findById(int $id) Return ChildOrder objects filtered by the id column * @method array findByRef(string $ref) Return ChildOrder objects filtered by the ref column * @method array findByCustomerId(int $customer_id) Return ChildOrder objects filtered by the customer_id column - * @method array findByAddressInvoice(int $address_invoice) Return ChildOrder objects filtered by the address_invoice column - * @method array findByAddressDelivery(int $address_delivery) Return ChildOrder objects filtered by the address_delivery column + * @method array findByInvoiceOrderAddressId(int $invoice_order_address_id) Return ChildOrder objects filtered by the invoice_order_address_id column + * @method array findByDeliveryOrderAddressId(int $delivery_order_address_id) Return ChildOrder objects filtered by the delivery_order_address_id column * @method array findByInvoiceDate(string $invoice_date) Return ChildOrder objects filtered by the invoice_date column * @method array findByCurrencyId(int $currency_id) Return ChildOrder objects filtered by the currency_id column * @method array findByCurrencyRate(double $currency_rate) Return ChildOrder objects filtered by the currency_rate column - * @method array findByTransaction(string $transaction) Return ChildOrder objects filtered by the transaction column - * @method array findByDeliveryNum(string $delivery_num) Return ChildOrder objects filtered by the delivery_num column - * @method array findByInvoice(string $invoice) Return ChildOrder objects filtered by the invoice column + * @method array findByTransactionRef(string $transaction_ref) Return ChildOrder objects filtered by the transaction_ref column + * @method array findByDeliveryRef(string $delivery_ref) Return ChildOrder objects filtered by the delivery_ref column + * @method array findByInvoiceRef(string $invoice_ref) Return ChildOrder objects filtered by the invoice_ref column * @method array findByPostage(double $postage) Return ChildOrder objects filtered by the postage column - * @method array findByPayment(string $payment) Return ChildOrder objects filtered by the payment column - * @method array findByCarrier(string $carrier) Return ChildOrder objects filtered by the carrier column + * @method array findByPaymentModuleId(int $payment_module_id) Return ChildOrder objects filtered by the payment_module_id column + * @method array findByDeliveryModuleId(int $delivery_module_id) Return ChildOrder objects filtered by the delivery_module_id column * @method array findByStatusId(int $status_id) Return ChildOrder objects filtered by the status_id column - * @method array findByLang(string $lang) Return ChildOrder objects filtered by the lang column + * @method array findByLangId(int $lang_id) Return ChildOrder objects filtered by the lang_id column * @method array findByCreatedAt(string $created_at) Return ChildOrder objects filtered by the created_at column * @method array findByUpdatedAt(string $updated_at) Return ChildOrder objects filtered by the updated_at column * @@ -219,7 +231,7 @@ abstract class OrderQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT ID, REF, CUSTOMER_ID, ADDRESS_INVOICE, ADDRESS_DELIVERY, INVOICE_DATE, CURRENCY_ID, CURRENCY_RATE, TRANSACTION, DELIVERY_NUM, INVOICE, POSTAGE, PAYMENT, CARRIER, STATUS_ID, LANG, CREATED_AT, UPDATED_AT FROM order WHERE ID = :p0'; + $sql = 'SELECT ID, REF, CUSTOMER_ID, INVOICE_ORDER_ADDRESS_ID, DELIVERY_ORDER_ADDRESS_ID, INVOICE_DATE, CURRENCY_ID, CURRENCY_RATE, TRANSACTION_REF, DELIVERY_REF, INVOICE_REF, POSTAGE, PAYMENT_MODULE_ID, DELIVERY_MODULE_ID, STATUS_ID, LANG_ID, CREATED_AT, UPDATED_AT FROM order WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -422,18 +434,18 @@ abstract class OrderQuery extends ModelCriteria } /** - * Filter the query on the address_invoice column + * Filter the query on the invoice_order_address_id column * * Example usage: * - * $query->filterByAddressInvoice(1234); // WHERE address_invoice = 1234 - * $query->filterByAddressInvoice(array(12, 34)); // WHERE address_invoice IN (12, 34) - * $query->filterByAddressInvoice(array('min' => 12)); // WHERE address_invoice > 12 + * $query->filterByInvoiceOrderAddressId(1234); // WHERE invoice_order_address_id = 1234 + * $query->filterByInvoiceOrderAddressId(array(12, 34)); // WHERE invoice_order_address_id IN (12, 34) + * $query->filterByInvoiceOrderAddressId(array('min' => 12)); // WHERE invoice_order_address_id > 12 * * - * @see filterByOrderAddressRelatedByAddressInvoice() + * @see filterByOrderAddressRelatedByInvoiceOrderAddressId() * - * @param mixed $addressInvoice The value to use as filter. + * @param mixed $invoiceOrderAddressId The value to use as filter. * Use scalar values for equality. * Use array values for in_array() equivalent. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. @@ -441,16 +453,16 @@ abstract class OrderQuery extends ModelCriteria * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByAddressInvoice($addressInvoice = null, $comparison = null) + public function filterByInvoiceOrderAddressId($invoiceOrderAddressId = null, $comparison = null) { - if (is_array($addressInvoice)) { + if (is_array($invoiceOrderAddressId)) { $useMinMax = false; - if (isset($addressInvoice['min'])) { - $this->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $addressInvoice['min'], Criteria::GREATER_EQUAL); + if (isset($invoiceOrderAddressId['min'])) { + $this->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $invoiceOrderAddressId['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } - if (isset($addressInvoice['max'])) { - $this->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $addressInvoice['max'], Criteria::LESS_EQUAL); + if (isset($invoiceOrderAddressId['max'])) { + $this->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $invoiceOrderAddressId['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { @@ -461,22 +473,22 @@ abstract class OrderQuery extends ModelCriteria } } - return $this->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $addressInvoice, $comparison); + return $this->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $invoiceOrderAddressId, $comparison); } /** - * Filter the query on the address_delivery column + * Filter the query on the delivery_order_address_id column * * Example usage: * - * $query->filterByAddressDelivery(1234); // WHERE address_delivery = 1234 - * $query->filterByAddressDelivery(array(12, 34)); // WHERE address_delivery IN (12, 34) - * $query->filterByAddressDelivery(array('min' => 12)); // WHERE address_delivery > 12 + * $query->filterByDeliveryOrderAddressId(1234); // WHERE delivery_order_address_id = 1234 + * $query->filterByDeliveryOrderAddressId(array(12, 34)); // WHERE delivery_order_address_id IN (12, 34) + * $query->filterByDeliveryOrderAddressId(array('min' => 12)); // WHERE delivery_order_address_id > 12 * * - * @see filterByOrderAddressRelatedByAddressDelivery() + * @see filterByOrderAddressRelatedByDeliveryOrderAddressId() * - * @param mixed $addressDelivery The value to use as filter. + * @param mixed $deliveryOrderAddressId The value to use as filter. * Use scalar values for equality. * Use array values for in_array() equivalent. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. @@ -484,16 +496,16 @@ abstract class OrderQuery extends ModelCriteria * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByAddressDelivery($addressDelivery = null, $comparison = null) + public function filterByDeliveryOrderAddressId($deliveryOrderAddressId = null, $comparison = null) { - if (is_array($addressDelivery)) { + if (is_array($deliveryOrderAddressId)) { $useMinMax = false; - if (isset($addressDelivery['min'])) { - $this->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $addressDelivery['min'], Criteria::GREATER_EQUAL); + if (isset($deliveryOrderAddressId['min'])) { + $this->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $deliveryOrderAddressId['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } - if (isset($addressDelivery['max'])) { - $this->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $addressDelivery['max'], Criteria::LESS_EQUAL); + if (isset($deliveryOrderAddressId['max'])) { + $this->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $deliveryOrderAddressId['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { @@ -504,7 +516,7 @@ abstract class OrderQuery extends ModelCriteria } } - return $this->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $addressDelivery, $comparison); + return $this->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $deliveryOrderAddressId, $comparison); } /** @@ -635,90 +647,90 @@ abstract class OrderQuery extends ModelCriteria } /** - * Filter the query on the transaction column + * Filter the query on the transaction_ref column * * Example usage: * - * $query->filterByTransaction('fooValue'); // WHERE transaction = 'fooValue' - * $query->filterByTransaction('%fooValue%'); // WHERE transaction LIKE '%fooValue%' + * $query->filterByTransactionRef('fooValue'); // WHERE transaction_ref = 'fooValue' + * $query->filterByTransactionRef('%fooValue%'); // WHERE transaction_ref LIKE '%fooValue%' * * - * @param string $transaction The value to use as filter. + * @param string $transactionRef The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByTransaction($transaction = null, $comparison = null) + public function filterByTransactionRef($transactionRef = null, $comparison = null) { if (null === $comparison) { - if (is_array($transaction)) { + if (is_array($transactionRef)) { $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $transaction)) { - $transaction = str_replace('*', '%', $transaction); + } elseif (preg_match('/[\%\*]/', $transactionRef)) { + $transactionRef = str_replace('*', '%', $transactionRef); $comparison = Criteria::LIKE; } } - return $this->addUsingAlias(OrderTableMap::TRANSACTION, $transaction, $comparison); + return $this->addUsingAlias(OrderTableMap::TRANSACTION_REF, $transactionRef, $comparison); } /** - * Filter the query on the delivery_num column + * Filter the query on the delivery_ref column * * Example usage: * - * $query->filterByDeliveryNum('fooValue'); // WHERE delivery_num = 'fooValue' - * $query->filterByDeliveryNum('%fooValue%'); // WHERE delivery_num LIKE '%fooValue%' + * $query->filterByDeliveryRef('fooValue'); // WHERE delivery_ref = 'fooValue' + * $query->filterByDeliveryRef('%fooValue%'); // WHERE delivery_ref LIKE '%fooValue%' * * - * @param string $deliveryNum The value to use as filter. + * @param string $deliveryRef The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByDeliveryNum($deliveryNum = null, $comparison = null) + public function filterByDeliveryRef($deliveryRef = null, $comparison = null) { if (null === $comparison) { - if (is_array($deliveryNum)) { + if (is_array($deliveryRef)) { $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $deliveryNum)) { - $deliveryNum = str_replace('*', '%', $deliveryNum); + } elseif (preg_match('/[\%\*]/', $deliveryRef)) { + $deliveryRef = str_replace('*', '%', $deliveryRef); $comparison = Criteria::LIKE; } } - return $this->addUsingAlias(OrderTableMap::DELIVERY_NUM, $deliveryNum, $comparison); + return $this->addUsingAlias(OrderTableMap::DELIVERY_REF, $deliveryRef, $comparison); } /** - * Filter the query on the invoice column + * Filter the query on the invoice_ref column * * Example usage: * - * $query->filterByInvoice('fooValue'); // WHERE invoice = 'fooValue' - * $query->filterByInvoice('%fooValue%'); // WHERE invoice LIKE '%fooValue%' + * $query->filterByInvoiceRef('fooValue'); // WHERE invoice_ref = 'fooValue' + * $query->filterByInvoiceRef('%fooValue%'); // WHERE invoice_ref LIKE '%fooValue%' * * - * @param string $invoice The value to use as filter. + * @param string $invoiceRef The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByInvoice($invoice = null, $comparison = null) + public function filterByInvoiceRef($invoiceRef = null, $comparison = null) { if (null === $comparison) { - if (is_array($invoice)) { + if (is_array($invoiceRef)) { $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $invoice)) { - $invoice = str_replace('*', '%', $invoice); + } elseif (preg_match('/[\%\*]/', $invoiceRef)) { + $invoiceRef = str_replace('*', '%', $invoiceRef); $comparison = Criteria::LIKE; } } - return $this->addUsingAlias(OrderTableMap::INVOICE, $invoice, $comparison); + return $this->addUsingAlias(OrderTableMap::INVOICE_REF, $invoiceRef, $comparison); } /** @@ -763,61 +775,89 @@ abstract class OrderQuery extends ModelCriteria } /** - * Filter the query on the payment column + * Filter the query on the payment_module_id column * * Example usage: * - * $query->filterByPayment('fooValue'); // WHERE payment = 'fooValue' - * $query->filterByPayment('%fooValue%'); // WHERE payment LIKE '%fooValue%' + * $query->filterByPaymentModuleId(1234); // WHERE payment_module_id = 1234 + * $query->filterByPaymentModuleId(array(12, 34)); // WHERE payment_module_id IN (12, 34) + * $query->filterByPaymentModuleId(array('min' => 12)); // WHERE payment_module_id > 12 * * - * @param string $payment The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) + * @see filterByModuleRelatedByPaymentModuleId() + * + * @param mixed $paymentModuleId The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByPayment($payment = null, $comparison = null) + public function filterByPaymentModuleId($paymentModuleId = null, $comparison = null) { - if (null === $comparison) { - if (is_array($payment)) { + if (is_array($paymentModuleId)) { + $useMinMax = false; + if (isset($paymentModuleId['min'])) { + $this->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $paymentModuleId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($paymentModuleId['max'])) { + $this->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $paymentModuleId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $payment)) { - $payment = str_replace('*', '%', $payment); - $comparison = Criteria::LIKE; } } - return $this->addUsingAlias(OrderTableMap::PAYMENT, $payment, $comparison); + return $this->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $paymentModuleId, $comparison); } /** - * Filter the query on the carrier column + * Filter the query on the delivery_module_id column * * Example usage: * - * $query->filterByCarrier('fooValue'); // WHERE carrier = 'fooValue' - * $query->filterByCarrier('%fooValue%'); // WHERE carrier LIKE '%fooValue%' + * $query->filterByDeliveryModuleId(1234); // WHERE delivery_module_id = 1234 + * $query->filterByDeliveryModuleId(array(12, 34)); // WHERE delivery_module_id IN (12, 34) + * $query->filterByDeliveryModuleId(array('min' => 12)); // WHERE delivery_module_id > 12 * * - * @param string $carrier The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) + * @see filterByModuleRelatedByDeliveryModuleId() + * + * @param mixed $deliveryModuleId The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByCarrier($carrier = null, $comparison = null) + public function filterByDeliveryModuleId($deliveryModuleId = null, $comparison = null) { - if (null === $comparison) { - if (is_array($carrier)) { + if (is_array($deliveryModuleId)) { + $useMinMax = false; + if (isset($deliveryModuleId['min'])) { + $this->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $deliveryModuleId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($deliveryModuleId['max'])) { + $this->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $deliveryModuleId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $carrier)) { - $carrier = str_replace('*', '%', $carrier); - $comparison = Criteria::LIKE; } } - return $this->addUsingAlias(OrderTableMap::CARRIER, $carrier, $comparison); + return $this->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $deliveryModuleId, $comparison); } /** @@ -864,32 +904,46 @@ abstract class OrderQuery extends ModelCriteria } /** - * Filter the query on the lang column + * Filter the query on the lang_id column * * Example usage: * - * $query->filterByLang('fooValue'); // WHERE lang = 'fooValue' - * $query->filterByLang('%fooValue%'); // WHERE lang LIKE '%fooValue%' + * $query->filterByLangId(1234); // WHERE lang_id = 1234 + * $query->filterByLangId(array(12, 34)); // WHERE lang_id IN (12, 34) + * $query->filterByLangId(array('min' => 12)); // WHERE lang_id > 12 * * - * @param string $lang The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) + * @see filterByLang() + * + * @param mixed $langId The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByLang($lang = null, $comparison = null) + public function filterByLangId($langId = null, $comparison = null) { - if (null === $comparison) { - if (is_array($lang)) { + if (is_array($langId)) { + $useMinMax = false; + if (isset($langId['min'])) { + $this->addUsingAlias(OrderTableMap::LANG_ID, $langId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($langId['max'])) { + $this->addUsingAlias(OrderTableMap::LANG_ID, $langId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $lang)) { - $lang = str_replace('*', '%', $lang); - $comparison = Criteria::LIKE; } } - return $this->addUsingAlias(OrderTableMap::LANG, $lang, $comparison); + return $this->addUsingAlias(OrderTableMap::LANG_ID, $langId, $comparison); } /** @@ -1011,7 +1065,7 @@ abstract class OrderQuery extends ModelCriteria * * @return ChildOrderQuery The current query, for fluid interface */ - public function joinCurrency($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinCurrency($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Currency'); @@ -1046,7 +1100,7 @@ abstract class OrderQuery extends ModelCriteria * * @return \Thelia\Model\CurrencyQuery A secondary query class using the current class as primary query */ - public function useCurrencyQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useCurrencyQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinCurrency($relationAlias, $joinType) @@ -1136,35 +1190,35 @@ abstract class OrderQuery extends ModelCriteria * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByOrderAddressRelatedByAddressInvoice($orderAddress, $comparison = null) + public function filterByOrderAddressRelatedByInvoiceOrderAddressId($orderAddress, $comparison = null) { if ($orderAddress instanceof \Thelia\Model\OrderAddress) { return $this - ->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $orderAddress->getId(), $comparison); + ->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $orderAddress->getId(), $comparison); } elseif ($orderAddress instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this - ->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison); + ->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { - throw new PropelException('filterByOrderAddressRelatedByAddressInvoice() only accepts arguments of type \Thelia\Model\OrderAddress or Collection'); + throw new PropelException('filterByOrderAddressRelatedByInvoiceOrderAddressId() only accepts arguments of type \Thelia\Model\OrderAddress or Collection'); } } /** - * Adds a JOIN clause to the query using the OrderAddressRelatedByAddressInvoice relation + * Adds a JOIN clause to the query using the OrderAddressRelatedByInvoiceOrderAddressId relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return ChildOrderQuery The current query, for fluid interface */ - public function joinOrderAddressRelatedByAddressInvoice($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('OrderAddressRelatedByAddressInvoice'); + $relationMap = $tableMap->getRelation('OrderAddressRelatedByInvoiceOrderAddressId'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -1179,14 +1233,14 @@ abstract class OrderQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'OrderAddressRelatedByAddressInvoice'); + $this->addJoinObject($join, 'OrderAddressRelatedByInvoiceOrderAddressId'); } return $this; } /** - * Use the OrderAddressRelatedByAddressInvoice relation OrderAddress object + * Use the OrderAddressRelatedByInvoiceOrderAddressId relation OrderAddress object * * @see useQuery() * @@ -1196,11 +1250,11 @@ abstract class OrderQuery extends ModelCriteria * * @return \Thelia\Model\OrderAddressQuery A secondary query class using the current class as primary query */ - public function useOrderAddressRelatedByAddressInvoiceQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useOrderAddressRelatedByInvoiceOrderAddressIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this - ->joinOrderAddressRelatedByAddressInvoice($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'OrderAddressRelatedByAddressInvoice', '\Thelia\Model\OrderAddressQuery'); + ->joinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'OrderAddressRelatedByInvoiceOrderAddressId', '\Thelia\Model\OrderAddressQuery'); } /** @@ -1211,35 +1265,35 @@ abstract class OrderQuery extends ModelCriteria * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByOrderAddressRelatedByAddressDelivery($orderAddress, $comparison = null) + public function filterByOrderAddressRelatedByDeliveryOrderAddressId($orderAddress, $comparison = null) { if ($orderAddress instanceof \Thelia\Model\OrderAddress) { return $this - ->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $orderAddress->getId(), $comparison); + ->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $orderAddress->getId(), $comparison); } elseif ($orderAddress instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this - ->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison); + ->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { - throw new PropelException('filterByOrderAddressRelatedByAddressDelivery() only accepts arguments of type \Thelia\Model\OrderAddress or Collection'); + throw new PropelException('filterByOrderAddressRelatedByDeliveryOrderAddressId() only accepts arguments of type \Thelia\Model\OrderAddress or Collection'); } } /** - * Adds a JOIN clause to the query using the OrderAddressRelatedByAddressDelivery relation + * Adds a JOIN clause to the query using the OrderAddressRelatedByDeliveryOrderAddressId relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return ChildOrderQuery The current query, for fluid interface */ - public function joinOrderAddressRelatedByAddressDelivery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('OrderAddressRelatedByAddressDelivery'); + $relationMap = $tableMap->getRelation('OrderAddressRelatedByDeliveryOrderAddressId'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -1254,14 +1308,14 @@ abstract class OrderQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'OrderAddressRelatedByAddressDelivery'); + $this->addJoinObject($join, 'OrderAddressRelatedByDeliveryOrderAddressId'); } return $this; } /** - * Use the OrderAddressRelatedByAddressDelivery relation OrderAddress object + * Use the OrderAddressRelatedByDeliveryOrderAddressId relation OrderAddress object * * @see useQuery() * @@ -1271,11 +1325,11 @@ abstract class OrderQuery extends ModelCriteria * * @return \Thelia\Model\OrderAddressQuery A secondary query class using the current class as primary query */ - public function useOrderAddressRelatedByAddressDeliveryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useOrderAddressRelatedByDeliveryOrderAddressIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this - ->joinOrderAddressRelatedByAddressDelivery($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'OrderAddressRelatedByAddressDelivery', '\Thelia\Model\OrderAddressQuery'); + ->joinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'OrderAddressRelatedByDeliveryOrderAddressId', '\Thelia\Model\OrderAddressQuery'); } /** @@ -1311,7 +1365,7 @@ abstract class OrderQuery extends ModelCriteria * * @return ChildOrderQuery The current query, for fluid interface */ - public function joinOrderStatus($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinOrderStatus($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('OrderStatus'); @@ -1346,13 +1400,238 @@ abstract class OrderQuery extends ModelCriteria * * @return \Thelia\Model\OrderStatusQuery A secondary query class using the current class as primary query */ - public function useOrderStatusQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useOrderStatusQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinOrderStatus($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'OrderStatus', '\Thelia\Model\OrderStatusQuery'); } + /** + * Filter the query by a related \Thelia\Model\Module object + * + * @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildOrderQuery The current query, for fluid interface + */ + public function filterByModuleRelatedByPaymentModuleId($module, $comparison = null) + { + if ($module instanceof \Thelia\Model\Module) { + return $this + ->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $module->getId(), $comparison); + } elseif ($module instanceof ObjectCollection) { + if (null === $comparison) { + $comparison = Criteria::IN; + } + + return $this + ->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison); + } else { + throw new PropelException('filterByModuleRelatedByPaymentModuleId() only accepts arguments of type \Thelia\Model\Module or Collection'); + } + } + + /** + * Adds a JOIN clause to the query using the ModuleRelatedByPaymentModuleId relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return ChildOrderQuery The current query, for fluid interface + */ + public function joinModuleRelatedByPaymentModuleId($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('ModuleRelatedByPaymentModuleId'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'ModuleRelatedByPaymentModuleId'); + } + + return $this; + } + + /** + * Use the ModuleRelatedByPaymentModuleId relation Module object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return \Thelia\Model\ModuleQuery A secondary query class using the current class as primary query + */ + public function useModuleRelatedByPaymentModuleIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + return $this + ->joinModuleRelatedByPaymentModuleId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'ModuleRelatedByPaymentModuleId', '\Thelia\Model\ModuleQuery'); + } + + /** + * Filter the query by a related \Thelia\Model\Module object + * + * @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildOrderQuery The current query, for fluid interface + */ + public function filterByModuleRelatedByDeliveryModuleId($module, $comparison = null) + { + if ($module instanceof \Thelia\Model\Module) { + return $this + ->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $module->getId(), $comparison); + } elseif ($module instanceof ObjectCollection) { + if (null === $comparison) { + $comparison = Criteria::IN; + } + + return $this + ->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison); + } else { + throw new PropelException('filterByModuleRelatedByDeliveryModuleId() only accepts arguments of type \Thelia\Model\Module or Collection'); + } + } + + /** + * Adds a JOIN clause to the query using the ModuleRelatedByDeliveryModuleId relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return ChildOrderQuery The current query, for fluid interface + */ + public function joinModuleRelatedByDeliveryModuleId($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('ModuleRelatedByDeliveryModuleId'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'ModuleRelatedByDeliveryModuleId'); + } + + return $this; + } + + /** + * Use the ModuleRelatedByDeliveryModuleId relation Module object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return \Thelia\Model\ModuleQuery A secondary query class using the current class as primary query + */ + public function useModuleRelatedByDeliveryModuleIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + return $this + ->joinModuleRelatedByDeliveryModuleId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'ModuleRelatedByDeliveryModuleId', '\Thelia\Model\ModuleQuery'); + } + + /** + * Filter the query by a related \Thelia\Model\Lang object + * + * @param \Thelia\Model\Lang|ObjectCollection $lang The related object(s) to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildOrderQuery The current query, for fluid interface + */ + public function filterByLang($lang, $comparison = null) + { + if ($lang instanceof \Thelia\Model\Lang) { + return $this + ->addUsingAlias(OrderTableMap::LANG_ID, $lang->getId(), $comparison); + } elseif ($lang instanceof ObjectCollection) { + if (null === $comparison) { + $comparison = Criteria::IN; + } + + return $this + ->addUsingAlias(OrderTableMap::LANG_ID, $lang->toKeyValue('PrimaryKey', 'Id'), $comparison); + } else { + throw new PropelException('filterByLang() only accepts arguments of type \Thelia\Model\Lang or Collection'); + } + } + + /** + * Adds a JOIN clause to the query using the Lang relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return ChildOrderQuery The current query, for fluid interface + */ + public function joinLang($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('Lang'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'Lang'); + } + + return $this; + } + + /** + * Use the Lang relation Lang object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return \Thelia\Model\LangQuery A secondary query class using the current class as primary query + */ + public function useLangQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + return $this + ->joinLang($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'Lang', '\Thelia\Model\LangQuery'); + } + /** * Filter the query by a related \Thelia\Model\OrderProduct object * diff --git a/core/lib/Thelia/Model/Base/OrderStatus.php b/core/lib/Thelia/Model/Base/OrderStatus.php index d249b4865..5771072f2 100644 --- a/core/lib/Thelia/Model/Base/OrderStatus.php +++ b/core/lib/Thelia/Model/Base/OrderStatus.php @@ -791,10 +791,9 @@ abstract class OrderStatus implements ActiveRecordInterface if ($this->ordersScheduledForDeletion !== null) { if (!$this->ordersScheduledForDeletion->isEmpty()) { - foreach ($this->ordersScheduledForDeletion as $order) { - // need to save related object because we set the relation to null - $order->save($con); - } + \Thelia\Model\OrderQuery::create() + ->filterByPrimaryKeys($this->ordersScheduledForDeletion->getPrimaryKeys(false)) + ->delete($con); $this->ordersScheduledForDeletion = null; } } @@ -1439,7 +1438,7 @@ abstract class OrderStatus implements ActiveRecordInterface $this->ordersScheduledForDeletion = clone $this->collOrders; $this->ordersScheduledForDeletion->clear(); } - $this->ordersScheduledForDeletion[]= $order; + $this->ordersScheduledForDeletion[]= clone $order; $order->setOrderStatus(null); } @@ -1513,10 +1512,10 @@ abstract class OrderStatus implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersJoinOrderAddressRelatedByAddressInvoice($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); - $query->joinWith('OrderAddressRelatedByAddressInvoice', $joinBehavior); + $query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior); return $this->getOrders($query, $con); } @@ -1538,10 +1537,85 @@ abstract class OrderStatus implements ActiveRecordInterface * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return Collection|ChildOrder[] List of ChildOrder objects */ - public function getOrdersJoinOrderAddressRelatedByAddressDelivery($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + public function getOrdersJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildOrderQuery::create(null, $criteria); - $query->joinWith('OrderAddressRelatedByAddressDelivery', $joinBehavior); + $query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this OrderStatus is new, it will return + * an empty collection; or if this OrderStatus has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in OrderStatus. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this OrderStatus is new, it will return + * an empty collection; or if this OrderStatus has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in OrderStatus. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior); + + return $this->getOrders($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this OrderStatus is new, it will return + * an empty collection; or if this OrderStatus has previously + * been saved, it will retrieve related Orders from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in OrderStatus. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param ConnectionInterface $con optional connection object + * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return Collection|ChildOrder[] List of ChildOrder objects + */ + public function getOrdersJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) + { + $query = ChildOrderQuery::create(null, $criteria); + $query->joinWith('Lang', $joinBehavior); return $this->getOrders($query, $con); } diff --git a/core/lib/Thelia/Model/Base/OrderStatusQuery.php b/core/lib/Thelia/Model/Base/OrderStatusQuery.php index 908efd6b6..7050b4a5a 100644 --- a/core/lib/Thelia/Model/Base/OrderStatusQuery.php +++ b/core/lib/Thelia/Model/Base/OrderStatusQuery.php @@ -420,7 +420,7 @@ abstract class OrderStatusQuery extends ModelCriteria * * @return ChildOrderStatusQuery The current query, for fluid interface */ - public function joinOrder($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Order'); @@ -455,7 +455,7 @@ abstract class OrderStatusQuery extends ModelCriteria * * @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query */ - public function useOrderQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinOrder($relationAlias, $joinType) diff --git a/core/lib/Thelia/Model/Base/ProductCategory.php b/core/lib/Thelia/Model/Base/ProductCategory.php index 62a6ea425..2c6db3184 100644 --- a/core/lib/Thelia/Model/Base/ProductCategory.php +++ b/core/lib/Thelia/Model/Base/ProductCategory.php @@ -70,6 +70,12 @@ abstract class ProductCategory implements ActiveRecordInterface */ protected $category_id; + /** + * The value for the default_category field. + * @var boolean + */ + protected $default_category; + /** * The value for the created_at field. * @var string @@ -376,6 +382,17 @@ abstract class ProductCategory implements ActiveRecordInterface return $this->category_id; } + /** + * Get the [default_category] column value. + * + * @return boolean + */ + public function getDefaultCategory() + { + + return $this->default_category; + } + /** * Get the [optionally formatted] temporal [created_at] column value. * @@ -466,6 +483,35 @@ abstract class ProductCategory implements ActiveRecordInterface return $this; } // setCategoryId() + /** + * Sets the value of the [default_category] column. + * Non-boolean arguments are converted using the following rules: + * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true + * * 0, '0', 'false', 'off', and 'no' are converted to boolean false + * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). + * + * @param boolean|integer|string $v The new value + * @return \Thelia\Model\ProductCategory The current object (for fluent API support) + */ + public function setDefaultCategory($v) + { + if ($v !== null) { + if (is_string($v)) { + $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; + } else { + $v = (boolean) $v; + } + } + + if ($this->default_category !== $v) { + $this->default_category = $v; + $this->modifiedColumns[] = ProductCategoryTableMap::DEFAULT_CATEGORY; + } + + + return $this; + } // setDefaultCategory() + /** * Sets the value of [created_at] column to a normalized version of the date/time value specified. * @@ -551,13 +597,16 @@ abstract class ProductCategory implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ProductCategoryTableMap::translateFieldName('CategoryId', TableMap::TYPE_PHPNAME, $indexType)]; $this->category_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProductCategoryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProductCategoryTableMap::translateFieldName('DefaultCategory', TableMap::TYPE_PHPNAME, $indexType)]; + $this->default_category = (null !== $col) ? (boolean) $col : null; + + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductCategoryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductCategoryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductCategoryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -570,7 +619,7 @@ abstract class ProductCategory implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 4; // 4 = ProductCategoryTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 5; // 5 = ProductCategoryTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating \Thelia\Model\ProductCategory object", 0, $e); @@ -819,6 +868,9 @@ abstract class ProductCategory implements ActiveRecordInterface if ($this->isColumnModified(ProductCategoryTableMap::CATEGORY_ID)) { $modifiedColumns[':p' . $index++] = 'CATEGORY_ID'; } + if ($this->isColumnModified(ProductCategoryTableMap::DEFAULT_CATEGORY)) { + $modifiedColumns[':p' . $index++] = 'DEFAULT_CATEGORY'; + } if ($this->isColumnModified(ProductCategoryTableMap::CREATED_AT)) { $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } @@ -842,6 +894,9 @@ abstract class ProductCategory implements ActiveRecordInterface case 'CATEGORY_ID': $stmt->bindValue($identifier, $this->category_id, PDO::PARAM_INT); break; + case 'DEFAULT_CATEGORY': + $stmt->bindValue($identifier, (int) $this->default_category, PDO::PARAM_INT); + break; case 'CREATED_AT': $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); break; @@ -910,9 +965,12 @@ abstract class ProductCategory implements ActiveRecordInterface return $this->getCategoryId(); break; case 2: - return $this->getCreatedAt(); + return $this->getDefaultCategory(); break; case 3: + return $this->getCreatedAt(); + break; + case 4: return $this->getUpdatedAt(); break; default: @@ -946,8 +1004,9 @@ abstract class ProductCategory implements ActiveRecordInterface $result = array( $keys[0] => $this->getProductId(), $keys[1] => $this->getCategoryId(), - $keys[2] => $this->getCreatedAt(), - $keys[3] => $this->getUpdatedAt(), + $keys[2] => $this->getDefaultCategory(), + $keys[3] => $this->getCreatedAt(), + $keys[4] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach($virtualColumns as $key => $virtualColumn) @@ -1003,9 +1062,12 @@ abstract class ProductCategory implements ActiveRecordInterface $this->setCategoryId($value); break; case 2: - $this->setCreatedAt($value); + $this->setDefaultCategory($value); break; case 3: + $this->setCreatedAt($value); + break; + case 4: $this->setUpdatedAt($value); break; } // switch() @@ -1034,8 +1096,9 @@ abstract class ProductCategory implements ActiveRecordInterface if (array_key_exists($keys[0], $arr)) $this->setProductId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setCategoryId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setCreatedAt($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]); + if (array_key_exists($keys[2], $arr)) $this->setDefaultCategory($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]); } /** @@ -1049,6 +1112,7 @@ abstract class ProductCategory implements ActiveRecordInterface if ($this->isColumnModified(ProductCategoryTableMap::PRODUCT_ID)) $criteria->add(ProductCategoryTableMap::PRODUCT_ID, $this->product_id); if ($this->isColumnModified(ProductCategoryTableMap::CATEGORY_ID)) $criteria->add(ProductCategoryTableMap::CATEGORY_ID, $this->category_id); + if ($this->isColumnModified(ProductCategoryTableMap::DEFAULT_CATEGORY)) $criteria->add(ProductCategoryTableMap::DEFAULT_CATEGORY, $this->default_category); if ($this->isColumnModified(ProductCategoryTableMap::CREATED_AT)) $criteria->add(ProductCategoryTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(ProductCategoryTableMap::UPDATED_AT)) $criteria->add(ProductCategoryTableMap::UPDATED_AT, $this->updated_at); @@ -1123,6 +1187,7 @@ abstract class ProductCategory implements ActiveRecordInterface { $copyObj->setProductId($this->getProductId()); $copyObj->setCategoryId($this->getCategoryId()); + $copyObj->setDefaultCategory($this->getDefaultCategory()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); if ($makeNew) { @@ -1261,6 +1326,7 @@ abstract class ProductCategory implements ActiveRecordInterface { $this->product_id = null; $this->category_id = null; + $this->default_category = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; diff --git a/core/lib/Thelia/Model/Base/ProductCategoryQuery.php b/core/lib/Thelia/Model/Base/ProductCategoryQuery.php index fd40e93c7..df9fc630b 100644 --- a/core/lib/Thelia/Model/Base/ProductCategoryQuery.php +++ b/core/lib/Thelia/Model/Base/ProductCategoryQuery.php @@ -23,11 +23,13 @@ use Thelia\Model\Map\ProductCategoryTableMap; * * @method ChildProductCategoryQuery orderByProductId($order = Criteria::ASC) Order by the product_id column * @method ChildProductCategoryQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column + * @method ChildProductCategoryQuery orderByDefaultCategory($order = Criteria::ASC) Order by the default_category column * @method ChildProductCategoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildProductCategoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * * @method ChildProductCategoryQuery groupByProductId() Group by the product_id column * @method ChildProductCategoryQuery groupByCategoryId() Group by the category_id column + * @method ChildProductCategoryQuery groupByDefaultCategory() Group by the default_category column * @method ChildProductCategoryQuery groupByCreatedAt() Group by the created_at column * @method ChildProductCategoryQuery groupByUpdatedAt() Group by the updated_at column * @@ -48,11 +50,13 @@ use Thelia\Model\Map\ProductCategoryTableMap; * * @method ChildProductCategory findOneByProductId(int $product_id) Return the first ChildProductCategory filtered by the product_id column * @method ChildProductCategory findOneByCategoryId(int $category_id) Return the first ChildProductCategory filtered by the category_id column + * @method ChildProductCategory findOneByDefaultCategory(boolean $default_category) Return the first ChildProductCategory filtered by the default_category column * @method ChildProductCategory findOneByCreatedAt(string $created_at) Return the first ChildProductCategory filtered by the created_at column * @method ChildProductCategory findOneByUpdatedAt(string $updated_at) Return the first ChildProductCategory filtered by the updated_at column * * @method array findByProductId(int $product_id) Return ChildProductCategory objects filtered by the product_id column * @method array findByCategoryId(int $category_id) Return ChildProductCategory objects filtered by the category_id column + * @method array findByDefaultCategory(boolean $default_category) Return ChildProductCategory objects filtered by the default_category column * @method array findByCreatedAt(string $created_at) Return ChildProductCategory objects filtered by the created_at column * @method array findByUpdatedAt(string $updated_at) Return ChildProductCategory objects filtered by the updated_at column * @@ -143,7 +147,7 @@ abstract class ProductCategoryQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT PRODUCT_ID, CATEGORY_ID, CREATED_AT, UPDATED_AT FROM product_category WHERE PRODUCT_ID = :p0 AND CATEGORY_ID = :p1'; + $sql = 'SELECT PRODUCT_ID, CATEGORY_ID, DEFAULT_CATEGORY, CREATED_AT, UPDATED_AT FROM product_category WHERE PRODUCT_ID = :p0 AND CATEGORY_ID = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); @@ -330,6 +334,33 @@ abstract class ProductCategoryQuery extends ModelCriteria return $this->addUsingAlias(ProductCategoryTableMap::CATEGORY_ID, $categoryId, $comparison); } + /** + * Filter the query on the default_category column + * + * Example usage: + * + * $query->filterByDefaultCategory(true); // WHERE default_category = true + * $query->filterByDefaultCategory('yes'); // WHERE default_category = true + * + * + * @param boolean|string $defaultCategory The value to use as filter. + * Non-boolean arguments are converted using the following rules: + * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true + * * 0, '0', 'false', 'off', and 'no' are converted to boolean false + * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildProductCategoryQuery The current query, for fluid interface + */ + public function filterByDefaultCategory($defaultCategory = null, $comparison = null) + { + if (is_string($defaultCategory)) { + $default_category = in_array(strtolower($defaultCategory), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; + } + + return $this->addUsingAlias(ProductCategoryTableMap::DEFAULT_CATEGORY, $defaultCategory, $comparison); + } + /** * Filter the query on the created_at column * diff --git a/core/lib/Thelia/Model/Map/ContentFolderTableMap.php b/core/lib/Thelia/Model/Map/ContentFolderTableMap.php index 4fedae441..9808399ff 100644 --- a/core/lib/Thelia/Model/Map/ContentFolderTableMap.php +++ b/core/lib/Thelia/Model/Map/ContentFolderTableMap.php @@ -57,7 +57,7 @@ class ContentFolderTableMap extends TableMap /** * The total number of columns */ - const NUM_COLUMNS = 4; + const NUM_COLUMNS = 5; /** * The number of lazy-loaded columns @@ -67,7 +67,7 @@ class ContentFolderTableMap extends TableMap /** * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 4; + const NUM_HYDRATE_COLUMNS = 5; /** * the column name for the CONTENT_ID field @@ -79,6 +79,11 @@ class ContentFolderTableMap extends TableMap */ const FOLDER_ID = 'content_folder.FOLDER_ID'; + /** + * the column name for the DEFAULT_FOLDER field + */ + const DEFAULT_FOLDER = 'content_folder.DEFAULT_FOLDER'; + /** * the column name for the CREATED_AT field */ @@ -101,12 +106,12 @@ class ContentFolderTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('ContentId', 'FolderId', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('contentId', 'folderId', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(ContentFolderTableMap::CONTENT_ID, ContentFolderTableMap::FOLDER_ID, ContentFolderTableMap::CREATED_AT, ContentFolderTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('CONTENT_ID', 'FOLDER_ID', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('content_id', 'folder_id', 'created_at', 'updated_at', ), - self::TYPE_NUM => array(0, 1, 2, 3, ) + self::TYPE_PHPNAME => array('ContentId', 'FolderId', 'DefaultFolder', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('contentId', 'folderId', 'defaultFolder', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(ContentFolderTableMap::CONTENT_ID, ContentFolderTableMap::FOLDER_ID, ContentFolderTableMap::DEFAULT_FOLDER, ContentFolderTableMap::CREATED_AT, ContentFolderTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('CONTENT_ID', 'FOLDER_ID', 'DEFAULT_FOLDER', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('content_id', 'folder_id', 'default_folder', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -116,12 +121,12 @@ class ContentFolderTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('ContentId' => 0, 'FolderId' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ), - self::TYPE_STUDLYPHPNAME => array('contentId' => 0, 'folderId' => 1, 'createdAt' => 2, 'updatedAt' => 3, ), - self::TYPE_COLNAME => array(ContentFolderTableMap::CONTENT_ID => 0, ContentFolderTableMap::FOLDER_ID => 1, ContentFolderTableMap::CREATED_AT => 2, ContentFolderTableMap::UPDATED_AT => 3, ), - self::TYPE_RAW_COLNAME => array('CONTENT_ID' => 0, 'FOLDER_ID' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ), - self::TYPE_FIELDNAME => array('content_id' => 0, 'folder_id' => 1, 'created_at' => 2, 'updated_at' => 3, ), - self::TYPE_NUM => array(0, 1, 2, 3, ) + self::TYPE_PHPNAME => array('ContentId' => 0, 'FolderId' => 1, 'DefaultFolder' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ), + self::TYPE_STUDLYPHPNAME => array('contentId' => 0, 'folderId' => 1, 'defaultFolder' => 2, 'createdAt' => 3, 'updatedAt' => 4, ), + self::TYPE_COLNAME => array(ContentFolderTableMap::CONTENT_ID => 0, ContentFolderTableMap::FOLDER_ID => 1, ContentFolderTableMap::DEFAULT_FOLDER => 2, ContentFolderTableMap::CREATED_AT => 3, ContentFolderTableMap::UPDATED_AT => 4, ), + self::TYPE_RAW_COLNAME => array('CONTENT_ID' => 0, 'FOLDER_ID' => 1, 'DEFAULT_FOLDER' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ), + self::TYPE_FIELDNAME => array('content_id' => 0, 'folder_id' => 1, 'default_folder' => 2, 'created_at' => 3, 'updated_at' => 4, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -143,6 +148,7 @@ class ContentFolderTableMap extends TableMap // columns $this->addForeignPrimaryKey('CONTENT_ID', 'ContentId', 'INTEGER' , 'content', 'ID', true, null, null); $this->addForeignPrimaryKey('FOLDER_ID', 'FolderId', 'INTEGER' , 'folder', 'ID', true, null, null); + $this->addColumn('DEFAULT_FOLDER', 'DefaultFolder', 'BOOLEAN', false, 1, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); } // initialize() @@ -358,11 +364,13 @@ class ContentFolderTableMap extends TableMap if (null === $alias) { $criteria->addSelectColumn(ContentFolderTableMap::CONTENT_ID); $criteria->addSelectColumn(ContentFolderTableMap::FOLDER_ID); + $criteria->addSelectColumn(ContentFolderTableMap::DEFAULT_FOLDER); $criteria->addSelectColumn(ContentFolderTableMap::CREATED_AT); $criteria->addSelectColumn(ContentFolderTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.CONTENT_ID'); $criteria->addSelectColumn($alias . '.FOLDER_ID'); + $criteria->addSelectColumn($alias . '.DEFAULT_FOLDER'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); } diff --git a/core/lib/Thelia/Model/Map/CurrencyTableMap.php b/core/lib/Thelia/Model/Map/CurrencyTableMap.php index b37a6b30a..9c0e65296 100644 --- a/core/lib/Thelia/Model/Map/CurrencyTableMap.php +++ b/core/lib/Thelia/Model/Map/CurrencyTableMap.php @@ -184,7 +184,7 @@ class CurrencyTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), 'SET NULL', 'RESTRICT', 'Orders'); + $this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), 'RESTRICT', 'RESTRICT', 'Orders'); $this->addRelation('Cart', '\\Thelia\\Model\\Cart', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), null, null, 'Carts'); $this->addRelation('ProductPrice', '\\Thelia\\Model\\ProductPrice', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), 'CASCADE', null, 'ProductPrices'); $this->addRelation('CurrencyI18n', '\\Thelia\\Model\\CurrencyI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CurrencyI18ns'); @@ -210,7 +210,6 @@ class CurrencyTableMap extends TableMap { // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - OrderTableMap::clearInstancePool(); ProductPriceTableMap::clearInstancePool(); CurrencyI18nTableMap::clearInstancePool(); } diff --git a/core/lib/Thelia/Model/Map/CustomerTableMap.php b/core/lib/Thelia/Model/Map/CustomerTableMap.php index 32ccf07ee..4dd1c3e7d 100644 --- a/core/lib/Thelia/Model/Map/CustomerTableMap.php +++ b/core/lib/Thelia/Model/Map/CustomerTableMap.php @@ -225,7 +225,7 @@ class CustomerTableMap extends TableMap { $this->addRelation('CustomerTitle', '\\Thelia\\Model\\CustomerTitle', RelationMap::MANY_TO_ONE, array('title_id' => 'id', ), 'RESTRICT', 'RESTRICT'); $this->addRelation('Address', '\\Thelia\\Model\\Address', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'RESTRICT', 'Addresses'); - $this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'RESTRICT', 'Orders'); + $this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'RESTRICT', 'RESTRICT', 'Orders'); $this->addRelation('Cart', '\\Thelia\\Model\\Cart', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), null, null, 'Carts'); } // buildRelations() @@ -249,7 +249,6 @@ class CustomerTableMap extends TableMap // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. AddressTableMap::clearInstancePool(); - OrderTableMap::clearInstancePool(); } /** diff --git a/core/lib/Thelia/Model/Map/LangTableMap.php b/core/lib/Thelia/Model/Map/LangTableMap.php index 6d153b869..2e1f23204 100644 --- a/core/lib/Thelia/Model/Map/LangTableMap.php +++ b/core/lib/Thelia/Model/Map/LangTableMap.php @@ -217,6 +217,7 @@ class LangTableMap extends TableMap */ public function buildRelations() { + $this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'lang_id', ), 'RESTRICT', 'RESTRICT', 'Orders'); } // buildRelations() /** diff --git a/core/lib/Thelia/Model/Map/ModuleTableMap.php b/core/lib/Thelia/Model/Map/ModuleTableMap.php index dae9fda4a..252cad5cf 100644 --- a/core/lib/Thelia/Model/Map/ModuleTableMap.php +++ b/core/lib/Thelia/Model/Map/ModuleTableMap.php @@ -184,6 +184,8 @@ class ModuleTableMap extends TableMap */ public function buildRelations() { + $this->addRelation('OrderRelatedByPaymentModuleId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'payment_module_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByPaymentModuleId'); + $this->addRelation('OrderRelatedByDeliveryModuleId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByDeliveryModuleId'); $this->addRelation('GroupModule', '\\Thelia\\Model\\GroupModule', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'GroupModules'); $this->addRelation('ModuleI18n', '\\Thelia\\Model\\ModuleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModuleI18ns'); } // buildRelations() diff --git a/core/lib/Thelia/Model/Map/OrderAddressTableMap.php b/core/lib/Thelia/Model/Map/OrderAddressTableMap.php index 18753e7f0..73b8f798d 100644 --- a/core/lib/Thelia/Model/Map/OrderAddressTableMap.php +++ b/core/lib/Thelia/Model/Map/OrderAddressTableMap.php @@ -211,8 +211,8 @@ class OrderAddressTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('OrderRelatedByAddressInvoice', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'address_invoice', ), 'SET NULL', 'RESTRICT', 'OrdersRelatedByAddressInvoice'); - $this->addRelation('OrderRelatedByAddressDelivery', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'address_delivery', ), 'SET NULL', 'RESTRICT', 'OrdersRelatedByAddressDelivery'); + $this->addRelation('OrderRelatedByInvoiceOrderAddressId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'invoice_order_address_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByInvoiceOrderAddressId'); + $this->addRelation('OrderRelatedByDeliveryOrderAddressId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'delivery_order_address_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByDeliveryOrderAddressId'); } // buildRelations() /** @@ -227,15 +227,6 @@ class OrderAddressTableMap extends TableMap 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ), ); } // getBehaviors() - /** - * Method to invalidate the instance pool of all tables related to order_address * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - OrderTableMap::clearInstancePool(); - } /** * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table. diff --git a/core/lib/Thelia/Model/Map/OrderStatusTableMap.php b/core/lib/Thelia/Model/Map/OrderStatusTableMap.php index 18406d9aa..bc283a3e8 100644 --- a/core/lib/Thelia/Model/Map/OrderStatusTableMap.php +++ b/core/lib/Thelia/Model/Map/OrderStatusTableMap.php @@ -160,7 +160,7 @@ class OrderStatusTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'status_id', ), 'SET NULL', 'RESTRICT', 'Orders'); + $this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'status_id', ), 'RESTRICT', 'RESTRICT', 'Orders'); $this->addRelation('OrderStatusI18n', '\\Thelia\\Model\\OrderStatusI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'OrderStatusI18ns'); } // buildRelations() @@ -184,7 +184,6 @@ class OrderStatusTableMap extends TableMap { // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - OrderTableMap::clearInstancePool(); OrderStatusI18nTableMap::clearInstancePool(); } diff --git a/core/lib/Thelia/Model/Map/OrderTableMap.php b/core/lib/Thelia/Model/Map/OrderTableMap.php index 91d9b29de..ae43bd768 100644 --- a/core/lib/Thelia/Model/Map/OrderTableMap.php +++ b/core/lib/Thelia/Model/Map/OrderTableMap.php @@ -85,14 +85,14 @@ class OrderTableMap extends TableMap const CUSTOMER_ID = 'order.CUSTOMER_ID'; /** - * the column name for the ADDRESS_INVOICE field + * the column name for the INVOICE_ORDER_ADDRESS_ID field */ - const ADDRESS_INVOICE = 'order.ADDRESS_INVOICE'; + const INVOICE_ORDER_ADDRESS_ID = 'order.INVOICE_ORDER_ADDRESS_ID'; /** - * the column name for the ADDRESS_DELIVERY field + * the column name for the DELIVERY_ORDER_ADDRESS_ID field */ - const ADDRESS_DELIVERY = 'order.ADDRESS_DELIVERY'; + const DELIVERY_ORDER_ADDRESS_ID = 'order.DELIVERY_ORDER_ADDRESS_ID'; /** * the column name for the INVOICE_DATE field @@ -110,19 +110,19 @@ class OrderTableMap extends TableMap const CURRENCY_RATE = 'order.CURRENCY_RATE'; /** - * the column name for the TRANSACTION field + * the column name for the TRANSACTION_REF field */ - const TRANSACTION = 'order.TRANSACTION'; + const TRANSACTION_REF = 'order.TRANSACTION_REF'; /** - * the column name for the DELIVERY_NUM field + * the column name for the DELIVERY_REF field */ - const DELIVERY_NUM = 'order.DELIVERY_NUM'; + const DELIVERY_REF = 'order.DELIVERY_REF'; /** - * the column name for the INVOICE field + * the column name for the INVOICE_REF field */ - const INVOICE = 'order.INVOICE'; + const INVOICE_REF = 'order.INVOICE_REF'; /** * the column name for the POSTAGE field @@ -130,14 +130,14 @@ class OrderTableMap extends TableMap const POSTAGE = 'order.POSTAGE'; /** - * the column name for the PAYMENT field + * the column name for the PAYMENT_MODULE_ID field */ - const PAYMENT = 'order.PAYMENT'; + const PAYMENT_MODULE_ID = 'order.PAYMENT_MODULE_ID'; /** - * the column name for the CARRIER field + * the column name for the DELIVERY_MODULE_ID field */ - const CARRIER = 'order.CARRIER'; + const DELIVERY_MODULE_ID = 'order.DELIVERY_MODULE_ID'; /** * the column name for the STATUS_ID field @@ -145,9 +145,9 @@ class OrderTableMap extends TableMap const STATUS_ID = 'order.STATUS_ID'; /** - * the column name for the LANG field + * the column name for the LANG_ID field */ - const LANG = 'order.LANG'; + const LANG_ID = 'order.LANG_ID'; /** * the column name for the CREATED_AT field @@ -171,11 +171,11 @@ class OrderTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('Id', 'Ref', 'CustomerId', 'AddressInvoice', 'AddressDelivery', 'InvoiceDate', 'CurrencyId', 'CurrencyRate', 'Transaction', 'DeliveryNum', 'Invoice', 'Postage', 'Payment', 'Carrier', 'StatusId', 'Lang', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'customerId', 'addressInvoice', 'addressDelivery', 'invoiceDate', 'currencyId', 'currencyRate', 'transaction', 'deliveryNum', 'invoice', 'postage', 'payment', 'carrier', 'statusId', 'lang', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(OrderTableMap::ID, OrderTableMap::REF, OrderTableMap::CUSTOMER_ID, OrderTableMap::ADDRESS_INVOICE, OrderTableMap::ADDRESS_DELIVERY, OrderTableMap::INVOICE_DATE, OrderTableMap::CURRENCY_ID, OrderTableMap::CURRENCY_RATE, OrderTableMap::TRANSACTION, OrderTableMap::DELIVERY_NUM, OrderTableMap::INVOICE, OrderTableMap::POSTAGE, OrderTableMap::PAYMENT, OrderTableMap::CARRIER, OrderTableMap::STATUS_ID, OrderTableMap::LANG, OrderTableMap::CREATED_AT, OrderTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'REF', 'CUSTOMER_ID', 'ADDRESS_INVOICE', 'ADDRESS_DELIVERY', 'INVOICE_DATE', 'CURRENCY_ID', 'CURRENCY_RATE', 'TRANSACTION', 'DELIVERY_NUM', 'INVOICE', 'POSTAGE', 'PAYMENT', 'CARRIER', 'STATUS_ID', 'LANG', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'ref', 'customer_id', 'address_invoice', 'address_delivery', 'invoice_date', 'currency_id', 'currency_rate', 'transaction', 'delivery_num', 'invoice', 'postage', 'payment', 'carrier', 'status_id', 'lang', 'created_at', 'updated_at', ), + self::TYPE_PHPNAME => array('Id', 'Ref', 'CustomerId', 'InvoiceOrderAddressId', 'DeliveryOrderAddressId', 'InvoiceDate', 'CurrencyId', 'CurrencyRate', 'TransactionRef', 'DeliveryRef', 'InvoiceRef', 'Postage', 'PaymentModuleId', 'DeliveryModuleId', 'StatusId', 'LangId', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'customerId', 'invoiceOrderAddressId', 'deliveryOrderAddressId', 'invoiceDate', 'currencyId', 'currencyRate', 'transactionRef', 'deliveryRef', 'invoiceRef', 'postage', 'paymentModuleId', 'deliveryModuleId', 'statusId', 'langId', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(OrderTableMap::ID, OrderTableMap::REF, OrderTableMap::CUSTOMER_ID, OrderTableMap::INVOICE_ORDER_ADDRESS_ID, OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, OrderTableMap::INVOICE_DATE, OrderTableMap::CURRENCY_ID, OrderTableMap::CURRENCY_RATE, OrderTableMap::TRANSACTION_REF, OrderTableMap::DELIVERY_REF, OrderTableMap::INVOICE_REF, OrderTableMap::POSTAGE, OrderTableMap::PAYMENT_MODULE_ID, OrderTableMap::DELIVERY_MODULE_ID, OrderTableMap::STATUS_ID, OrderTableMap::LANG_ID, OrderTableMap::CREATED_AT, OrderTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'REF', 'CUSTOMER_ID', 'INVOICE_ORDER_ADDRESS_ID', 'DELIVERY_ORDER_ADDRESS_ID', 'INVOICE_DATE', 'CURRENCY_ID', 'CURRENCY_RATE', 'TRANSACTION_REF', 'DELIVERY_REF', 'INVOICE_REF', 'POSTAGE', 'PAYMENT_MODULE_ID', 'DELIVERY_MODULE_ID', 'STATUS_ID', 'LANG_ID', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'ref', 'customer_id', 'invoice_order_address_id', 'delivery_order_address_id', 'invoice_date', 'currency_id', 'currency_rate', 'transaction_ref', 'delivery_ref', 'invoice_ref', 'postage', 'payment_module_id', 'delivery_module_id', 'status_id', 'lang_id', 'created_at', 'updated_at', ), self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) ); @@ -186,11 +186,11 @@ class OrderTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'CustomerId' => 2, 'AddressInvoice' => 3, 'AddressDelivery' => 4, 'InvoiceDate' => 5, 'CurrencyId' => 6, 'CurrencyRate' => 7, 'Transaction' => 8, 'DeliveryNum' => 9, 'Invoice' => 10, 'Postage' => 11, 'Payment' => 12, 'Carrier' => 13, 'StatusId' => 14, 'Lang' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'customerId' => 2, 'addressInvoice' => 3, 'addressDelivery' => 4, 'invoiceDate' => 5, 'currencyId' => 6, 'currencyRate' => 7, 'transaction' => 8, 'deliveryNum' => 9, 'invoice' => 10, 'postage' => 11, 'payment' => 12, 'carrier' => 13, 'statusId' => 14, 'lang' => 15, 'createdAt' => 16, 'updatedAt' => 17, ), - self::TYPE_COLNAME => array(OrderTableMap::ID => 0, OrderTableMap::REF => 1, OrderTableMap::CUSTOMER_ID => 2, OrderTableMap::ADDRESS_INVOICE => 3, OrderTableMap::ADDRESS_DELIVERY => 4, OrderTableMap::INVOICE_DATE => 5, OrderTableMap::CURRENCY_ID => 6, OrderTableMap::CURRENCY_RATE => 7, OrderTableMap::TRANSACTION => 8, OrderTableMap::DELIVERY_NUM => 9, OrderTableMap::INVOICE => 10, OrderTableMap::POSTAGE => 11, OrderTableMap::PAYMENT => 12, OrderTableMap::CARRIER => 13, OrderTableMap::STATUS_ID => 14, OrderTableMap::LANG => 15, OrderTableMap::CREATED_AT => 16, OrderTableMap::UPDATED_AT => 17, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'CUSTOMER_ID' => 2, 'ADDRESS_INVOICE' => 3, 'ADDRESS_DELIVERY' => 4, 'INVOICE_DATE' => 5, 'CURRENCY_ID' => 6, 'CURRENCY_RATE' => 7, 'TRANSACTION' => 8, 'DELIVERY_NUM' => 9, 'INVOICE' => 10, 'POSTAGE' => 11, 'PAYMENT' => 12, 'CARRIER' => 13, 'STATUS_ID' => 14, 'LANG' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ), - self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'customer_id' => 2, 'address_invoice' => 3, 'address_delivery' => 4, 'invoice_date' => 5, 'currency_id' => 6, 'currency_rate' => 7, 'transaction' => 8, 'delivery_num' => 9, 'invoice' => 10, 'postage' => 11, 'payment' => 12, 'carrier' => 13, 'status_id' => 14, 'lang' => 15, 'created_at' => 16, 'updated_at' => 17, ), + self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'CustomerId' => 2, 'InvoiceOrderAddressId' => 3, 'DeliveryOrderAddressId' => 4, 'InvoiceDate' => 5, 'CurrencyId' => 6, 'CurrencyRate' => 7, 'TransactionRef' => 8, 'DeliveryRef' => 9, 'InvoiceRef' => 10, 'Postage' => 11, 'PaymentModuleId' => 12, 'DeliveryModuleId' => 13, 'StatusId' => 14, 'LangId' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'customerId' => 2, 'invoiceOrderAddressId' => 3, 'deliveryOrderAddressId' => 4, 'invoiceDate' => 5, 'currencyId' => 6, 'currencyRate' => 7, 'transactionRef' => 8, 'deliveryRef' => 9, 'invoiceRef' => 10, 'postage' => 11, 'paymentModuleId' => 12, 'deliveryModuleId' => 13, 'statusId' => 14, 'langId' => 15, 'createdAt' => 16, 'updatedAt' => 17, ), + self::TYPE_COLNAME => array(OrderTableMap::ID => 0, OrderTableMap::REF => 1, OrderTableMap::CUSTOMER_ID => 2, OrderTableMap::INVOICE_ORDER_ADDRESS_ID => 3, OrderTableMap::DELIVERY_ORDER_ADDRESS_ID => 4, OrderTableMap::INVOICE_DATE => 5, OrderTableMap::CURRENCY_ID => 6, OrderTableMap::CURRENCY_RATE => 7, OrderTableMap::TRANSACTION_REF => 8, OrderTableMap::DELIVERY_REF => 9, OrderTableMap::INVOICE_REF => 10, OrderTableMap::POSTAGE => 11, OrderTableMap::PAYMENT_MODULE_ID => 12, OrderTableMap::DELIVERY_MODULE_ID => 13, OrderTableMap::STATUS_ID => 14, OrderTableMap::LANG_ID => 15, OrderTableMap::CREATED_AT => 16, OrderTableMap::UPDATED_AT => 17, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'CUSTOMER_ID' => 2, 'INVOICE_ORDER_ADDRESS_ID' => 3, 'DELIVERY_ORDER_ADDRESS_ID' => 4, 'INVOICE_DATE' => 5, 'CURRENCY_ID' => 6, 'CURRENCY_RATE' => 7, 'TRANSACTION_REF' => 8, 'DELIVERY_REF' => 9, 'INVOICE_REF' => 10, 'POSTAGE' => 11, 'PAYMENT_MODULE_ID' => 12, 'DELIVERY_MODULE_ID' => 13, 'STATUS_ID' => 14, 'LANG_ID' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ), + self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'customer_id' => 2, 'invoice_order_address_id' => 3, 'delivery_order_address_id' => 4, 'invoice_date' => 5, 'currency_id' => 6, 'currency_rate' => 7, 'transaction_ref' => 8, 'delivery_ref' => 9, 'invoice_ref' => 10, 'postage' => 11, 'payment_module_id' => 12, 'delivery_module_id' => 13, 'status_id' => 14, 'lang_id' => 15, 'created_at' => 16, 'updated_at' => 17, ), self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) ); @@ -211,21 +211,21 @@ class OrderTableMap extends TableMap $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('REF', 'Ref', 'VARCHAR', false, 45, null); + $this->addColumn('REF', 'Ref', 'VARCHAR', true, 45, null); $this->addForeignKey('CUSTOMER_ID', 'CustomerId', 'INTEGER', 'customer', 'ID', true, null, null); - $this->addForeignKey('ADDRESS_INVOICE', 'AddressInvoice', 'INTEGER', 'order_address', 'ID', false, null, null); - $this->addForeignKey('ADDRESS_DELIVERY', 'AddressDelivery', 'INTEGER', 'order_address', 'ID', false, null, null); - $this->addColumn('INVOICE_DATE', 'InvoiceDate', 'DATE', false, null, null); - $this->addForeignKey('CURRENCY_ID', 'CurrencyId', 'INTEGER', 'currency', 'ID', false, null, null); + $this->addForeignKey('INVOICE_ORDER_ADDRESS_ID', 'InvoiceOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null); + $this->addForeignKey('DELIVERY_ORDER_ADDRESS_ID', 'DeliveryOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null); + $this->addColumn('INVOICE_DATE', 'InvoiceDate', 'DATE', true, null, null); + $this->addForeignKey('CURRENCY_ID', 'CurrencyId', 'INTEGER', 'currency', 'ID', true, null, null); $this->addColumn('CURRENCY_RATE', 'CurrencyRate', 'FLOAT', true, null, null); - $this->addColumn('TRANSACTION', 'Transaction', 'VARCHAR', false, 100, null); - $this->addColumn('DELIVERY_NUM', 'DeliveryNum', 'VARCHAR', false, 100, null); - $this->addColumn('INVOICE', 'Invoice', 'VARCHAR', false, 100, null); - $this->addColumn('POSTAGE', 'Postage', 'FLOAT', false, null, null); - $this->addColumn('PAYMENT', 'Payment', 'VARCHAR', true, 45, null); - $this->addColumn('CARRIER', 'Carrier', 'VARCHAR', true, 45, null); - $this->addForeignKey('STATUS_ID', 'StatusId', 'INTEGER', 'order_status', 'ID', false, null, null); - $this->addColumn('LANG', 'Lang', 'VARCHAR', true, 10, null); + $this->addColumn('TRANSACTION_REF', 'TransactionRef', 'VARCHAR', false, 100, null); + $this->addColumn('DELIVERY_REF', 'DeliveryRef', 'VARCHAR', false, 100, null); + $this->addColumn('INVOICE_REF', 'InvoiceRef', 'VARCHAR', false, 100, null); + $this->addColumn('POSTAGE', 'Postage', 'FLOAT', true, null, null); + $this->addForeignKey('PAYMENT_MODULE_ID', 'PaymentModuleId', 'INTEGER', 'module', 'ID', true, null, null); + $this->addForeignKey('DELIVERY_MODULE_ID', 'DeliveryModuleId', 'INTEGER', 'module', 'ID', true, null, null); + $this->addForeignKey('STATUS_ID', 'StatusId', 'INTEGER', 'order_status', 'ID', true, null, null); + $this->addForeignKey('LANG_ID', 'LangId', 'INTEGER', 'lang', 'ID', true, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); } // initialize() @@ -235,11 +235,14 @@ class OrderTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('Currency', '\\Thelia\\Model\\Currency', RelationMap::MANY_TO_ONE, array('currency_id' => 'id', ), 'SET NULL', 'RESTRICT'); - $this->addRelation('Customer', '\\Thelia\\Model\\Customer', RelationMap::MANY_TO_ONE, array('customer_id' => 'id', ), 'CASCADE', 'RESTRICT'); - $this->addRelation('OrderAddressRelatedByAddressInvoice', '\\Thelia\\Model\\OrderAddress', RelationMap::MANY_TO_ONE, array('address_invoice' => 'id', ), 'SET NULL', 'RESTRICT'); - $this->addRelation('OrderAddressRelatedByAddressDelivery', '\\Thelia\\Model\\OrderAddress', RelationMap::MANY_TO_ONE, array('address_delivery' => 'id', ), 'SET NULL', 'RESTRICT'); - $this->addRelation('OrderStatus', '\\Thelia\\Model\\OrderStatus', RelationMap::MANY_TO_ONE, array('status_id' => 'id', ), 'SET NULL', 'RESTRICT'); + $this->addRelation('Currency', '\\Thelia\\Model\\Currency', RelationMap::MANY_TO_ONE, array('currency_id' => 'id', ), 'RESTRICT', 'RESTRICT'); + $this->addRelation('Customer', '\\Thelia\\Model\\Customer', RelationMap::MANY_TO_ONE, array('customer_id' => 'id', ), 'RESTRICT', 'RESTRICT'); + $this->addRelation('OrderAddressRelatedByInvoiceOrderAddressId', '\\Thelia\\Model\\OrderAddress', RelationMap::MANY_TO_ONE, array('invoice_order_address_id' => 'id', ), 'RESTRICT', 'RESTRICT'); + $this->addRelation('OrderAddressRelatedByDeliveryOrderAddressId', '\\Thelia\\Model\\OrderAddress', RelationMap::MANY_TO_ONE, array('delivery_order_address_id' => 'id', ), 'RESTRICT', 'RESTRICT'); + $this->addRelation('OrderStatus', '\\Thelia\\Model\\OrderStatus', RelationMap::MANY_TO_ONE, array('status_id' => 'id', ), 'RESTRICT', 'RESTRICT'); + $this->addRelation('ModuleRelatedByPaymentModuleId', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('payment_module_id' => 'id', ), 'RESTRICT', 'RESTRICT'); + $this->addRelation('ModuleRelatedByDeliveryModuleId', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('delivery_module_id' => 'id', ), 'RESTRICT', 'RESTRICT'); + $this->addRelation('Lang', '\\Thelia\\Model\\Lang', RelationMap::MANY_TO_ONE, array('lang_id' => 'id', ), 'RESTRICT', 'RESTRICT'); $this->addRelation('OrderProduct', '\\Thelia\\Model\\OrderProduct', RelationMap::ONE_TO_MANY, array('id' => 'order_id', ), 'CASCADE', 'RESTRICT', 'OrderProducts'); $this->addRelation('CouponOrder', '\\Thelia\\Model\\CouponOrder', RelationMap::ONE_TO_MANY, array('id' => 'order_id', ), 'CASCADE', 'RESTRICT', 'CouponOrders'); } // buildRelations() @@ -408,38 +411,38 @@ class OrderTableMap extends TableMap $criteria->addSelectColumn(OrderTableMap::ID); $criteria->addSelectColumn(OrderTableMap::REF); $criteria->addSelectColumn(OrderTableMap::CUSTOMER_ID); - $criteria->addSelectColumn(OrderTableMap::ADDRESS_INVOICE); - $criteria->addSelectColumn(OrderTableMap::ADDRESS_DELIVERY); + $criteria->addSelectColumn(OrderTableMap::INVOICE_ORDER_ADDRESS_ID); + $criteria->addSelectColumn(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID); $criteria->addSelectColumn(OrderTableMap::INVOICE_DATE); $criteria->addSelectColumn(OrderTableMap::CURRENCY_ID); $criteria->addSelectColumn(OrderTableMap::CURRENCY_RATE); - $criteria->addSelectColumn(OrderTableMap::TRANSACTION); - $criteria->addSelectColumn(OrderTableMap::DELIVERY_NUM); - $criteria->addSelectColumn(OrderTableMap::INVOICE); + $criteria->addSelectColumn(OrderTableMap::TRANSACTION_REF); + $criteria->addSelectColumn(OrderTableMap::DELIVERY_REF); + $criteria->addSelectColumn(OrderTableMap::INVOICE_REF); $criteria->addSelectColumn(OrderTableMap::POSTAGE); - $criteria->addSelectColumn(OrderTableMap::PAYMENT); - $criteria->addSelectColumn(OrderTableMap::CARRIER); + $criteria->addSelectColumn(OrderTableMap::PAYMENT_MODULE_ID); + $criteria->addSelectColumn(OrderTableMap::DELIVERY_MODULE_ID); $criteria->addSelectColumn(OrderTableMap::STATUS_ID); - $criteria->addSelectColumn(OrderTableMap::LANG); + $criteria->addSelectColumn(OrderTableMap::LANG_ID); $criteria->addSelectColumn(OrderTableMap::CREATED_AT); $criteria->addSelectColumn(OrderTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.REF'); $criteria->addSelectColumn($alias . '.CUSTOMER_ID'); - $criteria->addSelectColumn($alias . '.ADDRESS_INVOICE'); - $criteria->addSelectColumn($alias . '.ADDRESS_DELIVERY'); + $criteria->addSelectColumn($alias . '.INVOICE_ORDER_ADDRESS_ID'); + $criteria->addSelectColumn($alias . '.DELIVERY_ORDER_ADDRESS_ID'); $criteria->addSelectColumn($alias . '.INVOICE_DATE'); $criteria->addSelectColumn($alias . '.CURRENCY_ID'); $criteria->addSelectColumn($alias . '.CURRENCY_RATE'); - $criteria->addSelectColumn($alias . '.TRANSACTION'); - $criteria->addSelectColumn($alias . '.DELIVERY_NUM'); - $criteria->addSelectColumn($alias . '.INVOICE'); + $criteria->addSelectColumn($alias . '.TRANSACTION_REF'); + $criteria->addSelectColumn($alias . '.DELIVERY_REF'); + $criteria->addSelectColumn($alias . '.INVOICE_REF'); $criteria->addSelectColumn($alias . '.POSTAGE'); - $criteria->addSelectColumn($alias . '.PAYMENT'); - $criteria->addSelectColumn($alias . '.CARRIER'); + $criteria->addSelectColumn($alias . '.PAYMENT_MODULE_ID'); + $criteria->addSelectColumn($alias . '.DELIVERY_MODULE_ID'); $criteria->addSelectColumn($alias . '.STATUS_ID'); - $criteria->addSelectColumn($alias . '.LANG'); + $criteria->addSelectColumn($alias . '.LANG_ID'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); } diff --git a/core/lib/Thelia/Model/Map/ProductCategoryTableMap.php b/core/lib/Thelia/Model/Map/ProductCategoryTableMap.php index 6a8361f27..73c87ce9f 100644 --- a/core/lib/Thelia/Model/Map/ProductCategoryTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductCategoryTableMap.php @@ -57,7 +57,7 @@ class ProductCategoryTableMap extends TableMap /** * The total number of columns */ - const NUM_COLUMNS = 4; + const NUM_COLUMNS = 5; /** * The number of lazy-loaded columns @@ -67,7 +67,7 @@ class ProductCategoryTableMap extends TableMap /** * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 4; + const NUM_HYDRATE_COLUMNS = 5; /** * the column name for the PRODUCT_ID field @@ -79,6 +79,11 @@ class ProductCategoryTableMap extends TableMap */ const CATEGORY_ID = 'product_category.CATEGORY_ID'; + /** + * the column name for the DEFAULT_CATEGORY field + */ + const DEFAULT_CATEGORY = 'product_category.DEFAULT_CATEGORY'; + /** * the column name for the CREATED_AT field */ @@ -101,12 +106,12 @@ class ProductCategoryTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('ProductId', 'CategoryId', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('productId', 'categoryId', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(ProductCategoryTableMap::PRODUCT_ID, ProductCategoryTableMap::CATEGORY_ID, ProductCategoryTableMap::CREATED_AT, ProductCategoryTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('PRODUCT_ID', 'CATEGORY_ID', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('product_id', 'category_id', 'created_at', 'updated_at', ), - self::TYPE_NUM => array(0, 1, 2, 3, ) + self::TYPE_PHPNAME => array('ProductId', 'CategoryId', 'DefaultCategory', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('productId', 'categoryId', 'defaultCategory', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(ProductCategoryTableMap::PRODUCT_ID, ProductCategoryTableMap::CATEGORY_ID, ProductCategoryTableMap::DEFAULT_CATEGORY, ProductCategoryTableMap::CREATED_AT, ProductCategoryTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('PRODUCT_ID', 'CATEGORY_ID', 'DEFAULT_CATEGORY', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('product_id', 'category_id', 'default_category', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -116,12 +121,12 @@ class ProductCategoryTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('ProductId' => 0, 'CategoryId' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ), - self::TYPE_STUDLYPHPNAME => array('productId' => 0, 'categoryId' => 1, 'createdAt' => 2, 'updatedAt' => 3, ), - self::TYPE_COLNAME => array(ProductCategoryTableMap::PRODUCT_ID => 0, ProductCategoryTableMap::CATEGORY_ID => 1, ProductCategoryTableMap::CREATED_AT => 2, ProductCategoryTableMap::UPDATED_AT => 3, ), - self::TYPE_RAW_COLNAME => array('PRODUCT_ID' => 0, 'CATEGORY_ID' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ), - self::TYPE_FIELDNAME => array('product_id' => 0, 'category_id' => 1, 'created_at' => 2, 'updated_at' => 3, ), - self::TYPE_NUM => array(0, 1, 2, 3, ) + self::TYPE_PHPNAME => array('ProductId' => 0, 'CategoryId' => 1, 'DefaultCategory' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ), + self::TYPE_STUDLYPHPNAME => array('productId' => 0, 'categoryId' => 1, 'defaultCategory' => 2, 'createdAt' => 3, 'updatedAt' => 4, ), + self::TYPE_COLNAME => array(ProductCategoryTableMap::PRODUCT_ID => 0, ProductCategoryTableMap::CATEGORY_ID => 1, ProductCategoryTableMap::DEFAULT_CATEGORY => 2, ProductCategoryTableMap::CREATED_AT => 3, ProductCategoryTableMap::UPDATED_AT => 4, ), + self::TYPE_RAW_COLNAME => array('PRODUCT_ID' => 0, 'CATEGORY_ID' => 1, 'DEFAULT_CATEGORY' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ), + self::TYPE_FIELDNAME => array('product_id' => 0, 'category_id' => 1, 'default_category' => 2, 'created_at' => 3, 'updated_at' => 4, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -143,6 +148,7 @@ class ProductCategoryTableMap extends TableMap // columns $this->addForeignPrimaryKey('PRODUCT_ID', 'ProductId', 'INTEGER' , 'product', 'ID', true, null, null); $this->addForeignPrimaryKey('CATEGORY_ID', 'CategoryId', 'INTEGER' , 'category', 'ID', true, null, null); + $this->addColumn('DEFAULT_CATEGORY', 'DefaultCategory', 'BOOLEAN', false, 1, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); } // initialize() @@ -358,11 +364,13 @@ class ProductCategoryTableMap extends TableMap if (null === $alias) { $criteria->addSelectColumn(ProductCategoryTableMap::PRODUCT_ID); $criteria->addSelectColumn(ProductCategoryTableMap::CATEGORY_ID); + $criteria->addSelectColumn(ProductCategoryTableMap::DEFAULT_CATEGORY); $criteria->addSelectColumn(ProductCategoryTableMap::CREATED_AT); $criteria->addSelectColumn(ProductCategoryTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.PRODUCT_ID'); $criteria->addSelectColumn($alias . '.CATEGORY_ID'); + $criteria->addSelectColumn($alias . '.DEFAULT_CATEGORY'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); } diff --git a/install/thelia.sql b/install/thelia.sql index f178467a1..435bdf8e5 100755 --- a/install/thelia.sql +++ b/install/thelia.sql @@ -21,7 +21,7 @@ CREATE TABLE `category` `version_created_at` DATETIME, `version_created_by` VARCHAR(100), PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product @@ -54,7 +54,7 @@ CREATE TABLE `product` CONSTRAINT `fk_product_template1` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_category @@ -66,11 +66,13 @@ CREATE TABLE `product_category` ( `product_id` INTEGER NOT NULL, `category_id` INTEGER NOT NULL, + `default_category` TINYINT(1), `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`product_id`,`category_id`), INDEX `idx_product_has_category_category1` (`category_id`), INDEX `idx_product_has_category_product1` (`product_id`), + INDEX `idx_product_has_category_default` (`default_category`), CONSTRAINT `fk_product_has_category_product1` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) @@ -81,7 +83,7 @@ CREATE TABLE `product_category` REFERENCES `category` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- country @@ -106,7 +108,7 @@ CREATE TABLE `country` REFERENCES `area` (`id`) ON UPDATE RESTRICT ON DELETE SET NULL -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax @@ -122,7 +124,7 @@ CREATE TABLE `tax` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax_rule @@ -136,7 +138,7 @@ CREATE TABLE `tax_rule` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax_rule_country @@ -171,7 +173,7 @@ CREATE TABLE `tax_rule_country` REFERENCES `country` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature @@ -187,7 +189,7 @@ CREATE TABLE `feature` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_av @@ -209,7 +211,7 @@ CREATE TABLE `feature_av` REFERENCES `feature` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_product @@ -246,7 +248,7 @@ CREATE TABLE `feature_product` REFERENCES `feature_av` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_template @@ -272,7 +274,7 @@ CREATE TABLE `feature_template` CONSTRAINT `fk_feature_template` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute @@ -287,7 +289,7 @@ CREATE TABLE `attribute` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_av @@ -309,7 +311,7 @@ CREATE TABLE `attribute_av` REFERENCES `attribute` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_combination @@ -341,7 +343,7 @@ CREATE TABLE `attribute_combination` CONSTRAINT `fk_attribute_combination_product_sale_elements_id` FOREIGN KEY (`product_sale_elements_id`) REFERENCES `product_sale_elements` (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_sale_elements @@ -368,7 +370,7 @@ CREATE TABLE `product_sale_elements` REFERENCES `product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_template @@ -394,7 +396,7 @@ CREATE TABLE `attribute_template` CONSTRAINT `fk_attribute_template` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- config @@ -413,7 +415,7 @@ CREATE TABLE `config` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- customer @@ -447,7 +449,7 @@ CREATE TABLE `customer` REFERENCES `customer_title` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- address @@ -494,7 +496,7 @@ CREATE TABLE `address` REFERENCES `country` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- customer_title @@ -510,7 +512,7 @@ CREATE TABLE `customer_title` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- lang @@ -536,7 +538,7 @@ CREATE TABLE `lang` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder @@ -556,7 +558,7 @@ CREATE TABLE `folder` `version_created_at` DATETIME, `version_created_by` VARCHAR(100), PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content @@ -575,7 +577,7 @@ CREATE TABLE `content` `version_created_at` DATETIME, `version_created_by` VARCHAR(100), PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_image @@ -598,7 +600,7 @@ CREATE TABLE `product_image` REFERENCES `product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_document @@ -621,7 +623,7 @@ CREATE TABLE `product_document` REFERENCES `product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order @@ -632,55 +634,74 @@ DROP TABLE IF EXISTS `order`; CREATE TABLE `order` ( `id` INTEGER NOT NULL AUTO_INCREMENT, - `ref` VARCHAR(45), + `ref` VARCHAR(45) NOT NULL, `customer_id` INTEGER NOT NULL, - `address_invoice` INTEGER, - `address_delivery` INTEGER, - `invoice_date` DATE, - `currency_id` INTEGER, + `invoice_order_address_id` INTEGER NOT NULL, + `delivery_order_address_id` INTEGER NOT NULL, + `invoice_date` DATE NOT NULL, + `currency_id` INTEGER NOT NULL, `currency_rate` FLOAT NOT NULL, - `transaction` VARCHAR(100), - `delivery_num` VARCHAR(100), - `invoice` VARCHAR(100), - `postage` FLOAT, - `payment` VARCHAR(45) NOT NULL, - `carrier` VARCHAR(45) NOT NULL, - `status_id` INTEGER, - `lang` VARCHAR(10) NOT NULL, + `transaction_ref` VARCHAR(100) COMMENT 'transaction reference - usually use to identify a transaction with banking modules', + `delivery_ref` VARCHAR(100) COMMENT 'delivery reference - usually use to identify a delivery progress on a distant delivery tracker website', + `invoice_ref` VARCHAR(100) COMMENT 'the invoice reference', + `postage` FLOAT NOT NULL, + `payment_module_id` INTEGER NOT NULL, + `delivery_module_id` INTEGER NOT NULL, + `status_id` INTEGER NOT NULL, + `lang_id` INTEGER NOT NULL, `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`), + UNIQUE INDEX `ref_UNIQUE` (`ref`), INDEX `idx_order_currency_id` (`currency_id`), INDEX `idx_order_customer_id` (`customer_id`), - INDEX `idx_order_address_invoice` (`address_invoice`), - INDEX `idx_order_address_delivery` (`address_delivery`), + INDEX `idx_order_invoice_order_address_id` (`invoice_order_address_id`), + INDEX `idx_order_delivery_order_address_id` (`delivery_order_address_id`), INDEX `idx_order_status_id` (`status_id`), + INDEX `fk_order_payment_module_id_idx` (`payment_module_id`), + INDEX `fk_order_delivery_module_id_idx` (`delivery_module_id`), + INDEX `fk_order_lang_id_idx` (`lang_id`), CONSTRAINT `fk_order_currency_id` FOREIGN KEY (`currency_id`) REFERENCES `currency` (`id`) ON UPDATE RESTRICT - ON DELETE SET NULL, + ON DELETE RESTRICT, CONSTRAINT `fk_order_customer_id` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON UPDATE RESTRICT - ON DELETE CASCADE, - CONSTRAINT `fk_order_address_invoice` - FOREIGN KEY (`address_invoice`) + ON DELETE RESTRICT, + CONSTRAINT `fk_order_invoice_order_address_id` + FOREIGN KEY (`invoice_order_address_id`) REFERENCES `order_address` (`id`) ON UPDATE RESTRICT - ON DELETE SET NULL, - CONSTRAINT `fk_order_address_delivery` - FOREIGN KEY (`address_delivery`) + ON DELETE RESTRICT, + CONSTRAINT `fk_order_delivery_order_address_id` + FOREIGN KEY (`delivery_order_address_id`) REFERENCES `order_address` (`id`) ON UPDATE RESTRICT - ON DELETE SET NULL, + ON DELETE RESTRICT, CONSTRAINT `fk_order_status_id` FOREIGN KEY (`status_id`) REFERENCES `order_status` (`id`) ON UPDATE RESTRICT - ON DELETE SET NULL -) ENGINE=InnoDB; + ON DELETE RESTRICT, + CONSTRAINT `fk_order_payment_module_id` + FOREIGN KEY (`payment_module_id`) + REFERENCES `module` (`id`) + ON UPDATE RESTRICT + ON DELETE RESTRICT, + CONSTRAINT `fk_order_delivery_module_id` + FOREIGN KEY (`delivery_module_id`) + REFERENCES `module` (`id`) + ON UPDATE RESTRICT + ON DELETE RESTRICT, + CONSTRAINT `fk_order_lang_id` + FOREIGN KEY (`lang_id`) + REFERENCES `lang` (`id`) + ON UPDATE RESTRICT + ON DELETE RESTRICT +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- currency @@ -699,7 +720,7 @@ CREATE TABLE `currency` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_address @@ -724,7 +745,7 @@ CREATE TABLE `order_address` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_product @@ -753,7 +774,7 @@ CREATE TABLE `order_product` REFERENCES `order` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_status @@ -768,7 +789,7 @@ CREATE TABLE `order_status` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_feature @@ -791,7 +812,7 @@ CREATE TABLE `order_feature` REFERENCES `order_product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- module @@ -811,7 +832,7 @@ CREATE TABLE `module` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `code_UNIQUE` (`code`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- accessory @@ -840,7 +861,7 @@ CREATE TABLE `accessory` REFERENCES `product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- area @@ -856,7 +877,7 @@ CREATE TABLE `area` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- delivzone @@ -878,7 +899,7 @@ CREATE TABLE `delivzone` REFERENCES `area` (`id`) ON UPDATE RESTRICT ON DELETE SET NULL -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- group @@ -894,7 +915,7 @@ CREATE TABLE `group` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `code_UNIQUE` (`code`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- resource @@ -910,7 +931,7 @@ CREATE TABLE `resource` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `code_UNIQUE` (`code`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- admin @@ -932,7 +953,7 @@ CREATE TABLE `admin` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- admin_group @@ -960,7 +981,7 @@ CREATE TABLE `admin_group` REFERENCES `admin` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- group_resource @@ -990,7 +1011,7 @@ CREATE TABLE `group_resource` REFERENCES `resource` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- group_module @@ -1019,7 +1040,7 @@ CREATE TABLE `group_module` REFERENCES `module` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- message @@ -1039,7 +1060,7 @@ CREATE TABLE `message` `version_created_by` VARCHAR(100), PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon @@ -1075,7 +1096,7 @@ CREATE TABLE `coupon` INDEX `idx_is_removing_postage` (`is_removing_postage`), INDEX `idx_max_usage` (`max_usage`), INDEX `idx_is_available_on_special_offers` (`is_available_on_special_offers`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon_order @@ -1097,7 +1118,7 @@ CREATE TABLE `coupon_order` REFERENCES `order` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- admin_log @@ -1116,7 +1137,7 @@ CREATE TABLE `admin_log` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_folder @@ -1128,11 +1149,13 @@ CREATE TABLE `content_folder` ( `content_id` INTEGER NOT NULL, `folder_id` INTEGER NOT NULL, + `default_folder` TINYINT(1), `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`content_id`,`folder_id`), INDEX `idx_content_folder_content_id` (`content_id`), INDEX `idx_content_folder_folder_id` (`folder_id`), + INDEX `idx_content_folder_default` (`default_folder`), CONSTRAINT `fk_content_folder_content_id` FOREIGN KEY (`content_id`) REFERENCES `content` (`id`) @@ -1143,7 +1166,7 @@ CREATE TABLE `content_folder` REFERENCES `folder` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- cart @@ -1180,7 +1203,7 @@ CREATE TABLE `cart` CONSTRAINT `fk_cart_currency_id` FOREIGN KEY (`currency_id`) REFERENCES `currency` (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- cart_item @@ -1215,7 +1238,7 @@ CREATE TABLE `cart_item` CONSTRAINT `fk_cart_item_product_sale_elements_id` FOREIGN KEY (`product_sale_elements_id`) REFERENCES `product_sale_elements` (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_price @@ -1242,7 +1265,7 @@ CREATE TABLE `product_price` FOREIGN KEY (`currency_id`) REFERENCES `currency` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_image @@ -1265,7 +1288,7 @@ CREATE TABLE `category_image` REFERENCES `category` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_image @@ -1288,7 +1311,7 @@ CREATE TABLE `folder_image` REFERENCES `folder` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_image @@ -1311,7 +1334,7 @@ CREATE TABLE `content_image` REFERENCES `content` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_document @@ -1334,7 +1357,7 @@ CREATE TABLE `category_document` REFERENCES `category` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_document @@ -1357,7 +1380,7 @@ CREATE TABLE `content_document` REFERENCES `content` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_document @@ -1380,7 +1403,7 @@ CREATE TABLE `folder_document` REFERENCES `folder` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_associated_content @@ -1409,7 +1432,7 @@ CREATE TABLE `product_associated_content` REFERENCES `content` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_associated_content @@ -1438,7 +1461,7 @@ CREATE TABLE `category_associated_content` REFERENCES `content` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- rewriting_url @@ -1465,7 +1488,7 @@ CREATE TABLE `rewriting_url` REFERENCES `rewriting_url` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- rewriting_argument @@ -1487,7 +1510,7 @@ CREATE TABLE `rewriting_argument` REFERENCES `rewriting_url` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- template @@ -1501,7 +1524,7 @@ CREATE TABLE `template` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_i18n @@ -1522,7 +1545,7 @@ CREATE TABLE `category_i18n` FOREIGN KEY (`id`) REFERENCES `category` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_i18n @@ -1543,7 +1566,7 @@ CREATE TABLE `product_i18n` FOREIGN KEY (`id`) REFERENCES `product` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- country_i18n @@ -1564,7 +1587,7 @@ CREATE TABLE `country_i18n` FOREIGN KEY (`id`) REFERENCES `country` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax_i18n @@ -1583,7 +1606,7 @@ CREATE TABLE `tax_i18n` FOREIGN KEY (`id`) REFERENCES `tax` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax_rule_i18n @@ -1602,7 +1625,7 @@ CREATE TABLE `tax_rule_i18n` FOREIGN KEY (`id`) REFERENCES `tax_rule` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_i18n @@ -1623,7 +1646,7 @@ CREATE TABLE `feature_i18n` FOREIGN KEY (`id`) REFERENCES `feature` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_av_i18n @@ -1644,7 +1667,7 @@ CREATE TABLE `feature_av_i18n` FOREIGN KEY (`id`) REFERENCES `feature_av` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_i18n @@ -1665,7 +1688,7 @@ CREATE TABLE `attribute_i18n` FOREIGN KEY (`id`) REFERENCES `attribute` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_av_i18n @@ -1686,7 +1709,7 @@ CREATE TABLE `attribute_av_i18n` FOREIGN KEY (`id`) REFERENCES `attribute_av` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- config_i18n @@ -1707,7 +1730,7 @@ CREATE TABLE `config_i18n` FOREIGN KEY (`id`) REFERENCES `config` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- customer_title_i18n @@ -1726,7 +1749,7 @@ CREATE TABLE `customer_title_i18n` FOREIGN KEY (`id`) REFERENCES `customer_title` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_i18n @@ -1747,7 +1770,7 @@ CREATE TABLE `folder_i18n` FOREIGN KEY (`id`) REFERENCES `folder` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_i18n @@ -1768,7 +1791,7 @@ CREATE TABLE `content_i18n` FOREIGN KEY (`id`) REFERENCES `content` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_image_i18n @@ -1789,7 +1812,7 @@ CREATE TABLE `product_image_i18n` FOREIGN KEY (`id`) REFERENCES `product_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_document_i18n @@ -1810,7 +1833,7 @@ CREATE TABLE `product_document_i18n` FOREIGN KEY (`id`) REFERENCES `product_document` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- currency_i18n @@ -1828,7 +1851,7 @@ CREATE TABLE `currency_i18n` FOREIGN KEY (`id`) REFERENCES `currency` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_status_i18n @@ -1849,7 +1872,7 @@ CREATE TABLE `order_status_i18n` FOREIGN KEY (`id`) REFERENCES `order_status` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- module_i18n @@ -1870,7 +1893,7 @@ CREATE TABLE `module_i18n` FOREIGN KEY (`id`) REFERENCES `module` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- group_i18n @@ -1891,7 +1914,7 @@ CREATE TABLE `group_i18n` FOREIGN KEY (`id`) REFERENCES `group` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- resource_i18n @@ -1912,7 +1935,7 @@ CREATE TABLE `resource_i18n` FOREIGN KEY (`id`) REFERENCES `resource` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- message_i18n @@ -1933,7 +1956,7 @@ CREATE TABLE `message_i18n` FOREIGN KEY (`id`) REFERENCES `message` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon_i18n @@ -1953,7 +1976,7 @@ CREATE TABLE `coupon_i18n` FOREIGN KEY (`id`) REFERENCES `coupon` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_image_i18n @@ -1974,7 +1997,7 @@ CREATE TABLE `category_image_i18n` FOREIGN KEY (`id`) REFERENCES `category_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_image_i18n @@ -1995,7 +2018,7 @@ CREATE TABLE `folder_image_i18n` FOREIGN KEY (`id`) REFERENCES `folder_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_image_i18n @@ -2016,7 +2039,7 @@ CREATE TABLE `content_image_i18n` FOREIGN KEY (`id`) REFERENCES `content_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_document_i18n @@ -2037,7 +2060,7 @@ CREATE TABLE `category_document_i18n` FOREIGN KEY (`id`) REFERENCES `category_document` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_document_i18n @@ -2058,7 +2081,7 @@ CREATE TABLE `content_document_i18n` FOREIGN KEY (`id`) REFERENCES `content_document` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_document_i18n @@ -2079,7 +2102,7 @@ CREATE TABLE `folder_document_i18n` FOREIGN KEY (`id`) REFERENCES `folder_document` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- template_i18n @@ -2097,7 +2120,7 @@ CREATE TABLE `template_i18n` FOREIGN KEY (`id`) REFERENCES `template` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_version @@ -2121,7 +2144,7 @@ CREATE TABLE `category_version` FOREIGN KEY (`id`) REFERENCES `category` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_version @@ -2147,7 +2170,7 @@ CREATE TABLE `product_version` FOREIGN KEY (`id`) REFERENCES `product` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_version @@ -2171,7 +2194,7 @@ CREATE TABLE `folder_version` FOREIGN KEY (`id`) REFERENCES `folder` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_version @@ -2194,7 +2217,7 @@ CREATE TABLE `content_version` FOREIGN KEY (`id`) REFERENCES `content` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- message_version @@ -2217,7 +2240,7 @@ CREATE TABLE `message_version` FOREIGN KEY (`id`) REFERENCES `message` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon_version @@ -2247,7 +2270,7 @@ CREATE TABLE `coupon_version` FOREIGN KEY (`id`) REFERENCES `coupon` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1; diff --git a/local/config/schema.xml b/local/config/schema.xml index 186bdbfd6..eac865408 100755 --- a/local/config/schema.xml +++ b/local/config/schema.xml @@ -1,1164 +1,1197 @@ - + - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - -
-
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + +
+ \ No newline at end of file