- * $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
- * $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
+ * $query->filterByName('fooValue'); // WHERE name = 'fooValue'
+ * $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
*
*
- * @param string $title The value to use as filter.
+ * @param string $name 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 ChildAddressQuery The current query, for fluid interface
*/
- public function filterByTitle($title = null, $comparison = null)
+ public function filterByName($name = null, $comparison = null)
{
if (null === $comparison) {
- if (is_array($title)) {
+ if (is_array($name)) {
$comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $title)) {
- $title = str_replace('*', '%', $title);
+ } elseif (preg_match('/[\%\*]/', $name)) {
+ $name = str_replace('*', '%', $name);
$comparison = Criteria::LIKE;
}
}
- return $this->addUsingAlias(AddressTableMap::TITLE, $title, $comparison);
+ return $this->addUsingAlias(AddressTableMap::NAME, $name, $comparison);
}
/**
@@ -410,18 +414,18 @@ abstract class AddressQuery extends ModelCriteria
}
/**
- * Filter the query on the customer_title_id column
+ * Filter the query on the title_id column
*
* Example usage:
*
- * $query->filterByCustomerTitleId(1234); // WHERE customer_title_id = 1234
- * $query->filterByCustomerTitleId(array(12, 34)); // WHERE customer_title_id IN (12, 34)
- * $query->filterByCustomerTitleId(array('min' => 12)); // WHERE customer_title_id > 12
+ * $query->filterByTitleId(1234); // WHERE title_id = 1234
+ * $query->filterByTitleId(array(12, 34)); // WHERE title_id IN (12, 34)
+ * $query->filterByTitleId(array('min' => 12)); // WHERE title_id > 12
*
*
* @see filterByCustomerTitle()
*
- * @param mixed $customerTitleId The value to use as filter.
+ * @param mixed $titleId 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.
@@ -429,16 +433,16 @@ abstract class AddressQuery extends ModelCriteria
*
* @return ChildAddressQuery The current query, for fluid interface
*/
- public function filterByCustomerTitleId($customerTitleId = null, $comparison = null)
+ public function filterByTitleId($titleId = null, $comparison = null)
{
- if (is_array($customerTitleId)) {
+ if (is_array($titleId)) {
$useMinMax = false;
- if (isset($customerTitleId['min'])) {
- $this->addUsingAlias(AddressTableMap::CUSTOMER_TITLE_ID, $customerTitleId['min'], Criteria::GREATER_EQUAL);
+ if (isset($titleId['min'])) {
+ $this->addUsingAlias(AddressTableMap::TITLE_ID, $titleId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($customerTitleId['max'])) {
- $this->addUsingAlias(AddressTableMap::CUSTOMER_TITLE_ID, $customerTitleId['max'], Criteria::LESS_EQUAL);
+ if (isset($titleId['max'])) {
+ $this->addUsingAlias(AddressTableMap::TITLE_ID, $titleId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -449,7 +453,7 @@ abstract class AddressQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(AddressTableMap::CUSTOMER_TITLE_ID, $customerTitleId, $comparison);
+ return $this->addUsingAlias(AddressTableMap::TITLE_ID, $titleId, $comparison);
}
/**
@@ -694,6 +698,8 @@ abstract class AddressQuery extends ModelCriteria
* $query->filterByCountryId(array('min' => 12)); // WHERE country_id > 12
*
*
+ * @see filterByCountry()
+ *
* @param mixed $countryId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
@@ -997,14 +1003,14 @@ abstract class AddressQuery extends ModelCriteria
{
if ($customerTitle instanceof \Thelia\Model\CustomerTitle) {
return $this
- ->addUsingAlias(AddressTableMap::CUSTOMER_TITLE_ID, $customerTitle->getId(), $comparison);
+ ->addUsingAlias(AddressTableMap::TITLE_ID, $customerTitle->getId(), $comparison);
} elseif ($customerTitle instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(AddressTableMap::CUSTOMER_TITLE_ID, $customerTitle->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(AddressTableMap::TITLE_ID, $customerTitle->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCustomerTitle() only accepts arguments of type \Thelia\Model\CustomerTitle or Collection');
}
@@ -1018,7 +1024,7 @@ abstract class AddressQuery extends ModelCriteria
*
* @return ChildAddressQuery The current query, for fluid interface
*/
- public function joinCustomerTitle($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function joinCustomerTitle($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CustomerTitle');
@@ -1053,13 +1059,88 @@ abstract class AddressQuery extends ModelCriteria
*
* @return \Thelia\Model\CustomerTitleQuery A secondary query class using the current class as primary query
*/
- public function useCustomerTitleQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function useCustomerTitleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCustomerTitle($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerTitle', '\Thelia\Model\CustomerTitleQuery');
}
+ /**
+ * Filter the query by a related \Thelia\Model\Country object
+ *
+ * @param \Thelia\Model\Country|ObjectCollection $country The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildAddressQuery The current query, for fluid interface
+ */
+ public function filterByCountry($country, $comparison = null)
+ {
+ if ($country instanceof \Thelia\Model\Country) {
+ return $this
+ ->addUsingAlias(AddressTableMap::COUNTRY_ID, $country->getId(), $comparison);
+ } elseif ($country instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(AddressTableMap::COUNTRY_ID, $country->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByCountry() only accepts arguments of type \Thelia\Model\Country or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Country relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildAddressQuery The current query, for fluid interface
+ */
+ public function joinCountry($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Country');
+
+ // 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, 'Country');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Country relation Country 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\CountryQuery A secondary query class using the current class as primary query
+ */
+ public function useCountryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinCountry($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Country', '\Thelia\Model\CountryQuery');
+ }
+
/**
* Filter the query by a related \Thelia\Model\Cart object
*
diff --git a/core/lib/Thelia/Model/Base/Admin.php b/core/lib/Thelia/Model/Base/Admin.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AdminGroup.php b/core/lib/Thelia/Model/Base/AdminGroup.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AdminGroupQuery.php b/core/lib/Thelia/Model/Base/AdminGroupQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AdminLog.php b/core/lib/Thelia/Model/Base/AdminLog.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AdminLogQuery.php b/core/lib/Thelia/Model/Base/AdminLogQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AdminQuery.php b/core/lib/Thelia/Model/Base/AdminQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Area.php b/core/lib/Thelia/Model/Base/Area.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AreaQuery.php b/core/lib/Thelia/Model/Base/AreaQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Attribute.php b/core/lib/Thelia/Model/Base/Attribute.php
old mode 100755
new mode 100644
index 9995df65f..efe4a631d
--- a/core/lib/Thelia/Model/Base/Attribute.php
+++ b/core/lib/Thelia/Model/Base/Attribute.php
@@ -1839,10 +1839,10 @@ abstract class Attribute implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildAttributeCombination[] List of ChildAttributeCombination objects
*/
- public function getAttributeCombinationsJoinCombination($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getAttributeCombinationsJoinProductSaleElements($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildAttributeCombinationQuery::create(null, $criteria);
- $query->joinWith('Combination', $joinBehavior);
+ $query->joinWith('ProductSaleElements', $joinBehavior);
return $this->getAttributeCombinations($query, $con);
}
diff --git a/core/lib/Thelia/Model/Base/AttributeAv.php b/core/lib/Thelia/Model/Base/AttributeAv.php
old mode 100755
new mode 100644
index be785f3e6..43a1be294
--- a/core/lib/Thelia/Model/Base/AttributeAv.php
+++ b/core/lib/Thelia/Model/Base/AttributeAv.php
@@ -1628,10 +1628,10 @@ abstract class AttributeAv implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildAttributeCombination[] List of ChildAttributeCombination objects
*/
- public function getAttributeCombinationsJoinCombination($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getAttributeCombinationsJoinProductSaleElements($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildAttributeCombinationQuery::create(null, $criteria);
- $query->joinWith('Combination', $joinBehavior);
+ $query->joinWith('ProductSaleElements', $joinBehavior);
return $this->getAttributeCombinations($query, $con);
}
diff --git a/core/lib/Thelia/Model/Base/AttributeAvI18n.php b/core/lib/Thelia/Model/Base/AttributeAvI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AttributeAvI18nQuery.php b/core/lib/Thelia/Model/Base/AttributeAvI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AttributeAvQuery.php b/core/lib/Thelia/Model/Base/AttributeAvQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AttributeCategory.php b/core/lib/Thelia/Model/Base/AttributeCategory.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AttributeCategoryQuery.php b/core/lib/Thelia/Model/Base/AttributeCategoryQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AttributeCombination.php b/core/lib/Thelia/Model/Base/AttributeCombination.php
old mode 100755
new mode 100644
index 53e671777..ea2ade03c
--- a/core/lib/Thelia/Model/Base/AttributeCombination.php
+++ b/core/lib/Thelia/Model/Base/AttributeCombination.php
@@ -22,8 +22,8 @@ use Thelia\Model\AttributeAvQuery as ChildAttributeAvQuery;
use Thelia\Model\AttributeCombination as ChildAttributeCombination;
use Thelia\Model\AttributeCombinationQuery as ChildAttributeCombinationQuery;
use Thelia\Model\AttributeQuery as ChildAttributeQuery;
-use Thelia\Model\Combination as ChildCombination;
-use Thelia\Model\CombinationQuery as ChildCombinationQuery;
+use Thelia\Model\ProductSaleElements as ChildProductSaleElements;
+use Thelia\Model\ProductSaleElementsQuery as ChildProductSaleElementsQuery;
use Thelia\Model\Map\AttributeCombinationTableMap;
abstract class AttributeCombination implements ActiveRecordInterface
@@ -60,30 +60,24 @@ abstract class AttributeCombination implements ActiveRecordInterface
*/
protected $virtualColumns = array();
- /**
- * The value for the id field.
- * @var int
- */
- protected $id;
-
/**
* The value for the attribute_id field.
* @var int
*/
protected $attribute_id;
- /**
- * The value for the combination_id field.
- * @var int
- */
- protected $combination_id;
-
/**
* The value for the attribute_av_id field.
* @var int
*/
protected $attribute_av_id;
+ /**
+ * The value for the product_sale_elements_id field.
+ * @var int
+ */
+ protected $product_sale_elements_id;
+
/**
* The value for the created_at field.
* @var string
@@ -107,9 +101,9 @@ abstract class AttributeCombination implements ActiveRecordInterface
protected $aAttributeAv;
/**
- * @var Combination
+ * @var ProductSaleElements
*/
- protected $aCombination;
+ protected $aProductSaleElements;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -373,17 +367,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
return array_keys(get_object_vars($this));
}
- /**
- * Get the [id] column value.
- *
- * @return int
- */
- public function getId()
- {
-
- return $this->id;
- }
-
/**
* Get the [attribute_id] column value.
*
@@ -395,17 +378,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
return $this->attribute_id;
}
- /**
- * Get the [combination_id] column value.
- *
- * @return int
- */
- public function getCombinationId()
- {
-
- return $this->combination_id;
- }
-
/**
* Get the [attribute_av_id] column value.
*
@@ -417,6 +389,17 @@ abstract class AttributeCombination implements ActiveRecordInterface
return $this->attribute_av_id;
}
+ /**
+ * Get the [product_sale_elements_id] column value.
+ *
+ * @return int
+ */
+ public function getProductSaleElementsId()
+ {
+
+ return $this->product_sale_elements_id;
+ }
+
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -457,27 +440,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
}
}
- /**
- * Set the value of [id] column.
- *
- * @param int $v new value
- * @return \Thelia\Model\AttributeCombination The current object (for fluent API support)
- */
- public function setId($v)
- {
- if ($v !== null) {
- $v = (int) $v;
- }
-
- if ($this->id !== $v) {
- $this->id = $v;
- $this->modifiedColumns[] = AttributeCombinationTableMap::ID;
- }
-
-
- return $this;
- } // setId()
-
/**
* Set the value of [attribute_id] column.
*
@@ -503,31 +465,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
return $this;
} // setAttributeId()
- /**
- * Set the value of [combination_id] column.
- *
- * @param int $v new value
- * @return \Thelia\Model\AttributeCombination The current object (for fluent API support)
- */
- public function setCombinationId($v)
- {
- if ($v !== null) {
- $v = (int) $v;
- }
-
- if ($this->combination_id !== $v) {
- $this->combination_id = $v;
- $this->modifiedColumns[] = AttributeCombinationTableMap::COMBINATION_ID;
- }
-
- if ($this->aCombination !== null && $this->aCombination->getId() !== $v) {
- $this->aCombination = null;
- }
-
-
- return $this;
- } // setCombinationId()
-
/**
* Set the value of [attribute_av_id] column.
*
@@ -553,6 +490,31 @@ abstract class AttributeCombination implements ActiveRecordInterface
return $this;
} // setAttributeAvId()
+ /**
+ * Set the value of [product_sale_elements_id] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\AttributeCombination The current object (for fluent API support)
+ */
+ public function setProductSaleElementsId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->product_sale_elements_id !== $v) {
+ $this->product_sale_elements_id = $v;
+ $this->modifiedColumns[] = AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID;
+ }
+
+ if ($this->aProductSaleElements !== null && $this->aProductSaleElements->getId() !== $v) {
+ $this->aProductSaleElements = null;
+ }
+
+
+ return $this;
+ } // setProductSaleElementsId()
+
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -632,25 +594,22 @@ abstract class AttributeCombination implements ActiveRecordInterface
try {
- $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : AttributeCombinationTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
- $this->id = (null !== $col) ? (int) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AttributeCombinationTableMap::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : AttributeCombinationTableMap::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)];
$this->attribute_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AttributeCombinationTableMap::translateFieldName('CombinationId', TableMap::TYPE_PHPNAME, $indexType)];
- $this->combination_id = (null !== $col) ? (int) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AttributeCombinationTableMap::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AttributeCombinationTableMap::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)];
$this->attribute_av_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AttributeCombinationTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AttributeCombinationTableMap::translateFieldName('ProductSaleElementsId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->product_sale_elements_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AttributeCombinationTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : AttributeCombinationTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AttributeCombinationTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -663,7 +622,7 @@ abstract class AttributeCombination implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 6; // 6 = AttributeCombinationTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 5; // 5 = AttributeCombinationTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\AttributeCombination object", 0, $e);
@@ -688,12 +647,12 @@ abstract class AttributeCombination implements ActiveRecordInterface
if ($this->aAttribute !== null && $this->attribute_id !== $this->aAttribute->getId()) {
$this->aAttribute = null;
}
- if ($this->aCombination !== null && $this->combination_id !== $this->aCombination->getId()) {
- $this->aCombination = null;
- }
if ($this->aAttributeAv !== null && $this->attribute_av_id !== $this->aAttributeAv->getId()) {
$this->aAttributeAv = null;
}
+ if ($this->aProductSaleElements !== null && $this->product_sale_elements_id !== $this->aProductSaleElements->getId()) {
+ $this->aProductSaleElements = null;
+ }
} // ensureConsistency
/**
@@ -735,7 +694,7 @@ abstract class AttributeCombination implements ActiveRecordInterface
$this->aAttribute = null;
$this->aAttributeAv = null;
- $this->aCombination = null;
+ $this->aProductSaleElements = null;
} // if (deep)
}
@@ -877,11 +836,11 @@ abstract class AttributeCombination implements ActiveRecordInterface
$this->setAttributeAv($this->aAttributeAv);
}
- if ($this->aCombination !== null) {
- if ($this->aCombination->isModified() || $this->aCombination->isNew()) {
- $affectedRows += $this->aCombination->save($con);
+ if ($this->aProductSaleElements !== null) {
+ if ($this->aProductSaleElements->isModified() || $this->aProductSaleElements->isNew()) {
+ $affectedRows += $this->aProductSaleElements->save($con);
}
- $this->setCombination($this->aCombination);
+ $this->setProductSaleElements($this->aProductSaleElements);
}
if ($this->isNew() || $this->isModified()) {
@@ -915,24 +874,17 @@ abstract class AttributeCombination implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
- $this->modifiedColumns[] = AttributeCombinationTableMap::ID;
- if (null !== $this->id) {
- throw new PropelException('Cannot insert a value for auto-increment primary key (' . AttributeCombinationTableMap::ID . ')');
- }
// check the columns in natural order for more readable SQL queries
- if ($this->isColumnModified(AttributeCombinationTableMap::ID)) {
- $modifiedColumns[':p' . $index++] = 'ID';
- }
if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_ID)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_ID';
}
- if ($this->isColumnModified(AttributeCombinationTableMap::COMBINATION_ID)) {
- $modifiedColumns[':p' . $index++] = 'COMBINATION_ID';
- }
if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_AV_ID)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_ID';
}
+ if ($this->isColumnModified(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID)) {
+ $modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_ID';
+ }
if ($this->isColumnModified(AttributeCombinationTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -950,18 +902,15 @@ abstract class AttributeCombination implements ActiveRecordInterface
$stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) {
- case 'ID':
- $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
- break;
case 'ATTRIBUTE_ID':
$stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT);
break;
- case 'COMBINATION_ID':
- $stmt->bindValue($identifier, $this->combination_id, PDO::PARAM_INT);
- break;
case 'ATTRIBUTE_AV_ID':
$stmt->bindValue($identifier, $this->attribute_av_id, PDO::PARAM_INT);
break;
+ case 'PRODUCT_SALE_ELEMENTS_ID':
+ $stmt->bindValue($identifier, $this->product_sale_elements_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);
break;
@@ -976,13 +925,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
}
- try {
- $pk = $con->lastInsertId();
- } catch (Exception $e) {
- throw new PropelException('Unable to get autoincrement id.', 0, $e);
- }
- $this->setId($pk);
-
$this->setNew(false);
}
@@ -1031,21 +973,18 @@ abstract class AttributeCombination implements ActiveRecordInterface
{
switch ($pos) {
case 0:
- return $this->getId();
- break;
- case 1:
return $this->getAttributeId();
break;
- case 2:
- return $this->getCombinationId();
- break;
- case 3:
+ case 1:
return $this->getAttributeAvId();
break;
- case 4:
+ case 2:
+ return $this->getProductSaleElementsId();
+ break;
+ case 3:
return $this->getCreatedAt();
break;
- case 5:
+ case 4:
return $this->getUpdatedAt();
break;
default:
@@ -1077,12 +1016,11 @@ abstract class AttributeCombination implements ActiveRecordInterface
$alreadyDumpedObjects['AttributeCombination'][serialize($this->getPrimaryKey())] = true;
$keys = AttributeCombinationTableMap::getFieldNames($keyType);
$result = array(
- $keys[0] => $this->getId(),
- $keys[1] => $this->getAttributeId(),
- $keys[2] => $this->getCombinationId(),
- $keys[3] => $this->getAttributeAvId(),
- $keys[4] => $this->getCreatedAt(),
- $keys[5] => $this->getUpdatedAt(),
+ $keys[0] => $this->getAttributeId(),
+ $keys[1] => $this->getAttributeAvId(),
+ $keys[2] => $this->getProductSaleElementsId(),
+ $keys[3] => $this->getCreatedAt(),
+ $keys[4] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1097,8 +1035,8 @@ abstract class AttributeCombination implements ActiveRecordInterface
if (null !== $this->aAttributeAv) {
$result['AttributeAv'] = $this->aAttributeAv->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
- if (null !== $this->aCombination) {
- $result['Combination'] = $this->aCombination->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ if (null !== $this->aProductSaleElements) {
+ $result['ProductSaleElements'] = $this->aProductSaleElements->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
@@ -1135,21 +1073,18 @@ abstract class AttributeCombination implements ActiveRecordInterface
{
switch ($pos) {
case 0:
- $this->setId($value);
- break;
- case 1:
$this->setAttributeId($value);
break;
- case 2:
- $this->setCombinationId($value);
- break;
- case 3:
+ case 1:
$this->setAttributeAvId($value);
break;
- case 4:
+ case 2:
+ $this->setProductSaleElementsId($value);
+ break;
+ case 3:
$this->setCreatedAt($value);
break;
- case 5:
+ case 4:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1176,12 +1111,11 @@ abstract class AttributeCombination implements ActiveRecordInterface
{
$keys = AttributeCombinationTableMap::getFieldNames($keyType);
- if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setAttributeId($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCombinationId($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setAttributeAvId($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setUpdatedAt($arr[$keys[5]]);
+ if (array_key_exists($keys[0], $arr)) $this->setAttributeId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setAttributeAvId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setProductSaleElementsId($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]]);
}
/**
@@ -1193,10 +1127,9 @@ abstract class AttributeCombination implements ActiveRecordInterface
{
$criteria = new Criteria(AttributeCombinationTableMap::DATABASE_NAME);
- if ($this->isColumnModified(AttributeCombinationTableMap::ID)) $criteria->add(AttributeCombinationTableMap::ID, $this->id);
if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_ID)) $criteria->add(AttributeCombinationTableMap::ATTRIBUTE_ID, $this->attribute_id);
- if ($this->isColumnModified(AttributeCombinationTableMap::COMBINATION_ID)) $criteria->add(AttributeCombinationTableMap::COMBINATION_ID, $this->combination_id);
if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_AV_ID)) $criteria->add(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $this->attribute_av_id);
+ if ($this->isColumnModified(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID)) $criteria->add(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $this->product_sale_elements_id);
if ($this->isColumnModified(AttributeCombinationTableMap::CREATED_AT)) $criteria->add(AttributeCombinationTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(AttributeCombinationTableMap::UPDATED_AT)) $criteria->add(AttributeCombinationTableMap::UPDATED_AT, $this->updated_at);
@@ -1214,10 +1147,9 @@ abstract class AttributeCombination implements ActiveRecordInterface
public function buildPkeyCriteria()
{
$criteria = new Criteria(AttributeCombinationTableMap::DATABASE_NAME);
- $criteria->add(AttributeCombinationTableMap::ID, $this->id);
$criteria->add(AttributeCombinationTableMap::ATTRIBUTE_ID, $this->attribute_id);
- $criteria->add(AttributeCombinationTableMap::COMBINATION_ID, $this->combination_id);
$criteria->add(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $this->attribute_av_id);
+ $criteria->add(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $this->product_sale_elements_id);
return $criteria;
}
@@ -1230,10 +1162,9 @@ abstract class AttributeCombination implements ActiveRecordInterface
public function getPrimaryKey()
{
$pks = array();
- $pks[0] = $this->getId();
- $pks[1] = $this->getAttributeId();
- $pks[2] = $this->getCombinationId();
- $pks[3] = $this->getAttributeAvId();
+ $pks[0] = $this->getAttributeId();
+ $pks[1] = $this->getAttributeAvId();
+ $pks[2] = $this->getProductSaleElementsId();
return $pks;
}
@@ -1246,10 +1177,9 @@ abstract class AttributeCombination implements ActiveRecordInterface
*/
public function setPrimaryKey($keys)
{
- $this->setId($keys[0]);
- $this->setAttributeId($keys[1]);
- $this->setCombinationId($keys[2]);
- $this->setAttributeAvId($keys[3]);
+ $this->setAttributeId($keys[0]);
+ $this->setAttributeAvId($keys[1]);
+ $this->setProductSaleElementsId($keys[2]);
}
/**
@@ -1259,7 +1189,7 @@ abstract class AttributeCombination implements ActiveRecordInterface
public function isPrimaryKeyNull()
{
- return (null === $this->getId()) && (null === $this->getAttributeId()) && (null === $this->getCombinationId()) && (null === $this->getAttributeAvId());
+ return (null === $this->getAttributeId()) && (null === $this->getAttributeAvId()) && (null === $this->getProductSaleElementsId());
}
/**
@@ -1276,13 +1206,12 @@ abstract class AttributeCombination implements ActiveRecordInterface
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setAttributeId($this->getAttributeId());
- $copyObj->setCombinationId($this->getCombinationId());
$copyObj->setAttributeAvId($this->getAttributeAvId());
+ $copyObj->setProductSaleElementsId($this->getProductSaleElementsId());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
$copyObj->setNew(true);
- $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
}
}
@@ -1411,24 +1340,24 @@ abstract class AttributeCombination implements ActiveRecordInterface
}
/**
- * Declares an association between this object and a ChildCombination object.
+ * Declares an association between this object and a ChildProductSaleElements object.
*
- * @param ChildCombination $v
+ * @param ChildProductSaleElements $v
* @return \Thelia\Model\AttributeCombination The current object (for fluent API support)
* @throws PropelException
*/
- public function setCombination(ChildCombination $v = null)
+ public function setProductSaleElements(ChildProductSaleElements $v = null)
{
if ($v === null) {
- $this->setCombinationId(NULL);
+ $this->setProductSaleElementsId(NULL);
} else {
- $this->setCombinationId($v->getId());
+ $this->setProductSaleElementsId($v->getId());
}
- $this->aCombination = $v;
+ $this->aProductSaleElements = $v;
// Add binding for other direction of this n:n relationship.
- // If this object has already been added to the ChildCombination object, it will not be re-added.
+ // If this object has already been added to the ChildProductSaleElements object, it will not be re-added.
if ($v !== null) {
$v->addAttributeCombination($this);
}
@@ -1439,26 +1368,26 @@ abstract class AttributeCombination implements ActiveRecordInterface
/**
- * Get the associated ChildCombination object
+ * Get the associated ChildProductSaleElements object
*
* @param ConnectionInterface $con Optional Connection object.
- * @return ChildCombination The associated ChildCombination object.
+ * @return ChildProductSaleElements The associated ChildProductSaleElements object.
* @throws PropelException
*/
- public function getCombination(ConnectionInterface $con = null)
+ public function getProductSaleElements(ConnectionInterface $con = null)
{
- if ($this->aCombination === null && ($this->combination_id !== null)) {
- $this->aCombination = ChildCombinationQuery::create()->findPk($this->combination_id, $con);
+ if ($this->aProductSaleElements === null && ($this->product_sale_elements_id !== null)) {
+ $this->aProductSaleElements = ChildProductSaleElementsQuery::create()->findPk($this->product_sale_elements_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->aCombination->addAttributeCombinations($this);
+ $this->aProductSaleElements->addAttributeCombinations($this);
*/
}
- return $this->aCombination;
+ return $this->aProductSaleElements;
}
/**
@@ -1466,10 +1395,9 @@ abstract class AttributeCombination implements ActiveRecordInterface
*/
public function clear()
{
- $this->id = null;
$this->attribute_id = null;
- $this->combination_id = null;
$this->attribute_av_id = null;
+ $this->product_sale_elements_id = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
@@ -1495,7 +1423,7 @@ abstract class AttributeCombination implements ActiveRecordInterface
$this->aAttribute = null;
$this->aAttributeAv = null;
- $this->aCombination = null;
+ $this->aProductSaleElements = null;
}
/**
diff --git a/core/lib/Thelia/Model/Base/AttributeCombinationQuery.php b/core/lib/Thelia/Model/Base/AttributeCombinationQuery.php
old mode 100755
new mode 100644
index 6ccd2fcba..291ff7725
--- a/core/lib/Thelia/Model/Base/AttributeCombinationQuery.php
+++ b/core/lib/Thelia/Model/Base/AttributeCombinationQuery.php
@@ -21,17 +21,15 @@ use Thelia\Model\Map\AttributeCombinationTableMap;
*
*
*
- * @method ChildAttributeCombinationQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAttributeCombinationQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
- * @method ChildAttributeCombinationQuery orderByCombinationId($order = Criteria::ASC) Order by the combination_id column
* @method ChildAttributeCombinationQuery orderByAttributeAvId($order = Criteria::ASC) Order by the attribute_av_id column
+ * @method ChildAttributeCombinationQuery orderByProductSaleElementsId($order = Criteria::ASC) Order by the product_sale_elements_id column
* @method ChildAttributeCombinationQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAttributeCombinationQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
- * @method ChildAttributeCombinationQuery groupById() Group by the id column
* @method ChildAttributeCombinationQuery groupByAttributeId() Group by the attribute_id column
- * @method ChildAttributeCombinationQuery groupByCombinationId() Group by the combination_id column
* @method ChildAttributeCombinationQuery groupByAttributeAvId() Group by the attribute_av_id column
+ * @method ChildAttributeCombinationQuery groupByProductSaleElementsId() Group by the product_sale_elements_id column
* @method ChildAttributeCombinationQuery groupByCreatedAt() Group by the created_at column
* @method ChildAttributeCombinationQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -47,24 +45,22 @@ use Thelia\Model\Map\AttributeCombinationTableMap;
* @method ChildAttributeCombinationQuery rightJoinAttributeAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeAv relation
* @method ChildAttributeCombinationQuery innerJoinAttributeAv($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeAv relation
*
- * @method ChildAttributeCombinationQuery leftJoinCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the Combination relation
- * @method ChildAttributeCombinationQuery rightJoinCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Combination relation
- * @method ChildAttributeCombinationQuery innerJoinCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the Combination relation
+ * @method ChildAttributeCombinationQuery leftJoinProductSaleElements($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductSaleElements relation
+ * @method ChildAttributeCombinationQuery rightJoinProductSaleElements($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductSaleElements relation
+ * @method ChildAttributeCombinationQuery innerJoinProductSaleElements($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductSaleElements relation
*
* @method ChildAttributeCombination findOne(ConnectionInterface $con = null) Return the first ChildAttributeCombination matching the query
* @method ChildAttributeCombination findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAttributeCombination matching the query, or a new ChildAttributeCombination object populated from the query conditions when no match is found
*
- * @method ChildAttributeCombination findOneById(int $id) Return the first ChildAttributeCombination filtered by the id column
* @method ChildAttributeCombination findOneByAttributeId(int $attribute_id) Return the first ChildAttributeCombination filtered by the attribute_id column
- * @method ChildAttributeCombination findOneByCombinationId(int $combination_id) Return the first ChildAttributeCombination filtered by the combination_id column
* @method ChildAttributeCombination findOneByAttributeAvId(int $attribute_av_id) Return the first ChildAttributeCombination filtered by the attribute_av_id column
+ * @method ChildAttributeCombination findOneByProductSaleElementsId(int $product_sale_elements_id) Return the first ChildAttributeCombination filtered by the product_sale_elements_id column
* @method ChildAttributeCombination findOneByCreatedAt(string $created_at) Return the first ChildAttributeCombination filtered by the created_at column
* @method ChildAttributeCombination findOneByUpdatedAt(string $updated_at) Return the first ChildAttributeCombination filtered by the updated_at column
*
- * @method array findById(int $id) Return ChildAttributeCombination objects filtered by the id column
* @method array findByAttributeId(int $attribute_id) Return ChildAttributeCombination objects filtered by the attribute_id column
- * @method array findByCombinationId(int $combination_id) Return ChildAttributeCombination objects filtered by the combination_id column
* @method array findByAttributeAvId(int $attribute_av_id) Return ChildAttributeCombination objects filtered by the attribute_av_id column
+ * @method array findByProductSaleElementsId(int $product_sale_elements_id) Return ChildAttributeCombination objects filtered by the product_sale_elements_id column
* @method array findByCreatedAt(string $created_at) Return ChildAttributeCombination objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAttributeCombination objects filtered by the updated_at column
*
@@ -114,10 +110,10 @@ abstract class AttributeCombinationQuery extends ModelCriteria
* Go fast if the query is untouched.
*
*
- * $obj = $c->findPk(array(12, 34, 56, 78), $con);
+ * $obj = $c->findPk(array(12, 34, 56), $con);
*
*
- * @param array[$id, $attribute_id, $combination_id, $attribute_av_id] $key Primary key to use for the query
+ * @param array[$attribute_id, $attribute_av_id, $product_sale_elements_id] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildAttributeCombination|array|mixed the result, formatted by the current formatter
@@ -127,7 +123,7 @@ abstract class AttributeCombinationQuery extends ModelCriteria
if ($key === null) {
return null;
}
- if ((null !== ($obj = AttributeCombinationTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2], (string) $key[3]))))) && !$this->formatter) {
+ if ((null !== ($obj = AttributeCombinationTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
@@ -155,13 +151,12 @@ abstract class AttributeCombinationQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, ATTRIBUTE_ID, COMBINATION_ID, ATTRIBUTE_AV_ID, CREATED_AT, UPDATED_AT FROM attribute_combination WHERE ID = :p0 AND ATTRIBUTE_ID = :p1 AND COMBINATION_ID = :p2 AND ATTRIBUTE_AV_ID = :p3';
+ $sql = 'SELECT ATTRIBUTE_ID, ATTRIBUTE_AV_ID, PRODUCT_SALE_ELEMENTS_ID, CREATED_AT, UPDATED_AT FROM attribute_combination WHERE ATTRIBUTE_ID = :p0 AND ATTRIBUTE_AV_ID = :p1 AND PRODUCT_SALE_ELEMENTS_ID = :p2';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
$stmt->bindValue(':p2', $key[2], PDO::PARAM_INT);
- $stmt->bindValue(':p3', $key[3], PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
@@ -171,7 +166,7 @@ abstract class AttributeCombinationQuery extends ModelCriteria
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildAttributeCombination();
$obj->hydrate($row);
- AttributeCombinationTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2], (string) $key[3])));
+ AttributeCombinationTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2])));
}
$stmt->closeCursor();
@@ -230,10 +225,9 @@ abstract class AttributeCombinationQuery extends ModelCriteria
*/
public function filterByPrimaryKey($key)
{
- $this->addUsingAlias(AttributeCombinationTableMap::ID, $key[0], Criteria::EQUAL);
- $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $key[1], Criteria::EQUAL);
- $this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $key[2], Criteria::EQUAL);
- $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $key[3], Criteria::EQUAL);
+ $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $key[0], Criteria::EQUAL);
+ $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $key[1], Criteria::EQUAL);
+ $this->addUsingAlias(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $key[2], Criteria::EQUAL);
return $this;
}
@@ -251,60 +245,17 @@ abstract class AttributeCombinationQuery extends ModelCriteria
return $this->add(null, '1<>1', Criteria::CUSTOM);
}
foreach ($keys as $key) {
- $cton0 = $this->getNewCriterion(AttributeCombinationTableMap::ID, $key[0], Criteria::EQUAL);
- $cton1 = $this->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_ID, $key[1], Criteria::EQUAL);
+ $cton0 = $this->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_ID, $key[0], Criteria::EQUAL);
+ $cton1 = $this->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
- $cton2 = $this->getNewCriterion(AttributeCombinationTableMap::COMBINATION_ID, $key[2], Criteria::EQUAL);
+ $cton2 = $this->getNewCriterion(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $key[2], Criteria::EQUAL);
$cton0->addAnd($cton2);
- $cton3 = $this->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $key[3], Criteria::EQUAL);
- $cton0->addAnd($cton3);
$this->addOr($cton0);
}
return $this;
}
- /**
- * Filter the query on the id column
- *
- * Example usage:
- *
- * $query->filterById(1234); // WHERE id = 1234
- * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
- * $query->filterById(array('min' => 12)); // WHERE id > 12
- *
- *
- * @param mixed $id 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 ChildAttributeCombinationQuery The current query, for fluid interface
- */
- public function filterById($id = null, $comparison = null)
- {
- if (is_array($id)) {
- $useMinMax = false;
- if (isset($id['min'])) {
- $this->addUsingAlias(AttributeCombinationTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($id['max'])) {
- $this->addUsingAlias(AttributeCombinationTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(AttributeCombinationTableMap::ID, $id, $comparison);
- }
-
/**
* Filter the query on the attribute_id column
*
@@ -348,49 +299,6 @@ abstract class AttributeCombinationQuery extends ModelCriteria
return $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attributeId, $comparison);
}
- /**
- * Filter the query on the combination_id column
- *
- * Example usage:
- *
- * $query->filterByCombinationId(1234); // WHERE combination_id = 1234
- * $query->filterByCombinationId(array(12, 34)); // WHERE combination_id IN (12, 34)
- * $query->filterByCombinationId(array('min' => 12)); // WHERE combination_id > 12
- *
- *
- * @see filterByCombination()
- *
- * @param mixed $combinationId 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 ChildAttributeCombinationQuery The current query, for fluid interface
- */
- public function filterByCombinationId($combinationId = null, $comparison = null)
- {
- if (is_array($combinationId)) {
- $useMinMax = false;
- if (isset($combinationId['min'])) {
- $this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combinationId['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($combinationId['max'])) {
- $this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combinationId['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combinationId, $comparison);
- }
-
/**
* Filter the query on the attribute_av_id column
*
@@ -434,6 +342,49 @@ abstract class AttributeCombinationQuery extends ModelCriteria
return $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAvId, $comparison);
}
+ /**
+ * Filter the query on the product_sale_elements_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByProductSaleElementsId(1234); // WHERE product_sale_elements_id = 1234
+ * $query->filterByProductSaleElementsId(array(12, 34)); // WHERE product_sale_elements_id IN (12, 34)
+ * $query->filterByProductSaleElementsId(array('min' => 12)); // WHERE product_sale_elements_id > 12
+ *
+ *
+ * @see filterByProductSaleElements()
+ *
+ * @param mixed $productSaleElementsId 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 ChildAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByProductSaleElementsId($productSaleElementsId = null, $comparison = null)
+ {
+ if (is_array($productSaleElementsId)) {
+ $useMinMax = false;
+ if (isset($productSaleElementsId['min'])) {
+ $this->addUsingAlias(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($productSaleElementsId['max'])) {
+ $this->addUsingAlias(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId, $comparison);
+ }
+
/**
* Filter the query on the created_at column
*
@@ -671,42 +622,42 @@ abstract class AttributeCombinationQuery extends ModelCriteria
}
/**
- * Filter the query by a related \Thelia\Model\Combination object
+ * Filter the query by a related \Thelia\Model\ProductSaleElements object
*
- * @param \Thelia\Model\Combination|ObjectCollection $combination The related object(s) to use as filter
+ * @param \Thelia\Model\ProductSaleElements|ObjectCollection $productSaleElements The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
- public function filterByCombination($combination, $comparison = null)
+ public function filterByProductSaleElements($productSaleElements, $comparison = null)
{
- if ($combination instanceof \Thelia\Model\Combination) {
+ if ($productSaleElements instanceof \Thelia\Model\ProductSaleElements) {
return $this
- ->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combination->getId(), $comparison);
- } elseif ($combination instanceof ObjectCollection) {
+ ->addUsingAlias(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElements->getId(), $comparison);
+ } elseif ($productSaleElements instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combination->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElements->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
- throw new PropelException('filterByCombination() only accepts arguments of type \Thelia\Model\Combination or Collection');
+ throw new PropelException('filterByProductSaleElements() only accepts arguments of type \Thelia\Model\ProductSaleElements or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the Combination relation
+ * Adds a JOIN clause to the query using the ProductSaleElements relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
- public function joinCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinProductSaleElements($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Combination');
+ $relationMap = $tableMap->getRelation('ProductSaleElements');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -721,14 +672,14 @@ abstract class AttributeCombinationQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'Combination');
+ $this->addJoinObject($join, 'ProductSaleElements');
}
return $this;
}
/**
- * Use the Combination relation Combination object
+ * Use the ProductSaleElements relation ProductSaleElements object
*
* @see useQuery()
*
@@ -736,13 +687,13 @@ abstract class AttributeCombinationQuery extends ModelCriteria
* 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\CombinationQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\ProductSaleElementsQuery A secondary query class using the current class as primary query
*/
- public function useCombinationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useProductSaleElementsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinCombination($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Combination', '\Thelia\Model\CombinationQuery');
+ ->joinProductSaleElements($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ProductSaleElements', '\Thelia\Model\ProductSaleElementsQuery');
}
/**
@@ -755,11 +706,10 @@ abstract class AttributeCombinationQuery extends ModelCriteria
public function prune($attributeCombination = null)
{
if ($attributeCombination) {
- $this->addCond('pruneCond0', $this->getAliasedColName(AttributeCombinationTableMap::ID), $attributeCombination->getId(), Criteria::NOT_EQUAL);
- $this->addCond('pruneCond1', $this->getAliasedColName(AttributeCombinationTableMap::ATTRIBUTE_ID), $attributeCombination->getAttributeId(), Criteria::NOT_EQUAL);
- $this->addCond('pruneCond2', $this->getAliasedColName(AttributeCombinationTableMap::COMBINATION_ID), $attributeCombination->getCombinationId(), Criteria::NOT_EQUAL);
- $this->addCond('pruneCond3', $this->getAliasedColName(AttributeCombinationTableMap::ATTRIBUTE_AV_ID), $attributeCombination->getAttributeAvId(), Criteria::NOT_EQUAL);
- $this->combine(array('pruneCond0', 'pruneCond1', 'pruneCond2', 'pruneCond3'), Criteria::LOGICAL_OR);
+ $this->addCond('pruneCond0', $this->getAliasedColName(AttributeCombinationTableMap::ATTRIBUTE_ID), $attributeCombination->getAttributeId(), Criteria::NOT_EQUAL);
+ $this->addCond('pruneCond1', $this->getAliasedColName(AttributeCombinationTableMap::ATTRIBUTE_AV_ID), $attributeCombination->getAttributeAvId(), Criteria::NOT_EQUAL);
+ $this->addCond('pruneCond2', $this->getAliasedColName(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID), $attributeCombination->getProductSaleElementsId(), Criteria::NOT_EQUAL);
+ $this->combine(array('pruneCond0', 'pruneCond1', 'pruneCond2'), Criteria::LOGICAL_OR);
}
return $this;
diff --git a/core/lib/Thelia/Model/Base/AttributeI18n.php b/core/lib/Thelia/Model/Base/AttributeI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AttributeI18nQuery.php b/core/lib/Thelia/Model/Base/AttributeI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/AttributeQuery.php b/core/lib/Thelia/Model/Base/AttributeQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Cart.php b/core/lib/Thelia/Model/Base/Cart.php
index 58b28ad6b..910bdf0e0 100644
--- a/core/lib/Thelia/Model/Base/Cart.php
+++ b/core/lib/Thelia/Model/Base/Cart.php
@@ -1963,10 +1963,10 @@ abstract class Cart implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildCartItem[] List of ChildCartItem objects
*/
- public function getCartItemsJoinCombination($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getCartItemsJoinProductSaleElements($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildCartItemQuery::create(null, $criteria);
- $query->joinWith('Combination', $joinBehavior);
+ $query->joinWith('ProductSaleElements', $joinBehavior);
return $this->getCartItems($query, $con);
}
diff --git a/core/lib/Thelia/Model/Base/CartItem.php b/core/lib/Thelia/Model/Base/CartItem.php
index f5eea36fc..fa187435a 100644
--- a/core/lib/Thelia/Model/Base/CartItem.php
+++ b/core/lib/Thelia/Model/Base/CartItem.php
@@ -20,10 +20,10 @@ use Thelia\Model\Cart as ChildCart;
use Thelia\Model\CartItem as ChildCartItem;
use Thelia\Model\CartItemQuery as ChildCartItemQuery;
use Thelia\Model\CartQuery as ChildCartQuery;
-use Thelia\Model\Combination as ChildCombination;
-use Thelia\Model\CombinationQuery as ChildCombinationQuery;
use Thelia\Model\Product as ChildProduct;
use Thelia\Model\ProductQuery as ChildProductQuery;
+use Thelia\Model\ProductSaleElements as ChildProductSaleElements;
+use Thelia\Model\ProductSaleElementsQuery as ChildProductSaleElementsQuery;
use Thelia\Model\Map\CartItemTableMap;
abstract class CartItem implements ActiveRecordInterface
@@ -86,10 +86,10 @@ abstract class CartItem implements ActiveRecordInterface
protected $quantity;
/**
- * The value for the combination_id field.
+ * The value for the product_sale_elements_id field.
* @var int
*/
- protected $combination_id;
+ protected $product_sale_elements_id;
/**
* The value for the created_at field.
@@ -114,9 +114,9 @@ abstract class CartItem implements ActiveRecordInterface
protected $aProduct;
/**
- * @var Combination
+ * @var ProductSaleElements
*/
- protected $aCombination;
+ protected $aProductSaleElements;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -438,14 +438,14 @@ abstract class CartItem implements ActiveRecordInterface
}
/**
- * Get the [combination_id] column value.
+ * Get the [product_sale_elements_id] column value.
*
* @return int
*/
- public function getCombinationId()
+ public function getProductSaleElementsId()
{
- return $this->combination_id;
+ return $this->product_sale_elements_id;
}
/**
@@ -581,29 +581,29 @@ abstract class CartItem implements ActiveRecordInterface
} // setQuantity()
/**
- * Set the value of [combination_id] column.
+ * Set the value of [product_sale_elements_id] column.
*
* @param int $v new value
* @return \Thelia\Model\CartItem The current object (for fluent API support)
*/
- public function setCombinationId($v)
+ public function setProductSaleElementsId($v)
{
if ($v !== null) {
$v = (int) $v;
}
- if ($this->combination_id !== $v) {
- $this->combination_id = $v;
- $this->modifiedColumns[] = CartItemTableMap::COMBINATION_ID;
+ if ($this->product_sale_elements_id !== $v) {
+ $this->product_sale_elements_id = $v;
+ $this->modifiedColumns[] = CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID;
}
- if ($this->aCombination !== null && $this->aCombination->getId() !== $v) {
- $this->aCombination = null;
+ if ($this->aProductSaleElements !== null && $this->aProductSaleElements->getId() !== $v) {
+ $this->aProductSaleElements = null;
}
return $this;
- } // setCombinationId()
+ } // setProductSaleElementsId()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
@@ -700,8 +700,8 @@ abstract class CartItem implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CartItemTableMap::translateFieldName('Quantity', TableMap::TYPE_PHPNAME, $indexType)];
$this->quantity = (null !== $col) ? (double) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CartItemTableMap::translateFieldName('CombinationId', TableMap::TYPE_PHPNAME, $indexType)];
- $this->combination_id = (null !== $col) ? (int) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CartItemTableMap::translateFieldName('ProductSaleElementsId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->product_sale_elements_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CartItemTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
@@ -750,8 +750,8 @@ abstract class CartItem implements ActiveRecordInterface
if ($this->aProduct !== null && $this->product_id !== $this->aProduct->getId()) {
$this->aProduct = null;
}
- if ($this->aCombination !== null && $this->combination_id !== $this->aCombination->getId()) {
- $this->aCombination = null;
+ if ($this->aProductSaleElements !== null && $this->product_sale_elements_id !== $this->aProductSaleElements->getId()) {
+ $this->aProductSaleElements = null;
}
} // ensureConsistency
@@ -794,7 +794,7 @@ abstract class CartItem implements ActiveRecordInterface
$this->aCart = null;
$this->aProduct = null;
- $this->aCombination = null;
+ $this->aProductSaleElements = null;
} // if (deep)
}
@@ -936,11 +936,11 @@ abstract class CartItem implements ActiveRecordInterface
$this->setProduct($this->aProduct);
}
- if ($this->aCombination !== null) {
- if ($this->aCombination->isModified() || $this->aCombination->isNew()) {
- $affectedRows += $this->aCombination->save($con);
+ if ($this->aProductSaleElements !== null) {
+ if ($this->aProductSaleElements->isModified() || $this->aProductSaleElements->isNew()) {
+ $affectedRows += $this->aProductSaleElements->save($con);
}
- $this->setCombination($this->aCombination);
+ $this->setProductSaleElements($this->aProductSaleElements);
}
if ($this->isNew() || $this->isModified()) {
@@ -992,8 +992,8 @@ abstract class CartItem implements ActiveRecordInterface
if ($this->isColumnModified(CartItemTableMap::QUANTITY)) {
$modifiedColumns[':p' . $index++] = 'QUANTITY';
}
- if ($this->isColumnModified(CartItemTableMap::COMBINATION_ID)) {
- $modifiedColumns[':p' . $index++] = 'COMBINATION_ID';
+ if ($this->isColumnModified(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID)) {
+ $modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_ID';
}
if ($this->isColumnModified(CartItemTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
@@ -1024,8 +1024,8 @@ abstract class CartItem implements ActiveRecordInterface
case 'QUANTITY':
$stmt->bindValue($identifier, $this->quantity, PDO::PARAM_STR);
break;
- case 'COMBINATION_ID':
- $stmt->bindValue($identifier, $this->combination_id, PDO::PARAM_INT);
+ case 'PRODUCT_SALE_ELEMENTS_ID':
+ $stmt->bindValue($identifier, $this->product_sale_elements_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);
@@ -1108,7 +1108,7 @@ abstract class CartItem implements ActiveRecordInterface
return $this->getQuantity();
break;
case 4:
- return $this->getCombinationId();
+ return $this->getProductSaleElementsId();
break;
case 5:
return $this->getCreatedAt();
@@ -1149,7 +1149,7 @@ abstract class CartItem implements ActiveRecordInterface
$keys[1] => $this->getCartId(),
$keys[2] => $this->getProductId(),
$keys[3] => $this->getQuantity(),
- $keys[4] => $this->getCombinationId(),
+ $keys[4] => $this->getProductSaleElementsId(),
$keys[5] => $this->getCreatedAt(),
$keys[6] => $this->getUpdatedAt(),
);
@@ -1166,8 +1166,8 @@ abstract class CartItem implements ActiveRecordInterface
if (null !== $this->aProduct) {
$result['Product'] = $this->aProduct->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
- if (null !== $this->aCombination) {
- $result['Combination'] = $this->aCombination->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ if (null !== $this->aProductSaleElements) {
+ $result['ProductSaleElements'] = $this->aProductSaleElements->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
@@ -1216,7 +1216,7 @@ abstract class CartItem implements ActiveRecordInterface
$this->setQuantity($value);
break;
case 4:
- $this->setCombinationId($value);
+ $this->setProductSaleElementsId($value);
break;
case 5:
$this->setCreatedAt($value);
@@ -1252,7 +1252,7 @@ abstract class CartItem implements ActiveRecordInterface
if (array_key_exists($keys[1], $arr)) $this->setCartId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setProductId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setQuantity($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setCombinationId($arr[$keys[4]]);
+ if (array_key_exists($keys[4], $arr)) $this->setProductSaleElementsId($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
}
@@ -1270,7 +1270,7 @@ abstract class CartItem implements ActiveRecordInterface
if ($this->isColumnModified(CartItemTableMap::CART_ID)) $criteria->add(CartItemTableMap::CART_ID, $this->cart_id);
if ($this->isColumnModified(CartItemTableMap::PRODUCT_ID)) $criteria->add(CartItemTableMap::PRODUCT_ID, $this->product_id);
if ($this->isColumnModified(CartItemTableMap::QUANTITY)) $criteria->add(CartItemTableMap::QUANTITY, $this->quantity);
- if ($this->isColumnModified(CartItemTableMap::COMBINATION_ID)) $criteria->add(CartItemTableMap::COMBINATION_ID, $this->combination_id);
+ if ($this->isColumnModified(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID)) $criteria->add(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, $this->product_sale_elements_id);
if ($this->isColumnModified(CartItemTableMap::CREATED_AT)) $criteria->add(CartItemTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(CartItemTableMap::UPDATED_AT)) $criteria->add(CartItemTableMap::UPDATED_AT, $this->updated_at);
@@ -1339,7 +1339,7 @@ abstract class CartItem implements ActiveRecordInterface
$copyObj->setCartId($this->getCartId());
$copyObj->setProductId($this->getProductId());
$copyObj->setQuantity($this->getQuantity());
- $copyObj->setCombinationId($this->getCombinationId());
+ $copyObj->setProductSaleElementsId($this->getProductSaleElementsId());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1473,24 +1473,24 @@ abstract class CartItem implements ActiveRecordInterface
}
/**
- * Declares an association between this object and a ChildCombination object.
+ * Declares an association between this object and a ChildProductSaleElements object.
*
- * @param ChildCombination $v
+ * @param ChildProductSaleElements $v
* @return \Thelia\Model\CartItem The current object (for fluent API support)
* @throws PropelException
*/
- public function setCombination(ChildCombination $v = null)
+ public function setProductSaleElements(ChildProductSaleElements $v = null)
{
if ($v === null) {
- $this->setCombinationId(NULL);
+ $this->setProductSaleElementsId(NULL);
} else {
- $this->setCombinationId($v->getId());
+ $this->setProductSaleElementsId($v->getId());
}
- $this->aCombination = $v;
+ $this->aProductSaleElements = $v;
// Add binding for other direction of this n:n relationship.
- // If this object has already been added to the ChildCombination object, it will not be re-added.
+ // If this object has already been added to the ChildProductSaleElements object, it will not be re-added.
if ($v !== null) {
$v->addCartItem($this);
}
@@ -1501,26 +1501,26 @@ abstract class CartItem implements ActiveRecordInterface
/**
- * Get the associated ChildCombination object
+ * Get the associated ChildProductSaleElements object
*
* @param ConnectionInterface $con Optional Connection object.
- * @return ChildCombination The associated ChildCombination object.
+ * @return ChildProductSaleElements The associated ChildProductSaleElements object.
* @throws PropelException
*/
- public function getCombination(ConnectionInterface $con = null)
+ public function getProductSaleElements(ConnectionInterface $con = null)
{
- if ($this->aCombination === null && ($this->combination_id !== null)) {
- $this->aCombination = ChildCombinationQuery::create()->findPk($this->combination_id, $con);
+ if ($this->aProductSaleElements === null && ($this->product_sale_elements_id !== null)) {
+ $this->aProductSaleElements = ChildProductSaleElementsQuery::create()->findPk($this->product_sale_elements_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->aCombination->addCartItems($this);
+ $this->aProductSaleElements->addCartItems($this);
*/
}
- return $this->aCombination;
+ return $this->aProductSaleElements;
}
/**
@@ -1532,7 +1532,7 @@ abstract class CartItem implements ActiveRecordInterface
$this->cart_id = null;
$this->product_id = null;
$this->quantity = null;
- $this->combination_id = null;
+ $this->product_sale_elements_id = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
@@ -1559,7 +1559,7 @@ abstract class CartItem implements ActiveRecordInterface
$this->aCart = null;
$this->aProduct = null;
- $this->aCombination = null;
+ $this->aProductSaleElements = null;
}
/**
diff --git a/core/lib/Thelia/Model/Base/CartItemQuery.php b/core/lib/Thelia/Model/Base/CartItemQuery.php
index 8d96f435d..a7258d60d 100644
--- a/core/lib/Thelia/Model/Base/CartItemQuery.php
+++ b/core/lib/Thelia/Model/Base/CartItemQuery.php
@@ -25,7 +25,7 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItemQuery orderByCartId($order = Criteria::ASC) Order by the cart_id column
* @method ChildCartItemQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
* @method ChildCartItemQuery orderByQuantity($order = Criteria::ASC) Order by the quantity column
- * @method ChildCartItemQuery orderByCombinationId($order = Criteria::ASC) Order by the combination_id column
+ * @method ChildCartItemQuery orderByProductSaleElementsId($order = Criteria::ASC) Order by the product_sale_elements_id column
* @method ChildCartItemQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCartItemQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
@@ -33,7 +33,7 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItemQuery groupByCartId() Group by the cart_id column
* @method ChildCartItemQuery groupByProductId() Group by the product_id column
* @method ChildCartItemQuery groupByQuantity() Group by the quantity column
- * @method ChildCartItemQuery groupByCombinationId() Group by the combination_id column
+ * @method ChildCartItemQuery groupByProductSaleElementsId() Group by the product_sale_elements_id column
* @method ChildCartItemQuery groupByCreatedAt() Group by the created_at column
* @method ChildCartItemQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -49,9 +49,9 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItemQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
* @method ChildCartItemQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
*
- * @method ChildCartItemQuery leftJoinCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the Combination relation
- * @method ChildCartItemQuery rightJoinCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Combination relation
- * @method ChildCartItemQuery innerJoinCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the Combination relation
+ * @method ChildCartItemQuery leftJoinProductSaleElements($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductSaleElements relation
+ * @method ChildCartItemQuery rightJoinProductSaleElements($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductSaleElements relation
+ * @method ChildCartItemQuery innerJoinProductSaleElements($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductSaleElements relation
*
* @method ChildCartItem findOne(ConnectionInterface $con = null) Return the first ChildCartItem matching the query
* @method ChildCartItem findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCartItem matching the query, or a new ChildCartItem object populated from the query conditions when no match is found
@@ -60,7 +60,7 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItem findOneByCartId(int $cart_id) Return the first ChildCartItem filtered by the cart_id column
* @method ChildCartItem findOneByProductId(int $product_id) Return the first ChildCartItem filtered by the product_id column
* @method ChildCartItem findOneByQuantity(double $quantity) Return the first ChildCartItem filtered by the quantity column
- * @method ChildCartItem findOneByCombinationId(int $combination_id) Return the first ChildCartItem filtered by the combination_id column
+ * @method ChildCartItem findOneByProductSaleElementsId(int $product_sale_elements_id) Return the first ChildCartItem filtered by the product_sale_elements_id column
* @method ChildCartItem findOneByCreatedAt(string $created_at) Return the first ChildCartItem filtered by the created_at column
* @method ChildCartItem findOneByUpdatedAt(string $updated_at) Return the first ChildCartItem filtered by the updated_at column
*
@@ -68,7 +68,7 @@ use Thelia\Model\Map\CartItemTableMap;
* @method array findByCartId(int $cart_id) Return ChildCartItem objects filtered by the cart_id column
* @method array findByProductId(int $product_id) Return ChildCartItem objects filtered by the product_id column
* @method array findByQuantity(double $quantity) Return ChildCartItem objects filtered by the quantity column
- * @method array findByCombinationId(int $combination_id) Return ChildCartItem objects filtered by the combination_id column
+ * @method array findByProductSaleElementsId(int $product_sale_elements_id) Return ChildCartItem objects filtered by the product_sale_elements_id column
* @method array findByCreatedAt(string $created_at) Return ChildCartItem objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCartItem objects filtered by the updated_at column
*
@@ -159,7 +159,7 @@ abstract class CartItemQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, CART_ID, PRODUCT_ID, QUANTITY, COMBINATION_ID, CREATED_AT, UPDATED_AT FROM cart_item WHERE ID = :p0';
+ $sql = 'SELECT ID, CART_ID, PRODUCT_ID, QUANTITY, PRODUCT_SALE_ELEMENTS_ID, CREATED_AT, UPDATED_AT FROM cart_item WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -417,18 +417,18 @@ abstract class CartItemQuery extends ModelCriteria
}
/**
- * Filter the query on the combination_id column
+ * Filter the query on the product_sale_elements_id column
*
* Example usage:
*
- * $query->filterByCombinationId(1234); // WHERE combination_id = 1234
- * $query->filterByCombinationId(array(12, 34)); // WHERE combination_id IN (12, 34)
- * $query->filterByCombinationId(array('min' => 12)); // WHERE combination_id > 12
+ * $query->filterByProductSaleElementsId(1234); // WHERE product_sale_elements_id = 1234
+ * $query->filterByProductSaleElementsId(array(12, 34)); // WHERE product_sale_elements_id IN (12, 34)
+ * $query->filterByProductSaleElementsId(array('min' => 12)); // WHERE product_sale_elements_id > 12
*
*
- * @see filterByCombination()
+ * @see filterByProductSaleElements()
*
- * @param mixed $combinationId The value to use as filter.
+ * @param mixed $productSaleElementsId 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.
@@ -436,16 +436,16 @@ abstract class CartItemQuery extends ModelCriteria
*
* @return ChildCartItemQuery The current query, for fluid interface
*/
- public function filterByCombinationId($combinationId = null, $comparison = null)
+ public function filterByProductSaleElementsId($productSaleElementsId = null, $comparison = null)
{
- if (is_array($combinationId)) {
+ if (is_array($productSaleElementsId)) {
$useMinMax = false;
- if (isset($combinationId['min'])) {
- $this->addUsingAlias(CartItemTableMap::COMBINATION_ID, $combinationId['min'], Criteria::GREATER_EQUAL);
+ if (isset($productSaleElementsId['min'])) {
+ $this->addUsingAlias(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($combinationId['max'])) {
- $this->addUsingAlias(CartItemTableMap::COMBINATION_ID, $combinationId['max'], Criteria::LESS_EQUAL);
+ if (isset($productSaleElementsId['max'])) {
+ $this->addUsingAlias(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -456,7 +456,7 @@ abstract class CartItemQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(CartItemTableMap::COMBINATION_ID, $combinationId, $comparison);
+ return $this->addUsingAlias(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId, $comparison);
}
/**
@@ -696,42 +696,42 @@ abstract class CartItemQuery extends ModelCriteria
}
/**
- * Filter the query by a related \Thelia\Model\Combination object
+ * Filter the query by a related \Thelia\Model\ProductSaleElements object
*
- * @param \Thelia\Model\Combination|ObjectCollection $combination The related object(s) to use as filter
+ * @param \Thelia\Model\ProductSaleElements|ObjectCollection $productSaleElements The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCartItemQuery The current query, for fluid interface
*/
- public function filterByCombination($combination, $comparison = null)
+ public function filterByProductSaleElements($productSaleElements, $comparison = null)
{
- if ($combination instanceof \Thelia\Model\Combination) {
+ if ($productSaleElements instanceof \Thelia\Model\ProductSaleElements) {
return $this
- ->addUsingAlias(CartItemTableMap::COMBINATION_ID, $combination->getId(), $comparison);
- } elseif ($combination instanceof ObjectCollection) {
+ ->addUsingAlias(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElements->getId(), $comparison);
+ } elseif ($productSaleElements instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(CartItemTableMap::COMBINATION_ID, $combination->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElements->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
- throw new PropelException('filterByCombination() only accepts arguments of type \Thelia\Model\Combination or Collection');
+ throw new PropelException('filterByProductSaleElements() only accepts arguments of type \Thelia\Model\ProductSaleElements or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the Combination relation
+ * Adds a JOIN clause to the query using the ProductSaleElements relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCartItemQuery The current query, for fluid interface
*/
- public function joinCombination($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function joinProductSaleElements($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Combination');
+ $relationMap = $tableMap->getRelation('ProductSaleElements');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -746,14 +746,14 @@ abstract class CartItemQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'Combination');
+ $this->addJoinObject($join, 'ProductSaleElements');
}
return $this;
}
/**
- * Use the Combination relation Combination object
+ * Use the ProductSaleElements relation ProductSaleElements object
*
* @see useQuery()
*
@@ -761,13 +761,13 @@ abstract class CartItemQuery extends ModelCriteria
* 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\CombinationQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\ProductSaleElementsQuery A secondary query class using the current class as primary query
*/
- public function useCombinationQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function useProductSaleElementsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinCombination($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Combination', '\Thelia\Model\CombinationQuery');
+ ->joinProductSaleElements($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ProductSaleElements', '\Thelia\Model\ProductSaleElementsQuery');
}
/**
diff --git a/core/lib/Thelia/Model/Base/Category.php b/core/lib/Thelia/Model/Base/Category.php
old mode 100755
new mode 100644
index 1af89e917..05838d1de
--- a/core/lib/Thelia/Model/Base/Category.php
+++ b/core/lib/Thelia/Model/Base/Category.php
@@ -5035,20 +5035,6 @@ abstract class Category implements ActiveRecordInterface
return (string) $this->exportTo(CategoryTableMap::DEFAULT_STRING_FORMAT);
}
- // timestampable behavior
-
- /**
- * Mark the current object so that the update date doesn't get updated during next save
- *
- * @return ChildCategory The current object (for fluent API support)
- */
- public function keepUpdateDateUnchanged()
- {
- $this->modifiedColumns[] = CategoryTableMap::UPDATED_AT;
-
- return $this;
- }
-
// i18n behavior
/**
@@ -5528,6 +5514,20 @@ abstract class Category implements ActiveRecordInterface
return $this->getCategoryVersions($criteria, $con);
}
+ // timestampable behavior
+
+ /**
+ * Mark the current object so that the update date doesn't get updated during next save
+ *
+ * @return ChildCategory The current object (for fluent API support)
+ */
+ public function keepUpdateDateUnchanged()
+ {
+ $this->modifiedColumns[] = CategoryTableMap::UPDATED_AT;
+
+ return $this;
+ }
+
/**
* Code to be run before persisting the object
* @param ConnectionInterface $con
diff --git a/core/lib/Thelia/Model/Base/CategoryI18n.php b/core/lib/Thelia/Model/Base/CategoryI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CategoryI18nQuery.php b/core/lib/Thelia/Model/Base/CategoryI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CategoryQuery.php b/core/lib/Thelia/Model/Base/CategoryQuery.php
old mode 100755
new mode 100644
index 0dc6ea4ef..c5b7156e4
--- a/core/lib/Thelia/Model/Base/CategoryQuery.php
+++ b/core/lib/Thelia/Model/Base/CategoryQuery.php
@@ -1450,72 +1450,6 @@ abstract class CategoryQuery extends ModelCriteria
}
}
- // timestampable behavior
-
- /**
- * Filter by the latest updated
- *
- * @param int $nbDays Maximum age of the latest update in days
- *
- * @return ChildCategoryQuery The current query, for fluid interface
- */
- public function recentlyUpdated($nbDays = 7)
- {
- return $this->addUsingAlias(CategoryTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
- }
-
- /**
- * Filter by the latest created
- *
- * @param int $nbDays Maximum age of in days
- *
- * @return ChildCategoryQuery The current query, for fluid interface
- */
- public function recentlyCreated($nbDays = 7)
- {
- return $this->addUsingAlias(CategoryTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
- }
-
- /**
- * Order by update date desc
- *
- * @return ChildCategoryQuery The current query, for fluid interface
- */
- public function lastUpdatedFirst()
- {
- return $this->addDescendingOrderByColumn(CategoryTableMap::UPDATED_AT);
- }
-
- /**
- * Order by update date asc
- *
- * @return ChildCategoryQuery The current query, for fluid interface
- */
- public function firstUpdatedFirst()
- {
- return $this->addAscendingOrderByColumn(CategoryTableMap::UPDATED_AT);
- }
-
- /**
- * Order by create date desc
- *
- * @return ChildCategoryQuery The current query, for fluid interface
- */
- public function lastCreatedFirst()
- {
- return $this->addDescendingOrderByColumn(CategoryTableMap::CREATED_AT);
- }
-
- /**
- * Order by create date asc
- *
- * @return ChildCategoryQuery The current query, for fluid interface
- */
- public function firstCreatedFirst()
- {
- return $this->addAscendingOrderByColumn(CategoryTableMap::CREATED_AT);
- }
-
// i18n behavior
/**
@@ -1601,4 +1535,70 @@ abstract class CategoryQuery extends ModelCriteria
self::$isVersioningEnabled = false;
}
+ // timestampable behavior
+
+ /**
+ * Filter by the latest updated
+ *
+ * @param int $nbDays Maximum age of the latest update in days
+ *
+ * @return ChildCategoryQuery The current query, for fluid interface
+ */
+ public function recentlyUpdated($nbDays = 7)
+ {
+ return $this->addUsingAlias(CategoryTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Filter by the latest created
+ *
+ * @param int $nbDays Maximum age of in days
+ *
+ * @return ChildCategoryQuery The current query, for fluid interface
+ */
+ public function recentlyCreated($nbDays = 7)
+ {
+ return $this->addUsingAlias(CategoryTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Order by update date desc
+ *
+ * @return ChildCategoryQuery The current query, for fluid interface
+ */
+ public function lastUpdatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(CategoryTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by update date asc
+ *
+ * @return ChildCategoryQuery The current query, for fluid interface
+ */
+ public function firstUpdatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(CategoryTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by create date desc
+ *
+ * @return ChildCategoryQuery The current query, for fluid interface
+ */
+ public function lastCreatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(CategoryTableMap::CREATED_AT);
+ }
+
+ /**
+ * Order by create date asc
+ *
+ * @return ChildCategoryQuery The current query, for fluid interface
+ */
+ public function firstCreatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(CategoryTableMap::CREATED_AT);
+ }
+
} // CategoryQuery
diff --git a/core/lib/Thelia/Model/Base/CategoryVersion.php b/core/lib/Thelia/Model/Base/CategoryVersion.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CategoryVersionQuery.php b/core/lib/Thelia/Model/Base/CategoryVersionQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CombinationQuery.php b/core/lib/Thelia/Model/Base/CombinationQuery.php
deleted file mode 100755
index d14358739..000000000
--- a/core/lib/Thelia/Model/Base/CombinationQuery.php
+++ /dev/null
@@ -1,771 +0,0 @@
-setModelAlias($modelAlias);
- }
- if ($criteria instanceof Criteria) {
- $query->mergeWith($criteria);
- }
-
- return $query;
- }
-
- /**
- * Find object by primary key.
- * Propel uses the instance pool to skip the database if the object exists.
- * Go fast if the query is untouched.
- *
- *
- * $obj = $c->findPk(12, $con);
- *
- *
- * @param mixed $key Primary key to use for the query
- * @param ConnectionInterface $con an optional connection object
- *
- * @return ChildCombination|array|mixed the result, formatted by the current formatter
- */
- public function findPk($key, $con = null)
- {
- if ($key === null) {
- return null;
- }
- if ((null !== ($obj = CombinationTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
- // the object is already in the instance pool
- return $obj;
- }
- if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(CombinationTableMap::DATABASE_NAME);
- }
- $this->basePreSelect($con);
- if ($this->formatter || $this->modelAlias || $this->with || $this->select
- || $this->selectColumns || $this->asColumns || $this->selectModifiers
- || $this->map || $this->having || $this->joins) {
- return $this->findPkComplex($key, $con);
- } else {
- return $this->findPkSimple($key, $con);
- }
- }
-
- /**
- * Find object by primary key using raw SQL to go fast.
- * Bypass doSelect() and the object formatter by using generated code.
- *
- * @param mixed $key Primary key to use for the query
- * @param ConnectionInterface $con A connection object
- *
- * @return ChildCombination A model object, or null if the key is not found
- */
- protected function findPkSimple($key, $con)
- {
- $sql = 'SELECT ID, REF, CREATED_AT, UPDATED_AT FROM combination WHERE ID = :p0';
- try {
- $stmt = $con->prepare($sql);
- $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
- $stmt->execute();
- } catch (Exception $e) {
- Propel::log($e->getMessage(), Propel::LOG_ERR);
- throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
- }
- $obj = null;
- if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
- $obj = new ChildCombination();
- $obj->hydrate($row);
- CombinationTableMap::addInstanceToPool($obj, (string) $key);
- }
- $stmt->closeCursor();
-
- return $obj;
- }
-
- /**
- * Find object by primary key.
- *
- * @param mixed $key Primary key to use for the query
- * @param ConnectionInterface $con A connection object
- *
- * @return ChildCombination|array|mixed the result, formatted by the current formatter
- */
- protected function findPkComplex($key, $con)
- {
- // As the query uses a PK condition, no limit(1) is necessary.
- $criteria = $this->isKeepQuery() ? clone $this : $this;
- $dataFetcher = $criteria
- ->filterByPrimaryKey($key)
- ->doSelect($con);
-
- return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
- }
-
- /**
- * Find objects by primary key
- *
- * $objs = $c->findPks(array(12, 56, 832), $con);
- *
- * @param array $keys Primary keys to use for the query
- * @param ConnectionInterface $con an optional connection object
- *
- * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
- */
- public function findPks($keys, $con = null)
- {
- if (null === $con) {
- $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
- }
- $this->basePreSelect($con);
- $criteria = $this->isKeepQuery() ? clone $this : $this;
- $dataFetcher = $criteria
- ->filterByPrimaryKeys($keys)
- ->doSelect($con);
-
- return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
- }
-
- /**
- * Filter the query by primary key
- *
- * @param mixed $key Primary key to use for the query
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function filterByPrimaryKey($key)
- {
-
- return $this->addUsingAlias(CombinationTableMap::ID, $key, Criteria::EQUAL);
- }
-
- /**
- * Filter the query by a list of primary keys
- *
- * @param array $keys The list of primary key to use for the query
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function filterByPrimaryKeys($keys)
- {
-
- return $this->addUsingAlias(CombinationTableMap::ID, $keys, Criteria::IN);
- }
-
- /**
- * Filter the query on the id column
- *
- * Example usage:
- *
- * $query->filterById(1234); // WHERE id = 1234
- * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
- * $query->filterById(array('min' => 12)); // WHERE id > 12
- *
- *
- * @param mixed $id 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 ChildCombinationQuery The current query, for fluid interface
- */
- public function filterById($id = null, $comparison = null)
- {
- if (is_array($id)) {
- $useMinMax = false;
- if (isset($id['min'])) {
- $this->addUsingAlias(CombinationTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($id['max'])) {
- $this->addUsingAlias(CombinationTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(CombinationTableMap::ID, $id, $comparison);
- }
-
- /**
- * Filter the query on the ref column
- *
- * Example usage:
- *
- * $query->filterByRef('fooValue'); // WHERE ref = 'fooValue'
- * $query->filterByRef('%fooValue%'); // WHERE ref LIKE '%fooValue%'
- *
- *
- * @param string $ref The value to use as filter.
- * Accepts wildcards (* and % trigger a LIKE)
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function filterByRef($ref = null, $comparison = null)
- {
- if (null === $comparison) {
- if (is_array($ref)) {
- $comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $ref)) {
- $ref = str_replace('*', '%', $ref);
- $comparison = Criteria::LIKE;
- }
- }
-
- return $this->addUsingAlias(CombinationTableMap::REF, $ref, $comparison);
- }
-
- /**
- * Filter the query on the created_at column
- *
- * Example usage:
- *
- * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
- * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
- * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
- *
- *
- * @param mixed $createdAt The value to use as filter.
- * Values can be integers (unix timestamps), DateTime objects, or strings.
- * Empty strings are treated as NULL.
- * 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 ChildCombinationQuery The current query, for fluid interface
- */
- public function filterByCreatedAt($createdAt = null, $comparison = null)
- {
- if (is_array($createdAt)) {
- $useMinMax = false;
- if (isset($createdAt['min'])) {
- $this->addUsingAlias(CombinationTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($createdAt['max'])) {
- $this->addUsingAlias(CombinationTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(CombinationTableMap::CREATED_AT, $createdAt, $comparison);
- }
-
- /**
- * Filter the query on the updated_at column
- *
- * Example usage:
- *
- * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
- * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
- * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
- *
- *
- * @param mixed $updatedAt The value to use as filter.
- * Values can be integers (unix timestamps), DateTime objects, or strings.
- * Empty strings are treated as NULL.
- * 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 ChildCombinationQuery The current query, for fluid interface
- */
- public function filterByUpdatedAt($updatedAt = null, $comparison = null)
- {
- if (is_array($updatedAt)) {
- $useMinMax = false;
- if (isset($updatedAt['min'])) {
- $this->addUsingAlias(CombinationTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($updatedAt['max'])) {
- $this->addUsingAlias(CombinationTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(CombinationTableMap::UPDATED_AT, $updatedAt, $comparison);
- }
-
- /**
- * Filter the query by a related \Thelia\Model\AttributeCombination object
- *
- * @param \Thelia\Model\AttributeCombination|ObjectCollection $attributeCombination the related object to use as filter
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function filterByAttributeCombination($attributeCombination, $comparison = null)
- {
- if ($attributeCombination instanceof \Thelia\Model\AttributeCombination) {
- return $this
- ->addUsingAlias(CombinationTableMap::ID, $attributeCombination->getCombinationId(), $comparison);
- } elseif ($attributeCombination instanceof ObjectCollection) {
- return $this
- ->useAttributeCombinationQuery()
- ->filterByPrimaryKeys($attributeCombination->getPrimaryKeys())
- ->endUse();
- } else {
- throw new PropelException('filterByAttributeCombination() only accepts arguments of type \Thelia\Model\AttributeCombination or Collection');
- }
- }
-
- /**
- * Adds a JOIN clause to the query using the AttributeCombination relation
- *
- * @param string $relationAlias optional alias for the relation
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function joinAttributeCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
- {
- $tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('AttributeCombination');
-
- // 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, 'AttributeCombination');
- }
-
- return $this;
- }
-
- /**
- * Use the AttributeCombination relation AttributeCombination 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\AttributeCombinationQuery A secondary query class using the current class as primary query
- */
- public function useAttributeCombinationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
- {
- return $this
- ->joinAttributeCombination($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'AttributeCombination', '\Thelia\Model\AttributeCombinationQuery');
- }
-
- /**
- * Filter the query by a related \Thelia\Model\Stock object
- *
- * @param \Thelia\Model\Stock|ObjectCollection $stock the related object to use as filter
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function filterByStock($stock, $comparison = null)
- {
- if ($stock instanceof \Thelia\Model\Stock) {
- return $this
- ->addUsingAlias(CombinationTableMap::ID, $stock->getCombinationId(), $comparison);
- } elseif ($stock instanceof ObjectCollection) {
- return $this
- ->useStockQuery()
- ->filterByPrimaryKeys($stock->getPrimaryKeys())
- ->endUse();
- } else {
- throw new PropelException('filterByStock() only accepts arguments of type \Thelia\Model\Stock or Collection');
- }
- }
-
- /**
- * Adds a JOIN clause to the query using the Stock relation
- *
- * @param string $relationAlias optional alias for the relation
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function joinStock($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- $tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Stock');
-
- // 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, 'Stock');
- }
-
- return $this;
- }
-
- /**
- * Use the Stock relation Stock 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\StockQuery A secondary query class using the current class as primary query
- */
- public function useStockQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- return $this
- ->joinStock($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Stock', '\Thelia\Model\StockQuery');
- }
-
- /**
- * Filter the query by a related \Thelia\Model\CartItem object
- *
- * @param \Thelia\Model\CartItem|ObjectCollection $cartItem the related object to use as filter
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function filterByCartItem($cartItem, $comparison = null)
- {
- if ($cartItem instanceof \Thelia\Model\CartItem) {
- return $this
- ->addUsingAlias(CombinationTableMap::ID, $cartItem->getCombinationId(), $comparison);
- } elseif ($cartItem instanceof ObjectCollection) {
- return $this
- ->useCartItemQuery()
- ->filterByPrimaryKeys($cartItem->getPrimaryKeys())
- ->endUse();
- } else {
- throw new PropelException('filterByCartItem() only accepts arguments of type \Thelia\Model\CartItem or Collection');
- }
- }
-
- /**
- * Adds a JOIN clause to the query using the CartItem relation
- *
- * @param string $relationAlias optional alias for the relation
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function joinCartItem($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- $tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('CartItem');
-
- // 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, 'CartItem');
- }
-
- return $this;
- }
-
- /**
- * Use the CartItem relation CartItem 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\CartItemQuery A secondary query class using the current class as primary query
- */
- public function useCartItemQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- return $this
- ->joinCartItem($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'CartItem', '\Thelia\Model\CartItemQuery');
- }
-
- /**
- * Exclude object from result
- *
- * @param ChildCombination $combination Object to remove from the list of results
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function prune($combination = null)
- {
- if ($combination) {
- $this->addUsingAlias(CombinationTableMap::ID, $combination->getId(), Criteria::NOT_EQUAL);
- }
-
- return $this;
- }
-
- /**
- * Deletes all rows from the combination table.
- *
- * @param ConnectionInterface $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public function doDeleteAll(ConnectionInterface $con = null)
- {
- if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(CombinationTableMap::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->beginTransaction();
- $affectedRows += parent::doDeleteAll($con);
- // Because this db requires some delete cascade/set null emulation, we have to
- // clear the cached instance *after* the emulation has happened (since
- // instances get re-added by the select statement contained therein).
- CombinationTableMap::clearInstancePool();
- CombinationTableMap::clearRelatedInstancePool();
-
- $con->commit();
- } catch (PropelException $e) {
- $con->rollBack();
- throw $e;
- }
-
- return $affectedRows;
- }
-
- /**
- * Performs a DELETE on the database, given a ChildCombination or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or ChildCombination object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param ConnectionInterface $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public function delete(ConnectionInterface $con = null)
- {
- if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(CombinationTableMap::DATABASE_NAME);
- }
-
- $criteria = $this;
-
- // Set the correct dbName
- $criteria->setDbName(CombinationTableMap::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->beginTransaction();
-
-
- CombinationTableMap::removeInstanceFromPool($criteria);
-
- $affectedRows += ModelCriteria::delete($con);
- CombinationTableMap::clearRelatedInstancePool();
- $con->commit();
-
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollBack();
- throw $e;
- }
- }
-
- // timestampable behavior
-
- /**
- * Filter by the latest updated
- *
- * @param int $nbDays Maximum age of the latest update in days
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function recentlyUpdated($nbDays = 7)
- {
- return $this->addUsingAlias(CombinationTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
- }
-
- /**
- * Filter by the latest created
- *
- * @param int $nbDays Maximum age of in days
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function recentlyCreated($nbDays = 7)
- {
- return $this->addUsingAlias(CombinationTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
- }
-
- /**
- * Order by update date desc
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function lastUpdatedFirst()
- {
- return $this->addDescendingOrderByColumn(CombinationTableMap::UPDATED_AT);
- }
-
- /**
- * Order by update date asc
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function firstUpdatedFirst()
- {
- return $this->addAscendingOrderByColumn(CombinationTableMap::UPDATED_AT);
- }
-
- /**
- * Order by create date desc
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function lastCreatedFirst()
- {
- return $this->addDescendingOrderByColumn(CombinationTableMap::CREATED_AT);
- }
-
- /**
- * Order by create date asc
- *
- * @return ChildCombinationQuery The current query, for fluid interface
- */
- public function firstCreatedFirst()
- {
- return $this->addAscendingOrderByColumn(CombinationTableMap::CREATED_AT);
- }
-
-} // CombinationQuery
diff --git a/core/lib/Thelia/Model/Base/Config.php b/core/lib/Thelia/Model/Base/Config.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ConfigI18n.php b/core/lib/Thelia/Model/Base/ConfigI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ConfigI18nQuery.php b/core/lib/Thelia/Model/Base/ConfigI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ConfigQuery.php b/core/lib/Thelia/Model/Base/ConfigQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Content.php b/core/lib/Thelia/Model/Base/Content.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ContentAssoc.php b/core/lib/Thelia/Model/Base/ContentAssoc.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ContentAssocQuery.php b/core/lib/Thelia/Model/Base/ContentAssocQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ContentFolder.php b/core/lib/Thelia/Model/Base/ContentFolder.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ContentFolderQuery.php b/core/lib/Thelia/Model/Base/ContentFolderQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ContentI18n.php b/core/lib/Thelia/Model/Base/ContentI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ContentI18nQuery.php b/core/lib/Thelia/Model/Base/ContentI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ContentQuery.php b/core/lib/Thelia/Model/Base/ContentQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ContentVersion.php b/core/lib/Thelia/Model/Base/ContentVersion.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ContentVersionQuery.php b/core/lib/Thelia/Model/Base/ContentVersionQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Country.php b/core/lib/Thelia/Model/Base/Country.php
old mode 100755
new mode 100644
index 4d21c09c2..704375de2
--- a/core/lib/Thelia/Model/Base/Country.php
+++ b/core/lib/Thelia/Model/Base/Country.php
@@ -17,6 +17,8 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
+use Thelia\Model\Address as ChildAddress;
+use Thelia\Model\AddressQuery as ChildAddressQuery;
use Thelia\Model\Area as ChildArea;
use Thelia\Model\AreaQuery as ChildAreaQuery;
use Thelia\Model\Country as ChildCountry;
@@ -114,6 +116,12 @@ abstract class Country implements ActiveRecordInterface
protected $collTaxRuleCountries;
protected $collTaxRuleCountriesPartial;
+ /**
+ * @var ObjectCollection|ChildAddress[] Collection to store aggregation of ChildAddress objects.
+ */
+ protected $collAddresses;
+ protected $collAddressesPartial;
+
/**
* @var ObjectCollection|ChildCountryI18n[] Collection to store aggregation of ChildCountryI18n objects.
*/
@@ -148,6 +156,12 @@ abstract class Country implements ActiveRecordInterface
*/
protected $taxRuleCountriesScheduledForDeletion = null;
+ /**
+ * An array of objects scheduled for deletion.
+ * @var ObjectCollection
+ */
+ protected $addressesScheduledForDeletion = null;
+
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
@@ -792,6 +806,8 @@ abstract class Country implements ActiveRecordInterface
$this->aArea = null;
$this->collTaxRuleCountries = null;
+ $this->collAddresses = null;
+
$this->collCountryI18ns = null;
} // if (deep)
@@ -956,6 +972,23 @@ abstract class Country implements ActiveRecordInterface
}
}
+ if ($this->addressesScheduledForDeletion !== null) {
+ if (!$this->addressesScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\AddressQuery::create()
+ ->filterByPrimaryKeys($this->addressesScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->addressesScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collAddresses !== null) {
+ foreach ($this->collAddresses as $referrerFK) {
+ if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
if ($this->countryI18nsScheduledForDeletion !== null) {
if (!$this->countryI18nsScheduledForDeletion->isEmpty()) {
\Thelia\Model\CountryI18nQuery::create()
@@ -1174,6 +1207,9 @@ abstract class Country implements ActiveRecordInterface
if (null !== $this->collTaxRuleCountries) {
$result['TaxRuleCountries'] = $this->collTaxRuleCountries->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
+ if (null !== $this->collAddresses) {
+ $result['Addresses'] = $this->collAddresses->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ }
if (null !== $this->collCountryI18ns) {
$result['CountryI18ns'] = $this->collCountryI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
@@ -1363,6 +1399,12 @@ abstract class Country implements ActiveRecordInterface
}
}
+ foreach ($this->getAddresses() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addAddress($relObj->copy($deepCopy));
+ }
+ }
+
foreach ($this->getCountryI18ns() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addCountryI18n($relObj->copy($deepCopy));
@@ -1463,6 +1505,9 @@ abstract class Country implements ActiveRecordInterface
if ('TaxRuleCountry' == $relationName) {
return $this->initTaxRuleCountries();
}
+ if ('Address' == $relationName) {
+ return $this->initAddresses();
+ }
if ('CountryI18n' == $relationName) {
return $this->initCountryI18ns();
}
@@ -1736,6 +1781,274 @@ abstract class Country implements ActiveRecordInterface
return $this->getTaxRuleCountries($query, $con);
}
+ /**
+ * Clears out the collAddresses 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 addAddresses()
+ */
+ public function clearAddresses()
+ {
+ $this->collAddresses = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collAddresses collection loaded partially.
+ */
+ public function resetPartialAddresses($v = true)
+ {
+ $this->collAddressesPartial = $v;
+ }
+
+ /**
+ * Initializes the collAddresses collection.
+ *
+ * By default this just sets the collAddresses collection to an empty array (like clearcollAddresses());
+ * 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 initAddresses($overrideExisting = true)
+ {
+ if (null !== $this->collAddresses && !$overrideExisting) {
+ return;
+ }
+ $this->collAddresses = new ObjectCollection();
+ $this->collAddresses->setModel('\Thelia\Model\Address');
+ }
+
+ /**
+ * Gets an array of ChildAddress 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 ChildCountry 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|ChildAddress[] List of ChildAddress objects
+ * @throws PropelException
+ */
+ public function getAddresses($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collAddressesPartial && !$this->isNew();
+ if (null === $this->collAddresses || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collAddresses) {
+ // return empty collection
+ $this->initAddresses();
+ } else {
+ $collAddresses = ChildAddressQuery::create(null, $criteria)
+ ->filterByCountry($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collAddressesPartial && count($collAddresses)) {
+ $this->initAddresses(false);
+
+ foreach ($collAddresses as $obj) {
+ if (false == $this->collAddresses->contains($obj)) {
+ $this->collAddresses->append($obj);
+ }
+ }
+
+ $this->collAddressesPartial = true;
+ }
+
+ $collAddresses->getInternalIterator()->rewind();
+
+ return $collAddresses;
+ }
+
+ if ($partial && $this->collAddresses) {
+ foreach ($this->collAddresses as $obj) {
+ if ($obj->isNew()) {
+ $collAddresses[] = $obj;
+ }
+ }
+ }
+
+ $this->collAddresses = $collAddresses;
+ $this->collAddressesPartial = false;
+ }
+ }
+
+ return $this->collAddresses;
+ }
+
+ /**
+ * Sets a collection of Address 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 $addresses A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildCountry The current object (for fluent API support)
+ */
+ public function setAddresses(Collection $addresses, ConnectionInterface $con = null)
+ {
+ $addressesToDelete = $this->getAddresses(new Criteria(), $con)->diff($addresses);
+
+
+ $this->addressesScheduledForDeletion = $addressesToDelete;
+
+ foreach ($addressesToDelete as $addressRemoved) {
+ $addressRemoved->setCountry(null);
+ }
+
+ $this->collAddresses = null;
+ foreach ($addresses as $address) {
+ $this->addAddress($address);
+ }
+
+ $this->collAddresses = $addresses;
+ $this->collAddressesPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related Address objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related Address objects.
+ * @throws PropelException
+ */
+ public function countAddresses(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collAddressesPartial && !$this->isNew();
+ if (null === $this->collAddresses || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collAddresses) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getAddresses());
+ }
+
+ $query = ChildAddressQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterByCountry($this)
+ ->count($con);
+ }
+
+ return count($this->collAddresses);
+ }
+
+ /**
+ * Method called to associate a ChildAddress object to this object
+ * through the ChildAddress foreign key attribute.
+ *
+ * @param ChildAddress $l ChildAddress
+ * @return \Thelia\Model\Country The current object (for fluent API support)
+ */
+ public function addAddress(ChildAddress $l)
+ {
+ if ($this->collAddresses === null) {
+ $this->initAddresses();
+ $this->collAddressesPartial = true;
+ }
+
+ if (!in_array($l, $this->collAddresses->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddAddress($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param Address $address The address object to add.
+ */
+ protected function doAddAddress($address)
+ {
+ $this->collAddresses[]= $address;
+ $address->setCountry($this);
+ }
+
+ /**
+ * @param Address $address The address object to remove.
+ * @return ChildCountry The current object (for fluent API support)
+ */
+ public function removeAddress($address)
+ {
+ if ($this->getAddresses()->contains($address)) {
+ $this->collAddresses->remove($this->collAddresses->search($address));
+ if (null === $this->addressesScheduledForDeletion) {
+ $this->addressesScheduledForDeletion = clone $this->collAddresses;
+ $this->addressesScheduledForDeletion->clear();
+ }
+ $this->addressesScheduledForDeletion[]= clone $address;
+ $address->setCountry(null);
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * If this collection has already been initialized with
+ * an identical criteria, it returns the collection.
+ * Otherwise if this Country is new, it will return
+ * an empty collection; or if this Country has previously
+ * been saved, it will retrieve related Addresses 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 Country.
+ *
+ * @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|ChildAddress[] List of ChildAddress objects
+ */
+ public function getAddressesJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ {
+ $query = ChildAddressQuery::create(null, $criteria);
+ $query->joinWith('Customer', $joinBehavior);
+
+ return $this->getAddresses($query, $con);
+ }
+
+
+ /**
+ * If this collection has already been initialized with
+ * an identical criteria, it returns the collection.
+ * Otherwise if this Country is new, it will return
+ * an empty collection; or if this Country has previously
+ * been saved, it will retrieve related Addresses 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 Country.
+ *
+ * @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|ChildAddress[] List of ChildAddress objects
+ */
+ public function getAddressesJoinCustomerTitle($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ {
+ $query = ChildAddressQuery::create(null, $criteria);
+ $query->joinWith('CustomerTitle', $joinBehavior);
+
+ return $this->getAddresses($query, $con);
+ }
+
/**
* Clears out the collCountryI18ns collection
*
@@ -1997,6 +2310,11 @@ abstract class Country implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
+ if ($this->collAddresses) {
+ foreach ($this->collAddresses as $o) {
+ $o->clearAllReferences($deep);
+ }
+ }
if ($this->collCountryI18ns) {
foreach ($this->collCountryI18ns as $o) {
$o->clearAllReferences($deep);
@@ -2012,6 +2330,10 @@ abstract class Country implements ActiveRecordInterface
$this->collTaxRuleCountries->clearIterator();
}
$this->collTaxRuleCountries = null;
+ if ($this->collAddresses instanceof Collection) {
+ $this->collAddresses->clearIterator();
+ }
+ $this->collAddresses = null;
if ($this->collCountryI18ns instanceof Collection) {
$this->collCountryI18ns->clearIterator();
}
diff --git a/core/lib/Thelia/Model/Base/CountryI18n.php b/core/lib/Thelia/Model/Base/CountryI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CountryI18nQuery.php b/core/lib/Thelia/Model/Base/CountryI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CountryQuery.php b/core/lib/Thelia/Model/Base/CountryQuery.php
old mode 100755
new mode 100644
index 04a66530c..6c3a1c950
--- a/core/lib/Thelia/Model/Base/CountryQuery.php
+++ b/core/lib/Thelia/Model/Base/CountryQuery.php
@@ -50,6 +50,10 @@ use Thelia\Model\Map\CountryTableMap;
* @method ChildCountryQuery rightJoinTaxRuleCountry($relationAlias = null) Adds a RIGHT JOIN clause to the query using the TaxRuleCountry relation
* @method ChildCountryQuery innerJoinTaxRuleCountry($relationAlias = null) Adds a INNER JOIN clause to the query using the TaxRuleCountry relation
*
+ * @method ChildCountryQuery leftJoinAddress($relationAlias = null) Adds a LEFT JOIN clause to the query using the Address relation
+ * @method ChildCountryQuery rightJoinAddress($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Address relation
+ * @method ChildCountryQuery innerJoinAddress($relationAlias = null) Adds a INNER JOIN clause to the query using the Address relation
+ *
* @method ChildCountryQuery leftJoinCountryI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CountryI18n relation
* @method ChildCountryQuery rightJoinCountryI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CountryI18n relation
* @method ChildCountryQuery innerJoinCountryI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CountryI18n relation
@@ -654,6 +658,79 @@ abstract class CountryQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'TaxRuleCountry', '\Thelia\Model\TaxRuleCountryQuery');
}
+ /**
+ * Filter the query by a related \Thelia\Model\Address object
+ *
+ * @param \Thelia\Model\Address|ObjectCollection $address the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildCountryQuery The current query, for fluid interface
+ */
+ public function filterByAddress($address, $comparison = null)
+ {
+ if ($address instanceof \Thelia\Model\Address) {
+ return $this
+ ->addUsingAlias(CountryTableMap::ID, $address->getCountryId(), $comparison);
+ } elseif ($address instanceof ObjectCollection) {
+ return $this
+ ->useAddressQuery()
+ ->filterByPrimaryKeys($address->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByAddress() only accepts arguments of type \Thelia\Model\Address or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Address relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildCountryQuery The current query, for fluid interface
+ */
+ public function joinAddress($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Address');
+
+ // 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, 'Address');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Address relation Address 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\AddressQuery A secondary query class using the current class as primary query
+ */
+ public function useAddressQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinAddress($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Address', '\Thelia\Model\AddressQuery');
+ }
+
/**
* Filter the query by a related \Thelia\Model\CountryI18n object
*
diff --git a/core/lib/Thelia/Model/Base/Coupon.php b/core/lib/Thelia/Model/Base/Coupon.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CouponOrder.php b/core/lib/Thelia/Model/Base/CouponOrder.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CouponOrderQuery.php b/core/lib/Thelia/Model/Base/CouponOrderQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CouponQuery.php b/core/lib/Thelia/Model/Base/CouponQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CouponRule.php b/core/lib/Thelia/Model/Base/CouponRule.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CouponRuleQuery.php b/core/lib/Thelia/Model/Base/CouponRuleQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Currency.php b/core/lib/Thelia/Model/Base/Currency.php
old mode 100755
new mode 100644
index 077fd972c..5ab40a742
--- a/core/lib/Thelia/Model/Base/Currency.php
+++ b/core/lib/Thelia/Model/Base/Currency.php
@@ -20,9 +20,13 @@ use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Cart as ChildCart;
use Thelia\Model\CartQuery as ChildCartQuery;
use Thelia\Model\Currency as ChildCurrency;
+use Thelia\Model\CurrencyI18n as ChildCurrencyI18n;
+use Thelia\Model\CurrencyI18nQuery as ChildCurrencyI18nQuery;
use Thelia\Model\CurrencyQuery as ChildCurrencyQuery;
use Thelia\Model\Order as ChildOrder;
use Thelia\Model\OrderQuery as ChildOrderQuery;
+use Thelia\Model\ProductPrice as ChildProductPrice;
+use Thelia\Model\ProductPriceQuery as ChildProductPriceQuery;
use Thelia\Model\Map\CurrencyTableMap;
abstract class Currency implements ActiveRecordInterface
@@ -65,12 +69,6 @@ abstract class Currency implements ActiveRecordInterface
*/
protected $id;
- /**
- * The value for the name field.
- * @var string
- */
- protected $name;
-
/**
* The value for the code field.
* @var string
@@ -119,6 +117,18 @@ abstract class Currency implements ActiveRecordInterface
protected $collCarts;
protected $collCartsPartial;
+ /**
+ * @var ObjectCollection|ChildProductPrice[] Collection to store aggregation of ChildProductPrice objects.
+ */
+ protected $collProductPrices;
+ protected $collProductPricesPartial;
+
+ /**
+ * @var ObjectCollection|ChildCurrencyI18n[] Collection to store aggregation of ChildCurrencyI18n objects.
+ */
+ protected $collCurrencyI18ns;
+ protected $collCurrencyI18nsPartial;
+
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -127,6 +137,20 @@ abstract class Currency implements ActiveRecordInterface
*/
protected $alreadyInSave = false;
+ // i18n behavior
+
+ /**
+ * Current locale
+ * @var string
+ */
+ protected $currentLocale = 'en_US';
+
+ /**
+ * Current translation objects
+ * @var array[ChildCurrencyI18n]
+ */
+ protected $currentTranslations;
+
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
@@ -139,6 +163,18 @@ abstract class Currency implements ActiveRecordInterface
*/
protected $cartsScheduledForDeletion = null;
+ /**
+ * An array of objects scheduled for deletion.
+ * @var ObjectCollection
+ */
+ protected $productPricesScheduledForDeletion = null;
+
+ /**
+ * An array of objects scheduled for deletion.
+ * @var ObjectCollection
+ */
+ protected $currencyI18nsScheduledForDeletion = null;
+
/**
* Initializes internal state of Thelia\Model\Base\Currency object.
*/
@@ -404,17 +440,6 @@ abstract class Currency implements ActiveRecordInterface
return $this->id;
}
- /**
- * Get the [name] column value.
- *
- * @return string
- */
- public function getName()
- {
-
- return $this->name;
- }
-
/**
* Get the [code] column value.
*
@@ -520,27 +545,6 @@ abstract class Currency implements ActiveRecordInterface
return $this;
} // setId()
- /**
- * Set the value of [name] column.
- *
- * @param string $v new value
- * @return \Thelia\Model\Currency The current object (for fluent API support)
- */
- public function setName($v)
- {
- if ($v !== null) {
- $v = (string) $v;
- }
-
- if ($this->name !== $v) {
- $this->name = $v;
- $this->modifiedColumns[] = CurrencyTableMap::NAME;
- }
-
-
- return $this;
- } // setName()
-
/**
* Set the value of [code] column.
*
@@ -707,28 +711,25 @@ abstract class Currency implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : CurrencyTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : CurrencyTableMap::translateFieldName('Name', TableMap::TYPE_PHPNAME, $indexType)];
- $this->name = (null !== $col) ? (string) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CurrencyTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : CurrencyTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)];
$this->code = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CurrencyTableMap::translateFieldName('Symbol', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CurrencyTableMap::translateFieldName('Symbol', TableMap::TYPE_PHPNAME, $indexType)];
$this->symbol = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CurrencyTableMap::translateFieldName('Rate', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CurrencyTableMap::translateFieldName('Rate', TableMap::TYPE_PHPNAME, $indexType)];
$this->rate = (null !== $col) ? (double) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CurrencyTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CurrencyTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
$this->by_default = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CurrencyTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CurrencyTableMap::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 ? 7 + $startcol : CurrencyTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CurrencyTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -741,7 +742,7 @@ abstract class Currency implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 8; // 8 = CurrencyTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 7; // 7 = CurrencyTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\Currency object", 0, $e);
@@ -806,6 +807,10 @@ abstract class Currency implements ActiveRecordInterface
$this->collCarts = null;
+ $this->collProductPrices = null;
+
+ $this->collCurrencyI18ns = null;
+
} // if (deep)
}
@@ -975,6 +980,40 @@ abstract class Currency implements ActiveRecordInterface
}
}
+ if ($this->productPricesScheduledForDeletion !== null) {
+ if (!$this->productPricesScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\ProductPriceQuery::create()
+ ->filterByPrimaryKeys($this->productPricesScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->productPricesScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collProductPrices !== null) {
+ foreach ($this->collProductPrices as $referrerFK) {
+ if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
+ if ($this->currencyI18nsScheduledForDeletion !== null) {
+ if (!$this->currencyI18nsScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\CurrencyI18nQuery::create()
+ ->filterByPrimaryKeys($this->currencyI18nsScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->currencyI18nsScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collCurrencyI18ns !== null) {
+ foreach ($this->collCurrencyI18ns as $referrerFK) {
+ if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
$this->alreadyInSave = false;
}
@@ -1004,9 +1043,6 @@ abstract class Currency implements ActiveRecordInterface
if ($this->isColumnModified(CurrencyTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
- if ($this->isColumnModified(CurrencyTableMap::NAME)) {
- $modifiedColumns[':p' . $index++] = 'NAME';
- }
if ($this->isColumnModified(CurrencyTableMap::CODE)) {
$modifiedColumns[':p' . $index++] = 'CODE';
}
@@ -1039,9 +1075,6 @@ abstract class Currency implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
- case 'NAME':
- $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
- break;
case 'CODE':
$stmt->bindValue($identifier, $this->code, PDO::PARAM_STR);
break;
@@ -1126,24 +1159,21 @@ abstract class Currency implements ActiveRecordInterface
return $this->getId();
break;
case 1:
- return $this->getName();
- break;
- case 2:
return $this->getCode();
break;
- case 3:
+ case 2:
return $this->getSymbol();
break;
- case 4:
+ case 3:
return $this->getRate();
break;
- case 5:
+ case 4:
return $this->getByDefault();
break;
- case 6:
+ case 5:
return $this->getCreatedAt();
break;
- case 7:
+ case 6:
return $this->getUpdatedAt();
break;
default:
@@ -1176,13 +1206,12 @@ abstract class Currency implements ActiveRecordInterface
$keys = CurrencyTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
- $keys[1] => $this->getName(),
- $keys[2] => $this->getCode(),
- $keys[3] => $this->getSymbol(),
- $keys[4] => $this->getRate(),
- $keys[5] => $this->getByDefault(),
- $keys[6] => $this->getCreatedAt(),
- $keys[7] => $this->getUpdatedAt(),
+ $keys[1] => $this->getCode(),
+ $keys[2] => $this->getSymbol(),
+ $keys[3] => $this->getRate(),
+ $keys[4] => $this->getByDefault(),
+ $keys[5] => $this->getCreatedAt(),
+ $keys[6] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1197,6 +1226,12 @@ abstract class Currency implements ActiveRecordInterface
if (null !== $this->collCarts) {
$result['Carts'] = $this->collCarts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
+ if (null !== $this->collProductPrices) {
+ $result['ProductPrices'] = $this->collProductPrices->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ }
+ if (null !== $this->collCurrencyI18ns) {
+ $result['CurrencyI18ns'] = $this->collCurrencyI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ }
}
return $result;
@@ -1235,24 +1270,21 @@ abstract class Currency implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
- $this->setName($value);
- break;
- case 2:
$this->setCode($value);
break;
- case 3:
+ case 2:
$this->setSymbol($value);
break;
- case 4:
+ case 3:
$this->setRate($value);
break;
- case 5:
+ case 4:
$this->setByDefault($value);
break;
- case 6:
+ case 5:
$this->setCreatedAt($value);
break;
- case 7:
+ case 6:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1280,13 +1312,12 @@ abstract class Currency implements ActiveRecordInterface
$keys = CurrencyTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCode($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setSymbol($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setRate($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setByDefault($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]);
+ if (array_key_exists($keys[1], $arr)) $this->setCode($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setSymbol($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setRate($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setByDefault($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
}
/**
@@ -1299,7 +1330,6 @@ abstract class Currency implements ActiveRecordInterface
$criteria = new Criteria(CurrencyTableMap::DATABASE_NAME);
if ($this->isColumnModified(CurrencyTableMap::ID)) $criteria->add(CurrencyTableMap::ID, $this->id);
- if ($this->isColumnModified(CurrencyTableMap::NAME)) $criteria->add(CurrencyTableMap::NAME, $this->name);
if ($this->isColumnModified(CurrencyTableMap::CODE)) $criteria->add(CurrencyTableMap::CODE, $this->code);
if ($this->isColumnModified(CurrencyTableMap::SYMBOL)) $criteria->add(CurrencyTableMap::SYMBOL, $this->symbol);
if ($this->isColumnModified(CurrencyTableMap::RATE)) $criteria->add(CurrencyTableMap::RATE, $this->rate);
@@ -1369,7 +1399,6 @@ abstract class Currency implements ActiveRecordInterface
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
- $copyObj->setName($this->getName());
$copyObj->setCode($this->getCode());
$copyObj->setSymbol($this->getSymbol());
$copyObj->setRate($this->getRate());
@@ -1394,6 +1423,18 @@ abstract class Currency implements ActiveRecordInterface
}
}
+ foreach ($this->getProductPrices() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addProductPrice($relObj->copy($deepCopy));
+ }
+ }
+
+ foreach ($this->getCurrencyI18ns() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addCurrencyI18n($relObj->copy($deepCopy));
+ }
+ }
+
} // if ($deepCopy)
if ($makeNew) {
@@ -1441,6 +1482,12 @@ abstract class Currency implements ActiveRecordInterface
if ('Cart' == $relationName) {
return $this->initCarts();
}
+ if ('ProductPrice' == $relationName) {
+ return $this->initProductPrices();
+ }
+ if ('CurrencyI18n' == $relationName) {
+ return $this->initCurrencyI18ns();
+ }
}
/**
@@ -2054,13 +2101,480 @@ abstract class Currency implements ActiveRecordInterface
return $this->getCarts($query, $con);
}
+ /**
+ * Clears out the collProductPrices 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 addProductPrices()
+ */
+ public function clearProductPrices()
+ {
+ $this->collProductPrices = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collProductPrices collection loaded partially.
+ */
+ public function resetPartialProductPrices($v = true)
+ {
+ $this->collProductPricesPartial = $v;
+ }
+
+ /**
+ * Initializes the collProductPrices collection.
+ *
+ * By default this just sets the collProductPrices collection to an empty array (like clearcollProductPrices());
+ * 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 initProductPrices($overrideExisting = true)
+ {
+ if (null !== $this->collProductPrices && !$overrideExisting) {
+ return;
+ }
+ $this->collProductPrices = new ObjectCollection();
+ $this->collProductPrices->setModel('\Thelia\Model\ProductPrice');
+ }
+
+ /**
+ * Gets an array of ChildProductPrice 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 ChildCurrency 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|ChildProductPrice[] List of ChildProductPrice objects
+ * @throws PropelException
+ */
+ public function getProductPrices($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collProductPricesPartial && !$this->isNew();
+ if (null === $this->collProductPrices || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collProductPrices) {
+ // return empty collection
+ $this->initProductPrices();
+ } else {
+ $collProductPrices = ChildProductPriceQuery::create(null, $criteria)
+ ->filterByCurrency($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collProductPricesPartial && count($collProductPrices)) {
+ $this->initProductPrices(false);
+
+ foreach ($collProductPrices as $obj) {
+ if (false == $this->collProductPrices->contains($obj)) {
+ $this->collProductPrices->append($obj);
+ }
+ }
+
+ $this->collProductPricesPartial = true;
+ }
+
+ $collProductPrices->getInternalIterator()->rewind();
+
+ return $collProductPrices;
+ }
+
+ if ($partial && $this->collProductPrices) {
+ foreach ($this->collProductPrices as $obj) {
+ if ($obj->isNew()) {
+ $collProductPrices[] = $obj;
+ }
+ }
+ }
+
+ $this->collProductPrices = $collProductPrices;
+ $this->collProductPricesPartial = false;
+ }
+ }
+
+ return $this->collProductPrices;
+ }
+
+ /**
+ * Sets a collection of ProductPrice 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 $productPrices A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildCurrency The current object (for fluent API support)
+ */
+ public function setProductPrices(Collection $productPrices, ConnectionInterface $con = null)
+ {
+ $productPricesToDelete = $this->getProductPrices(new Criteria(), $con)->diff($productPrices);
+
+
+ $this->productPricesScheduledForDeletion = $productPricesToDelete;
+
+ foreach ($productPricesToDelete as $productPriceRemoved) {
+ $productPriceRemoved->setCurrency(null);
+ }
+
+ $this->collProductPrices = null;
+ foreach ($productPrices as $productPrice) {
+ $this->addProductPrice($productPrice);
+ }
+
+ $this->collProductPrices = $productPrices;
+ $this->collProductPricesPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related ProductPrice objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related ProductPrice objects.
+ * @throws PropelException
+ */
+ public function countProductPrices(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collProductPricesPartial && !$this->isNew();
+ if (null === $this->collProductPrices || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collProductPrices) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getProductPrices());
+ }
+
+ $query = ChildProductPriceQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterByCurrency($this)
+ ->count($con);
+ }
+
+ return count($this->collProductPrices);
+ }
+
+ /**
+ * Method called to associate a ChildProductPrice object to this object
+ * through the ChildProductPrice foreign key attribute.
+ *
+ * @param ChildProductPrice $l ChildProductPrice
+ * @return \Thelia\Model\Currency The current object (for fluent API support)
+ */
+ public function addProductPrice(ChildProductPrice $l)
+ {
+ if ($this->collProductPrices === null) {
+ $this->initProductPrices();
+ $this->collProductPricesPartial = true;
+ }
+
+ if (!in_array($l, $this->collProductPrices->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddProductPrice($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param ProductPrice $productPrice The productPrice object to add.
+ */
+ protected function doAddProductPrice($productPrice)
+ {
+ $this->collProductPrices[]= $productPrice;
+ $productPrice->setCurrency($this);
+ }
+
+ /**
+ * @param ProductPrice $productPrice The productPrice object to remove.
+ * @return ChildCurrency The current object (for fluent API support)
+ */
+ public function removeProductPrice($productPrice)
+ {
+ if ($this->getProductPrices()->contains($productPrice)) {
+ $this->collProductPrices->remove($this->collProductPrices->search($productPrice));
+ if (null === $this->productPricesScheduledForDeletion) {
+ $this->productPricesScheduledForDeletion = clone $this->collProductPrices;
+ $this->productPricesScheduledForDeletion->clear();
+ }
+ $this->productPricesScheduledForDeletion[]= clone $productPrice;
+ $productPrice->setCurrency(null);
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * 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 ProductPrices 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|ChildProductPrice[] List of ChildProductPrice objects
+ */
+ public function getProductPricesJoinProductSaleElements($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ {
+ $query = ChildProductPriceQuery::create(null, $criteria);
+ $query->joinWith('ProductSaleElements', $joinBehavior);
+
+ return $this->getProductPrices($query, $con);
+ }
+
+ /**
+ * Clears out the collCurrencyI18ns 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 addCurrencyI18ns()
+ */
+ public function clearCurrencyI18ns()
+ {
+ $this->collCurrencyI18ns = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collCurrencyI18ns collection loaded partially.
+ */
+ public function resetPartialCurrencyI18ns($v = true)
+ {
+ $this->collCurrencyI18nsPartial = $v;
+ }
+
+ /**
+ * Initializes the collCurrencyI18ns collection.
+ *
+ * By default this just sets the collCurrencyI18ns collection to an empty array (like clearcollCurrencyI18ns());
+ * 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 initCurrencyI18ns($overrideExisting = true)
+ {
+ if (null !== $this->collCurrencyI18ns && !$overrideExisting) {
+ return;
+ }
+ $this->collCurrencyI18ns = new ObjectCollection();
+ $this->collCurrencyI18ns->setModel('\Thelia\Model\CurrencyI18n');
+ }
+
+ /**
+ * Gets an array of ChildCurrencyI18n 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 ChildCurrency 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|ChildCurrencyI18n[] List of ChildCurrencyI18n objects
+ * @throws PropelException
+ */
+ public function getCurrencyI18ns($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collCurrencyI18nsPartial && !$this->isNew();
+ if (null === $this->collCurrencyI18ns || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collCurrencyI18ns) {
+ // return empty collection
+ $this->initCurrencyI18ns();
+ } else {
+ $collCurrencyI18ns = ChildCurrencyI18nQuery::create(null, $criteria)
+ ->filterByCurrency($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collCurrencyI18nsPartial && count($collCurrencyI18ns)) {
+ $this->initCurrencyI18ns(false);
+
+ foreach ($collCurrencyI18ns as $obj) {
+ if (false == $this->collCurrencyI18ns->contains($obj)) {
+ $this->collCurrencyI18ns->append($obj);
+ }
+ }
+
+ $this->collCurrencyI18nsPartial = true;
+ }
+
+ $collCurrencyI18ns->getInternalIterator()->rewind();
+
+ return $collCurrencyI18ns;
+ }
+
+ if ($partial && $this->collCurrencyI18ns) {
+ foreach ($this->collCurrencyI18ns as $obj) {
+ if ($obj->isNew()) {
+ $collCurrencyI18ns[] = $obj;
+ }
+ }
+ }
+
+ $this->collCurrencyI18ns = $collCurrencyI18ns;
+ $this->collCurrencyI18nsPartial = false;
+ }
+ }
+
+ return $this->collCurrencyI18ns;
+ }
+
+ /**
+ * Sets a collection of CurrencyI18n 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 $currencyI18ns A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildCurrency The current object (for fluent API support)
+ */
+ public function setCurrencyI18ns(Collection $currencyI18ns, ConnectionInterface $con = null)
+ {
+ $currencyI18nsToDelete = $this->getCurrencyI18ns(new Criteria(), $con)->diff($currencyI18ns);
+
+
+ //since at least one column in the foreign key is at the same time a PK
+ //we can not just set a PK to NULL in the lines below. We have to store
+ //a backup of all values, so we are able to manipulate these items based on the onDelete value later.
+ $this->currencyI18nsScheduledForDeletion = clone $currencyI18nsToDelete;
+
+ foreach ($currencyI18nsToDelete as $currencyI18nRemoved) {
+ $currencyI18nRemoved->setCurrency(null);
+ }
+
+ $this->collCurrencyI18ns = null;
+ foreach ($currencyI18ns as $currencyI18n) {
+ $this->addCurrencyI18n($currencyI18n);
+ }
+
+ $this->collCurrencyI18ns = $currencyI18ns;
+ $this->collCurrencyI18nsPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related CurrencyI18n objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related CurrencyI18n objects.
+ * @throws PropelException
+ */
+ public function countCurrencyI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collCurrencyI18nsPartial && !$this->isNew();
+ if (null === $this->collCurrencyI18ns || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collCurrencyI18ns) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getCurrencyI18ns());
+ }
+
+ $query = ChildCurrencyI18nQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterByCurrency($this)
+ ->count($con);
+ }
+
+ return count($this->collCurrencyI18ns);
+ }
+
+ /**
+ * Method called to associate a ChildCurrencyI18n object to this object
+ * through the ChildCurrencyI18n foreign key attribute.
+ *
+ * @param ChildCurrencyI18n $l ChildCurrencyI18n
+ * @return \Thelia\Model\Currency The current object (for fluent API support)
+ */
+ public function addCurrencyI18n(ChildCurrencyI18n $l)
+ {
+ if ($l && $locale = $l->getLocale()) {
+ $this->setLocale($locale);
+ $this->currentTranslations[$locale] = $l;
+ }
+ if ($this->collCurrencyI18ns === null) {
+ $this->initCurrencyI18ns();
+ $this->collCurrencyI18nsPartial = true;
+ }
+
+ if (!in_array($l, $this->collCurrencyI18ns->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddCurrencyI18n($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param CurrencyI18n $currencyI18n The currencyI18n object to add.
+ */
+ protected function doAddCurrencyI18n($currencyI18n)
+ {
+ $this->collCurrencyI18ns[]= $currencyI18n;
+ $currencyI18n->setCurrency($this);
+ }
+
+ /**
+ * @param CurrencyI18n $currencyI18n The currencyI18n object to remove.
+ * @return ChildCurrency The current object (for fluent API support)
+ */
+ public function removeCurrencyI18n($currencyI18n)
+ {
+ if ($this->getCurrencyI18ns()->contains($currencyI18n)) {
+ $this->collCurrencyI18ns->remove($this->collCurrencyI18ns->search($currencyI18n));
+ if (null === $this->currencyI18nsScheduledForDeletion) {
+ $this->currencyI18nsScheduledForDeletion = clone $this->collCurrencyI18ns;
+ $this->currencyI18nsScheduledForDeletion->clear();
+ }
+ $this->currencyI18nsScheduledForDeletion[]= clone $currencyI18n;
+ $currencyI18n->setCurrency(null);
+ }
+
+ return $this;
+ }
+
/**
* Clears the current object and sets all attributes to their default values
*/
public function clear()
{
$this->id = null;
- $this->name = null;
$this->code = null;
$this->symbol = null;
$this->rate = null;
@@ -2096,8 +2610,22 @@ abstract class Currency implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
+ if ($this->collProductPrices) {
+ foreach ($this->collProductPrices as $o) {
+ $o->clearAllReferences($deep);
+ }
+ }
+ if ($this->collCurrencyI18ns) {
+ foreach ($this->collCurrencyI18ns as $o) {
+ $o->clearAllReferences($deep);
+ }
+ }
} // if ($deep)
+ // i18n behavior
+ $this->currentLocale = 'en_US';
+ $this->currentTranslations = null;
+
if ($this->collOrders instanceof Collection) {
$this->collOrders->clearIterator();
}
@@ -2106,6 +2634,14 @@ abstract class Currency implements ActiveRecordInterface
$this->collCarts->clearIterator();
}
$this->collCarts = null;
+ if ($this->collProductPrices instanceof Collection) {
+ $this->collProductPrices->clearIterator();
+ }
+ $this->collProductPrices = null;
+ if ($this->collCurrencyI18ns instanceof Collection) {
+ $this->collCurrencyI18ns->clearIterator();
+ }
+ $this->collCurrencyI18ns = null;
}
/**
@@ -2132,6 +2668,129 @@ abstract class Currency implements ActiveRecordInterface
return $this;
}
+ // i18n behavior
+
+ /**
+ * Sets the locale for translations
+ *
+ * @param string $locale Locale to use for the translation, e.g. 'fr_FR'
+ *
+ * @return ChildCurrency The current object (for fluent API support)
+ */
+ public function setLocale($locale = 'en_US')
+ {
+ $this->currentLocale = $locale;
+
+ return $this;
+ }
+
+ /**
+ * Gets the locale for translations
+ *
+ * @return string $locale Locale to use for the translation, e.g. 'fr_FR'
+ */
+ public function getLocale()
+ {
+ return $this->currentLocale;
+ }
+
+ /**
+ * Returns the current translation for a given locale
+ *
+ * @param string $locale Locale to use for the translation, e.g. 'fr_FR'
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildCurrencyI18n */
+ public function getTranslation($locale = 'en_US', ConnectionInterface $con = null)
+ {
+ if (!isset($this->currentTranslations[$locale])) {
+ if (null !== $this->collCurrencyI18ns) {
+ foreach ($this->collCurrencyI18ns as $translation) {
+ if ($translation->getLocale() == $locale) {
+ $this->currentTranslations[$locale] = $translation;
+
+ return $translation;
+ }
+ }
+ }
+ if ($this->isNew()) {
+ $translation = new ChildCurrencyI18n();
+ $translation->setLocale($locale);
+ } else {
+ $translation = ChildCurrencyI18nQuery::create()
+ ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
+ ->findOneOrCreate($con);
+ $this->currentTranslations[$locale] = $translation;
+ }
+ $this->addCurrencyI18n($translation);
+ }
+
+ return $this->currentTranslations[$locale];
+ }
+
+ /**
+ * Remove the translation for a given locale
+ *
+ * @param string $locale Locale to use for the translation, e.g. 'fr_FR'
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildCurrency The current object (for fluent API support)
+ */
+ public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null)
+ {
+ if (!$this->isNew()) {
+ ChildCurrencyI18nQuery::create()
+ ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
+ ->delete($con);
+ }
+ if (isset($this->currentTranslations[$locale])) {
+ unset($this->currentTranslations[$locale]);
+ }
+ foreach ($this->collCurrencyI18ns as $key => $translation) {
+ if ($translation->getLocale() == $locale) {
+ unset($this->collCurrencyI18ns[$key]);
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the current translation
+ *
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildCurrencyI18n */
+ public function getCurrentTranslation(ConnectionInterface $con = null)
+ {
+ return $this->getTranslation($this->getLocale(), $con);
+ }
+
+
+ /**
+ * Get the [name] column value.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->getCurrentTranslation()->getName();
+ }
+
+
+ /**
+ * Set the value of [name] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\CurrencyI18n The current object (for fluent API support)
+ */
+ public function setName($v)
+ { $this->getCurrentTranslation()->setName($v);
+
+ return $this;
+ }
+
/**
* Code to be run before persisting the object
* @param ConnectionInterface $con
diff --git a/core/lib/Thelia/Model/Base/CurrencyI18n.php b/core/lib/Thelia/Model/Base/CurrencyI18n.php
new file mode 100644
index 000000000..eb86a87c4
--- /dev/null
+++ b/core/lib/Thelia/Model/Base/CurrencyI18n.php
@@ -0,0 +1,1265 @@
+locale = 'en_US';
+ }
+
+ /**
+ * Initializes internal state of Thelia\Model\Base\CurrencyI18n object.
+ * @see applyDefaults()
+ */
+ public function __construct()
+ {
+ $this->applyDefaultValues();
+ }
+
+ /**
+ * Returns whether the object has been modified.
+ *
+ * @return boolean True if the object has been modified.
+ */
+ public function isModified()
+ {
+ return !empty($this->modifiedColumns);
+ }
+
+ /**
+ * Has specified column been modified?
+ *
+ * @param string $col column fully qualified name (TableMap::TYPE_COLNAME), e.g. Book::AUTHOR_ID
+ * @return boolean True if $col has been modified.
+ */
+ public function isColumnModified($col)
+ {
+ return in_array($col, $this->modifiedColumns);
+ }
+
+ /**
+ * Get the columns that have been modified in this object.
+ * @return array A unique list of the modified column names for this object.
+ */
+ public function getModifiedColumns()
+ {
+ return array_unique($this->modifiedColumns);
+ }
+
+ /**
+ * Returns whether the object has ever been saved. This will
+ * be false, if the object was retrieved from storage or was created
+ * and then saved.
+ *
+ * @return true, if the object has never been persisted.
+ */
+ public function isNew()
+ {
+ return $this->new;
+ }
+
+ /**
+ * Setter for the isNew attribute. This method will be called
+ * by Propel-generated children and objects.
+ *
+ * @param boolean $b the state of the object.
+ */
+ public function setNew($b)
+ {
+ $this->new = (Boolean) $b;
+ }
+
+ /**
+ * Whether this object has been deleted.
+ * @return boolean The deleted state of this object.
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Specify whether this object has been deleted.
+ * @param boolean $b The deleted state of this object.
+ * @return void
+ */
+ public function setDeleted($b)
+ {
+ $this->deleted = (Boolean) $b;
+ }
+
+ /**
+ * Sets the modified state for the object to be false.
+ * @param string $col If supplied, only the specified column is reset.
+ * @return void
+ */
+ public function resetModified($col = null)
+ {
+ if (null !== $col) {
+ while (false !== ($offset = array_search($col, $this->modifiedColumns))) {
+ array_splice($this->modifiedColumns, $offset, 1);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another CurrencyI18n instance. If
+ * obj is an instance of CurrencyI18n, delegates to
+ * equals(CurrencyI18n). Otherwise, returns false.
+ *
+ * @param obj The object to compare to.
+ * @return Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @param string $name The virtual column name
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return isset($this->virtualColumns[$name]);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @return mixed
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return CurrencyI18n The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return CurrencyI18n The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [locale] column value.
+ *
+ * @return string
+ */
+ public function getLocale()
+ {
+
+ return $this->locale;
+ }
+
+ /**
+ * Get the [name] column value.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+
+ return $this->name;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\CurrencyI18n The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[] = CurrencyI18nTableMap::ID;
+ }
+
+ if ($this->aCurrency !== null && $this->aCurrency->getId() !== $v) {
+ $this->aCurrency = null;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [locale] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\CurrencyI18n The current object (for fluent API support)
+ */
+ public function setLocale($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->locale !== $v) {
+ $this->locale = $v;
+ $this->modifiedColumns[] = CurrencyI18nTableMap::LOCALE;
+ }
+
+
+ return $this;
+ } // setLocale()
+
+ /**
+ * Set the value of [name] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\CurrencyI18n The current object (for fluent API support)
+ */
+ public function setName($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->name !== $v) {
+ $this->name = $v;
+ $this->modifiedColumns[] = CurrencyI18nTableMap::NAME;
+ }
+
+
+ return $this;
+ } // setName()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ if ($this->locale !== 'en_US') {
+ return false;
+ }
+
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : CurrencyI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : CurrencyI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->locale = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CurrencyI18nTableMap::translateFieldName('Name', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->name = (null !== $col) ? (string) $col : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 3; // 3 = CurrencyI18nTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \Thelia\Model\CurrencyI18n object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ if ($this->aCurrency !== null && $this->id !== $this->aCurrency->getId()) {
+ $this->aCurrency = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(CurrencyI18nTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildCurrencyI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->aCurrency = null;
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see CurrencyI18n::setDeleted()
+ * @see CurrencyI18n::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(CurrencyI18nTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildCurrencyI18nQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(CurrencyI18nTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ CurrencyI18nTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+ // We call the save method on the following object(s) if they
+ // were passed to this object by their corresponding set
+ // method. This object relates to these object(s) by a
+ // foreign key reference.
+
+ if ($this->aCurrency !== null) {
+ if ($this->aCurrency->isModified() || $this->aCurrency->isNew()) {
+ $affectedRows += $this->aCurrency->save($con);
+ }
+ $this->setCurrency($this->aCurrency);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(CurrencyI18nTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(CurrencyI18nTableMap::LOCALE)) {
+ $modifiedColumns[':p' . $index++] = 'LOCALE';
+ }
+ if ($this->isColumnModified(CurrencyI18nTableMap::NAME)) {
+ $modifiedColumns[':p' . $index++] = 'NAME';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO currency_i18n (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'LOCALE':
+ $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR);
+ break;
+ case 'NAME':
+ $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = CurrencyI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getLocale();
+ break;
+ case 2:
+ return $this->getName();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * 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(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['CurrencyI18n'][serialize($this->getPrimaryKey())])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['CurrencyI18n'][serialize($this->getPrimaryKey())] = true;
+ $keys = CurrencyI18nTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getLocale(),
+ $keys[2] => $this->getName(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach($virtualColumns as $key => $virtualColumn)
+ {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aCurrency) {
+ $result['Currency'] = $this->aCurrency->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = CurrencyI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setLocale($value);
+ break;
+ case 2:
+ $this->setName($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = CurrencyI18nTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setLocale($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setName($arr[$keys[2]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(CurrencyI18nTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(CurrencyI18nTableMap::ID)) $criteria->add(CurrencyI18nTableMap::ID, $this->id);
+ if ($this->isColumnModified(CurrencyI18nTableMap::LOCALE)) $criteria->add(CurrencyI18nTableMap::LOCALE, $this->locale);
+ if ($this->isColumnModified(CurrencyI18nTableMap::NAME)) $criteria->add(CurrencyI18nTableMap::NAME, $this->name);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(CurrencyI18nTableMap::DATABASE_NAME);
+ $criteria->add(CurrencyI18nTableMap::ID, $this->id);
+ $criteria->add(CurrencyI18nTableMap::LOCALE, $this->locale);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+ $pks[0] = $this->getId();
+ $pks[1] = $this->getLocale();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+ $this->setId($keys[0]);
+ $this->setLocale($keys[1]);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return (null === $this->getId()) && (null === $this->getLocale());
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \Thelia\Model\CurrencyI18n (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setId($this->getId());
+ $copyObj->setLocale($this->getLocale());
+ $copyObj->setName($this->getName());
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \Thelia\Model\CurrencyI18n Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Declares an association between this object and a ChildCurrency object.
+ *
+ * @param ChildCurrency $v
+ * @return \Thelia\Model\CurrencyI18n The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setCurrency(ChildCurrency $v = null)
+ {
+ if ($v === null) {
+ $this->setId(NULL);
+ } else {
+ $this->setId($v->getId());
+ }
+
+ $this->aCurrency = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildCurrency object, it will not be re-added.
+ if ($v !== null) {
+ $v->addCurrencyI18n($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildCurrency object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildCurrency The associated ChildCurrency object.
+ * @throws PropelException
+ */
+ public function getCurrency(ConnectionInterface $con = null)
+ {
+ if ($this->aCurrency === null && ($this->id !== null)) {
+ $this->aCurrency = ChildCurrencyQuery::create()->findPk($this->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->aCurrency->addCurrencyI18ns($this);
+ */
+ }
+
+ return $this->aCurrency;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->locale = null;
+ $this->name = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->applyDefaultValues();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ } // if ($deep)
+
+ $this->aCurrency = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(CurrencyI18nTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/core/lib/Thelia/Model/Base/CurrencyI18nQuery.php b/core/lib/Thelia/Model/Base/CurrencyI18nQuery.php
new file mode 100644
index 000000000..33af4ff87
--- /dev/null
+++ b/core/lib/Thelia/Model/Base/CurrencyI18nQuery.php
@@ -0,0 +1,508 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(array(12, 34), $con);
+ *
+ *
+ * @param array[$id, $locale] $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildCurrencyI18n|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = CurrencyI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(CurrencyI18nTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildCurrencyI18n A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, LOCALE, NAME FROM currency_i18n WHERE ID = :p0 AND LOCALE = :p1';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
+ $stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildCurrencyI18n();
+ $obj->hydrate($row);
+ CurrencyI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildCurrencyI18n|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildCurrencyI18nQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+ $this->addUsingAlias(CurrencyI18nTableMap::ID, $key[0], Criteria::EQUAL);
+ $this->addUsingAlias(CurrencyI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
+
+ return $this;
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildCurrencyI18nQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+ if (empty($keys)) {
+ return $this->add(null, '1<>1', Criteria::CUSTOM);
+ }
+ foreach ($keys as $key) {
+ $cton0 = $this->getNewCriterion(CurrencyI18nTableMap::ID, $key[0], Criteria::EQUAL);
+ $cton1 = $this->getNewCriterion(CurrencyI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
+ $cton0->addAnd($cton1);
+ $this->addOr($cton0);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @see filterByCurrency()
+ *
+ * @param mixed $id 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 ChildCurrencyI18nQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(CurrencyI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(CurrencyI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(CurrencyI18nTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the locale column
+ *
+ * Example usage:
+ *
+ * $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
+ * $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
+ *
+ *
+ * @param string $locale 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 ChildCurrencyI18nQuery The current query, for fluid interface
+ */
+ public function filterByLocale($locale = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($locale)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $locale)) {
+ $locale = str_replace('*', '%', $locale);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(CurrencyI18nTableMap::LOCALE, $locale, $comparison);
+ }
+
+ /**
+ * Filter the query on the name column
+ *
+ * Example usage:
+ *
+ * $query->filterByName('fooValue'); // WHERE name = 'fooValue'
+ * $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
+ *
+ *
+ * @param string $name 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 ChildCurrencyI18nQuery The current query, for fluid interface
+ */
+ public function filterByName($name = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($name)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $name)) {
+ $name = str_replace('*', '%', $name);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(CurrencyI18nTableMap::NAME, $name, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\Currency object
+ *
+ * @param \Thelia\Model\Currency|ObjectCollection $currency The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildCurrencyI18nQuery The current query, for fluid interface
+ */
+ public function filterByCurrency($currency, $comparison = null)
+ {
+ if ($currency instanceof \Thelia\Model\Currency) {
+ return $this
+ ->addUsingAlias(CurrencyI18nTableMap::ID, $currency->getId(), $comparison);
+ } elseif ($currency instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(CurrencyI18nTableMap::ID, $currency->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByCurrency() only accepts arguments of type \Thelia\Model\Currency or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Currency relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildCurrencyI18nQuery The current query, for fluid interface
+ */
+ public function joinCurrency($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Currency');
+
+ // 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, 'Currency');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Currency relation Currency 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\CurrencyQuery A secondary query class using the current class as primary query
+ */
+ public function useCurrencyQuery($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ return $this
+ ->joinCurrency($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Currency', '\Thelia\Model\CurrencyQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildCurrencyI18n $currencyI18n Object to remove from the list of results
+ *
+ * @return ChildCurrencyI18nQuery The current query, for fluid interface
+ */
+ public function prune($currencyI18n = null)
+ {
+ if ($currencyI18n) {
+ $this->addCond('pruneCond0', $this->getAliasedColName(CurrencyI18nTableMap::ID), $currencyI18n->getId(), Criteria::NOT_EQUAL);
+ $this->addCond('pruneCond1', $this->getAliasedColName(CurrencyI18nTableMap::LOCALE), $currencyI18n->getLocale(), Criteria::NOT_EQUAL);
+ $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the currency_i18n table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(CurrencyI18nTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ CurrencyI18nTableMap::clearInstancePool();
+ CurrencyI18nTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildCurrencyI18n or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildCurrencyI18n object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(CurrencyI18nTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(CurrencyI18nTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ CurrencyI18nTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ CurrencyI18nTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // CurrencyI18nQuery
diff --git a/core/lib/Thelia/Model/Base/CurrencyQuery.php b/core/lib/Thelia/Model/Base/CurrencyQuery.php
old mode 100755
new mode 100644
index 79c0dc7a1..140b70463
--- a/core/lib/Thelia/Model/Base/CurrencyQuery.php
+++ b/core/lib/Thelia/Model/Base/CurrencyQuery.php
@@ -13,6 +13,7 @@ use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Currency as ChildCurrency;
+use Thelia\Model\CurrencyI18nQuery as ChildCurrencyI18nQuery;
use Thelia\Model\CurrencyQuery as ChildCurrencyQuery;
use Thelia\Model\Map\CurrencyTableMap;
@@ -22,7 +23,6 @@ use Thelia\Model\Map\CurrencyTableMap;
*
*
* @method ChildCurrencyQuery orderById($order = Criteria::ASC) Order by the id column
- * @method ChildCurrencyQuery orderByName($order = Criteria::ASC) Order by the name column
* @method ChildCurrencyQuery orderByCode($order = Criteria::ASC) Order by the code column
* @method ChildCurrencyQuery orderBySymbol($order = Criteria::ASC) Order by the symbol column
* @method ChildCurrencyQuery orderByRate($order = Criteria::ASC) Order by the rate column
@@ -31,7 +31,6 @@ use Thelia\Model\Map\CurrencyTableMap;
* @method ChildCurrencyQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildCurrencyQuery groupById() Group by the id column
- * @method ChildCurrencyQuery groupByName() Group by the name column
* @method ChildCurrencyQuery groupByCode() Group by the code column
* @method ChildCurrencyQuery groupBySymbol() Group by the symbol column
* @method ChildCurrencyQuery groupByRate() Group by the rate column
@@ -51,11 +50,18 @@ use Thelia\Model\Map\CurrencyTableMap;
* @method ChildCurrencyQuery rightJoinCart($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Cart relation
* @method ChildCurrencyQuery innerJoinCart($relationAlias = null) Adds a INNER JOIN clause to the query using the Cart relation
*
+ * @method ChildCurrencyQuery leftJoinProductPrice($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductPrice relation
+ * @method ChildCurrencyQuery rightJoinProductPrice($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductPrice relation
+ * @method ChildCurrencyQuery innerJoinProductPrice($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductPrice relation
+ *
+ * @method ChildCurrencyQuery leftJoinCurrencyI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CurrencyI18n relation
+ * @method ChildCurrencyQuery rightJoinCurrencyI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CurrencyI18n relation
+ * @method ChildCurrencyQuery innerJoinCurrencyI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CurrencyI18n relation
+ *
* @method ChildCurrency findOne(ConnectionInterface $con = null) Return the first ChildCurrency matching the query
* @method ChildCurrency findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCurrency matching the query, or a new ChildCurrency object populated from the query conditions when no match is found
*
* @method ChildCurrency findOneById(int $id) Return the first ChildCurrency filtered by the id column
- * @method ChildCurrency findOneByName(string $name) Return the first ChildCurrency filtered by the name column
* @method ChildCurrency findOneByCode(string $code) Return the first ChildCurrency filtered by the code column
* @method ChildCurrency findOneBySymbol(string $symbol) Return the first ChildCurrency filtered by the symbol column
* @method ChildCurrency findOneByRate(double $rate) Return the first ChildCurrency filtered by the rate column
@@ -64,7 +70,6 @@ use Thelia\Model\Map\CurrencyTableMap;
* @method ChildCurrency findOneByUpdatedAt(string $updated_at) Return the first ChildCurrency filtered by the updated_at column
*
* @method array findById(int $id) Return ChildCurrency objects filtered by the id column
- * @method array findByName(string $name) Return ChildCurrency objects filtered by the name column
* @method array findByCode(string $code) Return ChildCurrency objects filtered by the code column
* @method array findBySymbol(string $symbol) Return ChildCurrency objects filtered by the symbol column
* @method array findByRate(double $rate) Return ChildCurrency objects filtered by the rate column
@@ -159,7 +164,7 @@ abstract class CurrencyQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, NAME, CODE, SYMBOL, RATE, BY_DEFAULT, CREATED_AT, UPDATED_AT FROM currency WHERE ID = :p0';
+ $sql = 'SELECT ID, CODE, SYMBOL, RATE, BY_DEFAULT, CREATED_AT, UPDATED_AT FROM currency WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -289,35 +294,6 @@ abstract class CurrencyQuery extends ModelCriteria
return $this->addUsingAlias(CurrencyTableMap::ID, $id, $comparison);
}
- /**
- * Filter the query on the name column
- *
- * Example usage:
- *
- * $query->filterByName('fooValue'); // WHERE name = 'fooValue'
- * $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
- *
- *
- * @param string $name 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 ChildCurrencyQuery The current query, for fluid interface
- */
- public function filterByName($name = null, $comparison = null)
- {
- if (null === $comparison) {
- if (is_array($name)) {
- $comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $name)) {
- $name = str_replace('*', '%', $name);
- $comparison = Criteria::LIKE;
- }
- }
-
- return $this->addUsingAlias(CurrencyTableMap::NAME, $name, $comparison);
- }
-
/**
* Filter the query on the code column
*
@@ -690,6 +666,152 @@ abstract class CurrencyQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'Cart', '\Thelia\Model\CartQuery');
}
+ /**
+ * Filter the query by a related \Thelia\Model\ProductPrice object
+ *
+ * @param \Thelia\Model\ProductPrice|ObjectCollection $productPrice the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildCurrencyQuery The current query, for fluid interface
+ */
+ public function filterByProductPrice($productPrice, $comparison = null)
+ {
+ if ($productPrice instanceof \Thelia\Model\ProductPrice) {
+ return $this
+ ->addUsingAlias(CurrencyTableMap::ID, $productPrice->getCurrencyId(), $comparison);
+ } elseif ($productPrice instanceof ObjectCollection) {
+ return $this
+ ->useProductPriceQuery()
+ ->filterByPrimaryKeys($productPrice->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByProductPrice() only accepts arguments of type \Thelia\Model\ProductPrice or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the ProductPrice relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildCurrencyQuery The current query, for fluid interface
+ */
+ public function joinProductPrice($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('ProductPrice');
+
+ // 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, 'ProductPrice');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the ProductPrice relation ProductPrice 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\ProductPriceQuery A secondary query class using the current class as primary query
+ */
+ public function useProductPriceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinProductPrice($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ProductPrice', '\Thelia\Model\ProductPriceQuery');
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\CurrencyI18n object
+ *
+ * @param \Thelia\Model\CurrencyI18n|ObjectCollection $currencyI18n the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildCurrencyQuery The current query, for fluid interface
+ */
+ public function filterByCurrencyI18n($currencyI18n, $comparison = null)
+ {
+ if ($currencyI18n instanceof \Thelia\Model\CurrencyI18n) {
+ return $this
+ ->addUsingAlias(CurrencyTableMap::ID, $currencyI18n->getId(), $comparison);
+ } elseif ($currencyI18n instanceof ObjectCollection) {
+ return $this
+ ->useCurrencyI18nQuery()
+ ->filterByPrimaryKeys($currencyI18n->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByCurrencyI18n() only accepts arguments of type \Thelia\Model\CurrencyI18n or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the CurrencyI18n relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildCurrencyQuery The current query, for fluid interface
+ */
+ public function joinCurrencyI18n($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('CurrencyI18n');
+
+ // 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, 'CurrencyI18n');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the CurrencyI18n relation CurrencyI18n 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\CurrencyI18nQuery A secondary query class using the current class as primary query
+ */
+ public function useCurrencyI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ return $this
+ ->joinCurrencyI18n($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'CurrencyI18n', '\Thelia\Model\CurrencyI18nQuery');
+ }
+
/**
* Exclude object from result
*
@@ -847,4 +969,61 @@ abstract class CurrencyQuery extends ModelCriteria
return $this->addAscendingOrderByColumn(CurrencyTableMap::CREATED_AT);
}
+ // i18n behavior
+
+ /**
+ * Adds a JOIN clause to the query using the i18n relation
+ *
+ * @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
+ *
+ * @return ChildCurrencyQuery The current query, for fluid interface
+ */
+ public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ {
+ $relationName = $relationAlias ? $relationAlias : 'CurrencyI18n';
+
+ return $this
+ ->joinCurrencyI18n($relationAlias, $joinType)
+ ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
+ }
+
+ /**
+ * Adds a JOIN clause to the query and hydrates the related I18n object.
+ * Shortcut for $c->joinI18n($locale)->with()
+ *
+ * @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
+ *
+ * @return ChildCurrencyQuery The current query, for fluid interface
+ */
+ public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
+ {
+ $this
+ ->joinI18n($locale, null, $joinType)
+ ->with('CurrencyI18n');
+ $this->with['CurrencyI18n']->setIsWithOneToMany(false);
+
+ return $this;
+ }
+
+ /**
+ * Use the I18n relation query object
+ *
+ * @see useQuery()
+ *
+ * @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
+ *
+ * @return ChildCurrencyI18nQuery A secondary query class using the current class as primary query
+ */
+ public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ {
+ return $this
+ ->joinI18n($locale, $relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'CurrencyI18n', '\Thelia\Model\CurrencyI18nQuery');
+ }
+
} // CurrencyQuery
diff --git a/core/lib/Thelia/Model/Base/Customer.php b/core/lib/Thelia/Model/Base/Customer.php
old mode 100755
new mode 100644
index 295d56920..c3315ac6f
--- a/core/lib/Thelia/Model/Base/Customer.php
+++ b/core/lib/Thelia/Model/Base/Customer.php
@@ -2153,6 +2153,31 @@ abstract class Customer implements ActiveRecordInterface
return $this->getAddresses($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 Addresses 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|ChildAddress[] List of ChildAddress objects
+ */
+ public function getAddressesJoinCountry($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ {
+ $query = ChildAddressQuery::create(null, $criteria);
+ $query->joinWith('Country', $joinBehavior);
+
+ return $this->getAddresses($query, $con);
+ }
+
/**
* Clears out the collOrders collection
*
diff --git a/core/lib/Thelia/Model/Base/CustomerQuery.php b/core/lib/Thelia/Model/Base/CustomerQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CustomerTitle.php b/core/lib/Thelia/Model/Base/CustomerTitle.php
old mode 100755
new mode 100644
index 5d34c95e5..5f8b11dd9
--- a/core/lib/Thelia/Model/Base/CustomerTitle.php
+++ b/core/lib/Thelia/Model/Base/CustomerTitle.php
@@ -883,10 +883,9 @@ abstract class CustomerTitle implements ActiveRecordInterface
if ($this->addressesScheduledForDeletion !== null) {
if (!$this->addressesScheduledForDeletion->isEmpty()) {
- foreach ($this->addressesScheduledForDeletion as $address) {
- // need to save related object because we set the relation to null
- $address->save($con);
- }
+ \Thelia\Model\AddressQuery::create()
+ ->filterByPrimaryKeys($this->addressesScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
$this->addressesScheduledForDeletion = null;
}
}
@@ -1777,7 +1776,7 @@ abstract class CustomerTitle implements ActiveRecordInterface
$this->addressesScheduledForDeletion = clone $this->collAddresses;
$this->addressesScheduledForDeletion->clear();
}
- $this->addressesScheduledForDeletion[]= $address;
+ $this->addressesScheduledForDeletion[]= clone $address;
$address->setCustomerTitle(null);
}
@@ -1809,6 +1808,31 @@ abstract class CustomerTitle implements ActiveRecordInterface
return $this->getAddresses($query, $con);
}
+
+ /**
+ * If this collection has already been initialized with
+ * an identical criteria, it returns the collection.
+ * Otherwise if this CustomerTitle is new, it will return
+ * an empty collection; or if this CustomerTitle has previously
+ * been saved, it will retrieve related Addresses 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 CustomerTitle.
+ *
+ * @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|ChildAddress[] List of ChildAddress objects
+ */
+ public function getAddressesJoinCountry($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ {
+ $query = ChildAddressQuery::create(null, $criteria);
+ $query->joinWith('Country', $joinBehavior);
+
+ return $this->getAddresses($query, $con);
+ }
+
/**
* Clears out the collCustomerTitleI18ns collection
*
diff --git a/core/lib/Thelia/Model/Base/CustomerTitleI18n.php b/core/lib/Thelia/Model/Base/CustomerTitleI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CustomerTitleI18nQuery.php b/core/lib/Thelia/Model/Base/CustomerTitleI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/CustomerTitleQuery.php b/core/lib/Thelia/Model/Base/CustomerTitleQuery.php
old mode 100755
new mode 100644
index f3c372248..ea34c8c91
--- a/core/lib/Thelia/Model/Base/CustomerTitleQuery.php
+++ b/core/lib/Thelia/Model/Base/CustomerTitleQuery.php
@@ -523,7 +523,7 @@ abstract class CustomerTitleQuery extends ModelCriteria
{
if ($address instanceof \Thelia\Model\Address) {
return $this
- ->addUsingAlias(CustomerTitleTableMap::ID, $address->getCustomerTitleId(), $comparison);
+ ->addUsingAlias(CustomerTitleTableMap::ID, $address->getTitleId(), $comparison);
} elseif ($address instanceof ObjectCollection) {
return $this
->useAddressQuery()
@@ -542,7 +542,7 @@ abstract class CustomerTitleQuery extends ModelCriteria
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
- public function joinAddress($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function joinAddress($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Address');
@@ -577,7 +577,7 @@ abstract class CustomerTitleQuery extends ModelCriteria
*
* @return \Thelia\Model\AddressQuery A secondary query class using the current class as primary query
*/
- public function useAddressQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function useAddressQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAddress($relationAlias, $joinType)
diff --git a/core/lib/Thelia/Model/Base/Delivzone.php b/core/lib/Thelia/Model/Base/Delivzone.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/DelivzoneQuery.php b/core/lib/Thelia/Model/Base/DelivzoneQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Document.php b/core/lib/Thelia/Model/Base/Document.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/DocumentI18n.php b/core/lib/Thelia/Model/Base/DocumentI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/DocumentI18nQuery.php b/core/lib/Thelia/Model/Base/DocumentI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/DocumentQuery.php b/core/lib/Thelia/Model/Base/DocumentQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Feature.php b/core/lib/Thelia/Model/Base/Feature.php
old mode 100755
new mode 100644
index c8e5e2603..0dddd14e0
--- a/core/lib/Thelia/Model/Base/Feature.php
+++ b/core/lib/Thelia/Model/Base/Feature.php
@@ -26,8 +26,8 @@ use Thelia\Model\FeatureCategory as ChildFeatureCategory;
use Thelia\Model\FeatureCategoryQuery as ChildFeatureCategoryQuery;
use Thelia\Model\FeatureI18n as ChildFeatureI18n;
use Thelia\Model\FeatureI18nQuery as ChildFeatureI18nQuery;
-use Thelia\Model\FeatureProd as ChildFeatureProd;
-use Thelia\Model\FeatureProdQuery as ChildFeatureProdQuery;
+use Thelia\Model\FeatureProduct as ChildFeatureProduct;
+use Thelia\Model\FeatureProductQuery as ChildFeatureProductQuery;
use Thelia\Model\FeatureQuery as ChildFeatureQuery;
use Thelia\Model\Map\FeatureTableMap;
@@ -103,10 +103,10 @@ abstract class Feature implements ActiveRecordInterface
protected $collFeatureAvsPartial;
/**
- * @var ObjectCollection|ChildFeatureProd[] Collection to store aggregation of ChildFeatureProd objects.
+ * @var ObjectCollection|ChildFeatureProduct[] Collection to store aggregation of ChildFeatureProduct objects.
*/
- protected $collFeatureProds;
- protected $collFeatureProdsPartial;
+ protected $collFeatureProducts;
+ protected $collFeatureProductsPartial;
/**
* @var ObjectCollection|ChildFeatureCategory[] Collection to store aggregation of ChildFeatureCategory objects.
@@ -163,7 +163,7 @@ abstract class Feature implements ActiveRecordInterface
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
- protected $featureProdsScheduledForDeletion = null;
+ protected $featureProductsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
@@ -754,7 +754,7 @@ abstract class Feature implements ActiveRecordInterface
$this->collFeatureAvs = null;
- $this->collFeatureProds = null;
+ $this->collFeatureProducts = null;
$this->collFeatureCategories = null;
@@ -938,17 +938,17 @@ abstract class Feature implements ActiveRecordInterface
}
}
- if ($this->featureProdsScheduledForDeletion !== null) {
- if (!$this->featureProdsScheduledForDeletion->isEmpty()) {
- \Thelia\Model\FeatureProdQuery::create()
- ->filterByPrimaryKeys($this->featureProdsScheduledForDeletion->getPrimaryKeys(false))
+ if ($this->featureProductsScheduledForDeletion !== null) {
+ if (!$this->featureProductsScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\FeatureProductQuery::create()
+ ->filterByPrimaryKeys($this->featureProductsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
- $this->featureProdsScheduledForDeletion = null;
+ $this->featureProductsScheduledForDeletion = null;
}
}
- if ($this->collFeatureProds !== null) {
- foreach ($this->collFeatureProds as $referrerFK) {
+ if ($this->collFeatureProducts !== null) {
+ foreach ($this->collFeatureProducts as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
@@ -1178,8 +1178,8 @@ abstract class Feature implements ActiveRecordInterface
if (null !== $this->collFeatureAvs) {
$result['FeatureAvs'] = $this->collFeatureAvs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
- if (null !== $this->collFeatureProds) {
- $result['FeatureProds'] = $this->collFeatureProds->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ if (null !== $this->collFeatureProducts) {
+ $result['FeatureProducts'] = $this->collFeatureProducts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collFeatureCategories) {
$result['FeatureCategories'] = $this->collFeatureCategories->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
@@ -1360,9 +1360,9 @@ abstract class Feature implements ActiveRecordInterface
}
}
- foreach ($this->getFeatureProds() as $relObj) {
+ foreach ($this->getFeatureProducts() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
- $copyObj->addFeatureProd($relObj->copy($deepCopy));
+ $copyObj->addFeatureProduct($relObj->copy($deepCopy));
}
}
@@ -1422,8 +1422,8 @@ abstract class Feature implements ActiveRecordInterface
if ('FeatureAv' == $relationName) {
return $this->initFeatureAvs();
}
- if ('FeatureProd' == $relationName) {
- return $this->initFeatureProds();
+ if ('FeatureProduct' == $relationName) {
+ return $this->initFeatureProducts();
}
if ('FeatureCategory' == $relationName) {
return $this->initFeatureCategories();
@@ -1652,31 +1652,31 @@ abstract class Feature implements ActiveRecordInterface
}
/**
- * Clears out the collFeatureProds collection
+ * Clears out the collFeatureProducts 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 addFeatureProds()
+ * @see addFeatureProducts()
*/
- public function clearFeatureProds()
+ public function clearFeatureProducts()
{
- $this->collFeatureProds = null; // important to set this to NULL since that means it is uninitialized
+ $this->collFeatureProducts = null; // important to set this to NULL since that means it is uninitialized
}
/**
- * Reset is the collFeatureProds collection loaded partially.
+ * Reset is the collFeatureProducts collection loaded partially.
*/
- public function resetPartialFeatureProds($v = true)
+ public function resetPartialFeatureProducts($v = true)
{
- $this->collFeatureProdsPartial = $v;
+ $this->collFeatureProductsPartial = $v;
}
/**
- * Initializes the collFeatureProds collection.
+ * Initializes the collFeatureProducts collection.
*
- * By default this just sets the collFeatureProds collection to an empty array (like clearcollFeatureProds());
+ * By default this just sets the collFeatureProducts collection to an empty array (like clearcollFeatureProducts());
* 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.
*
@@ -1685,17 +1685,17 @@ abstract class Feature implements ActiveRecordInterface
*
* @return void
*/
- public function initFeatureProds($overrideExisting = true)
+ public function initFeatureProducts($overrideExisting = true)
{
- if (null !== $this->collFeatureProds && !$overrideExisting) {
+ if (null !== $this->collFeatureProducts && !$overrideExisting) {
return;
}
- $this->collFeatureProds = new ObjectCollection();
- $this->collFeatureProds->setModel('\Thelia\Model\FeatureProd');
+ $this->collFeatureProducts = new ObjectCollection();
+ $this->collFeatureProducts->setModel('\Thelia\Model\FeatureProduct');
}
/**
- * Gets an array of ChildFeatureProd objects which contain a foreign key that references this object.
+ * Gets an array of ChildFeatureProduct 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.
@@ -1705,109 +1705,109 @@ abstract class Feature implements ActiveRecordInterface
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
- * @return Collection|ChildFeatureProd[] List of ChildFeatureProd objects
+ * @return Collection|ChildFeatureProduct[] List of ChildFeatureProduct objects
* @throws PropelException
*/
- public function getFeatureProds($criteria = null, ConnectionInterface $con = null)
+ public function getFeatureProducts($criteria = null, ConnectionInterface $con = null)
{
- $partial = $this->collFeatureProdsPartial && !$this->isNew();
- if (null === $this->collFeatureProds || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collFeatureProds) {
+ $partial = $this->collFeatureProductsPartial && !$this->isNew();
+ if (null === $this->collFeatureProducts || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collFeatureProducts) {
// return empty collection
- $this->initFeatureProds();
+ $this->initFeatureProducts();
} else {
- $collFeatureProds = ChildFeatureProdQuery::create(null, $criteria)
+ $collFeatureProducts = ChildFeatureProductQuery::create(null, $criteria)
->filterByFeature($this)
->find($con);
if (null !== $criteria) {
- if (false !== $this->collFeatureProdsPartial && count($collFeatureProds)) {
- $this->initFeatureProds(false);
+ if (false !== $this->collFeatureProductsPartial && count($collFeatureProducts)) {
+ $this->initFeatureProducts(false);
- foreach ($collFeatureProds as $obj) {
- if (false == $this->collFeatureProds->contains($obj)) {
- $this->collFeatureProds->append($obj);
+ foreach ($collFeatureProducts as $obj) {
+ if (false == $this->collFeatureProducts->contains($obj)) {
+ $this->collFeatureProducts->append($obj);
}
}
- $this->collFeatureProdsPartial = true;
+ $this->collFeatureProductsPartial = true;
}
- $collFeatureProds->getInternalIterator()->rewind();
+ $collFeatureProducts->getInternalIterator()->rewind();
- return $collFeatureProds;
+ return $collFeatureProducts;
}
- if ($partial && $this->collFeatureProds) {
- foreach ($this->collFeatureProds as $obj) {
+ if ($partial && $this->collFeatureProducts) {
+ foreach ($this->collFeatureProducts as $obj) {
if ($obj->isNew()) {
- $collFeatureProds[] = $obj;
+ $collFeatureProducts[] = $obj;
}
}
}
- $this->collFeatureProds = $collFeatureProds;
- $this->collFeatureProdsPartial = false;
+ $this->collFeatureProducts = $collFeatureProducts;
+ $this->collFeatureProductsPartial = false;
}
}
- return $this->collFeatureProds;
+ return $this->collFeatureProducts;
}
/**
- * Sets a collection of FeatureProd objects related by a one-to-many relationship
+ * Sets a collection of FeatureProduct 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 $featureProds A Propel collection.
+ * @param Collection $featureProducts A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildFeature The current object (for fluent API support)
*/
- public function setFeatureProds(Collection $featureProds, ConnectionInterface $con = null)
+ public function setFeatureProducts(Collection $featureProducts, ConnectionInterface $con = null)
{
- $featureProdsToDelete = $this->getFeatureProds(new Criteria(), $con)->diff($featureProds);
+ $featureProductsToDelete = $this->getFeatureProducts(new Criteria(), $con)->diff($featureProducts);
- $this->featureProdsScheduledForDeletion = $featureProdsToDelete;
+ $this->featureProductsScheduledForDeletion = $featureProductsToDelete;
- foreach ($featureProdsToDelete as $featureProdRemoved) {
- $featureProdRemoved->setFeature(null);
+ foreach ($featureProductsToDelete as $featureProductRemoved) {
+ $featureProductRemoved->setFeature(null);
}
- $this->collFeatureProds = null;
- foreach ($featureProds as $featureProd) {
- $this->addFeatureProd($featureProd);
+ $this->collFeatureProducts = null;
+ foreach ($featureProducts as $featureProduct) {
+ $this->addFeatureProduct($featureProduct);
}
- $this->collFeatureProds = $featureProds;
- $this->collFeatureProdsPartial = false;
+ $this->collFeatureProducts = $featureProducts;
+ $this->collFeatureProductsPartial = false;
return $this;
}
/**
- * Returns the number of related FeatureProd objects.
+ * Returns the number of related FeatureProduct objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
- * @return int Count of related FeatureProd objects.
+ * @return int Count of related FeatureProduct objects.
* @throws PropelException
*/
- public function countFeatureProds(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ public function countFeatureProducts(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
- $partial = $this->collFeatureProdsPartial && !$this->isNew();
- if (null === $this->collFeatureProds || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collFeatureProds) {
+ $partial = $this->collFeatureProductsPartial && !$this->isNew();
+ if (null === $this->collFeatureProducts || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collFeatureProducts) {
return 0;
}
if ($partial && !$criteria) {
- return count($this->getFeatureProds());
+ return count($this->getFeatureProducts());
}
- $query = ChildFeatureProdQuery::create(null, $criteria);
+ $query = ChildFeatureProductQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
@@ -1817,53 +1817,53 @@ abstract class Feature implements ActiveRecordInterface
->count($con);
}
- return count($this->collFeatureProds);
+ return count($this->collFeatureProducts);
}
/**
- * Method called to associate a ChildFeatureProd object to this object
- * through the ChildFeatureProd foreign key attribute.
+ * Method called to associate a ChildFeatureProduct object to this object
+ * through the ChildFeatureProduct foreign key attribute.
*
- * @param ChildFeatureProd $l ChildFeatureProd
+ * @param ChildFeatureProduct $l ChildFeatureProduct
* @return \Thelia\Model\Feature The current object (for fluent API support)
*/
- public function addFeatureProd(ChildFeatureProd $l)
+ public function addFeatureProduct(ChildFeatureProduct $l)
{
- if ($this->collFeatureProds === null) {
- $this->initFeatureProds();
- $this->collFeatureProdsPartial = true;
+ if ($this->collFeatureProducts === null) {
+ $this->initFeatureProducts();
+ $this->collFeatureProductsPartial = true;
}
- if (!in_array($l, $this->collFeatureProds->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
- $this->doAddFeatureProd($l);
+ if (!in_array($l, $this->collFeatureProducts->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddFeatureProduct($l);
}
return $this;
}
/**
- * @param FeatureProd $featureProd The featureProd object to add.
+ * @param FeatureProduct $featureProduct The featureProduct object to add.
*/
- protected function doAddFeatureProd($featureProd)
+ protected function doAddFeatureProduct($featureProduct)
{
- $this->collFeatureProds[]= $featureProd;
- $featureProd->setFeature($this);
+ $this->collFeatureProducts[]= $featureProduct;
+ $featureProduct->setFeature($this);
}
/**
- * @param FeatureProd $featureProd The featureProd object to remove.
+ * @param FeatureProduct $featureProduct The featureProduct object to remove.
* @return ChildFeature The current object (for fluent API support)
*/
- public function removeFeatureProd($featureProd)
+ public function removeFeatureProduct($featureProduct)
{
- if ($this->getFeatureProds()->contains($featureProd)) {
- $this->collFeatureProds->remove($this->collFeatureProds->search($featureProd));
- if (null === $this->featureProdsScheduledForDeletion) {
- $this->featureProdsScheduledForDeletion = clone $this->collFeatureProds;
- $this->featureProdsScheduledForDeletion->clear();
+ if ($this->getFeatureProducts()->contains($featureProduct)) {
+ $this->collFeatureProducts->remove($this->collFeatureProducts->search($featureProduct));
+ if (null === $this->featureProductsScheduledForDeletion) {
+ $this->featureProductsScheduledForDeletion = clone $this->collFeatureProducts;
+ $this->featureProductsScheduledForDeletion->clear();
}
- $this->featureProdsScheduledForDeletion[]= clone $featureProd;
- $featureProd->setFeature(null);
+ $this->featureProductsScheduledForDeletion[]= clone $featureProduct;
+ $featureProduct->setFeature(null);
}
return $this;
@@ -1875,7 +1875,7 @@ abstract class Feature implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this Feature is new, it will return
* an empty collection; or if this Feature has previously
- * been saved, it will retrieve related FeatureProds from storage.
+ * been saved, it will retrieve related FeatureProducts from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -1884,14 +1884,14 @@ abstract class Feature implements ActiveRecordInterface
* @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|ChildFeatureProd[] List of ChildFeatureProd objects
+ * @return Collection|ChildFeatureProduct[] List of ChildFeatureProduct objects
*/
- public function getFeatureProdsJoinProduct($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getFeatureProductsJoinProduct($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
- $query = ChildFeatureProdQuery::create(null, $criteria);
+ $query = ChildFeatureProductQuery::create(null, $criteria);
$query->joinWith('Product', $joinBehavior);
- return $this->getFeatureProds($query, $con);
+ return $this->getFeatureProducts($query, $con);
}
@@ -1900,7 +1900,7 @@ abstract class Feature implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this Feature is new, it will return
* an empty collection; or if this Feature has previously
- * been saved, it will retrieve related FeatureProds from storage.
+ * been saved, it will retrieve related FeatureProducts from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -1909,14 +1909,14 @@ abstract class Feature implements ActiveRecordInterface
* @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|ChildFeatureProd[] List of ChildFeatureProd objects
+ * @return Collection|ChildFeatureProduct[] List of ChildFeatureProduct objects
*/
- public function getFeatureProdsJoinFeatureAv($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getFeatureProductsJoinFeatureAv($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
- $query = ChildFeatureProdQuery::create(null, $criteria);
+ $query = ChildFeatureProductQuery::create(null, $criteria);
$query->joinWith('FeatureAv', $joinBehavior);
- return $this->getFeatureProds($query, $con);
+ return $this->getFeatureProducts($query, $con);
}
/**
@@ -2605,8 +2605,8 @@ abstract class Feature implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
- if ($this->collFeatureProds) {
- foreach ($this->collFeatureProds as $o) {
+ if ($this->collFeatureProducts) {
+ foreach ($this->collFeatureProducts as $o) {
$o->clearAllReferences($deep);
}
}
@@ -2635,10 +2635,10 @@ abstract class Feature implements ActiveRecordInterface
$this->collFeatureAvs->clearIterator();
}
$this->collFeatureAvs = null;
- if ($this->collFeatureProds instanceof Collection) {
- $this->collFeatureProds->clearIterator();
+ if ($this->collFeatureProducts instanceof Collection) {
+ $this->collFeatureProducts->clearIterator();
}
- $this->collFeatureProds = null;
+ $this->collFeatureProducts = null;
if ($this->collFeatureCategories instanceof Collection) {
$this->collFeatureCategories->clearIterator();
}
diff --git a/core/lib/Thelia/Model/Base/FeatureAv.php b/core/lib/Thelia/Model/Base/FeatureAv.php
old mode 100755
new mode 100644
index f60ee9eb2..b09a27cec
--- a/core/lib/Thelia/Model/Base/FeatureAv.php
+++ b/core/lib/Thelia/Model/Base/FeatureAv.php
@@ -22,8 +22,8 @@ use Thelia\Model\FeatureAv as ChildFeatureAv;
use Thelia\Model\FeatureAvI18n as ChildFeatureAvI18n;
use Thelia\Model\FeatureAvI18nQuery as ChildFeatureAvI18nQuery;
use Thelia\Model\FeatureAvQuery as ChildFeatureAvQuery;
-use Thelia\Model\FeatureProd as ChildFeatureProd;
-use Thelia\Model\FeatureProdQuery as ChildFeatureProdQuery;
+use Thelia\Model\FeatureProduct as ChildFeatureProduct;
+use Thelia\Model\FeatureProductQuery as ChildFeatureProductQuery;
use Thelia\Model\FeatureQuery as ChildFeatureQuery;
use Thelia\Model\Map\FeatureAvTableMap;
@@ -73,6 +73,12 @@ abstract class FeatureAv implements ActiveRecordInterface
*/
protected $feature_id;
+ /**
+ * The value for the position field.
+ * @var int
+ */
+ protected $position;
+
/**
* The value for the created_at field.
* @var string
@@ -91,10 +97,10 @@ abstract class FeatureAv implements ActiveRecordInterface
protected $aFeature;
/**
- * @var ObjectCollection|ChildFeatureProd[] Collection to store aggregation of ChildFeatureProd objects.
+ * @var ObjectCollection|ChildFeatureProduct[] Collection to store aggregation of ChildFeatureProduct objects.
*/
- protected $collFeatureProds;
- protected $collFeatureProdsPartial;
+ protected $collFeatureProducts;
+ protected $collFeatureProductsPartial;
/**
* @var ObjectCollection|ChildFeatureAvI18n[] Collection to store aggregation of ChildFeatureAvI18n objects.
@@ -128,7 +134,7 @@ abstract class FeatureAv implements ActiveRecordInterface
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
- protected $featureProdsScheduledForDeletion = null;
+ protected $featureProductsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
@@ -412,6 +418,17 @@ abstract class FeatureAv implements ActiveRecordInterface
return $this->feature_id;
}
+ /**
+ * Get the [position] column value.
+ *
+ * @return int
+ */
+ public function getPosition()
+ {
+
+ return $this->position;
+ }
+
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -498,6 +515,27 @@ abstract class FeatureAv implements ActiveRecordInterface
return $this;
} // setFeatureId()
+ /**
+ * Set the value of [position] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\FeatureAv The current object (for fluent API support)
+ */
+ public function setPosition($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->position !== $v) {
+ $this->position = $v;
+ $this->modifiedColumns[] = FeatureAvTableMap::POSITION;
+ }
+
+
+ return $this;
+ } // setPosition()
+
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -583,13 +621,16 @@ abstract class FeatureAv implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : FeatureAvTableMap::translateFieldName('FeatureId', TableMap::TYPE_PHPNAME, $indexType)];
$this->feature_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FeatureAvTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FeatureAvTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->position = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FeatureAvTableMap::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 : FeatureAvTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : FeatureAvTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -602,7 +643,7 @@ abstract class FeatureAv implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 4; // 4 = FeatureAvTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 5; // 5 = FeatureAvTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\FeatureAv object", 0, $e);
@@ -667,7 +708,7 @@ abstract class FeatureAv implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->aFeature = null;
- $this->collFeatureProds = null;
+ $this->collFeatureProducts = null;
$this->collFeatureAvI18ns = null;
@@ -816,17 +857,17 @@ abstract class FeatureAv implements ActiveRecordInterface
$this->resetModified();
}
- if ($this->featureProdsScheduledForDeletion !== null) {
- if (!$this->featureProdsScheduledForDeletion->isEmpty()) {
- \Thelia\Model\FeatureProdQuery::create()
- ->filterByPrimaryKeys($this->featureProdsScheduledForDeletion->getPrimaryKeys(false))
+ if ($this->featureProductsScheduledForDeletion !== null) {
+ if (!$this->featureProductsScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\FeatureProductQuery::create()
+ ->filterByPrimaryKeys($this->featureProductsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
- $this->featureProdsScheduledForDeletion = null;
+ $this->featureProductsScheduledForDeletion = null;
}
}
- if ($this->collFeatureProds !== null) {
- foreach ($this->collFeatureProds as $referrerFK) {
+ if ($this->collFeatureProducts !== null) {
+ foreach ($this->collFeatureProducts as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
@@ -882,6 +923,9 @@ abstract class FeatureAv implements ActiveRecordInterface
if ($this->isColumnModified(FeatureAvTableMap::FEATURE_ID)) {
$modifiedColumns[':p' . $index++] = 'FEATURE_ID';
}
+ if ($this->isColumnModified(FeatureAvTableMap::POSITION)) {
+ $modifiedColumns[':p' . $index++] = 'POSITION';
+ }
if ($this->isColumnModified(FeatureAvTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -905,6 +949,9 @@ abstract class FeatureAv implements ActiveRecordInterface
case 'FEATURE_ID':
$stmt->bindValue($identifier, $this->feature_id, PDO::PARAM_INT);
break;
+ case 'POSITION':
+ $stmt->bindValue($identifier, $this->position, 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;
@@ -980,9 +1027,12 @@ abstract class FeatureAv implements ActiveRecordInterface
return $this->getFeatureId();
break;
case 2:
- return $this->getCreatedAt();
+ return $this->getPosition();
break;
case 3:
+ return $this->getCreatedAt();
+ break;
+ case 4:
return $this->getUpdatedAt();
break;
default:
@@ -1016,8 +1066,9 @@ abstract class FeatureAv implements ActiveRecordInterface
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getFeatureId(),
- $keys[2] => $this->getCreatedAt(),
- $keys[3] => $this->getUpdatedAt(),
+ $keys[2] => $this->getPosition(),
+ $keys[3] => $this->getCreatedAt(),
+ $keys[4] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1029,8 +1080,8 @@ abstract class FeatureAv implements ActiveRecordInterface
if (null !== $this->aFeature) {
$result['Feature'] = $this->aFeature->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
- if (null !== $this->collFeatureProds) {
- $result['FeatureProds'] = $this->collFeatureProds->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ if (null !== $this->collFeatureProducts) {
+ $result['FeatureProducts'] = $this->collFeatureProducts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collFeatureAvI18ns) {
$result['FeatureAvI18ns'] = $this->collFeatureAvI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
@@ -1076,9 +1127,12 @@ abstract class FeatureAv implements ActiveRecordInterface
$this->setFeatureId($value);
break;
case 2:
- $this->setCreatedAt($value);
+ $this->setPosition($value);
break;
case 3:
+ $this->setCreatedAt($value);
+ break;
+ case 4:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1107,8 +1161,9 @@ abstract class FeatureAv implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setFeatureId($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->setPosition($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
}
/**
@@ -1122,6 +1177,7 @@ abstract class FeatureAv implements ActiveRecordInterface
if ($this->isColumnModified(FeatureAvTableMap::ID)) $criteria->add(FeatureAvTableMap::ID, $this->id);
if ($this->isColumnModified(FeatureAvTableMap::FEATURE_ID)) $criteria->add(FeatureAvTableMap::FEATURE_ID, $this->feature_id);
+ if ($this->isColumnModified(FeatureAvTableMap::POSITION)) $criteria->add(FeatureAvTableMap::POSITION, $this->position);
if ($this->isColumnModified(FeatureAvTableMap::CREATED_AT)) $criteria->add(FeatureAvTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(FeatureAvTableMap::UPDATED_AT)) $criteria->add(FeatureAvTableMap::UPDATED_AT, $this->updated_at);
@@ -1188,6 +1244,7 @@ abstract class FeatureAv implements ActiveRecordInterface
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setFeatureId($this->getFeatureId());
+ $copyObj->setPosition($this->getPosition());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -1196,9 +1253,9 @@ abstract class FeatureAv implements ActiveRecordInterface
// the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false);
- foreach ($this->getFeatureProds() as $relObj) {
+ foreach ($this->getFeatureProducts() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
- $copyObj->addFeatureProd($relObj->copy($deepCopy));
+ $copyObj->addFeatureProduct($relObj->copy($deepCopy));
}
}
@@ -1300,8 +1357,8 @@ abstract class FeatureAv implements ActiveRecordInterface
*/
public function initRelation($relationName)
{
- if ('FeatureProd' == $relationName) {
- return $this->initFeatureProds();
+ if ('FeatureProduct' == $relationName) {
+ return $this->initFeatureProducts();
}
if ('FeatureAvI18n' == $relationName) {
return $this->initFeatureAvI18ns();
@@ -1309,31 +1366,31 @@ abstract class FeatureAv implements ActiveRecordInterface
}
/**
- * Clears out the collFeatureProds collection
+ * Clears out the collFeatureProducts 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 addFeatureProds()
+ * @see addFeatureProducts()
*/
- public function clearFeatureProds()
+ public function clearFeatureProducts()
{
- $this->collFeatureProds = null; // important to set this to NULL since that means it is uninitialized
+ $this->collFeatureProducts = null; // important to set this to NULL since that means it is uninitialized
}
/**
- * Reset is the collFeatureProds collection loaded partially.
+ * Reset is the collFeatureProducts collection loaded partially.
*/
- public function resetPartialFeatureProds($v = true)
+ public function resetPartialFeatureProducts($v = true)
{
- $this->collFeatureProdsPartial = $v;
+ $this->collFeatureProductsPartial = $v;
}
/**
- * Initializes the collFeatureProds collection.
+ * Initializes the collFeatureProducts collection.
*
- * By default this just sets the collFeatureProds collection to an empty array (like clearcollFeatureProds());
+ * By default this just sets the collFeatureProducts collection to an empty array (like clearcollFeatureProducts());
* 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.
*
@@ -1342,17 +1399,17 @@ abstract class FeatureAv implements ActiveRecordInterface
*
* @return void
*/
- public function initFeatureProds($overrideExisting = true)
+ public function initFeatureProducts($overrideExisting = true)
{
- if (null !== $this->collFeatureProds && !$overrideExisting) {
+ if (null !== $this->collFeatureProducts && !$overrideExisting) {
return;
}
- $this->collFeatureProds = new ObjectCollection();
- $this->collFeatureProds->setModel('\Thelia\Model\FeatureProd');
+ $this->collFeatureProducts = new ObjectCollection();
+ $this->collFeatureProducts->setModel('\Thelia\Model\FeatureProduct');
}
/**
- * Gets an array of ChildFeatureProd objects which contain a foreign key that references this object.
+ * Gets an array of ChildFeatureProduct 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.
@@ -1362,109 +1419,109 @@ abstract class FeatureAv implements ActiveRecordInterface
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
- * @return Collection|ChildFeatureProd[] List of ChildFeatureProd objects
+ * @return Collection|ChildFeatureProduct[] List of ChildFeatureProduct objects
* @throws PropelException
*/
- public function getFeatureProds($criteria = null, ConnectionInterface $con = null)
+ public function getFeatureProducts($criteria = null, ConnectionInterface $con = null)
{
- $partial = $this->collFeatureProdsPartial && !$this->isNew();
- if (null === $this->collFeatureProds || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collFeatureProds) {
+ $partial = $this->collFeatureProductsPartial && !$this->isNew();
+ if (null === $this->collFeatureProducts || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collFeatureProducts) {
// return empty collection
- $this->initFeatureProds();
+ $this->initFeatureProducts();
} else {
- $collFeatureProds = ChildFeatureProdQuery::create(null, $criteria)
+ $collFeatureProducts = ChildFeatureProductQuery::create(null, $criteria)
->filterByFeatureAv($this)
->find($con);
if (null !== $criteria) {
- if (false !== $this->collFeatureProdsPartial && count($collFeatureProds)) {
- $this->initFeatureProds(false);
+ if (false !== $this->collFeatureProductsPartial && count($collFeatureProducts)) {
+ $this->initFeatureProducts(false);
- foreach ($collFeatureProds as $obj) {
- if (false == $this->collFeatureProds->contains($obj)) {
- $this->collFeatureProds->append($obj);
+ foreach ($collFeatureProducts as $obj) {
+ if (false == $this->collFeatureProducts->contains($obj)) {
+ $this->collFeatureProducts->append($obj);
}
}
- $this->collFeatureProdsPartial = true;
+ $this->collFeatureProductsPartial = true;
}
- $collFeatureProds->getInternalIterator()->rewind();
+ $collFeatureProducts->getInternalIterator()->rewind();
- return $collFeatureProds;
+ return $collFeatureProducts;
}
- if ($partial && $this->collFeatureProds) {
- foreach ($this->collFeatureProds as $obj) {
+ if ($partial && $this->collFeatureProducts) {
+ foreach ($this->collFeatureProducts as $obj) {
if ($obj->isNew()) {
- $collFeatureProds[] = $obj;
+ $collFeatureProducts[] = $obj;
}
}
}
- $this->collFeatureProds = $collFeatureProds;
- $this->collFeatureProdsPartial = false;
+ $this->collFeatureProducts = $collFeatureProducts;
+ $this->collFeatureProductsPartial = false;
}
}
- return $this->collFeatureProds;
+ return $this->collFeatureProducts;
}
/**
- * Sets a collection of FeatureProd objects related by a one-to-many relationship
+ * Sets a collection of FeatureProduct 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 $featureProds A Propel collection.
+ * @param Collection $featureProducts A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildFeatureAv The current object (for fluent API support)
*/
- public function setFeatureProds(Collection $featureProds, ConnectionInterface $con = null)
+ public function setFeatureProducts(Collection $featureProducts, ConnectionInterface $con = null)
{
- $featureProdsToDelete = $this->getFeatureProds(new Criteria(), $con)->diff($featureProds);
+ $featureProductsToDelete = $this->getFeatureProducts(new Criteria(), $con)->diff($featureProducts);
- $this->featureProdsScheduledForDeletion = $featureProdsToDelete;
+ $this->featureProductsScheduledForDeletion = $featureProductsToDelete;
- foreach ($featureProdsToDelete as $featureProdRemoved) {
- $featureProdRemoved->setFeatureAv(null);
+ foreach ($featureProductsToDelete as $featureProductRemoved) {
+ $featureProductRemoved->setFeatureAv(null);
}
- $this->collFeatureProds = null;
- foreach ($featureProds as $featureProd) {
- $this->addFeatureProd($featureProd);
+ $this->collFeatureProducts = null;
+ foreach ($featureProducts as $featureProduct) {
+ $this->addFeatureProduct($featureProduct);
}
- $this->collFeatureProds = $featureProds;
- $this->collFeatureProdsPartial = false;
+ $this->collFeatureProducts = $featureProducts;
+ $this->collFeatureProductsPartial = false;
return $this;
}
/**
- * Returns the number of related FeatureProd objects.
+ * Returns the number of related FeatureProduct objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
- * @return int Count of related FeatureProd objects.
+ * @return int Count of related FeatureProduct objects.
* @throws PropelException
*/
- public function countFeatureProds(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ public function countFeatureProducts(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
- $partial = $this->collFeatureProdsPartial && !$this->isNew();
- if (null === $this->collFeatureProds || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collFeatureProds) {
+ $partial = $this->collFeatureProductsPartial && !$this->isNew();
+ if (null === $this->collFeatureProducts || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collFeatureProducts) {
return 0;
}
if ($partial && !$criteria) {
- return count($this->getFeatureProds());
+ return count($this->getFeatureProducts());
}
- $query = ChildFeatureProdQuery::create(null, $criteria);
+ $query = ChildFeatureProductQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
@@ -1474,53 +1531,53 @@ abstract class FeatureAv implements ActiveRecordInterface
->count($con);
}
- return count($this->collFeatureProds);
+ return count($this->collFeatureProducts);
}
/**
- * Method called to associate a ChildFeatureProd object to this object
- * through the ChildFeatureProd foreign key attribute.
+ * Method called to associate a ChildFeatureProduct object to this object
+ * through the ChildFeatureProduct foreign key attribute.
*
- * @param ChildFeatureProd $l ChildFeatureProd
+ * @param ChildFeatureProduct $l ChildFeatureProduct
* @return \Thelia\Model\FeatureAv The current object (for fluent API support)
*/
- public function addFeatureProd(ChildFeatureProd $l)
+ public function addFeatureProduct(ChildFeatureProduct $l)
{
- if ($this->collFeatureProds === null) {
- $this->initFeatureProds();
- $this->collFeatureProdsPartial = true;
+ if ($this->collFeatureProducts === null) {
+ $this->initFeatureProducts();
+ $this->collFeatureProductsPartial = true;
}
- if (!in_array($l, $this->collFeatureProds->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
- $this->doAddFeatureProd($l);
+ if (!in_array($l, $this->collFeatureProducts->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddFeatureProduct($l);
}
return $this;
}
/**
- * @param FeatureProd $featureProd The featureProd object to add.
+ * @param FeatureProduct $featureProduct The featureProduct object to add.
*/
- protected function doAddFeatureProd($featureProd)
+ protected function doAddFeatureProduct($featureProduct)
{
- $this->collFeatureProds[]= $featureProd;
- $featureProd->setFeatureAv($this);
+ $this->collFeatureProducts[]= $featureProduct;
+ $featureProduct->setFeatureAv($this);
}
/**
- * @param FeatureProd $featureProd The featureProd object to remove.
+ * @param FeatureProduct $featureProduct The featureProduct object to remove.
* @return ChildFeatureAv The current object (for fluent API support)
*/
- public function removeFeatureProd($featureProd)
+ public function removeFeatureProduct($featureProduct)
{
- if ($this->getFeatureProds()->contains($featureProd)) {
- $this->collFeatureProds->remove($this->collFeatureProds->search($featureProd));
- if (null === $this->featureProdsScheduledForDeletion) {
- $this->featureProdsScheduledForDeletion = clone $this->collFeatureProds;
- $this->featureProdsScheduledForDeletion->clear();
+ if ($this->getFeatureProducts()->contains($featureProduct)) {
+ $this->collFeatureProducts->remove($this->collFeatureProducts->search($featureProduct));
+ if (null === $this->featureProductsScheduledForDeletion) {
+ $this->featureProductsScheduledForDeletion = clone $this->collFeatureProducts;
+ $this->featureProductsScheduledForDeletion->clear();
}
- $this->featureProdsScheduledForDeletion[]= $featureProd;
- $featureProd->setFeatureAv(null);
+ $this->featureProductsScheduledForDeletion[]= $featureProduct;
+ $featureProduct->setFeatureAv(null);
}
return $this;
@@ -1532,7 +1589,7 @@ abstract class FeatureAv implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this FeatureAv is new, it will return
* an empty collection; or if this FeatureAv has previously
- * been saved, it will retrieve related FeatureProds from storage.
+ * been saved, it will retrieve related FeatureProducts from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -1541,14 +1598,14 @@ abstract class FeatureAv implements ActiveRecordInterface
* @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|ChildFeatureProd[] List of ChildFeatureProd objects
+ * @return Collection|ChildFeatureProduct[] List of ChildFeatureProduct objects
*/
- public function getFeatureProdsJoinProduct($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getFeatureProductsJoinProduct($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
- $query = ChildFeatureProdQuery::create(null, $criteria);
+ $query = ChildFeatureProductQuery::create(null, $criteria);
$query->joinWith('Product', $joinBehavior);
- return $this->getFeatureProds($query, $con);
+ return $this->getFeatureProducts($query, $con);
}
@@ -1557,7 +1614,7 @@ abstract class FeatureAv implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this FeatureAv is new, it will return
* an empty collection; or if this FeatureAv has previously
- * been saved, it will retrieve related FeatureProds from storage.
+ * been saved, it will retrieve related FeatureProducts from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -1566,14 +1623,14 @@ abstract class FeatureAv implements ActiveRecordInterface
* @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|ChildFeatureProd[] List of ChildFeatureProd objects
+ * @return Collection|ChildFeatureProduct[] List of ChildFeatureProduct objects
*/
- public function getFeatureProdsJoinFeature($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getFeatureProductsJoinFeature($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
- $query = ChildFeatureProdQuery::create(null, $criteria);
+ $query = ChildFeatureProductQuery::create(null, $criteria);
$query->joinWith('Feature', $joinBehavior);
- return $this->getFeatureProds($query, $con);
+ return $this->getFeatureProducts($query, $con);
}
/**
@@ -1808,6 +1865,7 @@ abstract class FeatureAv implements ActiveRecordInterface
{
$this->id = null;
$this->feature_id = null;
+ $this->position = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
@@ -1829,8 +1887,8 @@ abstract class FeatureAv implements ActiveRecordInterface
public function clearAllReferences($deep = false)
{
if ($deep) {
- if ($this->collFeatureProds) {
- foreach ($this->collFeatureProds as $o) {
+ if ($this->collFeatureProducts) {
+ foreach ($this->collFeatureProducts as $o) {
$o->clearAllReferences($deep);
}
}
@@ -1845,10 +1903,10 @@ abstract class FeatureAv implements ActiveRecordInterface
$this->currentLocale = 'en_US';
$this->currentTranslations = null;
- if ($this->collFeatureProds instanceof Collection) {
- $this->collFeatureProds->clearIterator();
+ if ($this->collFeatureProducts instanceof Collection) {
+ $this->collFeatureProducts->clearIterator();
}
- $this->collFeatureProds = null;
+ $this->collFeatureProducts = null;
if ($this->collFeatureAvI18ns instanceof Collection) {
$this->collFeatureAvI18ns->clearIterator();
}
diff --git a/core/lib/Thelia/Model/Base/FeatureAvI18n.php b/core/lib/Thelia/Model/Base/FeatureAvI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FeatureAvI18nQuery.php b/core/lib/Thelia/Model/Base/FeatureAvI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FeatureAvQuery.php b/core/lib/Thelia/Model/Base/FeatureAvQuery.php
old mode 100755
new mode 100644
index 193254a87..fb3796c97
--- a/core/lib/Thelia/Model/Base/FeatureAvQuery.php
+++ b/core/lib/Thelia/Model/Base/FeatureAvQuery.php
@@ -24,11 +24,13 @@ use Thelia\Model\Map\FeatureAvTableMap;
*
* @method ChildFeatureAvQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildFeatureAvQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
+ * @method ChildFeatureAvQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildFeatureAvQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildFeatureAvQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildFeatureAvQuery groupById() Group by the id column
* @method ChildFeatureAvQuery groupByFeatureId() Group by the feature_id column
+ * @method ChildFeatureAvQuery groupByPosition() Group by the position column
* @method ChildFeatureAvQuery groupByCreatedAt() Group by the created_at column
* @method ChildFeatureAvQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -40,9 +42,9 @@ use Thelia\Model\Map\FeatureAvTableMap;
* @method ChildFeatureAvQuery rightJoinFeature($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Feature relation
* @method ChildFeatureAvQuery innerJoinFeature($relationAlias = null) Adds a INNER JOIN clause to the query using the Feature relation
*
- * @method ChildFeatureAvQuery leftJoinFeatureProd($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureProd relation
- * @method ChildFeatureAvQuery rightJoinFeatureProd($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureProd relation
- * @method ChildFeatureAvQuery innerJoinFeatureProd($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureProd relation
+ * @method ChildFeatureAvQuery leftJoinFeatureProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureProduct relation
+ * @method ChildFeatureAvQuery rightJoinFeatureProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureProduct relation
+ * @method ChildFeatureAvQuery innerJoinFeatureProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureProduct relation
*
* @method ChildFeatureAvQuery leftJoinFeatureAvI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureAvI18n relation
* @method ChildFeatureAvQuery rightJoinFeatureAvI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureAvI18n relation
@@ -53,11 +55,13 @@ use Thelia\Model\Map\FeatureAvTableMap;
*
* @method ChildFeatureAv findOneById(int $id) Return the first ChildFeatureAv filtered by the id column
* @method ChildFeatureAv findOneByFeatureId(int $feature_id) Return the first ChildFeatureAv filtered by the feature_id column
+ * @method ChildFeatureAv findOneByPosition(int $position) Return the first ChildFeatureAv filtered by the position column
* @method ChildFeatureAv findOneByCreatedAt(string $created_at) Return the first ChildFeatureAv filtered by the created_at column
* @method ChildFeatureAv findOneByUpdatedAt(string $updated_at) Return the first ChildFeatureAv filtered by the updated_at column
*
* @method array findById(int $id) Return ChildFeatureAv objects filtered by the id column
* @method array findByFeatureId(int $feature_id) Return ChildFeatureAv objects filtered by the feature_id column
+ * @method array findByPosition(int $position) Return ChildFeatureAv objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildFeatureAv objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildFeatureAv objects filtered by the updated_at column
*
@@ -148,7 +152,7 @@ abstract class FeatureAvQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, FEATURE_ID, CREATED_AT, UPDATED_AT FROM feature_av WHERE ID = :p0';
+ $sql = 'SELECT ID, FEATURE_ID, POSITION, CREATED_AT, UPDATED_AT FROM feature_av WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -321,6 +325,47 @@ abstract class FeatureAvQuery extends ModelCriteria
return $this->addUsingAlias(FeatureAvTableMap::FEATURE_ID, $featureId, $comparison);
}
+ /**
+ * Filter the query on the position column
+ *
+ * Example usage:
+ *
+ * $query->filterByPosition(1234); // WHERE position = 1234
+ * $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
+ * $query->filterByPosition(array('min' => 12)); // WHERE position > 12
+ *
+ *
+ * @param mixed $position 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 ChildFeatureAvQuery The current query, for fluid interface
+ */
+ public function filterByPosition($position = null, $comparison = null)
+ {
+ if (is_array($position)) {
+ $useMinMax = false;
+ if (isset($position['min'])) {
+ $this->addUsingAlias(FeatureAvTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($position['max'])) {
+ $this->addUsingAlias(FeatureAvTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(FeatureAvTableMap::POSITION, $position, $comparison);
+ }
+
/**
* Filter the query on the created_at column
*
@@ -483,40 +528,40 @@ abstract class FeatureAvQuery extends ModelCriteria
}
/**
- * Filter the query by a related \Thelia\Model\FeatureProd object
+ * Filter the query by a related \Thelia\Model\FeatureProduct object
*
- * @param \Thelia\Model\FeatureProd|ObjectCollection $featureProd the related object to use as filter
+ * @param \Thelia\Model\FeatureProduct|ObjectCollection $featureProduct the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
- public function filterByFeatureProd($featureProd, $comparison = null)
+ public function filterByFeatureProduct($featureProduct, $comparison = null)
{
- if ($featureProd instanceof \Thelia\Model\FeatureProd) {
+ if ($featureProduct instanceof \Thelia\Model\FeatureProduct) {
return $this
- ->addUsingAlias(FeatureAvTableMap::ID, $featureProd->getFeatureAvId(), $comparison);
- } elseif ($featureProd instanceof ObjectCollection) {
+ ->addUsingAlias(FeatureAvTableMap::ID, $featureProduct->getFeatureAvId(), $comparison);
+ } elseif ($featureProduct instanceof ObjectCollection) {
return $this
- ->useFeatureProdQuery()
- ->filterByPrimaryKeys($featureProd->getPrimaryKeys())
+ ->useFeatureProductQuery()
+ ->filterByPrimaryKeys($featureProduct->getPrimaryKeys())
->endUse();
} else {
- throw new PropelException('filterByFeatureProd() only accepts arguments of type \Thelia\Model\FeatureProd or Collection');
+ throw new PropelException('filterByFeatureProduct() only accepts arguments of type \Thelia\Model\FeatureProduct or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the FeatureProd relation
+ * Adds a JOIN clause to the query using the FeatureProduct relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
- public function joinFeatureProd($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function joinFeatureProduct($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('FeatureProd');
+ $relationMap = $tableMap->getRelation('FeatureProduct');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -531,14 +576,14 @@ abstract class FeatureAvQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'FeatureProd');
+ $this->addJoinObject($join, 'FeatureProduct');
}
return $this;
}
/**
- * Use the FeatureProd relation FeatureProd object
+ * Use the FeatureProduct relation FeatureProduct object
*
* @see useQuery()
*
@@ -546,13 +591,13 @@ abstract class FeatureAvQuery extends ModelCriteria
* 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\FeatureProdQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\FeatureProductQuery A secondary query class using the current class as primary query
*/
- public function useFeatureProdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function useFeatureProductQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
- ->joinFeatureProd($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'FeatureProd', '\Thelia\Model\FeatureProdQuery');
+ ->joinFeatureProduct($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'FeatureProduct', '\Thelia\Model\FeatureProductQuery');
}
/**
diff --git a/core/lib/Thelia/Model/Base/FeatureCategory.php b/core/lib/Thelia/Model/Base/FeatureCategory.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FeatureCategoryQuery.php b/core/lib/Thelia/Model/Base/FeatureCategoryQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FeatureI18n.php b/core/lib/Thelia/Model/Base/FeatureI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FeatureI18nQuery.php b/core/lib/Thelia/Model/Base/FeatureI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FeatureProd.php b/core/lib/Thelia/Model/Base/FeatureProduct.php
old mode 100755
new mode 100644
similarity index 87%
rename from core/lib/Thelia/Model/Base/FeatureProd.php
rename to core/lib/Thelia/Model/Base/FeatureProduct.php
index 0f14fae8e..b68f4acd2
--- a/core/lib/Thelia/Model/Base/FeatureProd.php
+++ b/core/lib/Thelia/Model/Base/FeatureProduct.php
@@ -19,19 +19,19 @@ use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Feature as ChildFeature;
use Thelia\Model\FeatureAv as ChildFeatureAv;
use Thelia\Model\FeatureAvQuery as ChildFeatureAvQuery;
-use Thelia\Model\FeatureProd as ChildFeatureProd;
-use Thelia\Model\FeatureProdQuery as ChildFeatureProdQuery;
+use Thelia\Model\FeatureProduct as ChildFeatureProduct;
+use Thelia\Model\FeatureProductQuery as ChildFeatureProductQuery;
use Thelia\Model\FeatureQuery as ChildFeatureQuery;
use Thelia\Model\Product as ChildProduct;
use Thelia\Model\ProductQuery as ChildProductQuery;
-use Thelia\Model\Map\FeatureProdTableMap;
+use Thelia\Model\Map\FeatureProductTableMap;
-abstract class FeatureProd implements ActiveRecordInterface
+abstract class FeatureProduct implements ActiveRecordInterface
{
/**
* TableMap class name
*/
- const TABLE_MAP = '\\Thelia\\Model\\Map\\FeatureProdTableMap';
+ const TABLE_MAP = '\\Thelia\\Model\\Map\\FeatureProductTableMap';
/**
@@ -132,7 +132,7 @@ abstract class FeatureProd implements ActiveRecordInterface
protected $alreadyInSave = false;
/**
- * Initializes internal state of Thelia\Model\Base\FeatureProd object.
+ * Initializes internal state of Thelia\Model\Base\FeatureProduct object.
*/
public function __construct()
{
@@ -227,9 +227,9 @@ abstract class FeatureProd implements ActiveRecordInterface
}
/**
- * Compares this with another FeatureProd instance. If
- * obj is an instance of FeatureProd, delegates to
- * equals(FeatureProd). Otherwise, returns false.
+ * Compares this with another FeatureProduct instance. If
+ * obj is an instance of FeatureProduct, delegates to
+ * equals(FeatureProduct). Otherwise, returns false.
*
* @param obj The object to compare to.
* @return Whether equal to the object specified.
@@ -310,7 +310,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* @param string $name The virtual column name
* @param mixed $value The value to give to the virtual column
*
- * @return FeatureProd The current object, for fluid interface
+ * @return FeatureProduct The current object, for fluid interface
*/
public function setVirtualColumn($name, $value)
{
@@ -342,7 +342,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
* @param string $data The source data to import from
*
- * @return FeatureProd The current object, for fluid interface
+ * @return FeatureProduct The current object, for fluid interface
*/
public function importFrom($parser, $data)
{
@@ -495,7 +495,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* Set the value of [id] column.
*
* @param int $v new value
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
*/
public function setId($v)
{
@@ -505,7 +505,7 @@ abstract class FeatureProd implements ActiveRecordInterface
if ($this->id !== $v) {
$this->id = $v;
- $this->modifiedColumns[] = FeatureProdTableMap::ID;
+ $this->modifiedColumns[] = FeatureProductTableMap::ID;
}
@@ -516,7 +516,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* Set the value of [product_id] column.
*
* @param int $v new value
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
*/
public function setProductId($v)
{
@@ -526,7 +526,7 @@ abstract class FeatureProd implements ActiveRecordInterface
if ($this->product_id !== $v) {
$this->product_id = $v;
- $this->modifiedColumns[] = FeatureProdTableMap::PRODUCT_ID;
+ $this->modifiedColumns[] = FeatureProductTableMap::PRODUCT_ID;
}
if ($this->aProduct !== null && $this->aProduct->getId() !== $v) {
@@ -541,7 +541,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* Set the value of [feature_id] column.
*
* @param int $v new value
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
*/
public function setFeatureId($v)
{
@@ -551,7 +551,7 @@ abstract class FeatureProd implements ActiveRecordInterface
if ($this->feature_id !== $v) {
$this->feature_id = $v;
- $this->modifiedColumns[] = FeatureProdTableMap::FEATURE_ID;
+ $this->modifiedColumns[] = FeatureProductTableMap::FEATURE_ID;
}
if ($this->aFeature !== null && $this->aFeature->getId() !== $v) {
@@ -566,7 +566,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* Set the value of [feature_av_id] column.
*
* @param int $v new value
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
*/
public function setFeatureAvId($v)
{
@@ -576,7 +576,7 @@ abstract class FeatureProd implements ActiveRecordInterface
if ($this->feature_av_id !== $v) {
$this->feature_av_id = $v;
- $this->modifiedColumns[] = FeatureProdTableMap::FEATURE_AV_ID;
+ $this->modifiedColumns[] = FeatureProductTableMap::FEATURE_AV_ID;
}
if ($this->aFeatureAv !== null && $this->aFeatureAv->getId() !== $v) {
@@ -591,7 +591,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* Set the value of [by_default] column.
*
* @param string $v new value
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
*/
public function setByDefault($v)
{
@@ -601,7 +601,7 @@ abstract class FeatureProd implements ActiveRecordInterface
if ($this->by_default !== $v) {
$this->by_default = $v;
- $this->modifiedColumns[] = FeatureProdTableMap::BY_DEFAULT;
+ $this->modifiedColumns[] = FeatureProductTableMap::BY_DEFAULT;
}
@@ -612,7 +612,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* Set the value of [position] column.
*
* @param int $v new value
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
*/
public function setPosition($v)
{
@@ -622,7 +622,7 @@ abstract class FeatureProd implements ActiveRecordInterface
if ($this->position !== $v) {
$this->position = $v;
- $this->modifiedColumns[] = FeatureProdTableMap::POSITION;
+ $this->modifiedColumns[] = FeatureProductTableMap::POSITION;
}
@@ -634,7 +634,7 @@ abstract class FeatureProd implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
*/
public function setCreatedAt($v)
{
@@ -642,7 +642,7 @@ abstract class FeatureProd implements ActiveRecordInterface
if ($this->created_at !== null || $dt !== null) {
if ($dt !== $this->created_at) {
$this->created_at = $dt;
- $this->modifiedColumns[] = FeatureProdTableMap::CREATED_AT;
+ $this->modifiedColumns[] = FeatureProductTableMap::CREATED_AT;
}
} // if either are not null
@@ -655,7 +655,7 @@ abstract class FeatureProd implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
*/
public function setUpdatedAt($v)
{
@@ -663,7 +663,7 @@ abstract class FeatureProd implements ActiveRecordInterface
if ($this->updated_at !== null || $dt !== null) {
if ($dt !== $this->updated_at) {
$this->updated_at = $dt;
- $this->modifiedColumns[] = FeatureProdTableMap::UPDATED_AT;
+ $this->modifiedColumns[] = FeatureProductTableMap::UPDATED_AT;
}
} // if either are not null
@@ -708,31 +708,31 @@ abstract class FeatureProd implements ActiveRecordInterface
try {
- $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : FeatureProdTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : FeatureProductTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : FeatureProdTableMap::translateFieldName('ProductId', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : FeatureProductTableMap::translateFieldName('ProductId', TableMap::TYPE_PHPNAME, $indexType)];
$this->product_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FeatureProdTableMap::translateFieldName('FeatureId', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FeatureProductTableMap::translateFieldName('FeatureId', TableMap::TYPE_PHPNAME, $indexType)];
$this->feature_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FeatureProdTableMap::translateFieldName('FeatureAvId', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FeatureProductTableMap::translateFieldName('FeatureAvId', TableMap::TYPE_PHPNAME, $indexType)];
$this->feature_av_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : FeatureProdTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : FeatureProductTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
$this->by_default = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : FeatureProdTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : FeatureProductTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
$this->position = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : FeatureProdTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : FeatureProductTableMap::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 ? 7 + $startcol : FeatureProdTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : FeatureProductTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -745,10 +745,10 @@ abstract class FeatureProd implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 8; // 8 = FeatureProdTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 8; // 8 = FeatureProductTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
- throw new PropelException("Error populating \Thelia\Model\FeatureProd object", 0, $e);
+ throw new PropelException("Error populating \Thelia\Model\FeatureProduct object", 0, $e);
}
}
@@ -799,13 +799,13 @@ abstract class FeatureProd implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(FeatureProdTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getReadConnection(FeatureProductTableMap::DATABASE_NAME);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
- $dataFetcher = ChildFeatureProdQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $dataFetcher = ChildFeatureProductQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$row = $dataFetcher->fetch();
$dataFetcher->close();
if (!$row) {
@@ -827,8 +827,8 @@ abstract class FeatureProd implements ActiveRecordInterface
* @param ConnectionInterface $con
* @return void
* @throws PropelException
- * @see FeatureProd::setDeleted()
- * @see FeatureProd::isDeleted()
+ * @see FeatureProduct::setDeleted()
+ * @see FeatureProduct::isDeleted()
*/
public function delete(ConnectionInterface $con = null)
{
@@ -837,12 +837,12 @@ abstract class FeatureProd implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureProdTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(FeatureProductTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
- $deleteQuery = ChildFeatureProdQuery::create()
+ $deleteQuery = ChildFeatureProductQuery::create()
->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con);
if ($ret) {
@@ -879,7 +879,7 @@ abstract class FeatureProd implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureProdTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(FeatureProductTableMap::DATABASE_NAME);
}
$con->beginTransaction();
@@ -889,16 +889,16 @@ abstract class FeatureProd implements ActiveRecordInterface
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
// timestampable behavior
- if (!$this->isColumnModified(FeatureProdTableMap::CREATED_AT)) {
+ if (!$this->isColumnModified(FeatureProductTableMap::CREATED_AT)) {
$this->setCreatedAt(time());
}
- if (!$this->isColumnModified(FeatureProdTableMap::UPDATED_AT)) {
+ if (!$this->isColumnModified(FeatureProductTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
// timestampable behavior
- if ($this->isModified() && !$this->isColumnModified(FeatureProdTableMap::UPDATED_AT)) {
+ if ($this->isModified() && !$this->isColumnModified(FeatureProductTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
}
@@ -910,7 +910,7 @@ abstract class FeatureProd implements ActiveRecordInterface
$this->postUpdate($con);
}
$this->postSave($con);
- FeatureProdTableMap::addInstanceToPool($this);
+ FeatureProductTableMap::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
@@ -997,39 +997,39 @@ abstract class FeatureProd implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
- $this->modifiedColumns[] = FeatureProdTableMap::ID;
+ $this->modifiedColumns[] = FeatureProductTableMap::ID;
if (null !== $this->id) {
- throw new PropelException('Cannot insert a value for auto-increment primary key (' . FeatureProdTableMap::ID . ')');
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . FeatureProductTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries
- if ($this->isColumnModified(FeatureProdTableMap::ID)) {
+ if ($this->isColumnModified(FeatureProductTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
- if ($this->isColumnModified(FeatureProdTableMap::PRODUCT_ID)) {
+ if ($this->isColumnModified(FeatureProductTableMap::PRODUCT_ID)) {
$modifiedColumns[':p' . $index++] = 'PRODUCT_ID';
}
- if ($this->isColumnModified(FeatureProdTableMap::FEATURE_ID)) {
+ if ($this->isColumnModified(FeatureProductTableMap::FEATURE_ID)) {
$modifiedColumns[':p' . $index++] = 'FEATURE_ID';
}
- if ($this->isColumnModified(FeatureProdTableMap::FEATURE_AV_ID)) {
+ if ($this->isColumnModified(FeatureProductTableMap::FEATURE_AV_ID)) {
$modifiedColumns[':p' . $index++] = 'FEATURE_AV_ID';
}
- if ($this->isColumnModified(FeatureProdTableMap::BY_DEFAULT)) {
+ if ($this->isColumnModified(FeatureProductTableMap::BY_DEFAULT)) {
$modifiedColumns[':p' . $index++] = 'BY_DEFAULT';
}
- if ($this->isColumnModified(FeatureProdTableMap::POSITION)) {
+ if ($this->isColumnModified(FeatureProductTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION';
}
- if ($this->isColumnModified(FeatureProdTableMap::CREATED_AT)) {
+ if ($this->isColumnModified(FeatureProductTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
- if ($this->isColumnModified(FeatureProdTableMap::UPDATED_AT)) {
+ if ($this->isColumnModified(FeatureProductTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT';
}
$sql = sprintf(
- 'INSERT INTO feature_prod (%s) VALUES (%s)',
+ 'INSERT INTO feature_product (%s) VALUES (%s)',
implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns))
);
@@ -1108,7 +1108,7 @@ abstract class FeatureProd implements ActiveRecordInterface
*/
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
{
- $pos = FeatureProdTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = FeatureProductTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
@@ -1171,11 +1171,11 @@ abstract class FeatureProd implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
- if (isset($alreadyDumpedObjects['FeatureProd'][$this->getPrimaryKey()])) {
+ if (isset($alreadyDumpedObjects['FeatureProduct'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
- $alreadyDumpedObjects['FeatureProd'][$this->getPrimaryKey()] = true;
- $keys = FeatureProdTableMap::getFieldNames($keyType);
+ $alreadyDumpedObjects['FeatureProduct'][$this->getPrimaryKey()] = true;
+ $keys = FeatureProductTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getProductId(),
@@ -1220,7 +1220,7 @@ abstract class FeatureProd implements ActiveRecordInterface
*/
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
{
- $pos = FeatureProdTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = FeatureProductTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -1282,7 +1282,7 @@ abstract class FeatureProd implements ActiveRecordInterface
*/
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
- $keys = FeatureProdTableMap::getFieldNames($keyType);
+ $keys = FeatureProductTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setProductId($arr[$keys[1]]);
@@ -1301,16 +1301,16 @@ abstract class FeatureProd implements ActiveRecordInterface
*/
public function buildCriteria()
{
- $criteria = new Criteria(FeatureProdTableMap::DATABASE_NAME);
+ $criteria = new Criteria(FeatureProductTableMap::DATABASE_NAME);
- if ($this->isColumnModified(FeatureProdTableMap::ID)) $criteria->add(FeatureProdTableMap::ID, $this->id);
- if ($this->isColumnModified(FeatureProdTableMap::PRODUCT_ID)) $criteria->add(FeatureProdTableMap::PRODUCT_ID, $this->product_id);
- if ($this->isColumnModified(FeatureProdTableMap::FEATURE_ID)) $criteria->add(FeatureProdTableMap::FEATURE_ID, $this->feature_id);
- if ($this->isColumnModified(FeatureProdTableMap::FEATURE_AV_ID)) $criteria->add(FeatureProdTableMap::FEATURE_AV_ID, $this->feature_av_id);
- if ($this->isColumnModified(FeatureProdTableMap::BY_DEFAULT)) $criteria->add(FeatureProdTableMap::BY_DEFAULT, $this->by_default);
- if ($this->isColumnModified(FeatureProdTableMap::POSITION)) $criteria->add(FeatureProdTableMap::POSITION, $this->position);
- if ($this->isColumnModified(FeatureProdTableMap::CREATED_AT)) $criteria->add(FeatureProdTableMap::CREATED_AT, $this->created_at);
- if ($this->isColumnModified(FeatureProdTableMap::UPDATED_AT)) $criteria->add(FeatureProdTableMap::UPDATED_AT, $this->updated_at);
+ if ($this->isColumnModified(FeatureProductTableMap::ID)) $criteria->add(FeatureProductTableMap::ID, $this->id);
+ if ($this->isColumnModified(FeatureProductTableMap::PRODUCT_ID)) $criteria->add(FeatureProductTableMap::PRODUCT_ID, $this->product_id);
+ if ($this->isColumnModified(FeatureProductTableMap::FEATURE_ID)) $criteria->add(FeatureProductTableMap::FEATURE_ID, $this->feature_id);
+ if ($this->isColumnModified(FeatureProductTableMap::FEATURE_AV_ID)) $criteria->add(FeatureProductTableMap::FEATURE_AV_ID, $this->feature_av_id);
+ if ($this->isColumnModified(FeatureProductTableMap::BY_DEFAULT)) $criteria->add(FeatureProductTableMap::BY_DEFAULT, $this->by_default);
+ if ($this->isColumnModified(FeatureProductTableMap::POSITION)) $criteria->add(FeatureProductTableMap::POSITION, $this->position);
+ if ($this->isColumnModified(FeatureProductTableMap::CREATED_AT)) $criteria->add(FeatureProductTableMap::CREATED_AT, $this->created_at);
+ if ($this->isColumnModified(FeatureProductTableMap::UPDATED_AT)) $criteria->add(FeatureProductTableMap::UPDATED_AT, $this->updated_at);
return $criteria;
}
@@ -1325,8 +1325,8 @@ abstract class FeatureProd implements ActiveRecordInterface
*/
public function buildPkeyCriteria()
{
- $criteria = new Criteria(FeatureProdTableMap::DATABASE_NAME);
- $criteria->add(FeatureProdTableMap::ID, $this->id);
+ $criteria = new Criteria(FeatureProductTableMap::DATABASE_NAME);
+ $criteria->add(FeatureProductTableMap::ID, $this->id);
return $criteria;
}
@@ -1367,7 +1367,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
- * @param object $copyObj An object of \Thelia\Model\FeatureProd (or compatible) type.
+ * @param object $copyObj An object of \Thelia\Model\FeatureProduct (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
* @throws PropelException
@@ -1396,7 +1396,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return \Thelia\Model\FeatureProd Clone of current object.
+ * @return \Thelia\Model\FeatureProduct Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -1413,7 +1413,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* Declares an association between this object and a ChildProduct object.
*
* @param ChildProduct $v
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
* @throws PropelException
*/
public function setProduct(ChildProduct $v = null)
@@ -1429,7 +1429,7 @@ abstract class FeatureProd implements ActiveRecordInterface
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildProduct object, it will not be re-added.
if ($v !== null) {
- $v->addFeatureProd($this);
+ $v->addFeatureProduct($this);
}
@@ -1453,7 +1453,7 @@ abstract class FeatureProd implements ActiveRecordInterface
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->aProduct->addFeatureProds($this);
+ $this->aProduct->addFeatureProducts($this);
*/
}
@@ -1464,7 +1464,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* Declares an association between this object and a ChildFeature object.
*
* @param ChildFeature $v
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
* @throws PropelException
*/
public function setFeature(ChildFeature $v = null)
@@ -1480,7 +1480,7 @@ abstract class FeatureProd implements ActiveRecordInterface
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildFeature object, it will not be re-added.
if ($v !== null) {
- $v->addFeatureProd($this);
+ $v->addFeatureProduct($this);
}
@@ -1504,7 +1504,7 @@ abstract class FeatureProd implements ActiveRecordInterface
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->aFeature->addFeatureProds($this);
+ $this->aFeature->addFeatureProducts($this);
*/
}
@@ -1515,7 +1515,7 @@ abstract class FeatureProd implements ActiveRecordInterface
* Declares an association between this object and a ChildFeatureAv object.
*
* @param ChildFeatureAv $v
- * @return \Thelia\Model\FeatureProd The current object (for fluent API support)
+ * @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
* @throws PropelException
*/
public function setFeatureAv(ChildFeatureAv $v = null)
@@ -1531,7 +1531,7 @@ abstract class FeatureProd implements ActiveRecordInterface
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildFeatureAv object, it will not be re-added.
if ($v !== null) {
- $v->addFeatureProd($this);
+ $v->addFeatureProduct($this);
}
@@ -1555,7 +1555,7 @@ abstract class FeatureProd implements ActiveRecordInterface
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->aFeatureAv->addFeatureProds($this);
+ $this->aFeatureAv->addFeatureProducts($this);
*/
}
@@ -1608,7 +1608,7 @@ abstract class FeatureProd implements ActiveRecordInterface
*/
public function __toString()
{
- return (string) $this->exportTo(FeatureProdTableMap::DEFAULT_STRING_FORMAT);
+ return (string) $this->exportTo(FeatureProductTableMap::DEFAULT_STRING_FORMAT);
}
// timestampable behavior
@@ -1616,11 +1616,11 @@ abstract class FeatureProd implements ActiveRecordInterface
/**
* Mark the current object so that the update date doesn't get updated during next save
*
- * @return ChildFeatureProd The current object (for fluent API support)
+ * @return ChildFeatureProduct The current object (for fluent API support)
*/
public function keepUpdateDateUnchanged()
{
- $this->modifiedColumns[] = FeatureProdTableMap::UPDATED_AT;
+ $this->modifiedColumns[] = FeatureProductTableMap::UPDATED_AT;
return $this;
}
diff --git a/core/lib/Thelia/Model/Base/FeatureProdQuery.php b/core/lib/Thelia/Model/Base/FeatureProductQuery.php
old mode 100755
new mode 100644
similarity index 68%
rename from core/lib/Thelia/Model/Base/FeatureProdQuery.php
rename to core/lib/Thelia/Model/Base/FeatureProductQuery.php
index 14f5a551b..c6a8f2a73
--- a/core/lib/Thelia/Model/Base/FeatureProdQuery.php
+++ b/core/lib/Thelia/Model/Base/FeatureProductQuery.php
@@ -12,100 +12,100 @@ use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
-use Thelia\Model\FeatureProd as ChildFeatureProd;
-use Thelia\Model\FeatureProdQuery as ChildFeatureProdQuery;
-use Thelia\Model\Map\FeatureProdTableMap;
+use Thelia\Model\FeatureProduct as ChildFeatureProduct;
+use Thelia\Model\FeatureProductQuery as ChildFeatureProductQuery;
+use Thelia\Model\Map\FeatureProductTableMap;
/**
- * Base class that represents a query for the 'feature_prod' table.
+ * Base class that represents a query for the 'feature_product' table.
*
*
*
- * @method ChildFeatureProdQuery orderById($order = Criteria::ASC) Order by the id column
- * @method ChildFeatureProdQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
- * @method ChildFeatureProdQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
- * @method ChildFeatureProdQuery orderByFeatureAvId($order = Criteria::ASC) Order by the feature_av_id column
- * @method ChildFeatureProdQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
- * @method ChildFeatureProdQuery orderByPosition($order = Criteria::ASC) Order by the position column
- * @method ChildFeatureProdQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
- * @method ChildFeatureProdQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
+ * @method ChildFeatureProductQuery orderById($order = Criteria::ASC) Order by the id column
+ * @method ChildFeatureProductQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
+ * @method ChildFeatureProductQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
+ * @method ChildFeatureProductQuery orderByFeatureAvId($order = Criteria::ASC) Order by the feature_av_id column
+ * @method ChildFeatureProductQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
+ * @method ChildFeatureProductQuery orderByPosition($order = Criteria::ASC) Order by the position column
+ * @method ChildFeatureProductQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
+ * @method ChildFeatureProductQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
- * @method ChildFeatureProdQuery groupById() Group by the id column
- * @method ChildFeatureProdQuery groupByProductId() Group by the product_id column
- * @method ChildFeatureProdQuery groupByFeatureId() Group by the feature_id column
- * @method ChildFeatureProdQuery groupByFeatureAvId() Group by the feature_av_id column
- * @method ChildFeatureProdQuery groupByByDefault() Group by the by_default column
- * @method ChildFeatureProdQuery groupByPosition() Group by the position column
- * @method ChildFeatureProdQuery groupByCreatedAt() Group by the created_at column
- * @method ChildFeatureProdQuery groupByUpdatedAt() Group by the updated_at column
+ * @method ChildFeatureProductQuery groupById() Group by the id column
+ * @method ChildFeatureProductQuery groupByProductId() Group by the product_id column
+ * @method ChildFeatureProductQuery groupByFeatureId() Group by the feature_id column
+ * @method ChildFeatureProductQuery groupByFeatureAvId() Group by the feature_av_id column
+ * @method ChildFeatureProductQuery groupByByDefault() Group by the by_default column
+ * @method ChildFeatureProductQuery groupByPosition() Group by the position column
+ * @method ChildFeatureProductQuery groupByCreatedAt() Group by the created_at column
+ * @method ChildFeatureProductQuery groupByUpdatedAt() Group by the updated_at column
*
- * @method ChildFeatureProdQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
- * @method ChildFeatureProdQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
- * @method ChildFeatureProdQuery innerJoin($relation) Adds a INNER JOIN clause to the query
+ * @method ChildFeatureProductQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
+ * @method ChildFeatureProductQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
+ * @method ChildFeatureProductQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
- * @method ChildFeatureProdQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
- * @method ChildFeatureProdQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
- * @method ChildFeatureProdQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
+ * @method ChildFeatureProductQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
+ * @method ChildFeatureProductQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
+ * @method ChildFeatureProductQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
*
- * @method ChildFeatureProdQuery leftJoinFeature($relationAlias = null) Adds a LEFT JOIN clause to the query using the Feature relation
- * @method ChildFeatureProdQuery rightJoinFeature($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Feature relation
- * @method ChildFeatureProdQuery innerJoinFeature($relationAlias = null) Adds a INNER JOIN clause to the query using the Feature relation
+ * @method ChildFeatureProductQuery leftJoinFeature($relationAlias = null) Adds a LEFT JOIN clause to the query using the Feature relation
+ * @method ChildFeatureProductQuery rightJoinFeature($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Feature relation
+ * @method ChildFeatureProductQuery innerJoinFeature($relationAlias = null) Adds a INNER JOIN clause to the query using the Feature relation
*
- * @method ChildFeatureProdQuery leftJoinFeatureAv($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureAv relation
- * @method ChildFeatureProdQuery rightJoinFeatureAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureAv relation
- * @method ChildFeatureProdQuery innerJoinFeatureAv($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureAv relation
+ * @method ChildFeatureProductQuery leftJoinFeatureAv($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureAv relation
+ * @method ChildFeatureProductQuery rightJoinFeatureAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureAv relation
+ * @method ChildFeatureProductQuery innerJoinFeatureAv($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureAv relation
*
- * @method ChildFeatureProd findOne(ConnectionInterface $con = null) Return the first ChildFeatureProd matching the query
- * @method ChildFeatureProd findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFeatureProd matching the query, or a new ChildFeatureProd object populated from the query conditions when no match is found
+ * @method ChildFeatureProduct findOne(ConnectionInterface $con = null) Return the first ChildFeatureProduct matching the query
+ * @method ChildFeatureProduct findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFeatureProduct matching the query, or a new ChildFeatureProduct object populated from the query conditions when no match is found
*
- * @method ChildFeatureProd findOneById(int $id) Return the first ChildFeatureProd filtered by the id column
- * @method ChildFeatureProd findOneByProductId(int $product_id) Return the first ChildFeatureProd filtered by the product_id column
- * @method ChildFeatureProd findOneByFeatureId(int $feature_id) Return the first ChildFeatureProd filtered by the feature_id column
- * @method ChildFeatureProd findOneByFeatureAvId(int $feature_av_id) Return the first ChildFeatureProd filtered by the feature_av_id column
- * @method ChildFeatureProd findOneByByDefault(string $by_default) Return the first ChildFeatureProd filtered by the by_default column
- * @method ChildFeatureProd findOneByPosition(int $position) Return the first ChildFeatureProd filtered by the position column
- * @method ChildFeatureProd findOneByCreatedAt(string $created_at) Return the first ChildFeatureProd filtered by the created_at column
- * @method ChildFeatureProd findOneByUpdatedAt(string $updated_at) Return the first ChildFeatureProd filtered by the updated_at column
+ * @method ChildFeatureProduct findOneById(int $id) Return the first ChildFeatureProduct filtered by the id column
+ * @method ChildFeatureProduct findOneByProductId(int $product_id) Return the first ChildFeatureProduct filtered by the product_id column
+ * @method ChildFeatureProduct findOneByFeatureId(int $feature_id) Return the first ChildFeatureProduct filtered by the feature_id column
+ * @method ChildFeatureProduct findOneByFeatureAvId(int $feature_av_id) Return the first ChildFeatureProduct filtered by the feature_av_id column
+ * @method ChildFeatureProduct findOneByByDefault(string $by_default) Return the first ChildFeatureProduct filtered by the by_default column
+ * @method ChildFeatureProduct findOneByPosition(int $position) Return the first ChildFeatureProduct filtered by the position column
+ * @method ChildFeatureProduct findOneByCreatedAt(string $created_at) Return the first ChildFeatureProduct filtered by the created_at column
+ * @method ChildFeatureProduct findOneByUpdatedAt(string $updated_at) Return the first ChildFeatureProduct filtered by the updated_at column
*
- * @method array findById(int $id) Return ChildFeatureProd objects filtered by the id column
- * @method array findByProductId(int $product_id) Return ChildFeatureProd objects filtered by the product_id column
- * @method array findByFeatureId(int $feature_id) Return ChildFeatureProd objects filtered by the feature_id column
- * @method array findByFeatureAvId(int $feature_av_id) Return ChildFeatureProd objects filtered by the feature_av_id column
- * @method array findByByDefault(string $by_default) Return ChildFeatureProd objects filtered by the by_default column
- * @method array findByPosition(int $position) Return ChildFeatureProd objects filtered by the position column
- * @method array findByCreatedAt(string $created_at) Return ChildFeatureProd objects filtered by the created_at column
- * @method array findByUpdatedAt(string $updated_at) Return ChildFeatureProd objects filtered by the updated_at column
+ * @method array findById(int $id) Return ChildFeatureProduct objects filtered by the id column
+ * @method array findByProductId(int $product_id) Return ChildFeatureProduct objects filtered by the product_id column
+ * @method array findByFeatureId(int $feature_id) Return ChildFeatureProduct objects filtered by the feature_id column
+ * @method array findByFeatureAvId(int $feature_av_id) Return ChildFeatureProduct objects filtered by the feature_av_id column
+ * @method array findByByDefault(string $by_default) Return ChildFeatureProduct objects filtered by the by_default column
+ * @method array findByPosition(int $position) Return ChildFeatureProduct objects filtered by the position column
+ * @method array findByCreatedAt(string $created_at) Return ChildFeatureProduct objects filtered by the created_at column
+ * @method array findByUpdatedAt(string $updated_at) Return ChildFeatureProduct objects filtered by the updated_at column
*
*/
-abstract class FeatureProdQuery extends ModelCriteria
+abstract class FeatureProductQuery extends ModelCriteria
{
/**
- * Initializes internal state of \Thelia\Model\Base\FeatureProdQuery object.
+ * Initializes internal state of \Thelia\Model\Base\FeatureProductQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
- public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\FeatureProd', $modelAlias = null)
+ public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\FeatureProduct', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
- * Returns a new ChildFeatureProdQuery object.
+ * Returns a new ChildFeatureProductQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
- * @return ChildFeatureProdQuery
+ * @return ChildFeatureProductQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
- if ($criteria instanceof \Thelia\Model\FeatureProdQuery) {
+ if ($criteria instanceof \Thelia\Model\FeatureProductQuery) {
return $criteria;
}
- $query = new \Thelia\Model\FeatureProdQuery();
+ $query = new \Thelia\Model\FeatureProductQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
@@ -128,19 +128,19 @@ abstract class FeatureProdQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
- * @return ChildFeatureProd|array|mixed the result, formatted by the current formatter
+ * @return ChildFeatureProduct|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
- if ((null !== ($obj = FeatureProdTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ if ((null !== ($obj = FeatureProductTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(FeatureProdTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getReadConnection(FeatureProductTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
@@ -159,11 +159,11 @@ abstract class FeatureProdQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
- * @return ChildFeatureProd A model object, or null if the key is not found
+ * @return ChildFeatureProduct A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, PRODUCT_ID, FEATURE_ID, FEATURE_AV_ID, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM feature_prod WHERE ID = :p0';
+ $sql = 'SELECT ID, PRODUCT_ID, FEATURE_ID, FEATURE_AV_ID, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM feature_product WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -174,9 +174,9 @@ abstract class FeatureProdQuery extends ModelCriteria
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
- $obj = new ChildFeatureProd();
+ $obj = new ChildFeatureProduct();
$obj->hydrate($row);
- FeatureProdTableMap::addInstanceToPool($obj, (string) $key);
+ FeatureProductTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
@@ -189,7 +189,7 @@ abstract class FeatureProdQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
- * @return ChildFeatureProd|array|mixed the result, formatted by the current formatter
+ * @return ChildFeatureProduct|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
@@ -231,12 +231,12 @@ abstract class FeatureProdQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
- return $this->addUsingAlias(FeatureProdTableMap::ID, $key, Criteria::EQUAL);
+ return $this->addUsingAlias(FeatureProductTableMap::ID, $key, Criteria::EQUAL);
}
/**
@@ -244,12 +244,12 @@ abstract class FeatureProdQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
- return $this->addUsingAlias(FeatureProdTableMap::ID, $keys, Criteria::IN);
+ return $this->addUsingAlias(FeatureProductTableMap::ID, $keys, Criteria::IN);
}
/**
@@ -268,18 +268,18 @@ abstract class FeatureProdQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
- $this->addUsingAlias(FeatureProdTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
- $this->addUsingAlias(FeatureProdTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -290,7 +290,7 @@ abstract class FeatureProdQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureProdTableMap::ID, $id, $comparison);
+ return $this->addUsingAlias(FeatureProductTableMap::ID, $id, $comparison);
}
/**
@@ -311,18 +311,18 @@ abstract class FeatureProdQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByProductId($productId = null, $comparison = null)
{
if (is_array($productId)) {
$useMinMax = false;
if (isset($productId['min'])) {
- $this->addUsingAlias(FeatureProdTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($productId['max'])) {
- $this->addUsingAlias(FeatureProdTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -333,7 +333,7 @@ abstract class FeatureProdQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureProdTableMap::PRODUCT_ID, $productId, $comparison);
+ return $this->addUsingAlias(FeatureProductTableMap::PRODUCT_ID, $productId, $comparison);
}
/**
@@ -354,18 +354,18 @@ abstract class FeatureProdQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByFeatureId($featureId = null, $comparison = null)
{
if (is_array($featureId)) {
$useMinMax = false;
if (isset($featureId['min'])) {
- $this->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $featureId['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::FEATURE_ID, $featureId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($featureId['max'])) {
- $this->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $featureId['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::FEATURE_ID, $featureId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -376,7 +376,7 @@ abstract class FeatureProdQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $featureId, $comparison);
+ return $this->addUsingAlias(FeatureProductTableMap::FEATURE_ID, $featureId, $comparison);
}
/**
@@ -397,18 +397,18 @@ abstract class FeatureProdQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByFeatureAvId($featureAvId = null, $comparison = null)
{
if (is_array($featureAvId)) {
$useMinMax = false;
if (isset($featureAvId['min'])) {
- $this->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAvId['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::FEATURE_AV_ID, $featureAvId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($featureAvId['max'])) {
- $this->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAvId['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::FEATURE_AV_ID, $featureAvId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -419,7 +419,7 @@ abstract class FeatureProdQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAvId, $comparison);
+ return $this->addUsingAlias(FeatureProductTableMap::FEATURE_AV_ID, $featureAvId, $comparison);
}
/**
@@ -435,7 +435,7 @@ abstract class FeatureProdQuery extends ModelCriteria
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByByDefault($byDefault = null, $comparison = null)
{
@@ -448,7 +448,7 @@ abstract class FeatureProdQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureProdTableMap::BY_DEFAULT, $byDefault, $comparison);
+ return $this->addUsingAlias(FeatureProductTableMap::BY_DEFAULT, $byDefault, $comparison);
}
/**
@@ -467,18 +467,18 @@ abstract class FeatureProdQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($position)) {
$useMinMax = false;
if (isset($position['min'])) {
- $this->addUsingAlias(FeatureProdTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
- $this->addUsingAlias(FeatureProdTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -489,7 +489,7 @@ abstract class FeatureProdQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureProdTableMap::POSITION, $position, $comparison);
+ return $this->addUsingAlias(FeatureProductTableMap::POSITION, $position, $comparison);
}
/**
@@ -510,18 +510,18 @@ abstract class FeatureProdQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByCreatedAt($createdAt = null, $comparison = null)
{
if (is_array($createdAt)) {
$useMinMax = false;
if (isset($createdAt['min'])) {
- $this->addUsingAlias(FeatureProdTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
- $this->addUsingAlias(FeatureProdTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -532,7 +532,7 @@ abstract class FeatureProdQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureProdTableMap::CREATED_AT, $createdAt, $comparison);
+ return $this->addUsingAlias(FeatureProductTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
@@ -553,18 +553,18 @@ abstract class FeatureProdQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
{
if (is_array($updatedAt)) {
$useMinMax = false;
if (isset($updatedAt['min'])) {
- $this->addUsingAlias(FeatureProdTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
- $this->addUsingAlias(FeatureProdTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(FeatureProductTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -575,7 +575,7 @@ abstract class FeatureProdQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureProdTableMap::UPDATED_AT, $updatedAt, $comparison);
+ return $this->addUsingAlias(FeatureProductTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
@@ -584,20 +584,20 @@ abstract class FeatureProdQuery extends ModelCriteria
* @param \Thelia\Model\Product|ObjectCollection $product The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByProduct($product, $comparison = null)
{
if ($product instanceof \Thelia\Model\Product) {
return $this
- ->addUsingAlias(FeatureProdTableMap::PRODUCT_ID, $product->getId(), $comparison);
+ ->addUsingAlias(FeatureProductTableMap::PRODUCT_ID, $product->getId(), $comparison);
} elseif ($product instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(FeatureProdTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(FeatureProductTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByProduct() only accepts arguments of type \Thelia\Model\Product or Collection');
}
@@ -609,7 +609,7 @@ abstract class FeatureProdQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function joinProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
@@ -659,20 +659,20 @@ abstract class FeatureProdQuery extends ModelCriteria
* @param \Thelia\Model\Feature|ObjectCollection $feature The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByFeature($feature, $comparison = null)
{
if ($feature instanceof \Thelia\Model\Feature) {
return $this
- ->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $feature->getId(), $comparison);
+ ->addUsingAlias(FeatureProductTableMap::FEATURE_ID, $feature->getId(), $comparison);
} elseif ($feature instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $feature->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(FeatureProductTableMap::FEATURE_ID, $feature->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByFeature() only accepts arguments of type \Thelia\Model\Feature or Collection');
}
@@ -684,7 +684,7 @@ abstract class FeatureProdQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function joinFeature($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
@@ -734,20 +734,20 @@ abstract class FeatureProdQuery extends ModelCriteria
* @param \Thelia\Model\FeatureAv|ObjectCollection $featureAv The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByFeatureAv($featureAv, $comparison = null)
{
if ($featureAv instanceof \Thelia\Model\FeatureAv) {
return $this
- ->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAv->getId(), $comparison);
+ ->addUsingAlias(FeatureProductTableMap::FEATURE_AV_ID, $featureAv->getId(), $comparison);
} elseif ($featureAv instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAv->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(FeatureProductTableMap::FEATURE_AV_ID, $featureAv->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByFeatureAv() only accepts arguments of type \Thelia\Model\FeatureAv or Collection');
}
@@ -759,7 +759,7 @@ abstract class FeatureProdQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function joinFeatureAv($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
@@ -806,21 +806,21 @@ abstract class FeatureProdQuery extends ModelCriteria
/**
* Exclude object from result
*
- * @param ChildFeatureProd $featureProd Object to remove from the list of results
+ * @param ChildFeatureProduct $featureProduct Object to remove from the list of results
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
- public function prune($featureProd = null)
+ public function prune($featureProduct = null)
{
- if ($featureProd) {
- $this->addUsingAlias(FeatureProdTableMap::ID, $featureProd->getId(), Criteria::NOT_EQUAL);
+ if ($featureProduct) {
+ $this->addUsingAlias(FeatureProductTableMap::ID, $featureProduct->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
- * Deletes all rows from the feature_prod table.
+ * Deletes all rows from the feature_product table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
@@ -828,7 +828,7 @@ abstract class FeatureProdQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureProdTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(FeatureProductTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
@@ -839,8 +839,8 @@ abstract class FeatureProdQuery extends ModelCriteria
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
- FeatureProdTableMap::clearInstancePool();
- FeatureProdTableMap::clearRelatedInstancePool();
+ FeatureProductTableMap::clearInstancePool();
+ FeatureProductTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
@@ -852,9 +852,9 @@ abstract class FeatureProdQuery extends ModelCriteria
}
/**
- * Performs a DELETE on the database, given a ChildFeatureProd or Criteria object OR a primary key value.
+ * Performs a DELETE on the database, given a ChildFeatureProduct or Criteria object OR a primary key value.
*
- * @param mixed $values Criteria or ChildFeatureProd object or primary key or array of primary keys
+ * @param mixed $values Criteria or ChildFeatureProduct object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -865,13 +865,13 @@ abstract class FeatureProdQuery extends ModelCriteria
public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureProdTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(FeatureProductTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
- $criteria->setDbName(FeatureProdTableMap::DATABASE_NAME);
+ $criteria->setDbName(FeatureProductTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
@@ -881,10 +881,10 @@ abstract class FeatureProdQuery extends ModelCriteria
$con->beginTransaction();
- FeatureProdTableMap::removeInstanceFromPool($criteria);
+ FeatureProductTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
- FeatureProdTableMap::clearRelatedInstancePool();
+ FeatureProductTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
@@ -901,11 +901,11 @@ abstract class FeatureProdQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of the latest update in days
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
- return $this->addUsingAlias(FeatureProdTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ return $this->addUsingAlias(FeatureProductTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
@@ -913,51 +913,51 @@ abstract class FeatureProdQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of in days
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
- return $this->addUsingAlias(FeatureProdTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ return $this->addUsingAlias(FeatureProductTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
- return $this->addDescendingOrderByColumn(FeatureProdTableMap::UPDATED_AT);
+ return $this->addDescendingOrderByColumn(FeatureProductTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
- return $this->addAscendingOrderByColumn(FeatureProdTableMap::UPDATED_AT);
+ return $this->addAscendingOrderByColumn(FeatureProductTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
- return $this->addDescendingOrderByColumn(FeatureProdTableMap::CREATED_AT);
+ return $this->addDescendingOrderByColumn(FeatureProductTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
- * @return ChildFeatureProdQuery The current query, for fluid interface
+ * @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
- return $this->addAscendingOrderByColumn(FeatureProdTableMap::CREATED_AT);
+ return $this->addAscendingOrderByColumn(FeatureProductTableMap::CREATED_AT);
}
-} // FeatureProdQuery
+} // FeatureProductQuery
diff --git a/core/lib/Thelia/Model/Base/FeatureQuery.php b/core/lib/Thelia/Model/Base/FeatureQuery.php
old mode 100755
new mode 100644
index ba927a766..9b00e812e
--- a/core/lib/Thelia/Model/Base/FeatureQuery.php
+++ b/core/lib/Thelia/Model/Base/FeatureQuery.php
@@ -42,9 +42,9 @@ use Thelia\Model\Map\FeatureTableMap;
* @method ChildFeatureQuery rightJoinFeatureAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureAv relation
* @method ChildFeatureQuery innerJoinFeatureAv($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureAv relation
*
- * @method ChildFeatureQuery leftJoinFeatureProd($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureProd relation
- * @method ChildFeatureQuery rightJoinFeatureProd($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureProd relation
- * @method ChildFeatureQuery innerJoinFeatureProd($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureProd relation
+ * @method ChildFeatureQuery leftJoinFeatureProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureProduct relation
+ * @method ChildFeatureQuery rightJoinFeatureProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureProduct relation
+ * @method ChildFeatureQuery innerJoinFeatureProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureProduct relation
*
* @method ChildFeatureQuery leftJoinFeatureCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureCategory relation
* @method ChildFeatureQuery rightJoinFeatureCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureCategory relation
@@ -528,40 +528,40 @@ abstract class FeatureQuery extends ModelCriteria
}
/**
- * Filter the query by a related \Thelia\Model\FeatureProd object
+ * Filter the query by a related \Thelia\Model\FeatureProduct object
*
- * @param \Thelia\Model\FeatureProd|ObjectCollection $featureProd the related object to use as filter
+ * @param \Thelia\Model\FeatureProduct|ObjectCollection $featureProduct the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
- public function filterByFeatureProd($featureProd, $comparison = null)
+ public function filterByFeatureProduct($featureProduct, $comparison = null)
{
- if ($featureProd instanceof \Thelia\Model\FeatureProd) {
+ if ($featureProduct instanceof \Thelia\Model\FeatureProduct) {
return $this
- ->addUsingAlias(FeatureTableMap::ID, $featureProd->getFeatureId(), $comparison);
- } elseif ($featureProd instanceof ObjectCollection) {
+ ->addUsingAlias(FeatureTableMap::ID, $featureProduct->getFeatureId(), $comparison);
+ } elseif ($featureProduct instanceof ObjectCollection) {
return $this
- ->useFeatureProdQuery()
- ->filterByPrimaryKeys($featureProd->getPrimaryKeys())
+ ->useFeatureProductQuery()
+ ->filterByPrimaryKeys($featureProduct->getPrimaryKeys())
->endUse();
} else {
- throw new PropelException('filterByFeatureProd() only accepts arguments of type \Thelia\Model\FeatureProd or Collection');
+ throw new PropelException('filterByFeatureProduct() only accepts arguments of type \Thelia\Model\FeatureProduct or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the FeatureProd relation
+ * Adds a JOIN clause to the query using the FeatureProduct relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
- public function joinFeatureProd($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinFeatureProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('FeatureProd');
+ $relationMap = $tableMap->getRelation('FeatureProduct');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -576,14 +576,14 @@ abstract class FeatureQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'FeatureProd');
+ $this->addJoinObject($join, 'FeatureProduct');
}
return $this;
}
/**
- * Use the FeatureProd relation FeatureProd object
+ * Use the FeatureProduct relation FeatureProduct object
*
* @see useQuery()
*
@@ -591,13 +591,13 @@ abstract class FeatureQuery extends ModelCriteria
* 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\FeatureProdQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\FeatureProductQuery A secondary query class using the current class as primary query
*/
- public function useFeatureProdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useFeatureProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinFeatureProd($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'FeatureProd', '\Thelia\Model\FeatureProdQuery');
+ ->joinFeatureProduct($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'FeatureProduct', '\Thelia\Model\FeatureProductQuery');
}
/**
diff --git a/core/lib/Thelia/Model/Base/Folder.php b/core/lib/Thelia/Model/Base/Folder.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FolderI18n.php b/core/lib/Thelia/Model/Base/FolderI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FolderI18nQuery.php b/core/lib/Thelia/Model/Base/FolderI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FolderQuery.php b/core/lib/Thelia/Model/Base/FolderQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FolderVersion.php b/core/lib/Thelia/Model/Base/FolderVersion.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/FolderVersionQuery.php b/core/lib/Thelia/Model/Base/FolderVersionQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Group.php b/core/lib/Thelia/Model/Base/Group.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/GroupI18n.php b/core/lib/Thelia/Model/Base/GroupI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/GroupI18nQuery.php b/core/lib/Thelia/Model/Base/GroupI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/GroupModule.php b/core/lib/Thelia/Model/Base/GroupModule.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/GroupModuleQuery.php b/core/lib/Thelia/Model/Base/GroupModuleQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/GroupQuery.php b/core/lib/Thelia/Model/Base/GroupQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/GroupResource.php b/core/lib/Thelia/Model/Base/GroupResource.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/GroupResourceQuery.php b/core/lib/Thelia/Model/Base/GroupResourceQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Image.php b/core/lib/Thelia/Model/Base/Image.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ImageI18n.php b/core/lib/Thelia/Model/Base/ImageI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ImageI18nQuery.php b/core/lib/Thelia/Model/Base/ImageI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ImageQuery.php b/core/lib/Thelia/Model/Base/ImageQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Lang.php b/core/lib/Thelia/Model/Base/Lang.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/LangQuery.php b/core/lib/Thelia/Model/Base/LangQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Message.php b/core/lib/Thelia/Model/Base/Message.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/MessageI18n.php b/core/lib/Thelia/Model/Base/MessageI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/MessageI18nQuery.php b/core/lib/Thelia/Model/Base/MessageI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/MessageQuery.php b/core/lib/Thelia/Model/Base/MessageQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/MessageVersion.php b/core/lib/Thelia/Model/Base/MessageVersion.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/MessageVersionQuery.php b/core/lib/Thelia/Model/Base/MessageVersionQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Module.php b/core/lib/Thelia/Model/Base/Module.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ModuleI18n.php b/core/lib/Thelia/Model/Base/ModuleI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ModuleI18nQuery.php b/core/lib/Thelia/Model/Base/ModuleI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ModuleQuery.php b/core/lib/Thelia/Model/Base/ModuleQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Order.php b/core/lib/Thelia/Model/Base/Order.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderAddress.php b/core/lib/Thelia/Model/Base/OrderAddress.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderAddressQuery.php b/core/lib/Thelia/Model/Base/OrderAddressQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderFeature.php b/core/lib/Thelia/Model/Base/OrderFeature.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderFeatureQuery.php b/core/lib/Thelia/Model/Base/OrderFeatureQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderProduct.php b/core/lib/Thelia/Model/Base/OrderProduct.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderProductQuery.php b/core/lib/Thelia/Model/Base/OrderProductQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderQuery.php b/core/lib/Thelia/Model/Base/OrderQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderStatus.php b/core/lib/Thelia/Model/Base/OrderStatus.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderStatusI18n.php b/core/lib/Thelia/Model/Base/OrderStatusI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderStatusI18nQuery.php b/core/lib/Thelia/Model/Base/OrderStatusI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/OrderStatusQuery.php b/core/lib/Thelia/Model/Base/OrderStatusQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Product.php b/core/lib/Thelia/Model/Base/Product.php
old mode 100755
new mode 100644
index 96b3f45f0..d8ca1d36b
--- a/core/lib/Thelia/Model/Base/Product.php
+++ b/core/lib/Thelia/Model/Base/Product.php
@@ -27,8 +27,8 @@ use Thelia\Model\ContentAssoc as ChildContentAssoc;
use Thelia\Model\ContentAssocQuery as ChildContentAssocQuery;
use Thelia\Model\Document as ChildDocument;
use Thelia\Model\DocumentQuery as ChildDocumentQuery;
-use Thelia\Model\FeatureProd as ChildFeatureProd;
-use Thelia\Model\FeatureProdQuery as ChildFeatureProdQuery;
+use Thelia\Model\FeatureProduct as ChildFeatureProduct;
+use Thelia\Model\FeatureProductQuery as ChildFeatureProductQuery;
use Thelia\Model\Image as ChildImage;
use Thelia\Model\ImageQuery as ChildImageQuery;
use Thelia\Model\Product as ChildProduct;
@@ -37,12 +37,12 @@ use Thelia\Model\ProductCategoryQuery as ChildProductCategoryQuery;
use Thelia\Model\ProductI18n as ChildProductI18n;
use Thelia\Model\ProductI18nQuery as ChildProductI18nQuery;
use Thelia\Model\ProductQuery as ChildProductQuery;
+use Thelia\Model\ProductSaleElements as ChildProductSaleElements;
+use Thelia\Model\ProductSaleElementsQuery as ChildProductSaleElementsQuery;
use Thelia\Model\ProductVersion as ChildProductVersion;
use Thelia\Model\ProductVersionQuery as ChildProductVersionQuery;
use Thelia\Model\Rewriting as ChildRewriting;
use Thelia\Model\RewritingQuery as ChildRewritingQuery;
-use Thelia\Model\Stock as ChildStock;
-use Thelia\Model\StockQuery as ChildStockQuery;
use Thelia\Model\TaxRule as ChildTaxRule;
use Thelia\Model\TaxRuleQuery as ChildTaxRuleQuery;
use Thelia\Model\Map\ProductTableMap;
@@ -100,45 +100,6 @@ abstract class Product implements ActiveRecordInterface
*/
protected $ref;
- /**
- * The value for the price field.
- * @var double
- */
- protected $price;
-
- /**
- * The value for the price2 field.
- * @var double
- */
- protected $price2;
-
- /**
- * The value for the ecotax field.
- * @var double
- */
- protected $ecotax;
-
- /**
- * The value for the newness field.
- * Note: this column has a database default value of: 0
- * @var int
- */
- protected $newness;
-
- /**
- * The value for the promo field.
- * Note: this column has a database default value of: 0
- * @var int
- */
- protected $promo;
-
- /**
- * The value for the quantity field.
- * Note: this column has a database default value of: 0
- * @var int
- */
- protected $quantity;
-
/**
* The value for the visible field.
* Note: this column has a database default value of: 0
@@ -146,12 +107,6 @@ abstract class Product implements ActiveRecordInterface
*/
protected $visible;
- /**
- * The value for the weight field.
- * @var double
- */
- protected $weight;
-
/**
* The value for the position field.
* @var int
@@ -201,16 +156,16 @@ abstract class Product implements ActiveRecordInterface
protected $collProductCategoriesPartial;
/**
- * @var ObjectCollection|ChildFeatureProd[] Collection to store aggregation of ChildFeatureProd objects.
+ * @var ObjectCollection|ChildFeatureProduct[] Collection to store aggregation of ChildFeatureProduct objects.
*/
- protected $collFeatureProds;
- protected $collFeatureProdsPartial;
+ protected $collFeatureProducts;
+ protected $collFeatureProductsPartial;
/**
- * @var ObjectCollection|ChildStock[] Collection to store aggregation of ChildStock objects.
+ * @var ObjectCollection|ChildProductSaleElements[] Collection to store aggregation of ChildProductSaleElements objects.
*/
- protected $collStocks;
- protected $collStocksPartial;
+ protected $collProductSaleElementss;
+ protected $collProductSaleElementssPartial;
/**
* @var ObjectCollection|ChildContentAssoc[] Collection to store aggregation of ChildContentAssoc objects.
@@ -339,13 +294,13 @@ abstract class Product implements ActiveRecordInterface
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
- protected $featureProdsScheduledForDeletion = null;
+ protected $featureProductsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
- protected $stocksScheduledForDeletion = null;
+ protected $productSaleElementssScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
@@ -409,9 +364,6 @@ abstract class Product implements ActiveRecordInterface
*/
public function applyDefaultValues()
{
- $this->newness = 0;
- $this->promo = 0;
- $this->quantity = 0;
$this->visible = 0;
$this->version = 0;
}
@@ -705,72 +657,6 @@ abstract class Product implements ActiveRecordInterface
return $this->ref;
}
- /**
- * Get the [price] column value.
- *
- * @return double
- */
- public function getPrice()
- {
-
- return $this->price;
- }
-
- /**
- * Get the [price2] column value.
- *
- * @return double
- */
- public function getPrice2()
- {
-
- return $this->price2;
- }
-
- /**
- * Get the [ecotax] column value.
- *
- * @return double
- */
- public function getEcotax()
- {
-
- return $this->ecotax;
- }
-
- /**
- * Get the [newness] column value.
- *
- * @return int
- */
- public function getNewness()
- {
-
- return $this->newness;
- }
-
- /**
- * Get the [promo] column value.
- *
- * @return int
- */
- public function getPromo()
- {
-
- return $this->promo;
- }
-
- /**
- * Get the [quantity] column value.
- *
- * @return int
- */
- public function getQuantity()
- {
-
- return $this->quantity;
- }
-
/**
* Get the [visible] column value.
*
@@ -782,17 +668,6 @@ abstract class Product implements ActiveRecordInterface
return $this->visible;
}
- /**
- * Get the [weight] column value.
- *
- * @return double
- */
- public function getWeight()
- {
-
- return $this->weight;
- }
-
/**
* Get the [position] column value.
*
@@ -953,132 +828,6 @@ abstract class Product implements ActiveRecordInterface
return $this;
} // setRef()
- /**
- * Set the value of [price] column.
- *
- * @param double $v new value
- * @return \Thelia\Model\Product The current object (for fluent API support)
- */
- public function setPrice($v)
- {
- if ($v !== null) {
- $v = (double) $v;
- }
-
- if ($this->price !== $v) {
- $this->price = $v;
- $this->modifiedColumns[] = ProductTableMap::PRICE;
- }
-
-
- return $this;
- } // setPrice()
-
- /**
- * Set the value of [price2] column.
- *
- * @param double $v new value
- * @return \Thelia\Model\Product The current object (for fluent API support)
- */
- public function setPrice2($v)
- {
- if ($v !== null) {
- $v = (double) $v;
- }
-
- if ($this->price2 !== $v) {
- $this->price2 = $v;
- $this->modifiedColumns[] = ProductTableMap::PRICE2;
- }
-
-
- return $this;
- } // setPrice2()
-
- /**
- * Set the value of [ecotax] column.
- *
- * @param double $v new value
- * @return \Thelia\Model\Product The current object (for fluent API support)
- */
- public function setEcotax($v)
- {
- if ($v !== null) {
- $v = (double) $v;
- }
-
- if ($this->ecotax !== $v) {
- $this->ecotax = $v;
- $this->modifiedColumns[] = ProductTableMap::ECOTAX;
- }
-
-
- return $this;
- } // setEcotax()
-
- /**
- * Set the value of [newness] column.
- *
- * @param int $v new value
- * @return \Thelia\Model\Product The current object (for fluent API support)
- */
- public function setNewness($v)
- {
- if ($v !== null) {
- $v = (int) $v;
- }
-
- if ($this->newness !== $v) {
- $this->newness = $v;
- $this->modifiedColumns[] = ProductTableMap::NEWNESS;
- }
-
-
- return $this;
- } // setNewness()
-
- /**
- * Set the value of [promo] column.
- *
- * @param int $v new value
- * @return \Thelia\Model\Product The current object (for fluent API support)
- */
- public function setPromo($v)
- {
- if ($v !== null) {
- $v = (int) $v;
- }
-
- if ($this->promo !== $v) {
- $this->promo = $v;
- $this->modifiedColumns[] = ProductTableMap::PROMO;
- }
-
-
- return $this;
- } // setPromo()
-
- /**
- * Set the value of [quantity] column.
- *
- * @param int $v new value
- * @return \Thelia\Model\Product The current object (for fluent API support)
- */
- public function setQuantity($v)
- {
- if ($v !== null) {
- $v = (int) $v;
- }
-
- if ($this->quantity !== $v) {
- $this->quantity = $v;
- $this->modifiedColumns[] = ProductTableMap::QUANTITY;
- }
-
-
- return $this;
- } // setQuantity()
-
/**
* Set the value of [visible] column.
*
@@ -1100,27 +849,6 @@ abstract class Product implements ActiveRecordInterface
return $this;
} // setVisible()
- /**
- * Set the value of [weight] column.
- *
- * @param double $v new value
- * @return \Thelia\Model\Product The current object (for fluent API support)
- */
- public function setWeight($v)
- {
- if ($v !== null) {
- $v = (double) $v;
- }
-
- if ($this->weight !== $v) {
- $this->weight = $v;
- $this->modifiedColumns[] = ProductTableMap::WEIGHT;
- }
-
-
- return $this;
- } // setWeight()
-
/**
* Set the value of [position] column.
*
@@ -1257,18 +985,6 @@ abstract class Product implements ActiveRecordInterface
*/
public function hasOnlyDefaultValues()
{
- if ($this->newness !== 0) {
- return false;
- }
-
- if ($this->promo !== 0) {
- return false;
- }
-
- if ($this->quantity !== 0) {
- return false;
- }
-
if ($this->visible !== 0) {
return false;
}
@@ -1313,55 +1029,34 @@ abstract class Product implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProductTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)];
$this->ref = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductTableMap::translateFieldName('Price', TableMap::TYPE_PHPNAME, $indexType)];
- $this->price = (null !== $col) ? (double) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductTableMap::translateFieldName('Price2', TableMap::TYPE_PHPNAME, $indexType)];
- $this->price2 = (null !== $col) ? (double) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductTableMap::translateFieldName('Ecotax', TableMap::TYPE_PHPNAME, $indexType)];
- $this->ecotax = (null !== $col) ? (double) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductTableMap::translateFieldName('Newness', TableMap::TYPE_PHPNAME, $indexType)];
- $this->newness = (null !== $col) ? (int) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductTableMap::translateFieldName('Promo', TableMap::TYPE_PHPNAME, $indexType)];
- $this->promo = (null !== $col) ? (int) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductTableMap::translateFieldName('Quantity', TableMap::TYPE_PHPNAME, $indexType)];
- $this->quantity = (null !== $col) ? (int) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductTableMap::translateFieldName('Visible', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductTableMap::translateFieldName('Visible', TableMap::TYPE_PHPNAME, $indexType)];
$this->visible = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : ProductTableMap::translateFieldName('Weight', TableMap::TYPE_PHPNAME, $indexType)];
- $this->weight = (null !== $col) ? (double) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : ProductTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
$this->position = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : ProductTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductTableMap::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 ? 13 + $startcol : ProductTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->updated_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : ProductTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
$this->version = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : ProductTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->version_created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : ProductTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
$this->version_created_by = (null !== $col) ? (string) $col : null;
$this->resetModified();
@@ -1371,7 +1066,7 @@ abstract class Product implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 17; // 17 = ProductTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 10; // 10 = ProductTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\Product object", 0, $e);
@@ -1438,9 +1133,9 @@ abstract class Product implements ActiveRecordInterface
$this->aTaxRule = null;
$this->collProductCategories = null;
- $this->collFeatureProds = null;
+ $this->collFeatureProducts = null;
- $this->collStocks = null;
+ $this->collProductSaleElementss = null;
$this->collContentAssocs = null;
@@ -1718,34 +1413,34 @@ abstract class Product implements ActiveRecordInterface
}
}
- if ($this->featureProdsScheduledForDeletion !== null) {
- if (!$this->featureProdsScheduledForDeletion->isEmpty()) {
- \Thelia\Model\FeatureProdQuery::create()
- ->filterByPrimaryKeys($this->featureProdsScheduledForDeletion->getPrimaryKeys(false))
+ if ($this->featureProductsScheduledForDeletion !== null) {
+ if (!$this->featureProductsScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\FeatureProductQuery::create()
+ ->filterByPrimaryKeys($this->featureProductsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
- $this->featureProdsScheduledForDeletion = null;
+ $this->featureProductsScheduledForDeletion = null;
}
}
- if ($this->collFeatureProds !== null) {
- foreach ($this->collFeatureProds as $referrerFK) {
+ if ($this->collFeatureProducts !== null) {
+ foreach ($this->collFeatureProducts as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
- if ($this->stocksScheduledForDeletion !== null) {
- if (!$this->stocksScheduledForDeletion->isEmpty()) {
- \Thelia\Model\StockQuery::create()
- ->filterByPrimaryKeys($this->stocksScheduledForDeletion->getPrimaryKeys(false))
+ if ($this->productSaleElementssScheduledForDeletion !== null) {
+ if (!$this->productSaleElementssScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\ProductSaleElementsQuery::create()
+ ->filterByPrimaryKeys($this->productSaleElementssScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
- $this->stocksScheduledForDeletion = null;
+ $this->productSaleElementssScheduledForDeletion = null;
}
}
- if ($this->collStocks !== null) {
- foreach ($this->collStocks as $referrerFK) {
+ if ($this->collProductSaleElementss !== null) {
+ foreach ($this->collProductSaleElementss as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
@@ -1940,30 +1635,9 @@ abstract class Product implements ActiveRecordInterface
if ($this->isColumnModified(ProductTableMap::REF)) {
$modifiedColumns[':p' . $index++] = 'REF';
}
- if ($this->isColumnModified(ProductTableMap::PRICE)) {
- $modifiedColumns[':p' . $index++] = 'PRICE';
- }
- if ($this->isColumnModified(ProductTableMap::PRICE2)) {
- $modifiedColumns[':p' . $index++] = 'PRICE2';
- }
- if ($this->isColumnModified(ProductTableMap::ECOTAX)) {
- $modifiedColumns[':p' . $index++] = 'ECOTAX';
- }
- if ($this->isColumnModified(ProductTableMap::NEWNESS)) {
- $modifiedColumns[':p' . $index++] = 'NEWNESS';
- }
- if ($this->isColumnModified(ProductTableMap::PROMO)) {
- $modifiedColumns[':p' . $index++] = 'PROMO';
- }
- if ($this->isColumnModified(ProductTableMap::QUANTITY)) {
- $modifiedColumns[':p' . $index++] = 'QUANTITY';
- }
if ($this->isColumnModified(ProductTableMap::VISIBLE)) {
$modifiedColumns[':p' . $index++] = 'VISIBLE';
}
- if ($this->isColumnModified(ProductTableMap::WEIGHT)) {
- $modifiedColumns[':p' . $index++] = 'WEIGHT';
- }
if ($this->isColumnModified(ProductTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION';
}
@@ -2002,30 +1676,9 @@ abstract class Product implements ActiveRecordInterface
case 'REF':
$stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR);
break;
- case 'PRICE':
- $stmt->bindValue($identifier, $this->price, PDO::PARAM_STR);
- break;
- case 'PRICE2':
- $stmt->bindValue($identifier, $this->price2, PDO::PARAM_STR);
- break;
- case 'ECOTAX':
- $stmt->bindValue($identifier, $this->ecotax, PDO::PARAM_STR);
- break;
- case 'NEWNESS':
- $stmt->bindValue($identifier, $this->newness, PDO::PARAM_INT);
- break;
- case 'PROMO':
- $stmt->bindValue($identifier, $this->promo, PDO::PARAM_INT);
- break;
- case 'QUANTITY':
- $stmt->bindValue($identifier, $this->quantity, PDO::PARAM_INT);
- break;
case 'VISIBLE':
$stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT);
break;
- case 'WEIGHT':
- $stmt->bindValue($identifier, $this->weight, PDO::PARAM_STR);
- break;
case 'POSITION':
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
break;
@@ -2116,45 +1769,24 @@ abstract class Product implements ActiveRecordInterface
return $this->getRef();
break;
case 3:
- return $this->getPrice();
- break;
- case 4:
- return $this->getPrice2();
- break;
- case 5:
- return $this->getEcotax();
- break;
- case 6:
- return $this->getNewness();
- break;
- case 7:
- return $this->getPromo();
- break;
- case 8:
- return $this->getQuantity();
- break;
- case 9:
return $this->getVisible();
break;
- case 10:
- return $this->getWeight();
- break;
- case 11:
+ case 4:
return $this->getPosition();
break;
- case 12:
+ case 5:
return $this->getCreatedAt();
break;
- case 13:
+ case 6:
return $this->getUpdatedAt();
break;
- case 14:
+ case 7:
return $this->getVersion();
break;
- case 15:
+ case 8:
return $this->getVersionCreatedAt();
break;
- case 16:
+ case 9:
return $this->getVersionCreatedBy();
break;
default:
@@ -2189,20 +1821,13 @@ abstract class Product implements ActiveRecordInterface
$keys[0] => $this->getId(),
$keys[1] => $this->getTaxRuleId(),
$keys[2] => $this->getRef(),
- $keys[3] => $this->getPrice(),
- $keys[4] => $this->getPrice2(),
- $keys[5] => $this->getEcotax(),
- $keys[6] => $this->getNewness(),
- $keys[7] => $this->getPromo(),
- $keys[8] => $this->getQuantity(),
- $keys[9] => $this->getVisible(),
- $keys[10] => $this->getWeight(),
- $keys[11] => $this->getPosition(),
- $keys[12] => $this->getCreatedAt(),
- $keys[13] => $this->getUpdatedAt(),
- $keys[14] => $this->getVersion(),
- $keys[15] => $this->getVersionCreatedAt(),
- $keys[16] => $this->getVersionCreatedBy(),
+ $keys[3] => $this->getVisible(),
+ $keys[4] => $this->getPosition(),
+ $keys[5] => $this->getCreatedAt(),
+ $keys[6] => $this->getUpdatedAt(),
+ $keys[7] => $this->getVersion(),
+ $keys[8] => $this->getVersionCreatedAt(),
+ $keys[9] => $this->getVersionCreatedBy(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -2217,11 +1842,11 @@ abstract class Product implements ActiveRecordInterface
if (null !== $this->collProductCategories) {
$result['ProductCategories'] = $this->collProductCategories->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
- if (null !== $this->collFeatureProds) {
- $result['FeatureProds'] = $this->collFeatureProds->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ if (null !== $this->collFeatureProducts) {
+ $result['FeatureProducts'] = $this->collFeatureProducts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
- if (null !== $this->collStocks) {
- $result['Stocks'] = $this->collStocks->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ if (null !== $this->collProductSaleElementss) {
+ $result['ProductSaleElementss'] = $this->collProductSaleElementss->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collContentAssocs) {
$result['ContentAssocs'] = $this->collContentAssocs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
@@ -2294,45 +1919,24 @@ abstract class Product implements ActiveRecordInterface
$this->setRef($value);
break;
case 3:
- $this->setPrice($value);
- break;
- case 4:
- $this->setPrice2($value);
- break;
- case 5:
- $this->setEcotax($value);
- break;
- case 6:
- $this->setNewness($value);
- break;
- case 7:
- $this->setPromo($value);
- break;
- case 8:
- $this->setQuantity($value);
- break;
- case 9:
$this->setVisible($value);
break;
- case 10:
- $this->setWeight($value);
- break;
- case 11:
+ case 4:
$this->setPosition($value);
break;
- case 12:
+ case 5:
$this->setCreatedAt($value);
break;
- case 13:
+ case 6:
$this->setUpdatedAt($value);
break;
- case 14:
+ case 7:
$this->setVersion($value);
break;
- case 15:
+ case 8:
$this->setVersionCreatedAt($value);
break;
- case 16:
+ case 9:
$this->setVersionCreatedBy($value);
break;
} // switch()
@@ -2362,20 +1966,13 @@ abstract class Product implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setTaxRuleId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setRef($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setPrice($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setPrice2($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setEcotax($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setNewness($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setPromo($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setQuantity($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setVisible($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setWeight($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setPosition($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setCreatedAt($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setUpdatedAt($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setVersion($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setVersionCreatedAt($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setVersionCreatedBy($arr[$keys[16]]);
+ if (array_key_exists($keys[3], $arr)) $this->setVisible($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setPosition($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
+ if (array_key_exists($keys[7], $arr)) $this->setVersion($arr[$keys[7]]);
+ if (array_key_exists($keys[8], $arr)) $this->setVersionCreatedAt($arr[$keys[8]]);
+ if (array_key_exists($keys[9], $arr)) $this->setVersionCreatedBy($arr[$keys[9]]);
}
/**
@@ -2390,14 +1987,7 @@ abstract class Product implements ActiveRecordInterface
if ($this->isColumnModified(ProductTableMap::ID)) $criteria->add(ProductTableMap::ID, $this->id);
if ($this->isColumnModified(ProductTableMap::TAX_RULE_ID)) $criteria->add(ProductTableMap::TAX_RULE_ID, $this->tax_rule_id);
if ($this->isColumnModified(ProductTableMap::REF)) $criteria->add(ProductTableMap::REF, $this->ref);
- if ($this->isColumnModified(ProductTableMap::PRICE)) $criteria->add(ProductTableMap::PRICE, $this->price);
- if ($this->isColumnModified(ProductTableMap::PRICE2)) $criteria->add(ProductTableMap::PRICE2, $this->price2);
- if ($this->isColumnModified(ProductTableMap::ECOTAX)) $criteria->add(ProductTableMap::ECOTAX, $this->ecotax);
- if ($this->isColumnModified(ProductTableMap::NEWNESS)) $criteria->add(ProductTableMap::NEWNESS, $this->newness);
- if ($this->isColumnModified(ProductTableMap::PROMO)) $criteria->add(ProductTableMap::PROMO, $this->promo);
- if ($this->isColumnModified(ProductTableMap::QUANTITY)) $criteria->add(ProductTableMap::QUANTITY, $this->quantity);
if ($this->isColumnModified(ProductTableMap::VISIBLE)) $criteria->add(ProductTableMap::VISIBLE, $this->visible);
- if ($this->isColumnModified(ProductTableMap::WEIGHT)) $criteria->add(ProductTableMap::WEIGHT, $this->weight);
if ($this->isColumnModified(ProductTableMap::POSITION)) $criteria->add(ProductTableMap::POSITION, $this->position);
if ($this->isColumnModified(ProductTableMap::CREATED_AT)) $criteria->add(ProductTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(ProductTableMap::UPDATED_AT)) $criteria->add(ProductTableMap::UPDATED_AT, $this->updated_at);
@@ -2469,14 +2059,7 @@ abstract class Product implements ActiveRecordInterface
{
$copyObj->setTaxRuleId($this->getTaxRuleId());
$copyObj->setRef($this->getRef());
- $copyObj->setPrice($this->getPrice());
- $copyObj->setPrice2($this->getPrice2());
- $copyObj->setEcotax($this->getEcotax());
- $copyObj->setNewness($this->getNewness());
- $copyObj->setPromo($this->getPromo());
- $copyObj->setQuantity($this->getQuantity());
$copyObj->setVisible($this->getVisible());
- $copyObj->setWeight($this->getWeight());
$copyObj->setPosition($this->getPosition());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -2495,15 +2078,15 @@ abstract class Product implements ActiveRecordInterface
}
}
- foreach ($this->getFeatureProds() as $relObj) {
+ foreach ($this->getFeatureProducts() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
- $copyObj->addFeatureProd($relObj->copy($deepCopy));
+ $copyObj->addFeatureProduct($relObj->copy($deepCopy));
}
}
- foreach ($this->getStocks() as $relObj) {
+ foreach ($this->getProductSaleElementss() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
- $copyObj->addStock($relObj->copy($deepCopy));
+ $copyObj->addProductSaleElements($relObj->copy($deepCopy));
}
}
@@ -2656,11 +2239,11 @@ abstract class Product implements ActiveRecordInterface
if ('ProductCategory' == $relationName) {
return $this->initProductCategories();
}
- if ('FeatureProd' == $relationName) {
- return $this->initFeatureProds();
+ if ('FeatureProduct' == $relationName) {
+ return $this->initFeatureProducts();
}
- if ('Stock' == $relationName) {
- return $this->initStocks();
+ if ('ProductSaleElements' == $relationName) {
+ return $this->initProductSaleElementss();
}
if ('ContentAssoc' == $relationName) {
return $this->initContentAssocs();
@@ -2938,31 +2521,31 @@ abstract class Product implements ActiveRecordInterface
}
/**
- * Clears out the collFeatureProds collection
+ * Clears out the collFeatureProducts 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 addFeatureProds()
+ * @see addFeatureProducts()
*/
- public function clearFeatureProds()
+ public function clearFeatureProducts()
{
- $this->collFeatureProds = null; // important to set this to NULL since that means it is uninitialized
+ $this->collFeatureProducts = null; // important to set this to NULL since that means it is uninitialized
}
/**
- * Reset is the collFeatureProds collection loaded partially.
+ * Reset is the collFeatureProducts collection loaded partially.
*/
- public function resetPartialFeatureProds($v = true)
+ public function resetPartialFeatureProducts($v = true)
{
- $this->collFeatureProdsPartial = $v;
+ $this->collFeatureProductsPartial = $v;
}
/**
- * Initializes the collFeatureProds collection.
+ * Initializes the collFeatureProducts collection.
*
- * By default this just sets the collFeatureProds collection to an empty array (like clearcollFeatureProds());
+ * By default this just sets the collFeatureProducts collection to an empty array (like clearcollFeatureProducts());
* 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.
*
@@ -2971,17 +2554,17 @@ abstract class Product implements ActiveRecordInterface
*
* @return void
*/
- public function initFeatureProds($overrideExisting = true)
+ public function initFeatureProducts($overrideExisting = true)
{
- if (null !== $this->collFeatureProds && !$overrideExisting) {
+ if (null !== $this->collFeatureProducts && !$overrideExisting) {
return;
}
- $this->collFeatureProds = new ObjectCollection();
- $this->collFeatureProds->setModel('\Thelia\Model\FeatureProd');
+ $this->collFeatureProducts = new ObjectCollection();
+ $this->collFeatureProducts->setModel('\Thelia\Model\FeatureProduct');
}
/**
- * Gets an array of ChildFeatureProd objects which contain a foreign key that references this object.
+ * Gets an array of ChildFeatureProduct 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.
@@ -2991,109 +2574,109 @@ abstract class Product implements ActiveRecordInterface
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
- * @return Collection|ChildFeatureProd[] List of ChildFeatureProd objects
+ * @return Collection|ChildFeatureProduct[] List of ChildFeatureProduct objects
* @throws PropelException
*/
- public function getFeatureProds($criteria = null, ConnectionInterface $con = null)
+ public function getFeatureProducts($criteria = null, ConnectionInterface $con = null)
{
- $partial = $this->collFeatureProdsPartial && !$this->isNew();
- if (null === $this->collFeatureProds || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collFeatureProds) {
+ $partial = $this->collFeatureProductsPartial && !$this->isNew();
+ if (null === $this->collFeatureProducts || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collFeatureProducts) {
// return empty collection
- $this->initFeatureProds();
+ $this->initFeatureProducts();
} else {
- $collFeatureProds = ChildFeatureProdQuery::create(null, $criteria)
+ $collFeatureProducts = ChildFeatureProductQuery::create(null, $criteria)
->filterByProduct($this)
->find($con);
if (null !== $criteria) {
- if (false !== $this->collFeatureProdsPartial && count($collFeatureProds)) {
- $this->initFeatureProds(false);
+ if (false !== $this->collFeatureProductsPartial && count($collFeatureProducts)) {
+ $this->initFeatureProducts(false);
- foreach ($collFeatureProds as $obj) {
- if (false == $this->collFeatureProds->contains($obj)) {
- $this->collFeatureProds->append($obj);
+ foreach ($collFeatureProducts as $obj) {
+ if (false == $this->collFeatureProducts->contains($obj)) {
+ $this->collFeatureProducts->append($obj);
}
}
- $this->collFeatureProdsPartial = true;
+ $this->collFeatureProductsPartial = true;
}
- $collFeatureProds->getInternalIterator()->rewind();
+ $collFeatureProducts->getInternalIterator()->rewind();
- return $collFeatureProds;
+ return $collFeatureProducts;
}
- if ($partial && $this->collFeatureProds) {
- foreach ($this->collFeatureProds as $obj) {
+ if ($partial && $this->collFeatureProducts) {
+ foreach ($this->collFeatureProducts as $obj) {
if ($obj->isNew()) {
- $collFeatureProds[] = $obj;
+ $collFeatureProducts[] = $obj;
}
}
}
- $this->collFeatureProds = $collFeatureProds;
- $this->collFeatureProdsPartial = false;
+ $this->collFeatureProducts = $collFeatureProducts;
+ $this->collFeatureProductsPartial = false;
}
}
- return $this->collFeatureProds;
+ return $this->collFeatureProducts;
}
/**
- * Sets a collection of FeatureProd objects related by a one-to-many relationship
+ * Sets a collection of FeatureProduct 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 $featureProds A Propel collection.
+ * @param Collection $featureProducts A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildProduct The current object (for fluent API support)
*/
- public function setFeatureProds(Collection $featureProds, ConnectionInterface $con = null)
+ public function setFeatureProducts(Collection $featureProducts, ConnectionInterface $con = null)
{
- $featureProdsToDelete = $this->getFeatureProds(new Criteria(), $con)->diff($featureProds);
+ $featureProductsToDelete = $this->getFeatureProducts(new Criteria(), $con)->diff($featureProducts);
- $this->featureProdsScheduledForDeletion = $featureProdsToDelete;
+ $this->featureProductsScheduledForDeletion = $featureProductsToDelete;
- foreach ($featureProdsToDelete as $featureProdRemoved) {
- $featureProdRemoved->setProduct(null);
+ foreach ($featureProductsToDelete as $featureProductRemoved) {
+ $featureProductRemoved->setProduct(null);
}
- $this->collFeatureProds = null;
- foreach ($featureProds as $featureProd) {
- $this->addFeatureProd($featureProd);
+ $this->collFeatureProducts = null;
+ foreach ($featureProducts as $featureProduct) {
+ $this->addFeatureProduct($featureProduct);
}
- $this->collFeatureProds = $featureProds;
- $this->collFeatureProdsPartial = false;
+ $this->collFeatureProducts = $featureProducts;
+ $this->collFeatureProductsPartial = false;
return $this;
}
/**
- * Returns the number of related FeatureProd objects.
+ * Returns the number of related FeatureProduct objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
- * @return int Count of related FeatureProd objects.
+ * @return int Count of related FeatureProduct objects.
* @throws PropelException
*/
- public function countFeatureProds(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ public function countFeatureProducts(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
- $partial = $this->collFeatureProdsPartial && !$this->isNew();
- if (null === $this->collFeatureProds || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collFeatureProds) {
+ $partial = $this->collFeatureProductsPartial && !$this->isNew();
+ if (null === $this->collFeatureProducts || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collFeatureProducts) {
return 0;
}
if ($partial && !$criteria) {
- return count($this->getFeatureProds());
+ return count($this->getFeatureProducts());
}
- $query = ChildFeatureProdQuery::create(null, $criteria);
+ $query = ChildFeatureProductQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
@@ -3103,53 +2686,53 @@ abstract class Product implements ActiveRecordInterface
->count($con);
}
- return count($this->collFeatureProds);
+ return count($this->collFeatureProducts);
}
/**
- * Method called to associate a ChildFeatureProd object to this object
- * through the ChildFeatureProd foreign key attribute.
+ * Method called to associate a ChildFeatureProduct object to this object
+ * through the ChildFeatureProduct foreign key attribute.
*
- * @param ChildFeatureProd $l ChildFeatureProd
+ * @param ChildFeatureProduct $l ChildFeatureProduct
* @return \Thelia\Model\Product The current object (for fluent API support)
*/
- public function addFeatureProd(ChildFeatureProd $l)
+ public function addFeatureProduct(ChildFeatureProduct $l)
{
- if ($this->collFeatureProds === null) {
- $this->initFeatureProds();
- $this->collFeatureProdsPartial = true;
+ if ($this->collFeatureProducts === null) {
+ $this->initFeatureProducts();
+ $this->collFeatureProductsPartial = true;
}
- if (!in_array($l, $this->collFeatureProds->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
- $this->doAddFeatureProd($l);
+ if (!in_array($l, $this->collFeatureProducts->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddFeatureProduct($l);
}
return $this;
}
/**
- * @param FeatureProd $featureProd The featureProd object to add.
+ * @param FeatureProduct $featureProduct The featureProduct object to add.
*/
- protected function doAddFeatureProd($featureProd)
+ protected function doAddFeatureProduct($featureProduct)
{
- $this->collFeatureProds[]= $featureProd;
- $featureProd->setProduct($this);
+ $this->collFeatureProducts[]= $featureProduct;
+ $featureProduct->setProduct($this);
}
/**
- * @param FeatureProd $featureProd The featureProd object to remove.
+ * @param FeatureProduct $featureProduct The featureProduct object to remove.
* @return ChildProduct The current object (for fluent API support)
*/
- public function removeFeatureProd($featureProd)
+ public function removeFeatureProduct($featureProduct)
{
- if ($this->getFeatureProds()->contains($featureProd)) {
- $this->collFeatureProds->remove($this->collFeatureProds->search($featureProd));
- if (null === $this->featureProdsScheduledForDeletion) {
- $this->featureProdsScheduledForDeletion = clone $this->collFeatureProds;
- $this->featureProdsScheduledForDeletion->clear();
+ if ($this->getFeatureProducts()->contains($featureProduct)) {
+ $this->collFeatureProducts->remove($this->collFeatureProducts->search($featureProduct));
+ if (null === $this->featureProductsScheduledForDeletion) {
+ $this->featureProductsScheduledForDeletion = clone $this->collFeatureProducts;
+ $this->featureProductsScheduledForDeletion->clear();
}
- $this->featureProdsScheduledForDeletion[]= clone $featureProd;
- $featureProd->setProduct(null);
+ $this->featureProductsScheduledForDeletion[]= clone $featureProduct;
+ $featureProduct->setProduct(null);
}
return $this;
@@ -3161,7 +2744,7 @@ abstract class Product implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this Product is new, it will return
* an empty collection; or if this Product has previously
- * been saved, it will retrieve related FeatureProds from storage.
+ * been saved, it will retrieve related FeatureProducts from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -3170,14 +2753,14 @@ abstract class Product implements ActiveRecordInterface
* @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|ChildFeatureProd[] List of ChildFeatureProd objects
+ * @return Collection|ChildFeatureProduct[] List of ChildFeatureProduct objects
*/
- public function getFeatureProdsJoinFeature($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getFeatureProductsJoinFeature($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
- $query = ChildFeatureProdQuery::create(null, $criteria);
+ $query = ChildFeatureProductQuery::create(null, $criteria);
$query->joinWith('Feature', $joinBehavior);
- return $this->getFeatureProds($query, $con);
+ return $this->getFeatureProducts($query, $con);
}
@@ -3186,7 +2769,7 @@ abstract class Product implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this Product is new, it will return
* an empty collection; or if this Product has previously
- * been saved, it will retrieve related FeatureProds from storage.
+ * been saved, it will retrieve related FeatureProducts from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -3195,42 +2778,42 @@ abstract class Product implements ActiveRecordInterface
* @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|ChildFeatureProd[] List of ChildFeatureProd objects
+ * @return Collection|ChildFeatureProduct[] List of ChildFeatureProduct objects
*/
- public function getFeatureProdsJoinFeatureAv($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getFeatureProductsJoinFeatureAv($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
- $query = ChildFeatureProdQuery::create(null, $criteria);
+ $query = ChildFeatureProductQuery::create(null, $criteria);
$query->joinWith('FeatureAv', $joinBehavior);
- return $this->getFeatureProds($query, $con);
+ return $this->getFeatureProducts($query, $con);
}
/**
- * Clears out the collStocks collection
+ * Clears out the collProductSaleElementss 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 addStocks()
+ * @see addProductSaleElementss()
*/
- public function clearStocks()
+ public function clearProductSaleElementss()
{
- $this->collStocks = null; // important to set this to NULL since that means it is uninitialized
+ $this->collProductSaleElementss = null; // important to set this to NULL since that means it is uninitialized
}
/**
- * Reset is the collStocks collection loaded partially.
+ * Reset is the collProductSaleElementss collection loaded partially.
*/
- public function resetPartialStocks($v = true)
+ public function resetPartialProductSaleElementss($v = true)
{
- $this->collStocksPartial = $v;
+ $this->collProductSaleElementssPartial = $v;
}
/**
- * Initializes the collStocks collection.
+ * Initializes the collProductSaleElementss collection.
*
- * By default this just sets the collStocks collection to an empty array (like clearcollStocks());
+ * By default this just sets the collProductSaleElementss collection to an empty array (like clearcollProductSaleElementss());
* 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.
*
@@ -3239,17 +2822,17 @@ abstract class Product implements ActiveRecordInterface
*
* @return void
*/
- public function initStocks($overrideExisting = true)
+ public function initProductSaleElementss($overrideExisting = true)
{
- if (null !== $this->collStocks && !$overrideExisting) {
+ if (null !== $this->collProductSaleElementss && !$overrideExisting) {
return;
}
- $this->collStocks = new ObjectCollection();
- $this->collStocks->setModel('\Thelia\Model\Stock');
+ $this->collProductSaleElementss = new ObjectCollection();
+ $this->collProductSaleElementss->setModel('\Thelia\Model\ProductSaleElements');
}
/**
- * Gets an array of ChildStock objects which contain a foreign key that references this object.
+ * Gets an array of ChildProductSaleElements 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.
@@ -3259,109 +2842,109 @@ abstract class Product implements ActiveRecordInterface
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
- * @return Collection|ChildStock[] List of ChildStock objects
+ * @return Collection|ChildProductSaleElements[] List of ChildProductSaleElements objects
* @throws PropelException
*/
- public function getStocks($criteria = null, ConnectionInterface $con = null)
+ public function getProductSaleElementss($criteria = null, ConnectionInterface $con = null)
{
- $partial = $this->collStocksPartial && !$this->isNew();
- if (null === $this->collStocks || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collStocks) {
+ $partial = $this->collProductSaleElementssPartial && !$this->isNew();
+ if (null === $this->collProductSaleElementss || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collProductSaleElementss) {
// return empty collection
- $this->initStocks();
+ $this->initProductSaleElementss();
} else {
- $collStocks = ChildStockQuery::create(null, $criteria)
+ $collProductSaleElementss = ChildProductSaleElementsQuery::create(null, $criteria)
->filterByProduct($this)
->find($con);
if (null !== $criteria) {
- if (false !== $this->collStocksPartial && count($collStocks)) {
- $this->initStocks(false);
+ if (false !== $this->collProductSaleElementssPartial && count($collProductSaleElementss)) {
+ $this->initProductSaleElementss(false);
- foreach ($collStocks as $obj) {
- if (false == $this->collStocks->contains($obj)) {
- $this->collStocks->append($obj);
+ foreach ($collProductSaleElementss as $obj) {
+ if (false == $this->collProductSaleElementss->contains($obj)) {
+ $this->collProductSaleElementss->append($obj);
}
}
- $this->collStocksPartial = true;
+ $this->collProductSaleElementssPartial = true;
}
- $collStocks->getInternalIterator()->rewind();
+ $collProductSaleElementss->getInternalIterator()->rewind();
- return $collStocks;
+ return $collProductSaleElementss;
}
- if ($partial && $this->collStocks) {
- foreach ($this->collStocks as $obj) {
+ if ($partial && $this->collProductSaleElementss) {
+ foreach ($this->collProductSaleElementss as $obj) {
if ($obj->isNew()) {
- $collStocks[] = $obj;
+ $collProductSaleElementss[] = $obj;
}
}
}
- $this->collStocks = $collStocks;
- $this->collStocksPartial = false;
+ $this->collProductSaleElementss = $collProductSaleElementss;
+ $this->collProductSaleElementssPartial = false;
}
}
- return $this->collStocks;
+ return $this->collProductSaleElementss;
}
/**
- * Sets a collection of Stock objects related by a one-to-many relationship
+ * Sets a collection of ProductSaleElements 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 $stocks A Propel collection.
+ * @param Collection $productSaleElementss A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildProduct The current object (for fluent API support)
*/
- public function setStocks(Collection $stocks, ConnectionInterface $con = null)
+ public function setProductSaleElementss(Collection $productSaleElementss, ConnectionInterface $con = null)
{
- $stocksToDelete = $this->getStocks(new Criteria(), $con)->diff($stocks);
+ $productSaleElementssToDelete = $this->getProductSaleElementss(new Criteria(), $con)->diff($productSaleElementss);
- $this->stocksScheduledForDeletion = $stocksToDelete;
+ $this->productSaleElementssScheduledForDeletion = $productSaleElementssToDelete;
- foreach ($stocksToDelete as $stockRemoved) {
- $stockRemoved->setProduct(null);
+ foreach ($productSaleElementssToDelete as $productSaleElementsRemoved) {
+ $productSaleElementsRemoved->setProduct(null);
}
- $this->collStocks = null;
- foreach ($stocks as $stock) {
- $this->addStock($stock);
+ $this->collProductSaleElementss = null;
+ foreach ($productSaleElementss as $productSaleElements) {
+ $this->addProductSaleElements($productSaleElements);
}
- $this->collStocks = $stocks;
- $this->collStocksPartial = false;
+ $this->collProductSaleElementss = $productSaleElementss;
+ $this->collProductSaleElementssPartial = false;
return $this;
}
/**
- * Returns the number of related Stock objects.
+ * Returns the number of related ProductSaleElements objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
- * @return int Count of related Stock objects.
+ * @return int Count of related ProductSaleElements objects.
* @throws PropelException
*/
- public function countStocks(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ public function countProductSaleElementss(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
- $partial = $this->collStocksPartial && !$this->isNew();
- if (null === $this->collStocks || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collStocks) {
+ $partial = $this->collProductSaleElementssPartial && !$this->isNew();
+ if (null === $this->collProductSaleElementss || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collProductSaleElementss) {
return 0;
}
if ($partial && !$criteria) {
- return count($this->getStocks());
+ return count($this->getProductSaleElementss());
}
- $query = ChildStockQuery::create(null, $criteria);
+ $query = ChildProductSaleElementsQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
@@ -3371,83 +2954,58 @@ abstract class Product implements ActiveRecordInterface
->count($con);
}
- return count($this->collStocks);
+ return count($this->collProductSaleElementss);
}
/**
- * Method called to associate a ChildStock object to this object
- * through the ChildStock foreign key attribute.
+ * Method called to associate a ChildProductSaleElements object to this object
+ * through the ChildProductSaleElements foreign key attribute.
*
- * @param ChildStock $l ChildStock
+ * @param ChildProductSaleElements $l ChildProductSaleElements
* @return \Thelia\Model\Product The current object (for fluent API support)
*/
- public function addStock(ChildStock $l)
+ public function addProductSaleElements(ChildProductSaleElements $l)
{
- if ($this->collStocks === null) {
- $this->initStocks();
- $this->collStocksPartial = true;
+ if ($this->collProductSaleElementss === null) {
+ $this->initProductSaleElementss();
+ $this->collProductSaleElementssPartial = true;
}
- if (!in_array($l, $this->collStocks->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
- $this->doAddStock($l);
+ if (!in_array($l, $this->collProductSaleElementss->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddProductSaleElements($l);
}
return $this;
}
/**
- * @param Stock $stock The stock object to add.
+ * @param ProductSaleElements $productSaleElements The productSaleElements object to add.
*/
- protected function doAddStock($stock)
+ protected function doAddProductSaleElements($productSaleElements)
{
- $this->collStocks[]= $stock;
- $stock->setProduct($this);
+ $this->collProductSaleElementss[]= $productSaleElements;
+ $productSaleElements->setProduct($this);
}
/**
- * @param Stock $stock The stock object to remove.
+ * @param ProductSaleElements $productSaleElements The productSaleElements object to remove.
* @return ChildProduct The current object (for fluent API support)
*/
- public function removeStock($stock)
+ public function removeProductSaleElements($productSaleElements)
{
- if ($this->getStocks()->contains($stock)) {
- $this->collStocks->remove($this->collStocks->search($stock));
- if (null === $this->stocksScheduledForDeletion) {
- $this->stocksScheduledForDeletion = clone $this->collStocks;
- $this->stocksScheduledForDeletion->clear();
+ if ($this->getProductSaleElementss()->contains($productSaleElements)) {
+ $this->collProductSaleElementss->remove($this->collProductSaleElementss->search($productSaleElements));
+ if (null === $this->productSaleElementssScheduledForDeletion) {
+ $this->productSaleElementssScheduledForDeletion = clone $this->collProductSaleElementss;
+ $this->productSaleElementssScheduledForDeletion->clear();
}
- $this->stocksScheduledForDeletion[]= clone $stock;
- $stock->setProduct(null);
+ $this->productSaleElementssScheduledForDeletion[]= clone $productSaleElements;
+ $productSaleElements->setProduct(null);
}
return $this;
}
-
- /**
- * If this collection has already been initialized with
- * an identical criteria, it returns the collection.
- * Otherwise if this Product is new, it will return
- * an empty collection; or if this Product has previously
- * been saved, it will retrieve related Stocks 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 Product.
- *
- * @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|ChildStock[] List of ChildStock objects
- */
- public function getStocksJoinCombination($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
- {
- $query = ChildStockQuery::create(null, $criteria);
- $query->joinWith('Combination', $joinBehavior);
-
- return $this->getStocks($query, $con);
- }
-
/**
* Clears out the collContentAssocs collection
*
@@ -5291,10 +4849,10 @@ abstract class Product implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildCartItem[] List of ChildCartItem objects
*/
- public function getCartItemsJoinCombination($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ public function getCartItemsJoinProductSaleElements($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildCartItemQuery::create(null, $criteria);
- $query->joinWith('Combination', $joinBehavior);
+ $query->joinWith('ProductSaleElements', $joinBehavior);
return $this->getCartItems($query, $con);
}
@@ -6302,14 +5860,7 @@ abstract class Product implements ActiveRecordInterface
$this->id = null;
$this->tax_rule_id = null;
$this->ref = null;
- $this->price = null;
- $this->price2 = null;
- $this->ecotax = null;
- $this->newness = null;
- $this->promo = null;
- $this->quantity = null;
$this->visible = null;
- $this->weight = null;
$this->position = null;
$this->created_at = null;
$this->updated_at = null;
@@ -6341,13 +5892,13 @@ abstract class Product implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
- if ($this->collFeatureProds) {
- foreach ($this->collFeatureProds as $o) {
+ if ($this->collFeatureProducts) {
+ foreach ($this->collFeatureProducts as $o) {
$o->clearAllReferences($deep);
}
}
- if ($this->collStocks) {
- foreach ($this->collStocks as $o) {
+ if ($this->collProductSaleElementss) {
+ foreach ($this->collProductSaleElementss as $o) {
$o->clearAllReferences($deep);
}
}
@@ -6421,14 +5972,14 @@ abstract class Product implements ActiveRecordInterface
$this->collProductCategories->clearIterator();
}
$this->collProductCategories = null;
- if ($this->collFeatureProds instanceof Collection) {
- $this->collFeatureProds->clearIterator();
+ if ($this->collFeatureProducts instanceof Collection) {
+ $this->collFeatureProducts->clearIterator();
}
- $this->collFeatureProds = null;
- if ($this->collStocks instanceof Collection) {
- $this->collStocks->clearIterator();
+ $this->collFeatureProducts = null;
+ if ($this->collProductSaleElementss instanceof Collection) {
+ $this->collProductSaleElementss->clearIterator();
}
- $this->collStocks = null;
+ $this->collProductSaleElementss = null;
if ($this->collContentAssocs instanceof Collection) {
$this->collContentAssocs->clearIterator();
}
@@ -6750,14 +6301,7 @@ abstract class Product implements ActiveRecordInterface
$version->setId($this->getId());
$version->setTaxRuleId($this->getTaxRuleId());
$version->setRef($this->getRef());
- $version->setPrice($this->getPrice());
- $version->setPrice2($this->getPrice2());
- $version->setEcotax($this->getEcotax());
- $version->setNewness($this->getNewness());
- $version->setPromo($this->getPromo());
- $version->setQuantity($this->getQuantity());
$version->setVisible($this->getVisible());
- $version->setWeight($this->getWeight());
$version->setPosition($this->getPosition());
$version->setCreatedAt($this->getCreatedAt());
$version->setUpdatedAt($this->getUpdatedAt());
@@ -6804,14 +6348,7 @@ abstract class Product implements ActiveRecordInterface
$this->setId($version->getId());
$this->setTaxRuleId($version->getTaxRuleId());
$this->setRef($version->getRef());
- $this->setPrice($version->getPrice());
- $this->setPrice2($version->getPrice2());
- $this->setEcotax($version->getEcotax());
- $this->setNewness($version->getNewness());
- $this->setPromo($version->getPromo());
- $this->setQuantity($version->getQuantity());
$this->setVisible($version->getVisible());
- $this->setWeight($version->getWeight());
$this->setPosition($version->getPosition());
$this->setCreatedAt($version->getCreatedAt());
$this->setUpdatedAt($version->getUpdatedAt());
diff --git a/core/lib/Thelia/Model/Base/ProductCategory.php b/core/lib/Thelia/Model/Base/ProductCategory.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ProductCategoryQuery.php b/core/lib/Thelia/Model/Base/ProductCategoryQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ProductI18n.php b/core/lib/Thelia/Model/Base/ProductI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ProductI18nQuery.php b/core/lib/Thelia/Model/Base/ProductI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Stock.php b/core/lib/Thelia/Model/Base/ProductPrice.php
old mode 100755
new mode 100644
similarity index 73%
rename from core/lib/Thelia/Model/Base/Stock.php
rename to core/lib/Thelia/Model/Base/ProductPrice.php
index 73942ce83..dab6e47a4
--- a/core/lib/Thelia/Model/Base/Stock.php
+++ b/core/lib/Thelia/Model/Base/ProductPrice.php
@@ -16,20 +16,20 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
-use Thelia\Model\Combination as ChildCombination;
-use Thelia\Model\CombinationQuery as ChildCombinationQuery;
-use Thelia\Model\Product as ChildProduct;
-use Thelia\Model\ProductQuery as ChildProductQuery;
-use Thelia\Model\Stock as ChildStock;
-use Thelia\Model\StockQuery as ChildStockQuery;
-use Thelia\Model\Map\StockTableMap;
+use Thelia\Model\Currency as ChildCurrency;
+use Thelia\Model\CurrencyQuery as ChildCurrencyQuery;
+use Thelia\Model\ProductPrice as ChildProductPrice;
+use Thelia\Model\ProductPriceQuery as ChildProductPriceQuery;
+use Thelia\Model\ProductSaleElements as ChildProductSaleElements;
+use Thelia\Model\ProductSaleElementsQuery as ChildProductSaleElementsQuery;
+use Thelia\Model\Map\ProductPriceTableMap;
-abstract class Stock implements ActiveRecordInterface
+abstract class ProductPrice implements ActiveRecordInterface
{
/**
* TableMap class name
*/
- const TABLE_MAP = '\\Thelia\\Model\\Map\\StockTableMap';
+ const TABLE_MAP = '\\Thelia\\Model\\Map\\ProductPriceTableMap';
/**
@@ -65,28 +65,28 @@ abstract class Stock implements ActiveRecordInterface
protected $id;
/**
- * The value for the combination_id field.
+ * The value for the product_sale_elements_id field.
* @var int
*/
- protected $combination_id;
+ protected $product_sale_elements_id;
/**
- * The value for the product_id field.
+ * The value for the currency_id field.
* @var int
*/
- protected $product_id;
+ protected $currency_id;
/**
- * The value for the increase field.
+ * The value for the price field.
* @var double
*/
- protected $increase;
+ protected $price;
/**
- * The value for the quantity field.
+ * The value for the promo_price field.
* @var double
*/
- protected $quantity;
+ protected $promo_price;
/**
* The value for the created_at field.
@@ -101,14 +101,14 @@ abstract class Stock implements ActiveRecordInterface
protected $updated_at;
/**
- * @var Combination
+ * @var ProductSaleElements
*/
- protected $aCombination;
+ protected $aProductSaleElements;
/**
- * @var Product
+ * @var Currency
*/
- protected $aProduct;
+ protected $aCurrency;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -119,7 +119,7 @@ abstract class Stock implements ActiveRecordInterface
protected $alreadyInSave = false;
/**
- * Initializes internal state of Thelia\Model\Base\Stock object.
+ * Initializes internal state of Thelia\Model\Base\ProductPrice object.
*/
public function __construct()
{
@@ -214,9 +214,9 @@ abstract class Stock implements ActiveRecordInterface
}
/**
- * Compares this with another Stock instance. If
- * obj is an instance of Stock, delegates to
- * equals(Stock). Otherwise, returns false.
+ * Compares this with another ProductPrice instance. If
+ * obj is an instance of ProductPrice, delegates to
+ * equals(ProductPrice). Otherwise, returns false.
*
* @param obj The object to compare to.
* @return Whether equal to the object specified.
@@ -297,7 +297,7 @@ abstract class Stock implements ActiveRecordInterface
* @param string $name The virtual column name
* @param mixed $value The value to give to the virtual column
*
- * @return Stock The current object, for fluid interface
+ * @return ProductPrice The current object, for fluid interface
*/
public function setVirtualColumn($name, $value)
{
@@ -329,7 +329,7 @@ abstract class Stock implements ActiveRecordInterface
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
* @param string $data The source data to import from
*
- * @return Stock The current object, for fluid interface
+ * @return ProductPrice The current object, for fluid interface
*/
public function importFrom($parser, $data)
{
@@ -384,47 +384,47 @@ abstract class Stock implements ActiveRecordInterface
}
/**
- * Get the [combination_id] column value.
+ * Get the [product_sale_elements_id] column value.
*
* @return int
*/
- public function getCombinationId()
+ public function getProductSaleElementsId()
{
- return $this->combination_id;
+ return $this->product_sale_elements_id;
}
/**
- * Get the [product_id] column value.
+ * Get the [currency_id] column value.
*
* @return int
*/
- public function getProductId()
+ public function getCurrencyId()
{
- return $this->product_id;
+ return $this->currency_id;
}
/**
- * Get the [increase] column value.
+ * Get the [price] column value.
*
* @return double
*/
- public function getIncrease()
+ public function getPrice()
{
- return $this->increase;
+ return $this->price;
}
/**
- * Get the [quantity] column value.
+ * Get the [promo_price] column value.
*
* @return double
*/
- public function getQuantity()
+ public function getPromoPrice()
{
- return $this->quantity;
+ return $this->promo_price;
}
/**
@@ -471,7 +471,7 @@ abstract class Stock implements ActiveRecordInterface
* Set the value of [id] column.
*
* @param int $v new value
- * @return \Thelia\Model\Stock The current object (for fluent API support)
+ * @return \Thelia\Model\ProductPrice The current object (for fluent API support)
*/
public function setId($v)
{
@@ -481,7 +481,7 @@ abstract class Stock implements ActiveRecordInterface
if ($this->id !== $v) {
$this->id = $v;
- $this->modifiedColumns[] = StockTableMap::ID;
+ $this->modifiedColumns[] = ProductPriceTableMap::ID;
}
@@ -489,103 +489,103 @@ abstract class Stock implements ActiveRecordInterface
} // setId()
/**
- * Set the value of [combination_id] column.
+ * Set the value of [product_sale_elements_id] column.
*
* @param int $v new value
- * @return \Thelia\Model\Stock The current object (for fluent API support)
+ * @return \Thelia\Model\ProductPrice The current object (for fluent API support)
*/
- public function setCombinationId($v)
+ public function setProductSaleElementsId($v)
{
if ($v !== null) {
$v = (int) $v;
}
- if ($this->combination_id !== $v) {
- $this->combination_id = $v;
- $this->modifiedColumns[] = StockTableMap::COMBINATION_ID;
+ if ($this->product_sale_elements_id !== $v) {
+ $this->product_sale_elements_id = $v;
+ $this->modifiedColumns[] = ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID;
}
- if ($this->aCombination !== null && $this->aCombination->getId() !== $v) {
- $this->aCombination = null;
+ if ($this->aProductSaleElements !== null && $this->aProductSaleElements->getId() !== $v) {
+ $this->aProductSaleElements = null;
}
return $this;
- } // setCombinationId()
+ } // setProductSaleElementsId()
/**
- * Set the value of [product_id] column.
+ * Set the value of [currency_id] column.
*
* @param int $v new value
- * @return \Thelia\Model\Stock The current object (for fluent API support)
+ * @return \Thelia\Model\ProductPrice The current object (for fluent API support)
*/
- public function setProductId($v)
+ public function setCurrencyId($v)
{
if ($v !== null) {
$v = (int) $v;
}
- if ($this->product_id !== $v) {
- $this->product_id = $v;
- $this->modifiedColumns[] = StockTableMap::PRODUCT_ID;
+ if ($this->currency_id !== $v) {
+ $this->currency_id = $v;
+ $this->modifiedColumns[] = ProductPriceTableMap::CURRENCY_ID;
}
- if ($this->aProduct !== null && $this->aProduct->getId() !== $v) {
- $this->aProduct = null;
+ if ($this->aCurrency !== null && $this->aCurrency->getId() !== $v) {
+ $this->aCurrency = null;
}
return $this;
- } // setProductId()
+ } // setCurrencyId()
/**
- * Set the value of [increase] column.
+ * Set the value of [price] column.
*
* @param double $v new value
- * @return \Thelia\Model\Stock The current object (for fluent API support)
+ * @return \Thelia\Model\ProductPrice The current object (for fluent API support)
*/
- public function setIncrease($v)
+ public function setPrice($v)
{
if ($v !== null) {
$v = (double) $v;
}
- if ($this->increase !== $v) {
- $this->increase = $v;
- $this->modifiedColumns[] = StockTableMap::INCREASE;
+ if ($this->price !== $v) {
+ $this->price = $v;
+ $this->modifiedColumns[] = ProductPriceTableMap::PRICE;
}
return $this;
- } // setIncrease()
+ } // setPrice()
/**
- * Set the value of [quantity] column.
+ * Set the value of [promo_price] column.
*
* @param double $v new value
- * @return \Thelia\Model\Stock The current object (for fluent API support)
+ * @return \Thelia\Model\ProductPrice The current object (for fluent API support)
*/
- public function setQuantity($v)
+ public function setPromoPrice($v)
{
if ($v !== null) {
$v = (double) $v;
}
- if ($this->quantity !== $v) {
- $this->quantity = $v;
- $this->modifiedColumns[] = StockTableMap::QUANTITY;
+ if ($this->promo_price !== $v) {
+ $this->promo_price = $v;
+ $this->modifiedColumns[] = ProductPriceTableMap::PROMO_PRICE;
}
return $this;
- } // setQuantity()
+ } // setPromoPrice()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
- * @return \Thelia\Model\Stock The current object (for fluent API support)
+ * @return \Thelia\Model\ProductPrice The current object (for fluent API support)
*/
public function setCreatedAt($v)
{
@@ -593,7 +593,7 @@ abstract class Stock implements ActiveRecordInterface
if ($this->created_at !== null || $dt !== null) {
if ($dt !== $this->created_at) {
$this->created_at = $dt;
- $this->modifiedColumns[] = StockTableMap::CREATED_AT;
+ $this->modifiedColumns[] = ProductPriceTableMap::CREATED_AT;
}
} // if either are not null
@@ -606,7 +606,7 @@ abstract class Stock implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
- * @return \Thelia\Model\Stock The current object (for fluent API support)
+ * @return \Thelia\Model\ProductPrice The current object (for fluent API support)
*/
public function setUpdatedAt($v)
{
@@ -614,7 +614,7 @@ abstract class Stock implements ActiveRecordInterface
if ($this->updated_at !== null || $dt !== null) {
if ($dt !== $this->updated_at) {
$this->updated_at = $dt;
- $this->modifiedColumns[] = StockTableMap::UPDATED_AT;
+ $this->modifiedColumns[] = ProductPriceTableMap::UPDATED_AT;
}
} // if either are not null
@@ -659,28 +659,28 @@ abstract class Stock implements ActiveRecordInterface
try {
- $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : StockTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ProductPriceTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : StockTableMap::translateFieldName('CombinationId', TableMap::TYPE_PHPNAME, $indexType)];
- $this->combination_id = (null !== $col) ? (int) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ProductPriceTableMap::translateFieldName('ProductSaleElementsId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->product_sale_elements_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : StockTableMap::translateFieldName('ProductId', TableMap::TYPE_PHPNAME, $indexType)];
- $this->product_id = (null !== $col) ? (int) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProductPriceTableMap::translateFieldName('CurrencyId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->currency_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : StockTableMap::translateFieldName('Increase', TableMap::TYPE_PHPNAME, $indexType)];
- $this->increase = (null !== $col) ? (double) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductPriceTableMap::translateFieldName('Price', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->price = (null !== $col) ? (double) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : StockTableMap::translateFieldName('Quantity', TableMap::TYPE_PHPNAME, $indexType)];
- $this->quantity = (null !== $col) ? (double) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductPriceTableMap::translateFieldName('PromoPrice', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->promo_price = (null !== $col) ? (double) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : StockTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductPriceTableMap::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 ? 6 + $startcol : StockTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductPriceTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -693,10 +693,10 @@ abstract class Stock implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 7; // 7 = StockTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 7; // 7 = ProductPriceTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
- throw new PropelException("Error populating \Thelia\Model\Stock object", 0, $e);
+ throw new PropelException("Error populating \Thelia\Model\ProductPrice object", 0, $e);
}
}
@@ -715,11 +715,11 @@ abstract class Stock implements ActiveRecordInterface
*/
public function ensureConsistency()
{
- if ($this->aCombination !== null && $this->combination_id !== $this->aCombination->getId()) {
- $this->aCombination = null;
+ if ($this->aProductSaleElements !== null && $this->product_sale_elements_id !== $this->aProductSaleElements->getId()) {
+ $this->aProductSaleElements = null;
}
- if ($this->aProduct !== null && $this->product_id !== $this->aProduct->getId()) {
- $this->aProduct = null;
+ if ($this->aCurrency !== null && $this->currency_id !== $this->aCurrency->getId()) {
+ $this->aCurrency = null;
}
} // ensureConsistency
@@ -744,13 +744,13 @@ abstract class Stock implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(StockTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getReadConnection(ProductPriceTableMap::DATABASE_NAME);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
- $dataFetcher = ChildStockQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $dataFetcher = ChildProductPriceQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$row = $dataFetcher->fetch();
$dataFetcher->close();
if (!$row) {
@@ -760,8 +760,8 @@ abstract class Stock implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
- $this->aCombination = null;
- $this->aProduct = null;
+ $this->aProductSaleElements = null;
+ $this->aCurrency = null;
} // if (deep)
}
@@ -771,8 +771,8 @@ abstract class Stock implements ActiveRecordInterface
* @param ConnectionInterface $con
* @return void
* @throws PropelException
- * @see Stock::setDeleted()
- * @see Stock::isDeleted()
+ * @see ProductPrice::setDeleted()
+ * @see ProductPrice::isDeleted()
*/
public function delete(ConnectionInterface $con = null)
{
@@ -781,12 +781,12 @@ abstract class Stock implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(StockTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductPriceTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
- $deleteQuery = ChildStockQuery::create()
+ $deleteQuery = ChildProductPriceQuery::create()
->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con);
if ($ret) {
@@ -823,7 +823,7 @@ abstract class Stock implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(StockTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductPriceTableMap::DATABASE_NAME);
}
$con->beginTransaction();
@@ -833,16 +833,16 @@ abstract class Stock implements ActiveRecordInterface
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
// timestampable behavior
- if (!$this->isColumnModified(StockTableMap::CREATED_AT)) {
+ if (!$this->isColumnModified(ProductPriceTableMap::CREATED_AT)) {
$this->setCreatedAt(time());
}
- if (!$this->isColumnModified(StockTableMap::UPDATED_AT)) {
+ if (!$this->isColumnModified(ProductPriceTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
// timestampable behavior
- if ($this->isModified() && !$this->isColumnModified(StockTableMap::UPDATED_AT)) {
+ if ($this->isModified() && !$this->isColumnModified(ProductPriceTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
}
@@ -854,7 +854,7 @@ abstract class Stock implements ActiveRecordInterface
$this->postUpdate($con);
}
$this->postSave($con);
- StockTableMap::addInstanceToPool($this);
+ ProductPriceTableMap::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
@@ -889,18 +889,18 @@ abstract class Stock implements ActiveRecordInterface
// method. This object relates to these object(s) by a
// foreign key reference.
- if ($this->aCombination !== null) {
- if ($this->aCombination->isModified() || $this->aCombination->isNew()) {
- $affectedRows += $this->aCombination->save($con);
+ if ($this->aProductSaleElements !== null) {
+ if ($this->aProductSaleElements->isModified() || $this->aProductSaleElements->isNew()) {
+ $affectedRows += $this->aProductSaleElements->save($con);
}
- $this->setCombination($this->aCombination);
+ $this->setProductSaleElements($this->aProductSaleElements);
}
- if ($this->aProduct !== null) {
- if ($this->aProduct->isModified() || $this->aProduct->isNew()) {
- $affectedRows += $this->aProduct->save($con);
+ if ($this->aCurrency !== null) {
+ if ($this->aCurrency->isModified() || $this->aCurrency->isNew()) {
+ $affectedRows += $this->aCurrency->save($con);
}
- $this->setProduct($this->aProduct);
+ $this->setCurrency($this->aCurrency);
}
if ($this->isNew() || $this->isModified()) {
@@ -934,36 +934,36 @@ abstract class Stock implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
- $this->modifiedColumns[] = StockTableMap::ID;
+ $this->modifiedColumns[] = ProductPriceTableMap::ID;
if (null !== $this->id) {
- throw new PropelException('Cannot insert a value for auto-increment primary key (' . StockTableMap::ID . ')');
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . ProductPriceTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries
- if ($this->isColumnModified(StockTableMap::ID)) {
+ if ($this->isColumnModified(ProductPriceTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
- if ($this->isColumnModified(StockTableMap::COMBINATION_ID)) {
- $modifiedColumns[':p' . $index++] = 'COMBINATION_ID';
+ if ($this->isColumnModified(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID)) {
+ $modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_ID';
}
- if ($this->isColumnModified(StockTableMap::PRODUCT_ID)) {
- $modifiedColumns[':p' . $index++] = 'PRODUCT_ID';
+ if ($this->isColumnModified(ProductPriceTableMap::CURRENCY_ID)) {
+ $modifiedColumns[':p' . $index++] = 'CURRENCY_ID';
}
- if ($this->isColumnModified(StockTableMap::INCREASE)) {
- $modifiedColumns[':p' . $index++] = 'INCREASE';
+ if ($this->isColumnModified(ProductPriceTableMap::PRICE)) {
+ $modifiedColumns[':p' . $index++] = 'PRICE';
}
- if ($this->isColumnModified(StockTableMap::QUANTITY)) {
- $modifiedColumns[':p' . $index++] = 'QUANTITY';
+ if ($this->isColumnModified(ProductPriceTableMap::PROMO_PRICE)) {
+ $modifiedColumns[':p' . $index++] = 'PROMO_PRICE';
}
- if ($this->isColumnModified(StockTableMap::CREATED_AT)) {
+ if ($this->isColumnModified(ProductPriceTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
- if ($this->isColumnModified(StockTableMap::UPDATED_AT)) {
+ if ($this->isColumnModified(ProductPriceTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT';
}
$sql = sprintf(
- 'INSERT INTO stock (%s) VALUES (%s)',
+ 'INSERT INTO product_price (%s) VALUES (%s)',
implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns))
);
@@ -975,17 +975,17 @@ abstract class Stock implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
- case 'COMBINATION_ID':
- $stmt->bindValue($identifier, $this->combination_id, PDO::PARAM_INT);
+ case 'PRODUCT_SALE_ELEMENTS_ID':
+ $stmt->bindValue($identifier, $this->product_sale_elements_id, PDO::PARAM_INT);
break;
- case 'PRODUCT_ID':
- $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT);
+ case 'CURRENCY_ID':
+ $stmt->bindValue($identifier, $this->currency_id, PDO::PARAM_INT);
break;
- case 'INCREASE':
- $stmt->bindValue($identifier, $this->increase, PDO::PARAM_STR);
+ case 'PRICE':
+ $stmt->bindValue($identifier, $this->price, PDO::PARAM_STR);
break;
- case 'QUANTITY':
- $stmt->bindValue($identifier, $this->quantity, PDO::PARAM_STR);
+ case 'PROMO_PRICE':
+ $stmt->bindValue($identifier, $this->promo_price, PDO::PARAM_STR);
break;
case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
@@ -1039,7 +1039,7 @@ abstract class Stock implements ActiveRecordInterface
*/
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
{
- $pos = StockTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = ProductPriceTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
@@ -1059,16 +1059,16 @@ abstract class Stock implements ActiveRecordInterface
return $this->getId();
break;
case 1:
- return $this->getCombinationId();
+ return $this->getProductSaleElementsId();
break;
case 2:
- return $this->getProductId();
+ return $this->getCurrencyId();
break;
case 3:
- return $this->getIncrease();
+ return $this->getPrice();
break;
case 4:
- return $this->getQuantity();
+ return $this->getPromoPrice();
break;
case 5:
return $this->getCreatedAt();
@@ -1099,17 +1099,17 @@ abstract class Stock implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
- if (isset($alreadyDumpedObjects['Stock'][$this->getPrimaryKey()])) {
+ if (isset($alreadyDumpedObjects['ProductPrice'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
- $alreadyDumpedObjects['Stock'][$this->getPrimaryKey()] = true;
- $keys = StockTableMap::getFieldNames($keyType);
+ $alreadyDumpedObjects['ProductPrice'][$this->getPrimaryKey()] = true;
+ $keys = ProductPriceTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
- $keys[1] => $this->getCombinationId(),
- $keys[2] => $this->getProductId(),
- $keys[3] => $this->getIncrease(),
- $keys[4] => $this->getQuantity(),
+ $keys[1] => $this->getProductSaleElementsId(),
+ $keys[2] => $this->getCurrencyId(),
+ $keys[3] => $this->getPrice(),
+ $keys[4] => $this->getPromoPrice(),
$keys[5] => $this->getCreatedAt(),
$keys[6] => $this->getUpdatedAt(),
);
@@ -1120,11 +1120,11 @@ abstract class Stock implements ActiveRecordInterface
}
if ($includeForeignObjects) {
- if (null !== $this->aCombination) {
- $result['Combination'] = $this->aCombination->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ if (null !== $this->aProductSaleElements) {
+ $result['ProductSaleElements'] = $this->aProductSaleElements->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
- if (null !== $this->aProduct) {
- $result['Product'] = $this->aProduct->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ if (null !== $this->aCurrency) {
+ $result['Currency'] = $this->aCurrency->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
@@ -1144,7 +1144,7 @@ abstract class Stock implements ActiveRecordInterface
*/
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
{
- $pos = StockTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = ProductPriceTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -1164,16 +1164,16 @@ abstract class Stock implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
- $this->setCombinationId($value);
+ $this->setProductSaleElementsId($value);
break;
case 2:
- $this->setProductId($value);
+ $this->setCurrencyId($value);
break;
case 3:
- $this->setIncrease($value);
+ $this->setPrice($value);
break;
case 4:
- $this->setQuantity($value);
+ $this->setPromoPrice($value);
break;
case 5:
$this->setCreatedAt($value);
@@ -1203,13 +1203,13 @@ abstract class Stock implements ActiveRecordInterface
*/
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
- $keys = StockTableMap::getFieldNames($keyType);
+ $keys = ProductPriceTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setCombinationId($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setProductId($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setIncrease($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setQuantity($arr[$keys[4]]);
+ if (array_key_exists($keys[1], $arr)) $this->setProductSaleElementsId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setCurrencyId($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setPrice($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setPromoPrice($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
}
@@ -1221,15 +1221,15 @@ abstract class Stock implements ActiveRecordInterface
*/
public function buildCriteria()
{
- $criteria = new Criteria(StockTableMap::DATABASE_NAME);
+ $criteria = new Criteria(ProductPriceTableMap::DATABASE_NAME);
- if ($this->isColumnModified(StockTableMap::ID)) $criteria->add(StockTableMap::ID, $this->id);
- if ($this->isColumnModified(StockTableMap::COMBINATION_ID)) $criteria->add(StockTableMap::COMBINATION_ID, $this->combination_id);
- if ($this->isColumnModified(StockTableMap::PRODUCT_ID)) $criteria->add(StockTableMap::PRODUCT_ID, $this->product_id);
- if ($this->isColumnModified(StockTableMap::INCREASE)) $criteria->add(StockTableMap::INCREASE, $this->increase);
- if ($this->isColumnModified(StockTableMap::QUANTITY)) $criteria->add(StockTableMap::QUANTITY, $this->quantity);
- if ($this->isColumnModified(StockTableMap::CREATED_AT)) $criteria->add(StockTableMap::CREATED_AT, $this->created_at);
- if ($this->isColumnModified(StockTableMap::UPDATED_AT)) $criteria->add(StockTableMap::UPDATED_AT, $this->updated_at);
+ if ($this->isColumnModified(ProductPriceTableMap::ID)) $criteria->add(ProductPriceTableMap::ID, $this->id);
+ if ($this->isColumnModified(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID)) $criteria->add(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID, $this->product_sale_elements_id);
+ if ($this->isColumnModified(ProductPriceTableMap::CURRENCY_ID)) $criteria->add(ProductPriceTableMap::CURRENCY_ID, $this->currency_id);
+ if ($this->isColumnModified(ProductPriceTableMap::PRICE)) $criteria->add(ProductPriceTableMap::PRICE, $this->price);
+ if ($this->isColumnModified(ProductPriceTableMap::PROMO_PRICE)) $criteria->add(ProductPriceTableMap::PROMO_PRICE, $this->promo_price);
+ if ($this->isColumnModified(ProductPriceTableMap::CREATED_AT)) $criteria->add(ProductPriceTableMap::CREATED_AT, $this->created_at);
+ if ($this->isColumnModified(ProductPriceTableMap::UPDATED_AT)) $criteria->add(ProductPriceTableMap::UPDATED_AT, $this->updated_at);
return $criteria;
}
@@ -1244,8 +1244,8 @@ abstract class Stock implements ActiveRecordInterface
*/
public function buildPkeyCriteria()
{
- $criteria = new Criteria(StockTableMap::DATABASE_NAME);
- $criteria->add(StockTableMap::ID, $this->id);
+ $criteria = new Criteria(ProductPriceTableMap::DATABASE_NAME);
+ $criteria->add(ProductPriceTableMap::ID, $this->id);
return $criteria;
}
@@ -1286,17 +1286,17 @@ abstract class Stock implements ActiveRecordInterface
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
- * @param object $copyObj An object of \Thelia\Model\Stock (or compatible) type.
+ * @param object $copyObj An object of \Thelia\Model\ProductPrice (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
* @throws PropelException
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
- $copyObj->setCombinationId($this->getCombinationId());
- $copyObj->setProductId($this->getProductId());
- $copyObj->setIncrease($this->getIncrease());
- $copyObj->setQuantity($this->getQuantity());
+ $copyObj->setProductSaleElementsId($this->getProductSaleElementsId());
+ $copyObj->setCurrencyId($this->getCurrencyId());
+ $copyObj->setPrice($this->getPrice());
+ $copyObj->setPromoPrice($this->getPromoPrice());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1314,7 +1314,7 @@ abstract class Stock implements ActiveRecordInterface
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return \Thelia\Model\Stock Clone of current object.
+ * @return \Thelia\Model\ProductPrice Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -1328,26 +1328,26 @@ abstract class Stock implements ActiveRecordInterface
}
/**
- * Declares an association between this object and a ChildCombination object.
+ * Declares an association between this object and a ChildProductSaleElements object.
*
- * @param ChildCombination $v
- * @return \Thelia\Model\Stock The current object (for fluent API support)
+ * @param ChildProductSaleElements $v
+ * @return \Thelia\Model\ProductPrice The current object (for fluent API support)
* @throws PropelException
*/
- public function setCombination(ChildCombination $v = null)
+ public function setProductSaleElements(ChildProductSaleElements $v = null)
{
if ($v === null) {
- $this->setCombinationId(NULL);
+ $this->setProductSaleElementsId(NULL);
} else {
- $this->setCombinationId($v->getId());
+ $this->setProductSaleElementsId($v->getId());
}
- $this->aCombination = $v;
+ $this->aProductSaleElements = $v;
// Add binding for other direction of this n:n relationship.
- // If this object has already been added to the ChildCombination object, it will not be re-added.
+ // If this object has already been added to the ChildProductSaleElements object, it will not be re-added.
if ($v !== null) {
- $v->addStock($this);
+ $v->addProductPrice($this);
}
@@ -1356,49 +1356,49 @@ abstract class Stock implements ActiveRecordInterface
/**
- * Get the associated ChildCombination object
+ * Get the associated ChildProductSaleElements object
*
* @param ConnectionInterface $con Optional Connection object.
- * @return ChildCombination The associated ChildCombination object.
+ * @return ChildProductSaleElements The associated ChildProductSaleElements object.
* @throws PropelException
*/
- public function getCombination(ConnectionInterface $con = null)
+ public function getProductSaleElements(ConnectionInterface $con = null)
{
- if ($this->aCombination === null && ($this->combination_id !== null)) {
- $this->aCombination = ChildCombinationQuery::create()->findPk($this->combination_id, $con);
+ if ($this->aProductSaleElements === null && ($this->product_sale_elements_id !== null)) {
+ $this->aProductSaleElements = ChildProductSaleElementsQuery::create()->findPk($this->product_sale_elements_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->aCombination->addStocks($this);
+ $this->aProductSaleElements->addProductPrices($this);
*/
}
- return $this->aCombination;
+ return $this->aProductSaleElements;
}
/**
- * Declares an association between this object and a ChildProduct object.
+ * Declares an association between this object and a ChildCurrency object.
*
- * @param ChildProduct $v
- * @return \Thelia\Model\Stock The current object (for fluent API support)
+ * @param ChildCurrency $v
+ * @return \Thelia\Model\ProductPrice The current object (for fluent API support)
* @throws PropelException
*/
- public function setProduct(ChildProduct $v = null)
+ public function setCurrency(ChildCurrency $v = null)
{
if ($v === null) {
- $this->setProductId(NULL);
+ $this->setCurrencyId(NULL);
} else {
- $this->setProductId($v->getId());
+ $this->setCurrencyId($v->getId());
}
- $this->aProduct = $v;
+ $this->aCurrency = $v;
// Add binding for other direction of this n:n relationship.
- // If this object has already been added to the ChildProduct object, it will not be re-added.
+ // If this object has already been added to the ChildCurrency object, it will not be re-added.
if ($v !== null) {
- $v->addStock($this);
+ $v->addProductPrice($this);
}
@@ -1407,26 +1407,26 @@ abstract class Stock implements ActiveRecordInterface
/**
- * Get the associated ChildProduct object
+ * Get the associated ChildCurrency object
*
* @param ConnectionInterface $con Optional Connection object.
- * @return ChildProduct The associated ChildProduct object.
+ * @return ChildCurrency The associated ChildCurrency object.
* @throws PropelException
*/
- public function getProduct(ConnectionInterface $con = null)
+ public function getCurrency(ConnectionInterface $con = null)
{
- if ($this->aProduct === null && ($this->product_id !== null)) {
- $this->aProduct = ChildProductQuery::create()->findPk($this->product_id, $con);
+ if ($this->aCurrency === null && ($this->currency_id !== null)) {
+ $this->aCurrency = ChildCurrencyQuery::create()->findPk($this->currency_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->aProduct->addStocks($this);
+ $this->aCurrency->addProductPrices($this);
*/
}
- return $this->aProduct;
+ return $this->aCurrency;
}
/**
@@ -1435,10 +1435,10 @@ abstract class Stock implements ActiveRecordInterface
public function clear()
{
$this->id = null;
- $this->combination_id = null;
- $this->product_id = null;
- $this->increase = null;
- $this->quantity = null;
+ $this->product_sale_elements_id = null;
+ $this->currency_id = null;
+ $this->price = null;
+ $this->promo_price = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
@@ -1462,8 +1462,8 @@ abstract class Stock implements ActiveRecordInterface
if ($deep) {
} // if ($deep)
- $this->aCombination = null;
- $this->aProduct = null;
+ $this->aProductSaleElements = null;
+ $this->aCurrency = null;
}
/**
@@ -1473,7 +1473,7 @@ abstract class Stock implements ActiveRecordInterface
*/
public function __toString()
{
- return (string) $this->exportTo(StockTableMap::DEFAULT_STRING_FORMAT);
+ return (string) $this->exportTo(ProductPriceTableMap::DEFAULT_STRING_FORMAT);
}
// timestampable behavior
@@ -1481,11 +1481,11 @@ abstract class Stock implements ActiveRecordInterface
/**
* Mark the current object so that the update date doesn't get updated during next save
*
- * @return ChildStock The current object (for fluent API support)
+ * @return ChildProductPrice The current object (for fluent API support)
*/
public function keepUpdateDateUnchanged()
{
- $this->modifiedColumns[] = StockTableMap::UPDATED_AT;
+ $this->modifiedColumns[] = ProductPriceTableMap::UPDATED_AT;
return $this;
}
diff --git a/core/lib/Thelia/Model/Base/StockQuery.php b/core/lib/Thelia/Model/Base/ProductPriceQuery.php
old mode 100755
new mode 100644
similarity index 52%
rename from core/lib/Thelia/Model/Base/StockQuery.php
rename to core/lib/Thelia/Model/Base/ProductPriceQuery.php
index 6a11b591d..275aebbb2
--- a/core/lib/Thelia/Model/Base/StockQuery.php
+++ b/core/lib/Thelia/Model/Base/ProductPriceQuery.php
@@ -12,92 +12,92 @@ use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
-use Thelia\Model\Stock as ChildStock;
-use Thelia\Model\StockQuery as ChildStockQuery;
-use Thelia\Model\Map\StockTableMap;
+use Thelia\Model\ProductPrice as ChildProductPrice;
+use Thelia\Model\ProductPriceQuery as ChildProductPriceQuery;
+use Thelia\Model\Map\ProductPriceTableMap;
/**
- * Base class that represents a query for the 'stock' table.
+ * Base class that represents a query for the 'product_price' table.
*
*
*
- * @method ChildStockQuery orderById($order = Criteria::ASC) Order by the id column
- * @method ChildStockQuery orderByCombinationId($order = Criteria::ASC) Order by the combination_id column
- * @method ChildStockQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
- * @method ChildStockQuery orderByIncrease($order = Criteria::ASC) Order by the increase column
- * @method ChildStockQuery orderByQuantity($order = Criteria::ASC) Order by the quantity column
- * @method ChildStockQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
- * @method ChildStockQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
+ * @method ChildProductPriceQuery orderById($order = Criteria::ASC) Order by the id column
+ * @method ChildProductPriceQuery orderByProductSaleElementsId($order = Criteria::ASC) Order by the product_sale_elements_id column
+ * @method ChildProductPriceQuery orderByCurrencyId($order = Criteria::ASC) Order by the currency_id column
+ * @method ChildProductPriceQuery orderByPrice($order = Criteria::ASC) Order by the price column
+ * @method ChildProductPriceQuery orderByPromoPrice($order = Criteria::ASC) Order by the promo_price column
+ * @method ChildProductPriceQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
+ * @method ChildProductPriceQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
- * @method ChildStockQuery groupById() Group by the id column
- * @method ChildStockQuery groupByCombinationId() Group by the combination_id column
- * @method ChildStockQuery groupByProductId() Group by the product_id column
- * @method ChildStockQuery groupByIncrease() Group by the increase column
- * @method ChildStockQuery groupByQuantity() Group by the quantity column
- * @method ChildStockQuery groupByCreatedAt() Group by the created_at column
- * @method ChildStockQuery groupByUpdatedAt() Group by the updated_at column
+ * @method ChildProductPriceQuery groupById() Group by the id column
+ * @method ChildProductPriceQuery groupByProductSaleElementsId() Group by the product_sale_elements_id column
+ * @method ChildProductPriceQuery groupByCurrencyId() Group by the currency_id column
+ * @method ChildProductPriceQuery groupByPrice() Group by the price column
+ * @method ChildProductPriceQuery groupByPromoPrice() Group by the promo_price column
+ * @method ChildProductPriceQuery groupByCreatedAt() Group by the created_at column
+ * @method ChildProductPriceQuery groupByUpdatedAt() Group by the updated_at column
*
- * @method ChildStockQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
- * @method ChildStockQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
- * @method ChildStockQuery innerJoin($relation) Adds a INNER JOIN clause to the query
+ * @method ChildProductPriceQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
+ * @method ChildProductPriceQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
+ * @method ChildProductPriceQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
- * @method ChildStockQuery leftJoinCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the Combination relation
- * @method ChildStockQuery rightJoinCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Combination relation
- * @method ChildStockQuery innerJoinCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the Combination relation
+ * @method ChildProductPriceQuery leftJoinProductSaleElements($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductSaleElements relation
+ * @method ChildProductPriceQuery rightJoinProductSaleElements($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductSaleElements relation
+ * @method ChildProductPriceQuery innerJoinProductSaleElements($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductSaleElements relation
*
- * @method ChildStockQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
- * @method ChildStockQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
- * @method ChildStockQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
+ * @method ChildProductPriceQuery leftJoinCurrency($relationAlias = null) Adds a LEFT JOIN clause to the query using the Currency relation
+ * @method ChildProductPriceQuery rightJoinCurrency($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Currency relation
+ * @method ChildProductPriceQuery innerJoinCurrency($relationAlias = null) Adds a INNER JOIN clause to the query using the Currency relation
*
- * @method ChildStock findOne(ConnectionInterface $con = null) Return the first ChildStock matching the query
- * @method ChildStock findOneOrCreate(ConnectionInterface $con = null) Return the first ChildStock matching the query, or a new ChildStock object populated from the query conditions when no match is found
+ * @method ChildProductPrice findOne(ConnectionInterface $con = null) Return the first ChildProductPrice matching the query
+ * @method ChildProductPrice findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProductPrice matching the query, or a new ChildProductPrice object populated from the query conditions when no match is found
*
- * @method ChildStock findOneById(int $id) Return the first ChildStock filtered by the id column
- * @method ChildStock findOneByCombinationId(int $combination_id) Return the first ChildStock filtered by the combination_id column
- * @method ChildStock findOneByProductId(int $product_id) Return the first ChildStock filtered by the product_id column
- * @method ChildStock findOneByIncrease(double $increase) Return the first ChildStock filtered by the increase column
- * @method ChildStock findOneByQuantity(double $quantity) Return the first ChildStock filtered by the quantity column
- * @method ChildStock findOneByCreatedAt(string $created_at) Return the first ChildStock filtered by the created_at column
- * @method ChildStock findOneByUpdatedAt(string $updated_at) Return the first ChildStock filtered by the updated_at column
+ * @method ChildProductPrice findOneById(int $id) Return the first ChildProductPrice filtered by the id column
+ * @method ChildProductPrice findOneByProductSaleElementsId(int $product_sale_elements_id) Return the first ChildProductPrice filtered by the product_sale_elements_id column
+ * @method ChildProductPrice findOneByCurrencyId(int $currency_id) Return the first ChildProductPrice filtered by the currency_id column
+ * @method ChildProductPrice findOneByPrice(double $price) Return the first ChildProductPrice filtered by the price column
+ * @method ChildProductPrice findOneByPromoPrice(double $promo_price) Return the first ChildProductPrice filtered by the promo_price column
+ * @method ChildProductPrice findOneByCreatedAt(string $created_at) Return the first ChildProductPrice filtered by the created_at column
+ * @method ChildProductPrice findOneByUpdatedAt(string $updated_at) Return the first ChildProductPrice filtered by the updated_at column
*
- * @method array findById(int $id) Return ChildStock objects filtered by the id column
- * @method array findByCombinationId(int $combination_id) Return ChildStock objects filtered by the combination_id column
- * @method array findByProductId(int $product_id) Return ChildStock objects filtered by the product_id column
- * @method array findByIncrease(double $increase) Return ChildStock objects filtered by the increase column
- * @method array findByQuantity(double $quantity) Return ChildStock objects filtered by the quantity column
- * @method array findByCreatedAt(string $created_at) Return ChildStock objects filtered by the created_at column
- * @method array findByUpdatedAt(string $updated_at) Return ChildStock objects filtered by the updated_at column
+ * @method array findById(int $id) Return ChildProductPrice objects filtered by the id column
+ * @method array findByProductSaleElementsId(int $product_sale_elements_id) Return ChildProductPrice objects filtered by the product_sale_elements_id column
+ * @method array findByCurrencyId(int $currency_id) Return ChildProductPrice objects filtered by the currency_id column
+ * @method array findByPrice(double $price) Return ChildProductPrice objects filtered by the price column
+ * @method array findByPromoPrice(double $promo_price) Return ChildProductPrice objects filtered by the promo_price column
+ * @method array findByCreatedAt(string $created_at) Return ChildProductPrice objects filtered by the created_at column
+ * @method array findByUpdatedAt(string $updated_at) Return ChildProductPrice objects filtered by the updated_at column
*
*/
-abstract class StockQuery extends ModelCriteria
+abstract class ProductPriceQuery extends ModelCriteria
{
/**
- * Initializes internal state of \Thelia\Model\Base\StockQuery object.
+ * Initializes internal state of \Thelia\Model\Base\ProductPriceQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
- public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Stock', $modelAlias = null)
+ public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ProductPrice', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
- * Returns a new ChildStockQuery object.
+ * Returns a new ChildProductPriceQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
- * @return ChildStockQuery
+ * @return ChildProductPriceQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
- if ($criteria instanceof \Thelia\Model\StockQuery) {
+ if ($criteria instanceof \Thelia\Model\ProductPriceQuery) {
return $criteria;
}
- $query = new \Thelia\Model\StockQuery();
+ $query = new \Thelia\Model\ProductPriceQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
@@ -120,19 +120,19 @@ abstract class StockQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
- * @return ChildStock|array|mixed the result, formatted by the current formatter
+ * @return ChildProductPrice|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
- if ((null !== ($obj = StockTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ if ((null !== ($obj = ProductPriceTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(StockTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getReadConnection(ProductPriceTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
@@ -151,11 +151,11 @@ abstract class StockQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
- * @return ChildStock A model object, or null if the key is not found
+ * @return ChildProductPrice A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, COMBINATION_ID, PRODUCT_ID, INCREASE, QUANTITY, CREATED_AT, UPDATED_AT FROM stock WHERE ID = :p0';
+ $sql = 'SELECT ID, PRODUCT_SALE_ELEMENTS_ID, CURRENCY_ID, PRICE, PROMO_PRICE, CREATED_AT, UPDATED_AT FROM product_price WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -166,9 +166,9 @@ abstract class StockQuery extends ModelCriteria
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
- $obj = new ChildStock();
+ $obj = new ChildProductPrice();
$obj->hydrate($row);
- StockTableMap::addInstanceToPool($obj, (string) $key);
+ ProductPriceTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
@@ -181,7 +181,7 @@ abstract class StockQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
- * @return ChildStock|array|mixed the result, formatted by the current formatter
+ * @return ChildProductPrice|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
@@ -223,12 +223,12 @@ abstract class StockQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
- return $this->addUsingAlias(StockTableMap::ID, $key, Criteria::EQUAL);
+ return $this->addUsingAlias(ProductPriceTableMap::ID, $key, Criteria::EQUAL);
}
/**
@@ -236,12 +236,12 @@ abstract class StockQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
- return $this->addUsingAlias(StockTableMap::ID, $keys, Criteria::IN);
+ return $this->addUsingAlias(ProductPriceTableMap::ID, $keys, Criteria::IN);
}
/**
@@ -260,18 +260,18 @@ abstract class StockQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
- $this->addUsingAlias(StockTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(ProductPriceTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
- $this->addUsingAlias(StockTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(ProductPriceTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -282,39 +282,39 @@ abstract class StockQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(StockTableMap::ID, $id, $comparison);
+ return $this->addUsingAlias(ProductPriceTableMap::ID, $id, $comparison);
}
/**
- * Filter the query on the combination_id column
+ * Filter the query on the product_sale_elements_id column
*
* Example usage:
*
- * $query->filterByCombinationId(1234); // WHERE combination_id = 1234
- * $query->filterByCombinationId(array(12, 34)); // WHERE combination_id IN (12, 34)
- * $query->filterByCombinationId(array('min' => 12)); // WHERE combination_id > 12
+ * $query->filterByProductSaleElementsId(1234); // WHERE product_sale_elements_id = 1234
+ * $query->filterByProductSaleElementsId(array(12, 34)); // WHERE product_sale_elements_id IN (12, 34)
+ * $query->filterByProductSaleElementsId(array('min' => 12)); // WHERE product_sale_elements_id > 12
*
*
- * @see filterByCombination()
+ * @see filterByProductSaleElements()
*
- * @param mixed $combinationId The value to use as filter.
+ * @param mixed $productSaleElementsId 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 ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
- public function filterByCombinationId($combinationId = null, $comparison = null)
+ public function filterByProductSaleElementsId($productSaleElementsId = null, $comparison = null)
{
- if (is_array($combinationId)) {
+ if (is_array($productSaleElementsId)) {
$useMinMax = false;
- if (isset($combinationId['min'])) {
- $this->addUsingAlias(StockTableMap::COMBINATION_ID, $combinationId['min'], Criteria::GREATER_EQUAL);
+ if (isset($productSaleElementsId['min'])) {
+ $this->addUsingAlias(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($combinationId['max'])) {
- $this->addUsingAlias(StockTableMap::COMBINATION_ID, $combinationId['max'], Criteria::LESS_EQUAL);
+ if (isset($productSaleElementsId['max'])) {
+ $this->addUsingAlias(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -325,39 +325,39 @@ abstract class StockQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(StockTableMap::COMBINATION_ID, $combinationId, $comparison);
+ return $this->addUsingAlias(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId, $comparison);
}
/**
- * Filter the query on the product_id column
+ * Filter the query on the currency_id column
*
* Example usage:
*
- * $query->filterByProductId(1234); // WHERE product_id = 1234
- * $query->filterByProductId(array(12, 34)); // WHERE product_id IN (12, 34)
- * $query->filterByProductId(array('min' => 12)); // WHERE product_id > 12
+ * $query->filterByCurrencyId(1234); // WHERE currency_id = 1234
+ * $query->filterByCurrencyId(array(12, 34)); // WHERE currency_id IN (12, 34)
+ * $query->filterByCurrencyId(array('min' => 12)); // WHERE currency_id > 12
*
*
- * @see filterByProduct()
+ * @see filterByCurrency()
*
- * @param mixed $productId The value to use as filter.
+ * @param mixed $currencyId 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 ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
- public function filterByProductId($productId = null, $comparison = null)
+ public function filterByCurrencyId($currencyId = null, $comparison = null)
{
- if (is_array($productId)) {
+ if (is_array($currencyId)) {
$useMinMax = false;
- if (isset($productId['min'])) {
- $this->addUsingAlias(StockTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
+ if (isset($currencyId['min'])) {
+ $this->addUsingAlias(ProductPriceTableMap::CURRENCY_ID, $currencyId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($productId['max'])) {
- $this->addUsingAlias(StockTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
+ if (isset($currencyId['max'])) {
+ $this->addUsingAlias(ProductPriceTableMap::CURRENCY_ID, $currencyId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -368,37 +368,37 @@ abstract class StockQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(StockTableMap::PRODUCT_ID, $productId, $comparison);
+ return $this->addUsingAlias(ProductPriceTableMap::CURRENCY_ID, $currencyId, $comparison);
}
/**
- * Filter the query on the increase column
+ * Filter the query on the price column
*
* Example usage:
*
- * $query->filterByIncrease(1234); // WHERE increase = 1234
- * $query->filterByIncrease(array(12, 34)); // WHERE increase IN (12, 34)
- * $query->filterByIncrease(array('min' => 12)); // WHERE increase > 12
+ * $query->filterByPrice(1234); // WHERE price = 1234
+ * $query->filterByPrice(array(12, 34)); // WHERE price IN (12, 34)
+ * $query->filterByPrice(array('min' => 12)); // WHERE price > 12
*
*
- * @param mixed $increase The value to use as filter.
+ * @param mixed $price 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 ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
- public function filterByIncrease($increase = null, $comparison = null)
+ public function filterByPrice($price = null, $comparison = null)
{
- if (is_array($increase)) {
+ if (is_array($price)) {
$useMinMax = false;
- if (isset($increase['min'])) {
- $this->addUsingAlias(StockTableMap::INCREASE, $increase['min'], Criteria::GREATER_EQUAL);
+ if (isset($price['min'])) {
+ $this->addUsingAlias(ProductPriceTableMap::PRICE, $price['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($increase['max'])) {
- $this->addUsingAlias(StockTableMap::INCREASE, $increase['max'], Criteria::LESS_EQUAL);
+ if (isset($price['max'])) {
+ $this->addUsingAlias(ProductPriceTableMap::PRICE, $price['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -409,37 +409,37 @@ abstract class StockQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(StockTableMap::INCREASE, $increase, $comparison);
+ return $this->addUsingAlias(ProductPriceTableMap::PRICE, $price, $comparison);
}
/**
- * Filter the query on the quantity column
+ * Filter the query on the promo_price column
*
* Example usage:
*
- * $query->filterByQuantity(1234); // WHERE quantity = 1234
- * $query->filterByQuantity(array(12, 34)); // WHERE quantity IN (12, 34)
- * $query->filterByQuantity(array('min' => 12)); // WHERE quantity > 12
+ * $query->filterByPromoPrice(1234); // WHERE promo_price = 1234
+ * $query->filterByPromoPrice(array(12, 34)); // WHERE promo_price IN (12, 34)
+ * $query->filterByPromoPrice(array('min' => 12)); // WHERE promo_price > 12
*
*
- * @param mixed $quantity The value to use as filter.
+ * @param mixed $promoPrice 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 ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
- public function filterByQuantity($quantity = null, $comparison = null)
+ public function filterByPromoPrice($promoPrice = null, $comparison = null)
{
- if (is_array($quantity)) {
+ if (is_array($promoPrice)) {
$useMinMax = false;
- if (isset($quantity['min'])) {
- $this->addUsingAlias(StockTableMap::QUANTITY, $quantity['min'], Criteria::GREATER_EQUAL);
+ if (isset($promoPrice['min'])) {
+ $this->addUsingAlias(ProductPriceTableMap::PROMO_PRICE, $promoPrice['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($quantity['max'])) {
- $this->addUsingAlias(StockTableMap::QUANTITY, $quantity['max'], Criteria::LESS_EQUAL);
+ if (isset($promoPrice['max'])) {
+ $this->addUsingAlias(ProductPriceTableMap::PROMO_PRICE, $promoPrice['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -450,7 +450,7 @@ abstract class StockQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(StockTableMap::QUANTITY, $quantity, $comparison);
+ return $this->addUsingAlias(ProductPriceTableMap::PROMO_PRICE, $promoPrice, $comparison);
}
/**
@@ -471,18 +471,18 @@ abstract class StockQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function filterByCreatedAt($createdAt = null, $comparison = null)
{
if (is_array($createdAt)) {
$useMinMax = false;
if (isset($createdAt['min'])) {
- $this->addUsingAlias(StockTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(ProductPriceTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
- $this->addUsingAlias(StockTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(ProductPriceTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -493,7 +493,7 @@ abstract class StockQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(StockTableMap::CREATED_AT, $createdAt, $comparison);
+ return $this->addUsingAlias(ProductPriceTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
@@ -514,18 +514,18 @@ abstract class StockQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
{
if (is_array($updatedAt)) {
$useMinMax = false;
if (isset($updatedAt['min'])) {
- $this->addUsingAlias(StockTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(ProductPriceTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
- $this->addUsingAlias(StockTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(ProductPriceTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -536,46 +536,46 @@ abstract class StockQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(StockTableMap::UPDATED_AT, $updatedAt, $comparison);
+ return $this->addUsingAlias(ProductPriceTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
- * Filter the query by a related \Thelia\Model\Combination object
+ * Filter the query by a related \Thelia\Model\ProductSaleElements object
*
- * @param \Thelia\Model\Combination|ObjectCollection $combination The related object(s) to use as filter
+ * @param \Thelia\Model\ProductSaleElements|ObjectCollection $productSaleElements The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
- public function filterByCombination($combination, $comparison = null)
+ public function filterByProductSaleElements($productSaleElements, $comparison = null)
{
- if ($combination instanceof \Thelia\Model\Combination) {
+ if ($productSaleElements instanceof \Thelia\Model\ProductSaleElements) {
return $this
- ->addUsingAlias(StockTableMap::COMBINATION_ID, $combination->getId(), $comparison);
- } elseif ($combination instanceof ObjectCollection) {
+ ->addUsingAlias(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElements->getId(), $comparison);
+ } elseif ($productSaleElements instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(StockTableMap::COMBINATION_ID, $combination->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElements->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
- throw new PropelException('filterByCombination() only accepts arguments of type \Thelia\Model\Combination or Collection');
+ throw new PropelException('filterByProductSaleElements() only accepts arguments of type \Thelia\Model\ProductSaleElements or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the Combination relation
+ * Adds a JOIN clause to the query using the ProductSaleElements relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
- public function joinCombination($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function joinProductSaleElements($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Combination');
+ $relationMap = $tableMap->getRelation('ProductSaleElements');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -590,14 +590,14 @@ abstract class StockQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'Combination');
+ $this->addJoinObject($join, 'ProductSaleElements');
}
return $this;
}
/**
- * Use the Combination relation Combination object
+ * Use the ProductSaleElements relation ProductSaleElements object
*
* @see useQuery()
*
@@ -605,52 +605,52 @@ abstract class StockQuery extends ModelCriteria
* 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\CombinationQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\ProductSaleElementsQuery A secondary query class using the current class as primary query
*/
- public function useCombinationQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ public function useProductSaleElementsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinCombination($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Combination', '\Thelia\Model\CombinationQuery');
+ ->joinProductSaleElements($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ProductSaleElements', '\Thelia\Model\ProductSaleElementsQuery');
}
/**
- * Filter the query by a related \Thelia\Model\Product object
+ * Filter the query by a related \Thelia\Model\Currency object
*
- * @param \Thelia\Model\Product|ObjectCollection $product The related object(s) to use as filter
+ * @param \Thelia\Model\Currency|ObjectCollection $currency The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
- public function filterByProduct($product, $comparison = null)
+ public function filterByCurrency($currency, $comparison = null)
{
- if ($product instanceof \Thelia\Model\Product) {
+ if ($currency instanceof \Thelia\Model\Currency) {
return $this
- ->addUsingAlias(StockTableMap::PRODUCT_ID, $product->getId(), $comparison);
- } elseif ($product instanceof ObjectCollection) {
+ ->addUsingAlias(ProductPriceTableMap::CURRENCY_ID, $currency->getId(), $comparison);
+ } elseif ($currency instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(StockTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(ProductPriceTableMap::CURRENCY_ID, $currency->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
- throw new PropelException('filterByProduct() only accepts arguments of type \Thelia\Model\Product or Collection');
+ throw new PropelException('filterByCurrency() only accepts arguments of type \Thelia\Model\Currency or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the Product relation
+ * Adds a JOIN clause to the query using the Currency relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
- public function joinProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinCurrency($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Product');
+ $relationMap = $tableMap->getRelation('Currency');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -665,14 +665,14 @@ abstract class StockQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'Product');
+ $this->addJoinObject($join, 'Currency');
}
return $this;
}
/**
- * Use the Product relation Product object
+ * Use the Currency relation Currency object
*
* @see useQuery()
*
@@ -680,33 +680,33 @@ abstract class StockQuery extends ModelCriteria
* 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\ProductQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\CurrencyQuery A secondary query class using the current class as primary query
*/
- public function useProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useCurrencyQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinProduct($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Product', '\Thelia\Model\ProductQuery');
+ ->joinCurrency($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Currency', '\Thelia\Model\CurrencyQuery');
}
/**
* Exclude object from result
*
- * @param ChildStock $stock Object to remove from the list of results
+ * @param ChildProductPrice $productPrice Object to remove from the list of results
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
- public function prune($stock = null)
+ public function prune($productPrice = null)
{
- if ($stock) {
- $this->addUsingAlias(StockTableMap::ID, $stock->getId(), Criteria::NOT_EQUAL);
+ if ($productPrice) {
+ $this->addUsingAlias(ProductPriceTableMap::ID, $productPrice->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
- * Deletes all rows from the stock table.
+ * Deletes all rows from the product_price table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
@@ -714,7 +714,7 @@ abstract class StockQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(StockTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductPriceTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
@@ -725,8 +725,8 @@ abstract class StockQuery extends ModelCriteria
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
- StockTableMap::clearInstancePool();
- StockTableMap::clearRelatedInstancePool();
+ ProductPriceTableMap::clearInstancePool();
+ ProductPriceTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
@@ -738,9 +738,9 @@ abstract class StockQuery extends ModelCriteria
}
/**
- * Performs a DELETE on the database, given a ChildStock or Criteria object OR a primary key value.
+ * Performs a DELETE on the database, given a ChildProductPrice or Criteria object OR a primary key value.
*
- * @param mixed $values Criteria or ChildStock object or primary key or array of primary keys
+ * @param mixed $values Criteria or ChildProductPrice object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -751,13 +751,13 @@ abstract class StockQuery extends ModelCriteria
public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(StockTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductPriceTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
- $criteria->setDbName(StockTableMap::DATABASE_NAME);
+ $criteria->setDbName(ProductPriceTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
@@ -767,10 +767,10 @@ abstract class StockQuery extends ModelCriteria
$con->beginTransaction();
- StockTableMap::removeInstanceFromPool($criteria);
+ ProductPriceTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
- StockTableMap::clearRelatedInstancePool();
+ ProductPriceTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
@@ -787,11 +787,11 @@ abstract class StockQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of the latest update in days
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
- return $this->addUsingAlias(StockTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ return $this->addUsingAlias(ProductPriceTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
@@ -799,51 +799,51 @@ abstract class StockQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of in days
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
- return $this->addUsingAlias(StockTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ return $this->addUsingAlias(ProductPriceTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
- return $this->addDescendingOrderByColumn(StockTableMap::UPDATED_AT);
+ return $this->addDescendingOrderByColumn(ProductPriceTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
- return $this->addAscendingOrderByColumn(StockTableMap::UPDATED_AT);
+ return $this->addAscendingOrderByColumn(ProductPriceTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
- return $this->addDescendingOrderByColumn(StockTableMap::CREATED_AT);
+ return $this->addDescendingOrderByColumn(ProductPriceTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
- * @return ChildStockQuery The current query, for fluid interface
+ * @return ChildProductPriceQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
- return $this->addAscendingOrderByColumn(StockTableMap::CREATED_AT);
+ return $this->addAscendingOrderByColumn(ProductPriceTableMap::CREATED_AT);
}
-} // StockQuery
+} // ProductPriceQuery
diff --git a/core/lib/Thelia/Model/Base/ProductQuery.php b/core/lib/Thelia/Model/Base/ProductQuery.php
old mode 100755
new mode 100644
index 8ded7703f..37371c4b0
--- a/core/lib/Thelia/Model/Base/ProductQuery.php
+++ b/core/lib/Thelia/Model/Base/ProductQuery.php
@@ -25,14 +25,7 @@ use Thelia\Model\Map\ProductTableMap;
* @method ChildProductQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildProductQuery orderByTaxRuleId($order = Criteria::ASC) Order by the tax_rule_id column
* @method ChildProductQuery orderByRef($order = Criteria::ASC) Order by the ref column
- * @method ChildProductQuery orderByPrice($order = Criteria::ASC) Order by the price column
- * @method ChildProductQuery orderByPrice2($order = Criteria::ASC) Order by the price2 column
- * @method ChildProductQuery orderByEcotax($order = Criteria::ASC) Order by the ecotax column
- * @method ChildProductQuery orderByNewness($order = Criteria::ASC) Order by the newness column
- * @method ChildProductQuery orderByPromo($order = Criteria::ASC) Order by the promo column
- * @method ChildProductQuery orderByQuantity($order = Criteria::ASC) Order by the quantity column
* @method ChildProductQuery orderByVisible($order = Criteria::ASC) Order by the visible column
- * @method ChildProductQuery orderByWeight($order = Criteria::ASC) Order by the weight column
* @method ChildProductQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildProductQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildProductQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
@@ -43,14 +36,7 @@ use Thelia\Model\Map\ProductTableMap;
* @method ChildProductQuery groupById() Group by the id column
* @method ChildProductQuery groupByTaxRuleId() Group by the tax_rule_id column
* @method ChildProductQuery groupByRef() Group by the ref column
- * @method ChildProductQuery groupByPrice() Group by the price column
- * @method ChildProductQuery groupByPrice2() Group by the price2 column
- * @method ChildProductQuery groupByEcotax() Group by the ecotax column
- * @method ChildProductQuery groupByNewness() Group by the newness column
- * @method ChildProductQuery groupByPromo() Group by the promo column
- * @method ChildProductQuery groupByQuantity() Group by the quantity column
* @method ChildProductQuery groupByVisible() Group by the visible column
- * @method ChildProductQuery groupByWeight() Group by the weight column
* @method ChildProductQuery groupByPosition() Group by the position column
* @method ChildProductQuery groupByCreatedAt() Group by the created_at column
* @method ChildProductQuery groupByUpdatedAt() Group by the updated_at column
@@ -70,13 +56,13 @@ use Thelia\Model\Map\ProductTableMap;
* @method ChildProductQuery rightJoinProductCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductCategory relation
* @method ChildProductQuery innerJoinProductCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductCategory relation
*
- * @method ChildProductQuery leftJoinFeatureProd($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureProd relation
- * @method ChildProductQuery rightJoinFeatureProd($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureProd relation
- * @method ChildProductQuery innerJoinFeatureProd($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureProd relation
+ * @method ChildProductQuery leftJoinFeatureProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureProduct relation
+ * @method ChildProductQuery rightJoinFeatureProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureProduct relation
+ * @method ChildProductQuery innerJoinFeatureProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureProduct relation
*
- * @method ChildProductQuery leftJoinStock($relationAlias = null) Adds a LEFT JOIN clause to the query using the Stock relation
- * @method ChildProductQuery rightJoinStock($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Stock relation
- * @method ChildProductQuery innerJoinStock($relationAlias = null) Adds a INNER JOIN clause to the query using the Stock relation
+ * @method ChildProductQuery leftJoinProductSaleElements($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductSaleElements relation
+ * @method ChildProductQuery rightJoinProductSaleElements($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductSaleElements relation
+ * @method ChildProductQuery innerJoinProductSaleElements($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductSaleElements relation
*
* @method ChildProductQuery leftJoinContentAssoc($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentAssoc relation
* @method ChildProductQuery rightJoinContentAssoc($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentAssoc relation
@@ -120,14 +106,7 @@ use Thelia\Model\Map\ProductTableMap;
* @method ChildProduct findOneById(int $id) Return the first ChildProduct filtered by the id column
* @method ChildProduct findOneByTaxRuleId(int $tax_rule_id) Return the first ChildProduct filtered by the tax_rule_id column
* @method ChildProduct findOneByRef(string $ref) Return the first ChildProduct filtered by the ref column
- * @method ChildProduct findOneByPrice(double $price) Return the first ChildProduct filtered by the price column
- * @method ChildProduct findOneByPrice2(double $price2) Return the first ChildProduct filtered by the price2 column
- * @method ChildProduct findOneByEcotax(double $ecotax) Return the first ChildProduct filtered by the ecotax column
- * @method ChildProduct findOneByNewness(int $newness) Return the first ChildProduct filtered by the newness column
- * @method ChildProduct findOneByPromo(int $promo) Return the first ChildProduct filtered by the promo column
- * @method ChildProduct findOneByQuantity(int $quantity) Return the first ChildProduct filtered by the quantity column
* @method ChildProduct findOneByVisible(int $visible) Return the first ChildProduct filtered by the visible column
- * @method ChildProduct findOneByWeight(double $weight) Return the first ChildProduct filtered by the weight column
* @method ChildProduct findOneByPosition(int $position) Return the first ChildProduct filtered by the position column
* @method ChildProduct findOneByCreatedAt(string $created_at) Return the first ChildProduct filtered by the created_at column
* @method ChildProduct findOneByUpdatedAt(string $updated_at) Return the first ChildProduct filtered by the updated_at column
@@ -138,14 +117,7 @@ use Thelia\Model\Map\ProductTableMap;
* @method array findById(int $id) Return ChildProduct objects filtered by the id column
* @method array findByTaxRuleId(int $tax_rule_id) Return ChildProduct objects filtered by the tax_rule_id column
* @method array findByRef(string $ref) Return ChildProduct objects filtered by the ref column
- * @method array findByPrice(double $price) Return ChildProduct objects filtered by the price column
- * @method array findByPrice2(double $price2) Return ChildProduct objects filtered by the price2 column
- * @method array findByEcotax(double $ecotax) Return ChildProduct objects filtered by the ecotax column
- * @method array findByNewness(int $newness) Return ChildProduct objects filtered by the newness column
- * @method array findByPromo(int $promo) Return ChildProduct objects filtered by the promo column
- * @method array findByQuantity(int $quantity) Return ChildProduct objects filtered by the quantity column
* @method array findByVisible(int $visible) Return ChildProduct objects filtered by the visible column
- * @method array findByWeight(double $weight) Return ChildProduct objects filtered by the weight column
* @method array findByPosition(int $position) Return ChildProduct objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildProduct objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildProduct objects filtered by the updated_at column
@@ -247,7 +219,7 @@ abstract class ProductQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, TAX_RULE_ID, REF, PRICE, PRICE2, ECOTAX, NEWNESS, PROMO, QUANTITY, VISIBLE, WEIGHT, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM product WHERE ID = :p0';
+ $sql = 'SELECT ID, TAX_RULE_ID, REF, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM product WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -449,252 +421,6 @@ abstract class ProductQuery extends ModelCriteria
return $this->addUsingAlias(ProductTableMap::REF, $ref, $comparison);
}
- /**
- * Filter the query on the price column
- *
- * Example usage:
- *
- * $query->filterByPrice(1234); // WHERE price = 1234
- * $query->filterByPrice(array(12, 34)); // WHERE price IN (12, 34)
- * $query->filterByPrice(array('min' => 12)); // WHERE price > 12
- *
- *
- * @param mixed $price 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 ChildProductQuery The current query, for fluid interface
- */
- public function filterByPrice($price = null, $comparison = null)
- {
- if (is_array($price)) {
- $useMinMax = false;
- if (isset($price['min'])) {
- $this->addUsingAlias(ProductTableMap::PRICE, $price['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($price['max'])) {
- $this->addUsingAlias(ProductTableMap::PRICE, $price['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductTableMap::PRICE, $price, $comparison);
- }
-
- /**
- * Filter the query on the price2 column
- *
- * Example usage:
- *
- * $query->filterByPrice2(1234); // WHERE price2 = 1234
- * $query->filterByPrice2(array(12, 34)); // WHERE price2 IN (12, 34)
- * $query->filterByPrice2(array('min' => 12)); // WHERE price2 > 12
- *
- *
- * @param mixed $price2 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 ChildProductQuery The current query, for fluid interface
- */
- public function filterByPrice2($price2 = null, $comparison = null)
- {
- if (is_array($price2)) {
- $useMinMax = false;
- if (isset($price2['min'])) {
- $this->addUsingAlias(ProductTableMap::PRICE2, $price2['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($price2['max'])) {
- $this->addUsingAlias(ProductTableMap::PRICE2, $price2['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductTableMap::PRICE2, $price2, $comparison);
- }
-
- /**
- * Filter the query on the ecotax column
- *
- * Example usage:
- *
- * $query->filterByEcotax(1234); // WHERE ecotax = 1234
- * $query->filterByEcotax(array(12, 34)); // WHERE ecotax IN (12, 34)
- * $query->filterByEcotax(array('min' => 12)); // WHERE ecotax > 12
- *
- *
- * @param mixed $ecotax 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 ChildProductQuery The current query, for fluid interface
- */
- public function filterByEcotax($ecotax = null, $comparison = null)
- {
- if (is_array($ecotax)) {
- $useMinMax = false;
- if (isset($ecotax['min'])) {
- $this->addUsingAlias(ProductTableMap::ECOTAX, $ecotax['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($ecotax['max'])) {
- $this->addUsingAlias(ProductTableMap::ECOTAX, $ecotax['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductTableMap::ECOTAX, $ecotax, $comparison);
- }
-
- /**
- * Filter the query on the newness column
- *
- * Example usage:
- *
- * $query->filterByNewness(1234); // WHERE newness = 1234
- * $query->filterByNewness(array(12, 34)); // WHERE newness IN (12, 34)
- * $query->filterByNewness(array('min' => 12)); // WHERE newness > 12
- *
- *
- * @param mixed $newness 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 ChildProductQuery The current query, for fluid interface
- */
- public function filterByNewness($newness = null, $comparison = null)
- {
- if (is_array($newness)) {
- $useMinMax = false;
- if (isset($newness['min'])) {
- $this->addUsingAlias(ProductTableMap::NEWNESS, $newness['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($newness['max'])) {
- $this->addUsingAlias(ProductTableMap::NEWNESS, $newness['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductTableMap::NEWNESS, $newness, $comparison);
- }
-
- /**
- * Filter the query on the promo column
- *
- * Example usage:
- *
- * $query->filterByPromo(1234); // WHERE promo = 1234
- * $query->filterByPromo(array(12, 34)); // WHERE promo IN (12, 34)
- * $query->filterByPromo(array('min' => 12)); // WHERE promo > 12
- *
- *
- * @param mixed $promo 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 ChildProductQuery The current query, for fluid interface
- */
- public function filterByPromo($promo = null, $comparison = null)
- {
- if (is_array($promo)) {
- $useMinMax = false;
- if (isset($promo['min'])) {
- $this->addUsingAlias(ProductTableMap::PROMO, $promo['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($promo['max'])) {
- $this->addUsingAlias(ProductTableMap::PROMO, $promo['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductTableMap::PROMO, $promo, $comparison);
- }
-
- /**
- * Filter the query on the quantity column
- *
- * Example usage:
- *
- * $query->filterByQuantity(1234); // WHERE quantity = 1234
- * $query->filterByQuantity(array(12, 34)); // WHERE quantity IN (12, 34)
- * $query->filterByQuantity(array('min' => 12)); // WHERE quantity > 12
- *
- *
- * @param mixed $quantity 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 ChildProductQuery The current query, for fluid interface
- */
- public function filterByQuantity($quantity = null, $comparison = null)
- {
- if (is_array($quantity)) {
- $useMinMax = false;
- if (isset($quantity['min'])) {
- $this->addUsingAlias(ProductTableMap::QUANTITY, $quantity['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($quantity['max'])) {
- $this->addUsingAlias(ProductTableMap::QUANTITY, $quantity['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductTableMap::QUANTITY, $quantity, $comparison);
- }
-
/**
* Filter the query on the visible column
*
@@ -736,47 +462,6 @@ abstract class ProductQuery extends ModelCriteria
return $this->addUsingAlias(ProductTableMap::VISIBLE, $visible, $comparison);
}
- /**
- * Filter the query on the weight column
- *
- * Example usage:
- *
- * $query->filterByWeight(1234); // WHERE weight = 1234
- * $query->filterByWeight(array(12, 34)); // WHERE weight IN (12, 34)
- * $query->filterByWeight(array('min' => 12)); // WHERE weight > 12
- *
- *
- * @param mixed $weight 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 ChildProductQuery The current query, for fluid interface
- */
- public function filterByWeight($weight = null, $comparison = null)
- {
- if (is_array($weight)) {
- $useMinMax = false;
- if (isset($weight['min'])) {
- $this->addUsingAlias(ProductTableMap::WEIGHT, $weight['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($weight['max'])) {
- $this->addUsingAlias(ProductTableMap::WEIGHT, $weight['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductTableMap::WEIGHT, $weight, $comparison);
- }
-
/**
* Filter the query on the position column
*
@@ -1166,40 +851,40 @@ abstract class ProductQuery extends ModelCriteria
}
/**
- * Filter the query by a related \Thelia\Model\FeatureProd object
+ * Filter the query by a related \Thelia\Model\FeatureProduct object
*
- * @param \Thelia\Model\FeatureProd|ObjectCollection $featureProd the related object to use as filter
+ * @param \Thelia\Model\FeatureProduct|ObjectCollection $featureProduct the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildProductQuery The current query, for fluid interface
*/
- public function filterByFeatureProd($featureProd, $comparison = null)
+ public function filterByFeatureProduct($featureProduct, $comparison = null)
{
- if ($featureProd instanceof \Thelia\Model\FeatureProd) {
+ if ($featureProduct instanceof \Thelia\Model\FeatureProduct) {
return $this
- ->addUsingAlias(ProductTableMap::ID, $featureProd->getProductId(), $comparison);
- } elseif ($featureProd instanceof ObjectCollection) {
+ ->addUsingAlias(ProductTableMap::ID, $featureProduct->getProductId(), $comparison);
+ } elseif ($featureProduct instanceof ObjectCollection) {
return $this
- ->useFeatureProdQuery()
- ->filterByPrimaryKeys($featureProd->getPrimaryKeys())
+ ->useFeatureProductQuery()
+ ->filterByPrimaryKeys($featureProduct->getPrimaryKeys())
->endUse();
} else {
- throw new PropelException('filterByFeatureProd() only accepts arguments of type \Thelia\Model\FeatureProd or Collection');
+ throw new PropelException('filterByFeatureProduct() only accepts arguments of type \Thelia\Model\FeatureProduct or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the FeatureProd relation
+ * Adds a JOIN clause to the query using the FeatureProduct relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildProductQuery The current query, for fluid interface
*/
- public function joinFeatureProd($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinFeatureProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('FeatureProd');
+ $relationMap = $tableMap->getRelation('FeatureProduct');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -1214,14 +899,14 @@ abstract class ProductQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'FeatureProd');
+ $this->addJoinObject($join, 'FeatureProduct');
}
return $this;
}
/**
- * Use the FeatureProd relation FeatureProd object
+ * Use the FeatureProduct relation FeatureProduct object
*
* @see useQuery()
*
@@ -1229,50 +914,50 @@ abstract class ProductQuery extends ModelCriteria
* 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\FeatureProdQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\FeatureProductQuery A secondary query class using the current class as primary query
*/
- public function useFeatureProdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useFeatureProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinFeatureProd($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'FeatureProd', '\Thelia\Model\FeatureProdQuery');
+ ->joinFeatureProduct($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'FeatureProduct', '\Thelia\Model\FeatureProductQuery');
}
/**
- * Filter the query by a related \Thelia\Model\Stock object
+ * Filter the query by a related \Thelia\Model\ProductSaleElements object
*
- * @param \Thelia\Model\Stock|ObjectCollection $stock the related object to use as filter
+ * @param \Thelia\Model\ProductSaleElements|ObjectCollection $productSaleElements the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildProductQuery The current query, for fluid interface
*/
- public function filterByStock($stock, $comparison = null)
+ public function filterByProductSaleElements($productSaleElements, $comparison = null)
{
- if ($stock instanceof \Thelia\Model\Stock) {
+ if ($productSaleElements instanceof \Thelia\Model\ProductSaleElements) {
return $this
- ->addUsingAlias(ProductTableMap::ID, $stock->getProductId(), $comparison);
- } elseif ($stock instanceof ObjectCollection) {
+ ->addUsingAlias(ProductTableMap::ID, $productSaleElements->getProductId(), $comparison);
+ } elseif ($productSaleElements instanceof ObjectCollection) {
return $this
- ->useStockQuery()
- ->filterByPrimaryKeys($stock->getPrimaryKeys())
+ ->useProductSaleElementsQuery()
+ ->filterByPrimaryKeys($productSaleElements->getPrimaryKeys())
->endUse();
} else {
- throw new PropelException('filterByStock() only accepts arguments of type \Thelia\Model\Stock or Collection');
+ throw new PropelException('filterByProductSaleElements() only accepts arguments of type \Thelia\Model\ProductSaleElements or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the Stock relation
+ * Adds a JOIN clause to the query using the ProductSaleElements relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildProductQuery The current query, for fluid interface
*/
- public function joinStock($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinProductSaleElements($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Stock');
+ $relationMap = $tableMap->getRelation('ProductSaleElements');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -1287,14 +972,14 @@ abstract class ProductQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'Stock');
+ $this->addJoinObject($join, 'ProductSaleElements');
}
return $this;
}
/**
- * Use the Stock relation Stock object
+ * Use the ProductSaleElements relation ProductSaleElements object
*
* @see useQuery()
*
@@ -1302,13 +987,13 @@ abstract class ProductQuery extends ModelCriteria
* 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\StockQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\ProductSaleElementsQuery A secondary query class using the current class as primary query
*/
- public function useStockQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useProductSaleElementsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinStock($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Stock', '\Thelia\Model\StockQuery');
+ ->joinProductSaleElements($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ProductSaleElements', '\Thelia\Model\ProductSaleElementsQuery');
}
/**
diff --git a/core/lib/Thelia/Model/Base/Combination.php b/core/lib/Thelia/Model/Base/ProductSaleElements.php
old mode 100755
new mode 100644
similarity index 70%
rename from core/lib/Thelia/Model/Base/Combination.php
rename to core/lib/Thelia/Model/Base/ProductSaleElements.php
index e5c42425a..22a8c9752
--- a/core/lib/Thelia/Model/Base/Combination.php
+++ b/core/lib/Thelia/Model/Base/ProductSaleElements.php
@@ -21,18 +21,20 @@ use Thelia\Model\AttributeCombination as ChildAttributeCombination;
use Thelia\Model\AttributeCombinationQuery as ChildAttributeCombinationQuery;
use Thelia\Model\CartItem as ChildCartItem;
use Thelia\Model\CartItemQuery as ChildCartItemQuery;
-use Thelia\Model\Combination as ChildCombination;
-use Thelia\Model\CombinationQuery as ChildCombinationQuery;
-use Thelia\Model\Stock as ChildStock;
-use Thelia\Model\StockQuery as ChildStockQuery;
-use Thelia\Model\Map\CombinationTableMap;
+use Thelia\Model\Product as ChildProduct;
+use Thelia\Model\ProductPrice as ChildProductPrice;
+use Thelia\Model\ProductPriceQuery as ChildProductPriceQuery;
+use Thelia\Model\ProductQuery as ChildProductQuery;
+use Thelia\Model\ProductSaleElements as ChildProductSaleElements;
+use Thelia\Model\ProductSaleElementsQuery as ChildProductSaleElementsQuery;
+use Thelia\Model\Map\ProductSaleElementsTableMap;
-abstract class Combination implements ActiveRecordInterface
+abstract class ProductSaleElements implements ActiveRecordInterface
{
/**
* TableMap class name
*/
- const TABLE_MAP = '\\Thelia\\Model\\Map\\CombinationTableMap';
+ const TABLE_MAP = '\\Thelia\\Model\\Map\\ProductSaleElementsTableMap';
/**
@@ -68,10 +70,36 @@ abstract class Combination implements ActiveRecordInterface
protected $id;
/**
- * The value for the ref field.
- * @var string
+ * The value for the product_id field.
+ * @var int
*/
- protected $ref;
+ protected $product_id;
+
+ /**
+ * The value for the quantity field.
+ * @var double
+ */
+ protected $quantity;
+
+ /**
+ * The value for the promo field.
+ * Note: this column has a database default value of: 0
+ * @var int
+ */
+ protected $promo;
+
+ /**
+ * The value for the newness field.
+ * Note: this column has a database default value of: 0
+ * @var int
+ */
+ protected $newness;
+
+ /**
+ * The value for the weight field.
+ * @var double
+ */
+ protected $weight;
/**
* The value for the created_at field.
@@ -85,24 +113,29 @@ abstract class Combination implements ActiveRecordInterface
*/
protected $updated_at;
+ /**
+ * @var Product
+ */
+ protected $aProduct;
+
/**
* @var ObjectCollection|ChildAttributeCombination[] Collection to store aggregation of ChildAttributeCombination objects.
*/
protected $collAttributeCombinations;
protected $collAttributeCombinationsPartial;
- /**
- * @var ObjectCollection|ChildStock[] Collection to store aggregation of ChildStock objects.
- */
- protected $collStocks;
- protected $collStocksPartial;
-
/**
* @var ObjectCollection|ChildCartItem[] Collection to store aggregation of ChildCartItem objects.
*/
protected $collCartItems;
protected $collCartItemsPartial;
+ /**
+ * @var ObjectCollection|ChildProductPrice[] Collection to store aggregation of ChildProductPrice objects.
+ */
+ protected $collProductPrices;
+ protected $collProductPricesPartial;
+
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -121,19 +154,33 @@ abstract class Combination implements ActiveRecordInterface
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
- protected $stocksScheduledForDeletion = null;
+ protected $cartItemsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
- protected $cartItemsScheduledForDeletion = null;
+ protected $productPricesScheduledForDeletion = null;
/**
- * Initializes internal state of Thelia\Model\Base\Combination object.
+ * Applies default values to this object.
+ * This method should be called from the object's constructor (or
+ * equivalent initialization method).
+ * @see __construct()
+ */
+ public function applyDefaultValues()
+ {
+ $this->promo = 0;
+ $this->newness = 0;
+ }
+
+ /**
+ * Initializes internal state of Thelia\Model\Base\ProductSaleElements object.
+ * @see applyDefaults()
*/
public function __construct()
{
+ $this->applyDefaultValues();
}
/**
@@ -225,9 +272,9 @@ abstract class Combination implements ActiveRecordInterface
}
/**
- * Compares this with another Combination instance. If
- * obj is an instance of Combination, delegates to
- * equals(Combination). Otherwise, returns false.
+ * Compares this with another ProductSaleElements instance. If
+ * obj is an instance of ProductSaleElements, delegates to
+ * equals(ProductSaleElements). Otherwise, returns false.
*
* @param obj The object to compare to.
* @return Whether equal to the object specified.
@@ -308,7 +355,7 @@ abstract class Combination implements ActiveRecordInterface
* @param string $name The virtual column name
* @param mixed $value The value to give to the virtual column
*
- * @return Combination The current object, for fluid interface
+ * @return ProductSaleElements The current object, for fluid interface
*/
public function setVirtualColumn($name, $value)
{
@@ -340,7 +387,7 @@ abstract class Combination implements ActiveRecordInterface
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
* @param string $data The source data to import from
*
- * @return Combination The current object, for fluid interface
+ * @return ProductSaleElements The current object, for fluid interface
*/
public function importFrom($parser, $data)
{
@@ -395,14 +442,58 @@ abstract class Combination implements ActiveRecordInterface
}
/**
- * Get the [ref] column value.
+ * Get the [product_id] column value.
*
- * @return string
+ * @return int
*/
- public function getRef()
+ public function getProductId()
{
- return $this->ref;
+ return $this->product_id;
+ }
+
+ /**
+ * Get the [quantity] column value.
+ *
+ * @return double
+ */
+ public function getQuantity()
+ {
+
+ return $this->quantity;
+ }
+
+ /**
+ * Get the [promo] column value.
+ *
+ * @return int
+ */
+ public function getPromo()
+ {
+
+ return $this->promo;
+ }
+
+ /**
+ * Get the [newness] column value.
+ *
+ * @return int
+ */
+ public function getNewness()
+ {
+
+ return $this->newness;
+ }
+
+ /**
+ * Get the [weight] column value.
+ *
+ * @return double
+ */
+ public function getWeight()
+ {
+
+ return $this->weight;
}
/**
@@ -449,7 +540,7 @@ abstract class Combination implements ActiveRecordInterface
* Set the value of [id] column.
*
* @param int $v new value
- * @return \Thelia\Model\Combination The current object (for fluent API support)
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
*/
public function setId($v)
{
@@ -459,7 +550,7 @@ abstract class Combination implements ActiveRecordInterface
if ($this->id !== $v) {
$this->id = $v;
- $this->modifiedColumns[] = CombinationTableMap::ID;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::ID;
}
@@ -467,32 +558,120 @@ abstract class Combination implements ActiveRecordInterface
} // setId()
/**
- * Set the value of [ref] column.
+ * Set the value of [product_id] column.
*
- * @param string $v new value
- * @return \Thelia\Model\Combination The current object (for fluent API support)
+ * @param int $v new value
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
*/
- public function setRef($v)
+ public function setProductId($v)
{
if ($v !== null) {
- $v = (string) $v;
+ $v = (int) $v;
}
- if ($this->ref !== $v) {
- $this->ref = $v;
- $this->modifiedColumns[] = CombinationTableMap::REF;
+ if ($this->product_id !== $v) {
+ $this->product_id = $v;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::PRODUCT_ID;
+ }
+
+ if ($this->aProduct !== null && $this->aProduct->getId() !== $v) {
+ $this->aProduct = null;
}
return $this;
- } // setRef()
+ } // setProductId()
+
+ /**
+ * Set the value of [quantity] column.
+ *
+ * @param double $v new value
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
+ */
+ public function setQuantity($v)
+ {
+ if ($v !== null) {
+ $v = (double) $v;
+ }
+
+ if ($this->quantity !== $v) {
+ $this->quantity = $v;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::QUANTITY;
+ }
+
+
+ return $this;
+ } // setQuantity()
+
+ /**
+ * Set the value of [promo] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
+ */
+ public function setPromo($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->promo !== $v) {
+ $this->promo = $v;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::PROMO;
+ }
+
+
+ return $this;
+ } // setPromo()
+
+ /**
+ * Set the value of [newness] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
+ */
+ public function setNewness($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->newness !== $v) {
+ $this->newness = $v;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::NEWNESS;
+ }
+
+
+ return $this;
+ } // setNewness()
+
+ /**
+ * Set the value of [weight] column.
+ *
+ * @param double $v new value
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
+ */
+ public function setWeight($v)
+ {
+ if ($v !== null) {
+ $v = (double) $v;
+ }
+
+ if ($this->weight !== $v) {
+ $this->weight = $v;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::WEIGHT;
+ }
+
+
+ return $this;
+ } // setWeight()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
- * @return \Thelia\Model\Combination The current object (for fluent API support)
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
*/
public function setCreatedAt($v)
{
@@ -500,7 +679,7 @@ abstract class Combination implements ActiveRecordInterface
if ($this->created_at !== null || $dt !== null) {
if ($dt !== $this->created_at) {
$this->created_at = $dt;
- $this->modifiedColumns[] = CombinationTableMap::CREATED_AT;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::CREATED_AT;
}
} // if either are not null
@@ -513,7 +692,7 @@ abstract class Combination implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
- * @return \Thelia\Model\Combination The current object (for fluent API support)
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
*/
public function setUpdatedAt($v)
{
@@ -521,7 +700,7 @@ abstract class Combination implements ActiveRecordInterface
if ($this->updated_at !== null || $dt !== null) {
if ($dt !== $this->updated_at) {
$this->updated_at = $dt;
- $this->modifiedColumns[] = CombinationTableMap::UPDATED_AT;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::UPDATED_AT;
}
} // if either are not null
@@ -539,6 +718,14 @@ abstract class Combination implements ActiveRecordInterface
*/
public function hasOnlyDefaultValues()
{
+ if ($this->promo !== 0) {
+ return false;
+ }
+
+ if ($this->newness !== 0) {
+ return false;
+ }
+
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
@@ -566,19 +753,31 @@ abstract class Combination implements ActiveRecordInterface
try {
- $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : CombinationTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ProductSaleElementsTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : CombinationTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)];
- $this->ref = (null !== $col) ? (string) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ProductSaleElementsTableMap::translateFieldName('ProductId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->product_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CombinationTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProductSaleElementsTableMap::translateFieldName('Quantity', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->quantity = (null !== $col) ? (double) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductSaleElementsTableMap::translateFieldName('Promo', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->promo = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductSaleElementsTableMap::translateFieldName('Newness', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->newness = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductSaleElementsTableMap::translateFieldName('Weight', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->weight = (null !== $col) ? (double) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductSaleElementsTableMap::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 : CombinationTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductSaleElementsTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -591,10 +790,10 @@ abstract class Combination implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 4; // 4 = CombinationTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 8; // 8 = ProductSaleElementsTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
- throw new PropelException("Error populating \Thelia\Model\Combination object", 0, $e);
+ throw new PropelException("Error populating \Thelia\Model\ProductSaleElements object", 0, $e);
}
}
@@ -613,6 +812,9 @@ abstract class Combination implements ActiveRecordInterface
*/
public function ensureConsistency()
{
+ if ($this->aProduct !== null && $this->product_id !== $this->aProduct->getId()) {
+ $this->aProduct = null;
+ }
} // ensureConsistency
/**
@@ -636,13 +838,13 @@ abstract class Combination implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(CombinationTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getReadConnection(ProductSaleElementsTableMap::DATABASE_NAME);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
- $dataFetcher = ChildCombinationQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $dataFetcher = ChildProductSaleElementsQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$row = $dataFetcher->fetch();
$dataFetcher->close();
if (!$row) {
@@ -652,12 +854,13 @@ abstract class Combination implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
+ $this->aProduct = null;
$this->collAttributeCombinations = null;
- $this->collStocks = null;
-
$this->collCartItems = null;
+ $this->collProductPrices = null;
+
} // if (deep)
}
@@ -667,8 +870,8 @@ abstract class Combination implements ActiveRecordInterface
* @param ConnectionInterface $con
* @return void
* @throws PropelException
- * @see Combination::setDeleted()
- * @see Combination::isDeleted()
+ * @see ProductSaleElements::setDeleted()
+ * @see ProductSaleElements::isDeleted()
*/
public function delete(ConnectionInterface $con = null)
{
@@ -677,12 +880,12 @@ abstract class Combination implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(CombinationTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
- $deleteQuery = ChildCombinationQuery::create()
+ $deleteQuery = ChildProductSaleElementsQuery::create()
->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con);
if ($ret) {
@@ -719,7 +922,7 @@ abstract class Combination implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(CombinationTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
}
$con->beginTransaction();
@@ -729,16 +932,16 @@ abstract class Combination implements ActiveRecordInterface
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
// timestampable behavior
- if (!$this->isColumnModified(CombinationTableMap::CREATED_AT)) {
+ if (!$this->isColumnModified(ProductSaleElementsTableMap::CREATED_AT)) {
$this->setCreatedAt(time());
}
- if (!$this->isColumnModified(CombinationTableMap::UPDATED_AT)) {
+ if (!$this->isColumnModified(ProductSaleElementsTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
// timestampable behavior
- if ($this->isModified() && !$this->isColumnModified(CombinationTableMap::UPDATED_AT)) {
+ if ($this->isModified() && !$this->isColumnModified(ProductSaleElementsTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
}
@@ -750,7 +953,7 @@ abstract class Combination implements ActiveRecordInterface
$this->postUpdate($con);
}
$this->postSave($con);
- CombinationTableMap::addInstanceToPool($this);
+ ProductSaleElementsTableMap::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
@@ -780,6 +983,18 @@ abstract class Combination implements ActiveRecordInterface
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
+ // We call the save method on the following object(s) if they
+ // were passed to this object by their corresponding set
+ // method. This object relates to these object(s) by a
+ // foreign key reference.
+
+ if ($this->aProduct !== null) {
+ if ($this->aProduct->isModified() || $this->aProduct->isNew()) {
+ $affectedRows += $this->aProduct->save($con);
+ }
+ $this->setProduct($this->aProduct);
+ }
+
if ($this->isNew() || $this->isModified()) {
// persist changes
if ($this->isNew()) {
@@ -808,30 +1023,11 @@ abstract class Combination implements ActiveRecordInterface
}
}
- if ($this->stocksScheduledForDeletion !== null) {
- if (!$this->stocksScheduledForDeletion->isEmpty()) {
- foreach ($this->stocksScheduledForDeletion as $stock) {
- // need to save related object because we set the relation to null
- $stock->save($con);
- }
- $this->stocksScheduledForDeletion = null;
- }
- }
-
- if ($this->collStocks !== null) {
- foreach ($this->collStocks as $referrerFK) {
- if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
- $affectedRows += $referrerFK->save($con);
- }
- }
- }
-
if ($this->cartItemsScheduledForDeletion !== null) {
if (!$this->cartItemsScheduledForDeletion->isEmpty()) {
- foreach ($this->cartItemsScheduledForDeletion as $cartItem) {
- // need to save related object because we set the relation to null
- $cartItem->save($con);
- }
+ \Thelia\Model\CartItemQuery::create()
+ ->filterByPrimaryKeys($this->cartItemsScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
$this->cartItemsScheduledForDeletion = null;
}
}
@@ -844,6 +1040,23 @@ abstract class Combination implements ActiveRecordInterface
}
}
+ if ($this->productPricesScheduledForDeletion !== null) {
+ if (!$this->productPricesScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\ProductPriceQuery::create()
+ ->filterByPrimaryKeys($this->productPricesScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->productPricesScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collProductPrices !== null) {
+ foreach ($this->collProductPrices as $referrerFK) {
+ if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
$this->alreadyInSave = false;
}
@@ -864,27 +1077,39 @@ abstract class Combination implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
- $this->modifiedColumns[] = CombinationTableMap::ID;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::ID;
if (null !== $this->id) {
- throw new PropelException('Cannot insert a value for auto-increment primary key (' . CombinationTableMap::ID . ')');
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . ProductSaleElementsTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries
- if ($this->isColumnModified(CombinationTableMap::ID)) {
+ if ($this->isColumnModified(ProductSaleElementsTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
- if ($this->isColumnModified(CombinationTableMap::REF)) {
- $modifiedColumns[':p' . $index++] = 'REF';
+ if ($this->isColumnModified(ProductSaleElementsTableMap::PRODUCT_ID)) {
+ $modifiedColumns[':p' . $index++] = 'PRODUCT_ID';
}
- if ($this->isColumnModified(CombinationTableMap::CREATED_AT)) {
+ if ($this->isColumnModified(ProductSaleElementsTableMap::QUANTITY)) {
+ $modifiedColumns[':p' . $index++] = 'QUANTITY';
+ }
+ if ($this->isColumnModified(ProductSaleElementsTableMap::PROMO)) {
+ $modifiedColumns[':p' . $index++] = 'PROMO';
+ }
+ if ($this->isColumnModified(ProductSaleElementsTableMap::NEWNESS)) {
+ $modifiedColumns[':p' . $index++] = 'NEWNESS';
+ }
+ if ($this->isColumnModified(ProductSaleElementsTableMap::WEIGHT)) {
+ $modifiedColumns[':p' . $index++] = 'WEIGHT';
+ }
+ if ($this->isColumnModified(ProductSaleElementsTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
- if ($this->isColumnModified(CombinationTableMap::UPDATED_AT)) {
+ if ($this->isColumnModified(ProductSaleElementsTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT';
}
$sql = sprintf(
- 'INSERT INTO combination (%s) VALUES (%s)',
+ 'INSERT INTO product_sale_elements (%s) VALUES (%s)',
implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns))
);
@@ -896,8 +1121,20 @@ abstract class Combination implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
- case 'REF':
- $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR);
+ case 'PRODUCT_ID':
+ $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT);
+ break;
+ case 'QUANTITY':
+ $stmt->bindValue($identifier, $this->quantity, PDO::PARAM_STR);
+ break;
+ case 'PROMO':
+ $stmt->bindValue($identifier, $this->promo, PDO::PARAM_INT);
+ break;
+ case 'NEWNESS':
+ $stmt->bindValue($identifier, $this->newness, PDO::PARAM_INT);
+ break;
+ case 'WEIGHT':
+ $stmt->bindValue($identifier, $this->weight, PDO::PARAM_STR);
break;
case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
@@ -951,7 +1188,7 @@ abstract class Combination implements ActiveRecordInterface
*/
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
{
- $pos = CombinationTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = ProductSaleElementsTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
@@ -971,12 +1208,24 @@ abstract class Combination implements ActiveRecordInterface
return $this->getId();
break;
case 1:
- return $this->getRef();
+ return $this->getProductId();
break;
case 2:
- return $this->getCreatedAt();
+ return $this->getQuantity();
break;
case 3:
+ return $this->getPromo();
+ break;
+ case 4:
+ return $this->getNewness();
+ break;
+ case 5:
+ return $this->getWeight();
+ break;
+ case 6:
+ return $this->getCreatedAt();
+ break;
+ case 7:
return $this->getUpdatedAt();
break;
default:
@@ -1002,16 +1251,20 @@ abstract class Combination implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
- if (isset($alreadyDumpedObjects['Combination'][$this->getPrimaryKey()])) {
+ if (isset($alreadyDumpedObjects['ProductSaleElements'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
- $alreadyDumpedObjects['Combination'][$this->getPrimaryKey()] = true;
- $keys = CombinationTableMap::getFieldNames($keyType);
+ $alreadyDumpedObjects['ProductSaleElements'][$this->getPrimaryKey()] = true;
+ $keys = ProductSaleElementsTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
- $keys[1] => $this->getRef(),
- $keys[2] => $this->getCreatedAt(),
- $keys[3] => $this->getUpdatedAt(),
+ $keys[1] => $this->getProductId(),
+ $keys[2] => $this->getQuantity(),
+ $keys[3] => $this->getPromo(),
+ $keys[4] => $this->getNewness(),
+ $keys[5] => $this->getWeight(),
+ $keys[6] => $this->getCreatedAt(),
+ $keys[7] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1020,15 +1273,18 @@ abstract class Combination implements ActiveRecordInterface
}
if ($includeForeignObjects) {
+ if (null !== $this->aProduct) {
+ $result['Product'] = $this->aProduct->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
if (null !== $this->collAttributeCombinations) {
$result['AttributeCombinations'] = $this->collAttributeCombinations->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
- if (null !== $this->collStocks) {
- $result['Stocks'] = $this->collStocks->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
- }
if (null !== $this->collCartItems) {
$result['CartItems'] = $this->collCartItems->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
+ if (null !== $this->collProductPrices) {
+ $result['ProductPrices'] = $this->collProductPrices->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ }
}
return $result;
@@ -1047,7 +1303,7 @@ abstract class Combination implements ActiveRecordInterface
*/
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
{
- $pos = CombinationTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = ProductSaleElementsTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -1067,12 +1323,24 @@ abstract class Combination implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
- $this->setRef($value);
+ $this->setProductId($value);
break;
case 2:
- $this->setCreatedAt($value);
+ $this->setQuantity($value);
break;
case 3:
+ $this->setPromo($value);
+ break;
+ case 4:
+ $this->setNewness($value);
+ break;
+ case 5:
+ $this->setWeight($value);
+ break;
+ case 6:
+ $this->setCreatedAt($value);
+ break;
+ case 7:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1097,12 +1365,16 @@ abstract class Combination implements ActiveRecordInterface
*/
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
- $keys = CombinationTableMap::getFieldNames($keyType);
+ $keys = ProductSaleElementsTableMap::getFieldNames($keyType);
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->setCreatedAt($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]);
+ if (array_key_exists($keys[1], $arr)) $this->setProductId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setQuantity($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setPromo($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setNewness($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setWeight($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]);
+ if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]);
}
/**
@@ -1112,12 +1384,16 @@ abstract class Combination implements ActiveRecordInterface
*/
public function buildCriteria()
{
- $criteria = new Criteria(CombinationTableMap::DATABASE_NAME);
+ $criteria = new Criteria(ProductSaleElementsTableMap::DATABASE_NAME);
- if ($this->isColumnModified(CombinationTableMap::ID)) $criteria->add(CombinationTableMap::ID, $this->id);
- if ($this->isColumnModified(CombinationTableMap::REF)) $criteria->add(CombinationTableMap::REF, $this->ref);
- if ($this->isColumnModified(CombinationTableMap::CREATED_AT)) $criteria->add(CombinationTableMap::CREATED_AT, $this->created_at);
- if ($this->isColumnModified(CombinationTableMap::UPDATED_AT)) $criteria->add(CombinationTableMap::UPDATED_AT, $this->updated_at);
+ if ($this->isColumnModified(ProductSaleElementsTableMap::ID)) $criteria->add(ProductSaleElementsTableMap::ID, $this->id);
+ if ($this->isColumnModified(ProductSaleElementsTableMap::PRODUCT_ID)) $criteria->add(ProductSaleElementsTableMap::PRODUCT_ID, $this->product_id);
+ if ($this->isColumnModified(ProductSaleElementsTableMap::QUANTITY)) $criteria->add(ProductSaleElementsTableMap::QUANTITY, $this->quantity);
+ if ($this->isColumnModified(ProductSaleElementsTableMap::PROMO)) $criteria->add(ProductSaleElementsTableMap::PROMO, $this->promo);
+ if ($this->isColumnModified(ProductSaleElementsTableMap::NEWNESS)) $criteria->add(ProductSaleElementsTableMap::NEWNESS, $this->newness);
+ if ($this->isColumnModified(ProductSaleElementsTableMap::WEIGHT)) $criteria->add(ProductSaleElementsTableMap::WEIGHT, $this->weight);
+ if ($this->isColumnModified(ProductSaleElementsTableMap::CREATED_AT)) $criteria->add(ProductSaleElementsTableMap::CREATED_AT, $this->created_at);
+ if ($this->isColumnModified(ProductSaleElementsTableMap::UPDATED_AT)) $criteria->add(ProductSaleElementsTableMap::UPDATED_AT, $this->updated_at);
return $criteria;
}
@@ -1132,8 +1408,8 @@ abstract class Combination implements ActiveRecordInterface
*/
public function buildPkeyCriteria()
{
- $criteria = new Criteria(CombinationTableMap::DATABASE_NAME);
- $criteria->add(CombinationTableMap::ID, $this->id);
+ $criteria = new Criteria(ProductSaleElementsTableMap::DATABASE_NAME);
+ $criteria->add(ProductSaleElementsTableMap::ID, $this->id);
return $criteria;
}
@@ -1174,14 +1450,18 @@ abstract class Combination implements ActiveRecordInterface
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
- * @param object $copyObj An object of \Thelia\Model\Combination (or compatible) type.
+ * @param object $copyObj An object of \Thelia\Model\ProductSaleElements (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
* @throws PropelException
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
- $copyObj->setRef($this->getRef());
+ $copyObj->setProductId($this->getProductId());
+ $copyObj->setQuantity($this->getQuantity());
+ $copyObj->setPromo($this->getPromo());
+ $copyObj->setNewness($this->getNewness());
+ $copyObj->setWeight($this->getWeight());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -1196,18 +1476,18 @@ abstract class Combination implements ActiveRecordInterface
}
}
- foreach ($this->getStocks() as $relObj) {
- if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
- $copyObj->addStock($relObj->copy($deepCopy));
- }
- }
-
foreach ($this->getCartItems() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addCartItem($relObj->copy($deepCopy));
}
}
+ foreach ($this->getProductPrices() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addProductPrice($relObj->copy($deepCopy));
+ }
+ }
+
} // if ($deepCopy)
if ($makeNew) {
@@ -1225,7 +1505,7 @@ abstract class Combination implements ActiveRecordInterface
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return \Thelia\Model\Combination Clone of current object.
+ * @return \Thelia\Model\ProductSaleElements Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -1238,6 +1518,57 @@ abstract class Combination implements ActiveRecordInterface
return $copyObj;
}
+ /**
+ * Declares an association between this object and a ChildProduct object.
+ *
+ * @param ChildProduct $v
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setProduct(ChildProduct $v = null)
+ {
+ if ($v === null) {
+ $this->setProductId(NULL);
+ } else {
+ $this->setProductId($v->getId());
+ }
+
+ $this->aProduct = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildProduct object, it will not be re-added.
+ if ($v !== null) {
+ $v->addProductSaleElements($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildProduct object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildProduct The associated ChildProduct object.
+ * @throws PropelException
+ */
+ public function getProduct(ConnectionInterface $con = null)
+ {
+ if ($this->aProduct === null && ($this->product_id !== null)) {
+ $this->aProduct = ChildProductQuery::create()->findPk($this->product_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->aProduct->addProductSaleElementss($this);
+ */
+ }
+
+ return $this->aProduct;
+ }
+
/**
* Initializes a collection based on the name of a relation.
@@ -1252,12 +1583,12 @@ abstract class Combination implements ActiveRecordInterface
if ('AttributeCombination' == $relationName) {
return $this->initAttributeCombinations();
}
- if ('Stock' == $relationName) {
- return $this->initStocks();
- }
if ('CartItem' == $relationName) {
return $this->initCartItems();
}
+ if ('ProductPrice' == $relationName) {
+ return $this->initProductPrices();
+ }
}
/**
@@ -1309,7 +1640,7 @@ abstract class Combination implements ActiveRecordInterface
* 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 ChildCombination is new, it will return
+ * If this ChildProductSaleElements 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
@@ -1326,7 +1657,7 @@ abstract class Combination implements ActiveRecordInterface
$this->initAttributeCombinations();
} else {
$collAttributeCombinations = ChildAttributeCombinationQuery::create(null, $criteria)
- ->filterByCombination($this)
+ ->filterByProductSaleElements($this)
->find($con);
if (null !== $criteria) {
@@ -1371,7 +1702,7 @@ abstract class Combination implements ActiveRecordInterface
*
* @param Collection $attributeCombinations A Propel collection.
* @param ConnectionInterface $con Optional connection object
- * @return ChildCombination The current object (for fluent API support)
+ * @return ChildProductSaleElements The current object (for fluent API support)
*/
public function setAttributeCombinations(Collection $attributeCombinations, ConnectionInterface $con = null)
{
@@ -1384,7 +1715,7 @@ abstract class Combination implements ActiveRecordInterface
$this->attributeCombinationsScheduledForDeletion = clone $attributeCombinationsToDelete;
foreach ($attributeCombinationsToDelete as $attributeCombinationRemoved) {
- $attributeCombinationRemoved->setCombination(null);
+ $attributeCombinationRemoved->setProductSaleElements(null);
}
$this->collAttributeCombinations = null;
@@ -1425,7 +1756,7 @@ abstract class Combination implements ActiveRecordInterface
}
return $query
- ->filterByCombination($this)
+ ->filterByProductSaleElements($this)
->count($con);
}
@@ -1437,7 +1768,7 @@ abstract class Combination implements ActiveRecordInterface
* through the ChildAttributeCombination foreign key attribute.
*
* @param ChildAttributeCombination $l ChildAttributeCombination
- * @return \Thelia\Model\Combination The current object (for fluent API support)
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
*/
public function addAttributeCombination(ChildAttributeCombination $l)
{
@@ -1459,12 +1790,12 @@ abstract class Combination implements ActiveRecordInterface
protected function doAddAttributeCombination($attributeCombination)
{
$this->collAttributeCombinations[]= $attributeCombination;
- $attributeCombination->setCombination($this);
+ $attributeCombination->setProductSaleElements($this);
}
/**
* @param AttributeCombination $attributeCombination The attributeCombination object to remove.
- * @return ChildCombination The current object (for fluent API support)
+ * @return ChildProductSaleElements The current object (for fluent API support)
*/
public function removeAttributeCombination($attributeCombination)
{
@@ -1475,7 +1806,7 @@ abstract class Combination implements ActiveRecordInterface
$this->attributeCombinationsScheduledForDeletion->clear();
}
$this->attributeCombinationsScheduledForDeletion[]= clone $attributeCombination;
- $attributeCombination->setCombination(null);
+ $attributeCombination->setProductSaleElements(null);
}
return $this;
@@ -1485,13 +1816,13 @@ abstract class Combination implements ActiveRecordInterface
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
- * Otherwise if this Combination is new, it will return
- * an empty collection; or if this Combination has previously
+ * Otherwise if this ProductSaleElements is new, it will return
+ * an empty collection; or if this ProductSaleElements has previously
* been saved, it will retrieve related AttributeCombinations 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 Combination.
+ * actually need in ProductSaleElements.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
@@ -1510,13 +1841,13 @@ abstract class Combination implements ActiveRecordInterface
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
- * Otherwise if this Combination is new, it will return
- * an empty collection; or if this Combination has previously
+ * Otherwise if this ProductSaleElements is new, it will return
+ * an empty collection; or if this ProductSaleElements has previously
* been saved, it will retrieve related AttributeCombinations 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 Combination.
+ * actually need in ProductSaleElements.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
@@ -1531,249 +1862,6 @@ abstract class Combination implements ActiveRecordInterface
return $this->getAttributeCombinations($query, $con);
}
- /**
- * Clears out the collStocks 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 addStocks()
- */
- public function clearStocks()
- {
- $this->collStocks = null; // important to set this to NULL since that means it is uninitialized
- }
-
- /**
- * Reset is the collStocks collection loaded partially.
- */
- public function resetPartialStocks($v = true)
- {
- $this->collStocksPartial = $v;
- }
-
- /**
- * Initializes the collStocks collection.
- *
- * By default this just sets the collStocks collection to an empty array (like clearcollStocks());
- * 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 initStocks($overrideExisting = true)
- {
- if (null !== $this->collStocks && !$overrideExisting) {
- return;
- }
- $this->collStocks = new ObjectCollection();
- $this->collStocks->setModel('\Thelia\Model\Stock');
- }
-
- /**
- * Gets an array of ChildStock 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 ChildCombination 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|ChildStock[] List of ChildStock objects
- * @throws PropelException
- */
- public function getStocks($criteria = null, ConnectionInterface $con = null)
- {
- $partial = $this->collStocksPartial && !$this->isNew();
- if (null === $this->collStocks || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collStocks) {
- // return empty collection
- $this->initStocks();
- } else {
- $collStocks = ChildStockQuery::create(null, $criteria)
- ->filterByCombination($this)
- ->find($con);
-
- if (null !== $criteria) {
- if (false !== $this->collStocksPartial && count($collStocks)) {
- $this->initStocks(false);
-
- foreach ($collStocks as $obj) {
- if (false == $this->collStocks->contains($obj)) {
- $this->collStocks->append($obj);
- }
- }
-
- $this->collStocksPartial = true;
- }
-
- $collStocks->getInternalIterator()->rewind();
-
- return $collStocks;
- }
-
- if ($partial && $this->collStocks) {
- foreach ($this->collStocks as $obj) {
- if ($obj->isNew()) {
- $collStocks[] = $obj;
- }
- }
- }
-
- $this->collStocks = $collStocks;
- $this->collStocksPartial = false;
- }
- }
-
- return $this->collStocks;
- }
-
- /**
- * Sets a collection of Stock 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 $stocks A Propel collection.
- * @param ConnectionInterface $con Optional connection object
- * @return ChildCombination The current object (for fluent API support)
- */
- public function setStocks(Collection $stocks, ConnectionInterface $con = null)
- {
- $stocksToDelete = $this->getStocks(new Criteria(), $con)->diff($stocks);
-
-
- $this->stocksScheduledForDeletion = $stocksToDelete;
-
- foreach ($stocksToDelete as $stockRemoved) {
- $stockRemoved->setCombination(null);
- }
-
- $this->collStocks = null;
- foreach ($stocks as $stock) {
- $this->addStock($stock);
- }
-
- $this->collStocks = $stocks;
- $this->collStocksPartial = false;
-
- return $this;
- }
-
- /**
- * Returns the number of related Stock objects.
- *
- * @param Criteria $criteria
- * @param boolean $distinct
- * @param ConnectionInterface $con
- * @return int Count of related Stock objects.
- * @throws PropelException
- */
- public function countStocks(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
- {
- $partial = $this->collStocksPartial && !$this->isNew();
- if (null === $this->collStocks || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collStocks) {
- return 0;
- }
-
- if ($partial && !$criteria) {
- return count($this->getStocks());
- }
-
- $query = ChildStockQuery::create(null, $criteria);
- if ($distinct) {
- $query->distinct();
- }
-
- return $query
- ->filterByCombination($this)
- ->count($con);
- }
-
- return count($this->collStocks);
- }
-
- /**
- * Method called to associate a ChildStock object to this object
- * through the ChildStock foreign key attribute.
- *
- * @param ChildStock $l ChildStock
- * @return \Thelia\Model\Combination The current object (for fluent API support)
- */
- public function addStock(ChildStock $l)
- {
- if ($this->collStocks === null) {
- $this->initStocks();
- $this->collStocksPartial = true;
- }
-
- if (!in_array($l, $this->collStocks->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
- $this->doAddStock($l);
- }
-
- return $this;
- }
-
- /**
- * @param Stock $stock The stock object to add.
- */
- protected function doAddStock($stock)
- {
- $this->collStocks[]= $stock;
- $stock->setCombination($this);
- }
-
- /**
- * @param Stock $stock The stock object to remove.
- * @return ChildCombination The current object (for fluent API support)
- */
- public function removeStock($stock)
- {
- if ($this->getStocks()->contains($stock)) {
- $this->collStocks->remove($this->collStocks->search($stock));
- if (null === $this->stocksScheduledForDeletion) {
- $this->stocksScheduledForDeletion = clone $this->collStocks;
- $this->stocksScheduledForDeletion->clear();
- }
- $this->stocksScheduledForDeletion[]= $stock;
- $stock->setCombination(null);
- }
-
- return $this;
- }
-
-
- /**
- * If this collection has already been initialized with
- * an identical criteria, it returns the collection.
- * Otherwise if this Combination is new, it will return
- * an empty collection; or if this Combination has previously
- * been saved, it will retrieve related Stocks 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 Combination.
- *
- * @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|ChildStock[] List of ChildStock objects
- */
- public function getStocksJoinProduct($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
- {
- $query = ChildStockQuery::create(null, $criteria);
- $query->joinWith('Product', $joinBehavior);
-
- return $this->getStocks($query, $con);
- }
-
/**
* Clears out the collCartItems collection
*
@@ -1823,7 +1911,7 @@ abstract class Combination implements ActiveRecordInterface
* 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 ChildCombination is new, it will return
+ * If this ChildProductSaleElements 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
@@ -1840,7 +1928,7 @@ abstract class Combination implements ActiveRecordInterface
$this->initCartItems();
} else {
$collCartItems = ChildCartItemQuery::create(null, $criteria)
- ->filterByCombination($this)
+ ->filterByProductSaleElements($this)
->find($con);
if (null !== $criteria) {
@@ -1885,7 +1973,7 @@ abstract class Combination implements ActiveRecordInterface
*
* @param Collection $cartItems A Propel collection.
* @param ConnectionInterface $con Optional connection object
- * @return ChildCombination The current object (for fluent API support)
+ * @return ChildProductSaleElements The current object (for fluent API support)
*/
public function setCartItems(Collection $cartItems, ConnectionInterface $con = null)
{
@@ -1895,7 +1983,7 @@ abstract class Combination implements ActiveRecordInterface
$this->cartItemsScheduledForDeletion = $cartItemsToDelete;
foreach ($cartItemsToDelete as $cartItemRemoved) {
- $cartItemRemoved->setCombination(null);
+ $cartItemRemoved->setProductSaleElements(null);
}
$this->collCartItems = null;
@@ -1936,7 +2024,7 @@ abstract class Combination implements ActiveRecordInterface
}
return $query
- ->filterByCombination($this)
+ ->filterByProductSaleElements($this)
->count($con);
}
@@ -1948,7 +2036,7 @@ abstract class Combination implements ActiveRecordInterface
* through the ChildCartItem foreign key attribute.
*
* @param ChildCartItem $l ChildCartItem
- * @return \Thelia\Model\Combination The current object (for fluent API support)
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
*/
public function addCartItem(ChildCartItem $l)
{
@@ -1970,12 +2058,12 @@ abstract class Combination implements ActiveRecordInterface
protected function doAddCartItem($cartItem)
{
$this->collCartItems[]= $cartItem;
- $cartItem->setCombination($this);
+ $cartItem->setProductSaleElements($this);
}
/**
* @param CartItem $cartItem The cartItem object to remove.
- * @return ChildCombination The current object (for fluent API support)
+ * @return ChildProductSaleElements The current object (for fluent API support)
*/
public function removeCartItem($cartItem)
{
@@ -1985,8 +2073,8 @@ abstract class Combination implements ActiveRecordInterface
$this->cartItemsScheduledForDeletion = clone $this->collCartItems;
$this->cartItemsScheduledForDeletion->clear();
}
- $this->cartItemsScheduledForDeletion[]= $cartItem;
- $cartItem->setCombination(null);
+ $this->cartItemsScheduledForDeletion[]= clone $cartItem;
+ $cartItem->setProductSaleElements(null);
}
return $this;
@@ -1996,13 +2084,13 @@ abstract class Combination implements ActiveRecordInterface
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
- * Otherwise if this Combination is new, it will return
- * an empty collection; or if this Combination has previously
+ * Otherwise if this ProductSaleElements is new, it will return
+ * an empty collection; or if this ProductSaleElements has previously
* been saved, it will retrieve related CartItems 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 Combination.
+ * actually need in ProductSaleElements.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
@@ -2021,13 +2109,13 @@ abstract class Combination implements ActiveRecordInterface
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
- * Otherwise if this Combination is new, it will return
- * an empty collection; or if this Combination has previously
+ * Otherwise if this ProductSaleElements is new, it will return
+ * an empty collection; or if this ProductSaleElements has previously
* been saved, it will retrieve related CartItems 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 Combination.
+ * actually need in ProductSaleElements.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
@@ -2042,17 +2130,265 @@ abstract class Combination implements ActiveRecordInterface
return $this->getCartItems($query, $con);
}
+ /**
+ * Clears out the collProductPrices 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 addProductPrices()
+ */
+ public function clearProductPrices()
+ {
+ $this->collProductPrices = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collProductPrices collection loaded partially.
+ */
+ public function resetPartialProductPrices($v = true)
+ {
+ $this->collProductPricesPartial = $v;
+ }
+
+ /**
+ * Initializes the collProductPrices collection.
+ *
+ * By default this just sets the collProductPrices collection to an empty array (like clearcollProductPrices());
+ * 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 initProductPrices($overrideExisting = true)
+ {
+ if (null !== $this->collProductPrices && !$overrideExisting) {
+ return;
+ }
+ $this->collProductPrices = new ObjectCollection();
+ $this->collProductPrices->setModel('\Thelia\Model\ProductPrice');
+ }
+
+ /**
+ * Gets an array of ChildProductPrice 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 ChildProductSaleElements 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|ChildProductPrice[] List of ChildProductPrice objects
+ * @throws PropelException
+ */
+ public function getProductPrices($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collProductPricesPartial && !$this->isNew();
+ if (null === $this->collProductPrices || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collProductPrices) {
+ // return empty collection
+ $this->initProductPrices();
+ } else {
+ $collProductPrices = ChildProductPriceQuery::create(null, $criteria)
+ ->filterByProductSaleElements($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collProductPricesPartial && count($collProductPrices)) {
+ $this->initProductPrices(false);
+
+ foreach ($collProductPrices as $obj) {
+ if (false == $this->collProductPrices->contains($obj)) {
+ $this->collProductPrices->append($obj);
+ }
+ }
+
+ $this->collProductPricesPartial = true;
+ }
+
+ $collProductPrices->getInternalIterator()->rewind();
+
+ return $collProductPrices;
+ }
+
+ if ($partial && $this->collProductPrices) {
+ foreach ($this->collProductPrices as $obj) {
+ if ($obj->isNew()) {
+ $collProductPrices[] = $obj;
+ }
+ }
+ }
+
+ $this->collProductPrices = $collProductPrices;
+ $this->collProductPricesPartial = false;
+ }
+ }
+
+ return $this->collProductPrices;
+ }
+
+ /**
+ * Sets a collection of ProductPrice 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 $productPrices A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildProductSaleElements The current object (for fluent API support)
+ */
+ public function setProductPrices(Collection $productPrices, ConnectionInterface $con = null)
+ {
+ $productPricesToDelete = $this->getProductPrices(new Criteria(), $con)->diff($productPrices);
+
+
+ $this->productPricesScheduledForDeletion = $productPricesToDelete;
+
+ foreach ($productPricesToDelete as $productPriceRemoved) {
+ $productPriceRemoved->setProductSaleElements(null);
+ }
+
+ $this->collProductPrices = null;
+ foreach ($productPrices as $productPrice) {
+ $this->addProductPrice($productPrice);
+ }
+
+ $this->collProductPrices = $productPrices;
+ $this->collProductPricesPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related ProductPrice objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related ProductPrice objects.
+ * @throws PropelException
+ */
+ public function countProductPrices(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collProductPricesPartial && !$this->isNew();
+ if (null === $this->collProductPrices || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collProductPrices) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getProductPrices());
+ }
+
+ $query = ChildProductPriceQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterByProductSaleElements($this)
+ ->count($con);
+ }
+
+ return count($this->collProductPrices);
+ }
+
+ /**
+ * Method called to associate a ChildProductPrice object to this object
+ * through the ChildProductPrice foreign key attribute.
+ *
+ * @param ChildProductPrice $l ChildProductPrice
+ * @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
+ */
+ public function addProductPrice(ChildProductPrice $l)
+ {
+ if ($this->collProductPrices === null) {
+ $this->initProductPrices();
+ $this->collProductPricesPartial = true;
+ }
+
+ if (!in_array($l, $this->collProductPrices->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddProductPrice($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param ProductPrice $productPrice The productPrice object to add.
+ */
+ protected function doAddProductPrice($productPrice)
+ {
+ $this->collProductPrices[]= $productPrice;
+ $productPrice->setProductSaleElements($this);
+ }
+
+ /**
+ * @param ProductPrice $productPrice The productPrice object to remove.
+ * @return ChildProductSaleElements The current object (for fluent API support)
+ */
+ public function removeProductPrice($productPrice)
+ {
+ if ($this->getProductPrices()->contains($productPrice)) {
+ $this->collProductPrices->remove($this->collProductPrices->search($productPrice));
+ if (null === $this->productPricesScheduledForDeletion) {
+ $this->productPricesScheduledForDeletion = clone $this->collProductPrices;
+ $this->productPricesScheduledForDeletion->clear();
+ }
+ $this->productPricesScheduledForDeletion[]= clone $productPrice;
+ $productPrice->setProductSaleElements(null);
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * If this collection has already been initialized with
+ * an identical criteria, it returns the collection.
+ * Otherwise if this ProductSaleElements is new, it will return
+ * an empty collection; or if this ProductSaleElements has previously
+ * been saved, it will retrieve related ProductPrices 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 ProductSaleElements.
+ *
+ * @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|ChildProductPrice[] List of ChildProductPrice objects
+ */
+ public function getProductPricesJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ {
+ $query = ChildProductPriceQuery::create(null, $criteria);
+ $query->joinWith('Currency', $joinBehavior);
+
+ return $this->getProductPrices($query, $con);
+ }
+
/**
* Clears the current object and sets all attributes to their default values
*/
public function clear()
{
$this->id = null;
- $this->ref = null;
+ $this->product_id = null;
+ $this->quantity = null;
+ $this->promo = null;
+ $this->newness = null;
+ $this->weight = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
+ $this->applyDefaultValues();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);
@@ -2075,13 +2411,13 @@ abstract class Combination implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
- if ($this->collStocks) {
- foreach ($this->collStocks as $o) {
+ if ($this->collCartItems) {
+ foreach ($this->collCartItems as $o) {
$o->clearAllReferences($deep);
}
}
- if ($this->collCartItems) {
- foreach ($this->collCartItems as $o) {
+ if ($this->collProductPrices) {
+ foreach ($this->collProductPrices as $o) {
$o->clearAllReferences($deep);
}
}
@@ -2091,14 +2427,15 @@ abstract class Combination implements ActiveRecordInterface
$this->collAttributeCombinations->clearIterator();
}
$this->collAttributeCombinations = null;
- if ($this->collStocks instanceof Collection) {
- $this->collStocks->clearIterator();
- }
- $this->collStocks = null;
if ($this->collCartItems instanceof Collection) {
$this->collCartItems->clearIterator();
}
$this->collCartItems = null;
+ if ($this->collProductPrices instanceof Collection) {
+ $this->collProductPrices->clearIterator();
+ }
+ $this->collProductPrices = null;
+ $this->aProduct = null;
}
/**
@@ -2108,7 +2445,7 @@ abstract class Combination implements ActiveRecordInterface
*/
public function __toString()
{
- return (string) $this->exportTo(CombinationTableMap::DEFAULT_STRING_FORMAT);
+ return (string) $this->exportTo(ProductSaleElementsTableMap::DEFAULT_STRING_FORMAT);
}
// timestampable behavior
@@ -2116,11 +2453,11 @@ abstract class Combination implements ActiveRecordInterface
/**
* Mark the current object so that the update date doesn't get updated during next save
*
- * @return ChildCombination The current object (for fluent API support)
+ * @return ChildProductSaleElements The current object (for fluent API support)
*/
public function keepUpdateDateUnchanged()
{
- $this->modifiedColumns[] = CombinationTableMap::UPDATED_AT;
+ $this->modifiedColumns[] = ProductSaleElementsTableMap::UPDATED_AT;
return $this;
}
diff --git a/core/lib/Thelia/Model/Base/ProductSaleElementsQuery.php b/core/lib/Thelia/Model/Base/ProductSaleElementsQuery.php
new file mode 100644
index 000000000..9892bff51
--- /dev/null
+++ b/core/lib/Thelia/Model/Base/ProductSaleElementsQuery.php
@@ -0,0 +1,1044 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildProductSaleElements|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = ProductSaleElementsTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(ProductSaleElementsTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildProductSaleElements A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, PRODUCT_ID, QUANTITY, PROMO, NEWNESS, WEIGHT, CREATED_AT, UPDATED_AT FROM product_sale_elements WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildProductSaleElements();
+ $obj->hydrate($row);
+ ProductSaleElementsTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildProductSaleElements|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @param mixed $id 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 ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the product_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByProductId(1234); // WHERE product_id = 1234
+ * $query->filterByProductId(array(12, 34)); // WHERE product_id IN (12, 34)
+ * $query->filterByProductId(array('min' => 12)); // WHERE product_id > 12
+ *
+ *
+ * @see filterByProduct()
+ *
+ * @param mixed $productId 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 ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByProductId($productId = null, $comparison = null)
+ {
+ if (is_array($productId)) {
+ $useMinMax = false;
+ if (isset($productId['min'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($productId['max'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::PRODUCT_ID, $productId, $comparison);
+ }
+
+ /**
+ * Filter the query on the quantity column
+ *
+ * Example usage:
+ *
+ * $query->filterByQuantity(1234); // WHERE quantity = 1234
+ * $query->filterByQuantity(array(12, 34)); // WHERE quantity IN (12, 34)
+ * $query->filterByQuantity(array('min' => 12)); // WHERE quantity > 12
+ *
+ *
+ * @param mixed $quantity 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 ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByQuantity($quantity = null, $comparison = null)
+ {
+ if (is_array($quantity)) {
+ $useMinMax = false;
+ if (isset($quantity['min'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::QUANTITY, $quantity['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($quantity['max'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::QUANTITY, $quantity['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::QUANTITY, $quantity, $comparison);
+ }
+
+ /**
+ * Filter the query on the promo column
+ *
+ * Example usage:
+ *
+ * $query->filterByPromo(1234); // WHERE promo = 1234
+ * $query->filterByPromo(array(12, 34)); // WHERE promo IN (12, 34)
+ * $query->filterByPromo(array('min' => 12)); // WHERE promo > 12
+ *
+ *
+ * @param mixed $promo 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 ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByPromo($promo = null, $comparison = null)
+ {
+ if (is_array($promo)) {
+ $useMinMax = false;
+ if (isset($promo['min'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::PROMO, $promo['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($promo['max'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::PROMO, $promo['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::PROMO, $promo, $comparison);
+ }
+
+ /**
+ * Filter the query on the newness column
+ *
+ * Example usage:
+ *
+ * $query->filterByNewness(1234); // WHERE newness = 1234
+ * $query->filterByNewness(array(12, 34)); // WHERE newness IN (12, 34)
+ * $query->filterByNewness(array('min' => 12)); // WHERE newness > 12
+ *
+ *
+ * @param mixed $newness 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 ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByNewness($newness = null, $comparison = null)
+ {
+ if (is_array($newness)) {
+ $useMinMax = false;
+ if (isset($newness['min'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::NEWNESS, $newness['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($newness['max'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::NEWNESS, $newness['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::NEWNESS, $newness, $comparison);
+ }
+
+ /**
+ * Filter the query on the weight column
+ *
+ * Example usage:
+ *
+ * $query->filterByWeight(1234); // WHERE weight = 1234
+ * $query->filterByWeight(array(12, 34)); // WHERE weight IN (12, 34)
+ * $query->filterByWeight(array('min' => 12)); // WHERE weight > 12
+ *
+ *
+ * @param mixed $weight 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 ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByWeight($weight = null, $comparison = null)
+ {
+ if (is_array($weight)) {
+ $useMinMax = false;
+ if (isset($weight['min'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::WEIGHT, $weight['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($weight['max'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::WEIGHT, $weight['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::WEIGHT, $weight, $comparison);
+ }
+
+ /**
+ * Filter the query on the created_at column
+ *
+ * Example usage:
+ *
+ * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
+ * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
+ * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
+ *
+ *
+ * @param mixed $createdAt The value to use as filter.
+ * Values can be integers (unix timestamps), DateTime objects, or strings.
+ * Empty strings are treated as NULL.
+ * 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 ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByCreatedAt($createdAt = null, $comparison = null)
+ {
+ if (is_array($createdAt)) {
+ $useMinMax = false;
+ if (isset($createdAt['min'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($createdAt['max'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::CREATED_AT, $createdAt, $comparison);
+ }
+
+ /**
+ * Filter the query on the updated_at column
+ *
+ * Example usage:
+ *
+ * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
+ * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
+ * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
+ *
+ *
+ * @param mixed $updatedAt The value to use as filter.
+ * Values can be integers (unix timestamps), DateTime objects, or strings.
+ * Empty strings are treated as NULL.
+ * 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 ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByUpdatedAt($updatedAt = null, $comparison = null)
+ {
+ if (is_array($updatedAt)) {
+ $useMinMax = false;
+ if (isset($updatedAt['min'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($updatedAt['max'])) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ProductSaleElementsTableMap::UPDATED_AT, $updatedAt, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\Product object
+ *
+ * @param \Thelia\Model\Product|ObjectCollection $product The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByProduct($product, $comparison = null)
+ {
+ if ($product instanceof \Thelia\Model\Product) {
+ return $this
+ ->addUsingAlias(ProductSaleElementsTableMap::PRODUCT_ID, $product->getId(), $comparison);
+ } elseif ($product instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(ProductSaleElementsTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByProduct() only accepts arguments of type \Thelia\Model\Product or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Product relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function joinProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Product');
+
+ // 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, 'Product');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Product relation Product 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\ProductQuery A secondary query class using the current class as primary query
+ */
+ public function useProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinProduct($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Product', '\Thelia\Model\ProductQuery');
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\AttributeCombination object
+ *
+ * @param \Thelia\Model\AttributeCombination|ObjectCollection $attributeCombination the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByAttributeCombination($attributeCombination, $comparison = null)
+ {
+ if ($attributeCombination instanceof \Thelia\Model\AttributeCombination) {
+ return $this
+ ->addUsingAlias(ProductSaleElementsTableMap::ID, $attributeCombination->getProductSaleElementsId(), $comparison);
+ } elseif ($attributeCombination instanceof ObjectCollection) {
+ return $this
+ ->useAttributeCombinationQuery()
+ ->filterByPrimaryKeys($attributeCombination->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByAttributeCombination() only accepts arguments of type \Thelia\Model\AttributeCombination or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the AttributeCombination relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function joinAttributeCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('AttributeCombination');
+
+ // 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, 'AttributeCombination');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the AttributeCombination relation AttributeCombination 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\AttributeCombinationQuery A secondary query class using the current class as primary query
+ */
+ public function useAttributeCombinationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinAttributeCombination($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'AttributeCombination', '\Thelia\Model\AttributeCombinationQuery');
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\CartItem object
+ *
+ * @param \Thelia\Model\CartItem|ObjectCollection $cartItem the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByCartItem($cartItem, $comparison = null)
+ {
+ if ($cartItem instanceof \Thelia\Model\CartItem) {
+ return $this
+ ->addUsingAlias(ProductSaleElementsTableMap::ID, $cartItem->getProductSaleElementsId(), $comparison);
+ } elseif ($cartItem instanceof ObjectCollection) {
+ return $this
+ ->useCartItemQuery()
+ ->filterByPrimaryKeys($cartItem->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByCartItem() only accepts arguments of type \Thelia\Model\CartItem or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the CartItem relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function joinCartItem($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('CartItem');
+
+ // 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, 'CartItem');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the CartItem relation CartItem 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\CartItemQuery A secondary query class using the current class as primary query
+ */
+ public function useCartItemQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinCartItem($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'CartItem', '\Thelia\Model\CartItemQuery');
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\ProductPrice object
+ *
+ * @param \Thelia\Model\ProductPrice|ObjectCollection $productPrice the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function filterByProductPrice($productPrice, $comparison = null)
+ {
+ if ($productPrice instanceof \Thelia\Model\ProductPrice) {
+ return $this
+ ->addUsingAlias(ProductSaleElementsTableMap::ID, $productPrice->getProductSaleElementsId(), $comparison);
+ } elseif ($productPrice instanceof ObjectCollection) {
+ return $this
+ ->useProductPriceQuery()
+ ->filterByPrimaryKeys($productPrice->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByProductPrice() only accepts arguments of type \Thelia\Model\ProductPrice or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the ProductPrice relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function joinProductPrice($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('ProductPrice');
+
+ // 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, 'ProductPrice');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the ProductPrice relation ProductPrice 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\ProductPriceQuery A secondary query class using the current class as primary query
+ */
+ public function useProductPriceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinProductPrice($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ProductPrice', '\Thelia\Model\ProductPriceQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildProductSaleElements $productSaleElements Object to remove from the list of results
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function prune($productSaleElements = null)
+ {
+ if ($productSaleElements) {
+ $this->addUsingAlias(ProductSaleElementsTableMap::ID, $productSaleElements->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the product_sale_elements table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ ProductSaleElementsTableMap::clearInstancePool();
+ ProductSaleElementsTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildProductSaleElements or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildProductSaleElements object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(ProductSaleElementsTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ ProductSaleElementsTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ ProductSaleElementsTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ // timestampable behavior
+
+ /**
+ * Filter by the latest updated
+ *
+ * @param int $nbDays Maximum age of the latest update in days
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function recentlyUpdated($nbDays = 7)
+ {
+ return $this->addUsingAlias(ProductSaleElementsTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Filter by the latest created
+ *
+ * @param int $nbDays Maximum age of in days
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function recentlyCreated($nbDays = 7)
+ {
+ return $this->addUsingAlias(ProductSaleElementsTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Order by update date desc
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function lastUpdatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(ProductSaleElementsTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by update date asc
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function firstUpdatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(ProductSaleElementsTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by create date desc
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function lastCreatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(ProductSaleElementsTableMap::CREATED_AT);
+ }
+
+ /**
+ * Order by create date asc
+ *
+ * @return ChildProductSaleElementsQuery The current query, for fluid interface
+ */
+ public function firstCreatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(ProductSaleElementsTableMap::CREATED_AT);
+ }
+
+} // ProductSaleElementsQuery
diff --git a/core/lib/Thelia/Model/Base/ProductVersion.php b/core/lib/Thelia/Model/Base/ProductVersion.php
old mode 100755
new mode 100644
index 4351460a5..1779cee20
--- a/core/lib/Thelia/Model/Base/ProductVersion.php
+++ b/core/lib/Thelia/Model/Base/ProductVersion.php
@@ -73,45 +73,6 @@ abstract class ProductVersion implements ActiveRecordInterface
*/
protected $ref;
- /**
- * The value for the price field.
- * @var double
- */
- protected $price;
-
- /**
- * The value for the price2 field.
- * @var double
- */
- protected $price2;
-
- /**
- * The value for the ecotax field.
- * @var double
- */
- protected $ecotax;
-
- /**
- * The value for the newness field.
- * Note: this column has a database default value of: 0
- * @var int
- */
- protected $newness;
-
- /**
- * The value for the promo field.
- * Note: this column has a database default value of: 0
- * @var int
- */
- protected $promo;
-
- /**
- * The value for the quantity field.
- * Note: this column has a database default value of: 0
- * @var int
- */
- protected $quantity;
-
/**
* The value for the visible field.
* Note: this column has a database default value of: 0
@@ -119,12 +80,6 @@ abstract class ProductVersion implements ActiveRecordInterface
*/
protected $visible;
- /**
- * The value for the weight field.
- * @var double
- */
- protected $weight;
-
/**
* The value for the position field.
* @var int
@@ -183,9 +138,6 @@ abstract class ProductVersion implements ActiveRecordInterface
*/
public function applyDefaultValues()
{
- $this->newness = 0;
- $this->promo = 0;
- $this->quantity = 0;
$this->visible = 0;
$this->version = 0;
}
@@ -479,72 +431,6 @@ abstract class ProductVersion implements ActiveRecordInterface
return $this->ref;
}
- /**
- * Get the [price] column value.
- *
- * @return double
- */
- public function getPrice()
- {
-
- return $this->price;
- }
-
- /**
- * Get the [price2] column value.
- *
- * @return double
- */
- public function getPrice2()
- {
-
- return $this->price2;
- }
-
- /**
- * Get the [ecotax] column value.
- *
- * @return double
- */
- public function getEcotax()
- {
-
- return $this->ecotax;
- }
-
- /**
- * Get the [newness] column value.
- *
- * @return int
- */
- public function getNewness()
- {
-
- return $this->newness;
- }
-
- /**
- * Get the [promo] column value.
- *
- * @return int
- */
- public function getPromo()
- {
-
- return $this->promo;
- }
-
- /**
- * Get the [quantity] column value.
- *
- * @return int
- */
- public function getQuantity()
- {
-
- return $this->quantity;
- }
-
/**
* Get the [visible] column value.
*
@@ -556,17 +442,6 @@ abstract class ProductVersion implements ActiveRecordInterface
return $this->visible;
}
- /**
- * Get the [weight] column value.
- *
- * @return double
- */
- public function getWeight()
- {
-
- return $this->weight;
- }
-
/**
* Get the [position] column value.
*
@@ -727,132 +602,6 @@ abstract class ProductVersion implements ActiveRecordInterface
return $this;
} // setRef()
- /**
- * Set the value of [price] column.
- *
- * @param double $v new value
- * @return \Thelia\Model\ProductVersion The current object (for fluent API support)
- */
- public function setPrice($v)
- {
- if ($v !== null) {
- $v = (double) $v;
- }
-
- if ($this->price !== $v) {
- $this->price = $v;
- $this->modifiedColumns[] = ProductVersionTableMap::PRICE;
- }
-
-
- return $this;
- } // setPrice()
-
- /**
- * Set the value of [price2] column.
- *
- * @param double $v new value
- * @return \Thelia\Model\ProductVersion The current object (for fluent API support)
- */
- public function setPrice2($v)
- {
- if ($v !== null) {
- $v = (double) $v;
- }
-
- if ($this->price2 !== $v) {
- $this->price2 = $v;
- $this->modifiedColumns[] = ProductVersionTableMap::PRICE2;
- }
-
-
- return $this;
- } // setPrice2()
-
- /**
- * Set the value of [ecotax] column.
- *
- * @param double $v new value
- * @return \Thelia\Model\ProductVersion The current object (for fluent API support)
- */
- public function setEcotax($v)
- {
- if ($v !== null) {
- $v = (double) $v;
- }
-
- if ($this->ecotax !== $v) {
- $this->ecotax = $v;
- $this->modifiedColumns[] = ProductVersionTableMap::ECOTAX;
- }
-
-
- return $this;
- } // setEcotax()
-
- /**
- * Set the value of [newness] column.
- *
- * @param int $v new value
- * @return \Thelia\Model\ProductVersion The current object (for fluent API support)
- */
- public function setNewness($v)
- {
- if ($v !== null) {
- $v = (int) $v;
- }
-
- if ($this->newness !== $v) {
- $this->newness = $v;
- $this->modifiedColumns[] = ProductVersionTableMap::NEWNESS;
- }
-
-
- return $this;
- } // setNewness()
-
- /**
- * Set the value of [promo] column.
- *
- * @param int $v new value
- * @return \Thelia\Model\ProductVersion The current object (for fluent API support)
- */
- public function setPromo($v)
- {
- if ($v !== null) {
- $v = (int) $v;
- }
-
- if ($this->promo !== $v) {
- $this->promo = $v;
- $this->modifiedColumns[] = ProductVersionTableMap::PROMO;
- }
-
-
- return $this;
- } // setPromo()
-
- /**
- * Set the value of [quantity] column.
- *
- * @param int $v new value
- * @return \Thelia\Model\ProductVersion The current object (for fluent API support)
- */
- public function setQuantity($v)
- {
- if ($v !== null) {
- $v = (int) $v;
- }
-
- if ($this->quantity !== $v) {
- $this->quantity = $v;
- $this->modifiedColumns[] = ProductVersionTableMap::QUANTITY;
- }
-
-
- return $this;
- } // setQuantity()
-
/**
* Set the value of [visible] column.
*
@@ -874,27 +623,6 @@ abstract class ProductVersion implements ActiveRecordInterface
return $this;
} // setVisible()
- /**
- * Set the value of [weight] column.
- *
- * @param double $v new value
- * @return \Thelia\Model\ProductVersion The current object (for fluent API support)
- */
- public function setWeight($v)
- {
- if ($v !== null) {
- $v = (double) $v;
- }
-
- if ($this->weight !== $v) {
- $this->weight = $v;
- $this->modifiedColumns[] = ProductVersionTableMap::WEIGHT;
- }
-
-
- return $this;
- } // setWeight()
-
/**
* Set the value of [position] column.
*
@@ -1031,18 +759,6 @@ abstract class ProductVersion implements ActiveRecordInterface
*/
public function hasOnlyDefaultValues()
{
- if ($this->newness !== 0) {
- return false;
- }
-
- if ($this->promo !== 0) {
- return false;
- }
-
- if ($this->quantity !== 0) {
- return false;
- }
-
if ($this->visible !== 0) {
return false;
}
@@ -1087,55 +803,34 @@ abstract class ProductVersion implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProductVersionTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)];
$this->ref = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductVersionTableMap::translateFieldName('Price', TableMap::TYPE_PHPNAME, $indexType)];
- $this->price = (null !== $col) ? (double) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductVersionTableMap::translateFieldName('Price2', TableMap::TYPE_PHPNAME, $indexType)];
- $this->price2 = (null !== $col) ? (double) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductVersionTableMap::translateFieldName('Ecotax', TableMap::TYPE_PHPNAME, $indexType)];
- $this->ecotax = (null !== $col) ? (double) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductVersionTableMap::translateFieldName('Newness', TableMap::TYPE_PHPNAME, $indexType)];
- $this->newness = (null !== $col) ? (int) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductVersionTableMap::translateFieldName('Promo', TableMap::TYPE_PHPNAME, $indexType)];
- $this->promo = (null !== $col) ? (int) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductVersionTableMap::translateFieldName('Quantity', TableMap::TYPE_PHPNAME, $indexType)];
- $this->quantity = (null !== $col) ? (int) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductVersionTableMap::translateFieldName('Visible', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductVersionTableMap::translateFieldName('Visible', TableMap::TYPE_PHPNAME, $indexType)];
$this->visible = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : ProductVersionTableMap::translateFieldName('Weight', TableMap::TYPE_PHPNAME, $indexType)];
- $this->weight = (null !== $col) ? (double) $col : null;
-
- $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : ProductVersionTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductVersionTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
$this->position = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : ProductVersionTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductVersionTableMap::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 ? 13 + $startcol : ProductVersionTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductVersionTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->updated_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : ProductVersionTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductVersionTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
$this->version = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : ProductVersionTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductVersionTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->version_created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : ProductVersionTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductVersionTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
$this->version_created_by = (null !== $col) ? (string) $col : null;
$this->resetModified();
@@ -1145,7 +840,7 @@ abstract class ProductVersion implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 17; // 17 = ProductVersionTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 10; // 10 = ProductVersionTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\ProductVersion object", 0, $e);
@@ -1375,30 +1070,9 @@ abstract class ProductVersion implements ActiveRecordInterface
if ($this->isColumnModified(ProductVersionTableMap::REF)) {
$modifiedColumns[':p' . $index++] = 'REF';
}
- if ($this->isColumnModified(ProductVersionTableMap::PRICE)) {
- $modifiedColumns[':p' . $index++] = 'PRICE';
- }
- if ($this->isColumnModified(ProductVersionTableMap::PRICE2)) {
- $modifiedColumns[':p' . $index++] = 'PRICE2';
- }
- if ($this->isColumnModified(ProductVersionTableMap::ECOTAX)) {
- $modifiedColumns[':p' . $index++] = 'ECOTAX';
- }
- if ($this->isColumnModified(ProductVersionTableMap::NEWNESS)) {
- $modifiedColumns[':p' . $index++] = 'NEWNESS';
- }
- if ($this->isColumnModified(ProductVersionTableMap::PROMO)) {
- $modifiedColumns[':p' . $index++] = 'PROMO';
- }
- if ($this->isColumnModified(ProductVersionTableMap::QUANTITY)) {
- $modifiedColumns[':p' . $index++] = 'QUANTITY';
- }
if ($this->isColumnModified(ProductVersionTableMap::VISIBLE)) {
$modifiedColumns[':p' . $index++] = 'VISIBLE';
}
- if ($this->isColumnModified(ProductVersionTableMap::WEIGHT)) {
- $modifiedColumns[':p' . $index++] = 'WEIGHT';
- }
if ($this->isColumnModified(ProductVersionTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION';
}
@@ -1437,30 +1111,9 @@ abstract class ProductVersion implements ActiveRecordInterface
case 'REF':
$stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR);
break;
- case 'PRICE':
- $stmt->bindValue($identifier, $this->price, PDO::PARAM_STR);
- break;
- case 'PRICE2':
- $stmt->bindValue($identifier, $this->price2, PDO::PARAM_STR);
- break;
- case 'ECOTAX':
- $stmt->bindValue($identifier, $this->ecotax, PDO::PARAM_STR);
- break;
- case 'NEWNESS':
- $stmt->bindValue($identifier, $this->newness, PDO::PARAM_INT);
- break;
- case 'PROMO':
- $stmt->bindValue($identifier, $this->promo, PDO::PARAM_INT);
- break;
- case 'QUANTITY':
- $stmt->bindValue($identifier, $this->quantity, PDO::PARAM_INT);
- break;
case 'VISIBLE':
$stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT);
break;
- case 'WEIGHT':
- $stmt->bindValue($identifier, $this->weight, PDO::PARAM_STR);
- break;
case 'POSITION':
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
break;
@@ -1544,45 +1197,24 @@ abstract class ProductVersion implements ActiveRecordInterface
return $this->getRef();
break;
case 3:
- return $this->getPrice();
- break;
- case 4:
- return $this->getPrice2();
- break;
- case 5:
- return $this->getEcotax();
- break;
- case 6:
- return $this->getNewness();
- break;
- case 7:
- return $this->getPromo();
- break;
- case 8:
- return $this->getQuantity();
- break;
- case 9:
return $this->getVisible();
break;
- case 10:
- return $this->getWeight();
- break;
- case 11:
+ case 4:
return $this->getPosition();
break;
- case 12:
+ case 5:
return $this->getCreatedAt();
break;
- case 13:
+ case 6:
return $this->getUpdatedAt();
break;
- case 14:
+ case 7:
return $this->getVersion();
break;
- case 15:
+ case 8:
return $this->getVersionCreatedAt();
break;
- case 16:
+ case 9:
return $this->getVersionCreatedBy();
break;
default:
@@ -1617,20 +1249,13 @@ abstract class ProductVersion implements ActiveRecordInterface
$keys[0] => $this->getId(),
$keys[1] => $this->getTaxRuleId(),
$keys[2] => $this->getRef(),
- $keys[3] => $this->getPrice(),
- $keys[4] => $this->getPrice2(),
- $keys[5] => $this->getEcotax(),
- $keys[6] => $this->getNewness(),
- $keys[7] => $this->getPromo(),
- $keys[8] => $this->getQuantity(),
- $keys[9] => $this->getVisible(),
- $keys[10] => $this->getWeight(),
- $keys[11] => $this->getPosition(),
- $keys[12] => $this->getCreatedAt(),
- $keys[13] => $this->getUpdatedAt(),
- $keys[14] => $this->getVersion(),
- $keys[15] => $this->getVersionCreatedAt(),
- $keys[16] => $this->getVersionCreatedBy(),
+ $keys[3] => $this->getVisible(),
+ $keys[4] => $this->getPosition(),
+ $keys[5] => $this->getCreatedAt(),
+ $keys[6] => $this->getUpdatedAt(),
+ $keys[7] => $this->getVersion(),
+ $keys[8] => $this->getVersionCreatedAt(),
+ $keys[9] => $this->getVersionCreatedBy(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1686,45 +1311,24 @@ abstract class ProductVersion implements ActiveRecordInterface
$this->setRef($value);
break;
case 3:
- $this->setPrice($value);
- break;
- case 4:
- $this->setPrice2($value);
- break;
- case 5:
- $this->setEcotax($value);
- break;
- case 6:
- $this->setNewness($value);
- break;
- case 7:
- $this->setPromo($value);
- break;
- case 8:
- $this->setQuantity($value);
- break;
- case 9:
$this->setVisible($value);
break;
- case 10:
- $this->setWeight($value);
- break;
- case 11:
+ case 4:
$this->setPosition($value);
break;
- case 12:
+ case 5:
$this->setCreatedAt($value);
break;
- case 13:
+ case 6:
$this->setUpdatedAt($value);
break;
- case 14:
+ case 7:
$this->setVersion($value);
break;
- case 15:
+ case 8:
$this->setVersionCreatedAt($value);
break;
- case 16:
+ case 9:
$this->setVersionCreatedBy($value);
break;
} // switch()
@@ -1754,20 +1358,13 @@ abstract class ProductVersion implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setTaxRuleId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setRef($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setPrice($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setPrice2($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setEcotax($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setNewness($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setPromo($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setQuantity($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setVisible($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setWeight($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setPosition($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setCreatedAt($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setUpdatedAt($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setVersion($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setVersionCreatedAt($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setVersionCreatedBy($arr[$keys[16]]);
+ if (array_key_exists($keys[3], $arr)) $this->setVisible($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setPosition($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
+ if (array_key_exists($keys[7], $arr)) $this->setVersion($arr[$keys[7]]);
+ if (array_key_exists($keys[8], $arr)) $this->setVersionCreatedAt($arr[$keys[8]]);
+ if (array_key_exists($keys[9], $arr)) $this->setVersionCreatedBy($arr[$keys[9]]);
}
/**
@@ -1782,14 +1379,7 @@ abstract class ProductVersion implements ActiveRecordInterface
if ($this->isColumnModified(ProductVersionTableMap::ID)) $criteria->add(ProductVersionTableMap::ID, $this->id);
if ($this->isColumnModified(ProductVersionTableMap::TAX_RULE_ID)) $criteria->add(ProductVersionTableMap::TAX_RULE_ID, $this->tax_rule_id);
if ($this->isColumnModified(ProductVersionTableMap::REF)) $criteria->add(ProductVersionTableMap::REF, $this->ref);
- if ($this->isColumnModified(ProductVersionTableMap::PRICE)) $criteria->add(ProductVersionTableMap::PRICE, $this->price);
- if ($this->isColumnModified(ProductVersionTableMap::PRICE2)) $criteria->add(ProductVersionTableMap::PRICE2, $this->price2);
- if ($this->isColumnModified(ProductVersionTableMap::ECOTAX)) $criteria->add(ProductVersionTableMap::ECOTAX, $this->ecotax);
- if ($this->isColumnModified(ProductVersionTableMap::NEWNESS)) $criteria->add(ProductVersionTableMap::NEWNESS, $this->newness);
- if ($this->isColumnModified(ProductVersionTableMap::PROMO)) $criteria->add(ProductVersionTableMap::PROMO, $this->promo);
- if ($this->isColumnModified(ProductVersionTableMap::QUANTITY)) $criteria->add(ProductVersionTableMap::QUANTITY, $this->quantity);
if ($this->isColumnModified(ProductVersionTableMap::VISIBLE)) $criteria->add(ProductVersionTableMap::VISIBLE, $this->visible);
- if ($this->isColumnModified(ProductVersionTableMap::WEIGHT)) $criteria->add(ProductVersionTableMap::WEIGHT, $this->weight);
if ($this->isColumnModified(ProductVersionTableMap::POSITION)) $criteria->add(ProductVersionTableMap::POSITION, $this->position);
if ($this->isColumnModified(ProductVersionTableMap::CREATED_AT)) $criteria->add(ProductVersionTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(ProductVersionTableMap::UPDATED_AT)) $criteria->add(ProductVersionTableMap::UPDATED_AT, $this->updated_at);
@@ -1869,14 +1459,7 @@ abstract class ProductVersion implements ActiveRecordInterface
$copyObj->setId($this->getId());
$copyObj->setTaxRuleId($this->getTaxRuleId());
$copyObj->setRef($this->getRef());
- $copyObj->setPrice($this->getPrice());
- $copyObj->setPrice2($this->getPrice2());
- $copyObj->setEcotax($this->getEcotax());
- $copyObj->setNewness($this->getNewness());
- $copyObj->setPromo($this->getPromo());
- $copyObj->setQuantity($this->getQuantity());
$copyObj->setVisible($this->getVisible());
- $copyObj->setWeight($this->getWeight());
$copyObj->setPosition($this->getPosition());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -1969,14 +1552,7 @@ abstract class ProductVersion implements ActiveRecordInterface
$this->id = null;
$this->tax_rule_id = null;
$this->ref = null;
- $this->price = null;
- $this->price2 = null;
- $this->ecotax = null;
- $this->newness = null;
- $this->promo = null;
- $this->quantity = null;
$this->visible = null;
- $this->weight = null;
$this->position = null;
$this->created_at = null;
$this->updated_at = null;
diff --git a/core/lib/Thelia/Model/Base/ProductVersionQuery.php b/core/lib/Thelia/Model/Base/ProductVersionQuery.php
old mode 100755
new mode 100644
index 47f94eb9c..1b43f7e66
--- a/core/lib/Thelia/Model/Base/ProductVersionQuery.php
+++ b/core/lib/Thelia/Model/Base/ProductVersionQuery.php
@@ -24,14 +24,7 @@ use Thelia\Model\Map\ProductVersionTableMap;
* @method ChildProductVersionQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildProductVersionQuery orderByTaxRuleId($order = Criteria::ASC) Order by the tax_rule_id column
* @method ChildProductVersionQuery orderByRef($order = Criteria::ASC) Order by the ref column
- * @method ChildProductVersionQuery orderByPrice($order = Criteria::ASC) Order by the price column
- * @method ChildProductVersionQuery orderByPrice2($order = Criteria::ASC) Order by the price2 column
- * @method ChildProductVersionQuery orderByEcotax($order = Criteria::ASC) Order by the ecotax column
- * @method ChildProductVersionQuery orderByNewness($order = Criteria::ASC) Order by the newness column
- * @method ChildProductVersionQuery orderByPromo($order = Criteria::ASC) Order by the promo column
- * @method ChildProductVersionQuery orderByQuantity($order = Criteria::ASC) Order by the quantity column
* @method ChildProductVersionQuery orderByVisible($order = Criteria::ASC) Order by the visible column
- * @method ChildProductVersionQuery orderByWeight($order = Criteria::ASC) Order by the weight column
* @method ChildProductVersionQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildProductVersionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildProductVersionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
@@ -42,14 +35,7 @@ use Thelia\Model\Map\ProductVersionTableMap;
* @method ChildProductVersionQuery groupById() Group by the id column
* @method ChildProductVersionQuery groupByTaxRuleId() Group by the tax_rule_id column
* @method ChildProductVersionQuery groupByRef() Group by the ref column
- * @method ChildProductVersionQuery groupByPrice() Group by the price column
- * @method ChildProductVersionQuery groupByPrice2() Group by the price2 column
- * @method ChildProductVersionQuery groupByEcotax() Group by the ecotax column
- * @method ChildProductVersionQuery groupByNewness() Group by the newness column
- * @method ChildProductVersionQuery groupByPromo() Group by the promo column
- * @method ChildProductVersionQuery groupByQuantity() Group by the quantity column
* @method ChildProductVersionQuery groupByVisible() Group by the visible column
- * @method ChildProductVersionQuery groupByWeight() Group by the weight column
* @method ChildProductVersionQuery groupByPosition() Group by the position column
* @method ChildProductVersionQuery groupByCreatedAt() Group by the created_at column
* @method ChildProductVersionQuery groupByUpdatedAt() Group by the updated_at column
@@ -71,14 +57,7 @@ use Thelia\Model\Map\ProductVersionTableMap;
* @method ChildProductVersion findOneById(int $id) Return the first ChildProductVersion filtered by the id column
* @method ChildProductVersion findOneByTaxRuleId(int $tax_rule_id) Return the first ChildProductVersion filtered by the tax_rule_id column
* @method ChildProductVersion findOneByRef(string $ref) Return the first ChildProductVersion filtered by the ref column
- * @method ChildProductVersion findOneByPrice(double $price) Return the first ChildProductVersion filtered by the price column
- * @method ChildProductVersion findOneByPrice2(double $price2) Return the first ChildProductVersion filtered by the price2 column
- * @method ChildProductVersion findOneByEcotax(double $ecotax) Return the first ChildProductVersion filtered by the ecotax column
- * @method ChildProductVersion findOneByNewness(int $newness) Return the first ChildProductVersion filtered by the newness column
- * @method ChildProductVersion findOneByPromo(int $promo) Return the first ChildProductVersion filtered by the promo column
- * @method ChildProductVersion findOneByQuantity(int $quantity) Return the first ChildProductVersion filtered by the quantity column
* @method ChildProductVersion findOneByVisible(int $visible) Return the first ChildProductVersion filtered by the visible column
- * @method ChildProductVersion findOneByWeight(double $weight) Return the first ChildProductVersion filtered by the weight column
* @method ChildProductVersion findOneByPosition(int $position) Return the first ChildProductVersion filtered by the position column
* @method ChildProductVersion findOneByCreatedAt(string $created_at) Return the first ChildProductVersion filtered by the created_at column
* @method ChildProductVersion findOneByUpdatedAt(string $updated_at) Return the first ChildProductVersion filtered by the updated_at column
@@ -89,14 +68,7 @@ use Thelia\Model\Map\ProductVersionTableMap;
* @method array findById(int $id) Return ChildProductVersion objects filtered by the id column
* @method array findByTaxRuleId(int $tax_rule_id) Return ChildProductVersion objects filtered by the tax_rule_id column
* @method array findByRef(string $ref) Return ChildProductVersion objects filtered by the ref column
- * @method array findByPrice(double $price) Return ChildProductVersion objects filtered by the price column
- * @method array findByPrice2(double $price2) Return ChildProductVersion objects filtered by the price2 column
- * @method array findByEcotax(double $ecotax) Return ChildProductVersion objects filtered by the ecotax column
- * @method array findByNewness(int $newness) Return ChildProductVersion objects filtered by the newness column
- * @method array findByPromo(int $promo) Return ChildProductVersion objects filtered by the promo column
- * @method array findByQuantity(int $quantity) Return ChildProductVersion objects filtered by the quantity column
* @method array findByVisible(int $visible) Return ChildProductVersion objects filtered by the visible column
- * @method array findByWeight(double $weight) Return ChildProductVersion objects filtered by the weight column
* @method array findByPosition(int $position) Return ChildProductVersion objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildProductVersion objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildProductVersion objects filtered by the updated_at column
@@ -191,7 +163,7 @@ abstract class ProductVersionQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, TAX_RULE_ID, REF, PRICE, PRICE2, ECOTAX, NEWNESS, PROMO, QUANTITY, VISIBLE, WEIGHT, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM product_version WHERE ID = :p0 AND VERSION = :p1';
+ $sql = 'SELECT ID, TAX_RULE_ID, REF, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM product_version WHERE ID = :p0 AND VERSION = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -405,252 +377,6 @@ abstract class ProductVersionQuery extends ModelCriteria
return $this->addUsingAlias(ProductVersionTableMap::REF, $ref, $comparison);
}
- /**
- * Filter the query on the price column
- *
- * Example usage:
- *
- * $query->filterByPrice(1234); // WHERE price = 1234
- * $query->filterByPrice(array(12, 34)); // WHERE price IN (12, 34)
- * $query->filterByPrice(array('min' => 12)); // WHERE price > 12
- *
- *
- * @param mixed $price 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 ChildProductVersionQuery The current query, for fluid interface
- */
- public function filterByPrice($price = null, $comparison = null)
- {
- if (is_array($price)) {
- $useMinMax = false;
- if (isset($price['min'])) {
- $this->addUsingAlias(ProductVersionTableMap::PRICE, $price['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($price['max'])) {
- $this->addUsingAlias(ProductVersionTableMap::PRICE, $price['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductVersionTableMap::PRICE, $price, $comparison);
- }
-
- /**
- * Filter the query on the price2 column
- *
- * Example usage:
- *
- * $query->filterByPrice2(1234); // WHERE price2 = 1234
- * $query->filterByPrice2(array(12, 34)); // WHERE price2 IN (12, 34)
- * $query->filterByPrice2(array('min' => 12)); // WHERE price2 > 12
- *
- *
- * @param mixed $price2 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 ChildProductVersionQuery The current query, for fluid interface
- */
- public function filterByPrice2($price2 = null, $comparison = null)
- {
- if (is_array($price2)) {
- $useMinMax = false;
- if (isset($price2['min'])) {
- $this->addUsingAlias(ProductVersionTableMap::PRICE2, $price2['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($price2['max'])) {
- $this->addUsingAlias(ProductVersionTableMap::PRICE2, $price2['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductVersionTableMap::PRICE2, $price2, $comparison);
- }
-
- /**
- * Filter the query on the ecotax column
- *
- * Example usage:
- *
- * $query->filterByEcotax(1234); // WHERE ecotax = 1234
- * $query->filterByEcotax(array(12, 34)); // WHERE ecotax IN (12, 34)
- * $query->filterByEcotax(array('min' => 12)); // WHERE ecotax > 12
- *
- *
- * @param mixed $ecotax 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 ChildProductVersionQuery The current query, for fluid interface
- */
- public function filterByEcotax($ecotax = null, $comparison = null)
- {
- if (is_array($ecotax)) {
- $useMinMax = false;
- if (isset($ecotax['min'])) {
- $this->addUsingAlias(ProductVersionTableMap::ECOTAX, $ecotax['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($ecotax['max'])) {
- $this->addUsingAlias(ProductVersionTableMap::ECOTAX, $ecotax['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductVersionTableMap::ECOTAX, $ecotax, $comparison);
- }
-
- /**
- * Filter the query on the newness column
- *
- * Example usage:
- *
- * $query->filterByNewness(1234); // WHERE newness = 1234
- * $query->filterByNewness(array(12, 34)); // WHERE newness IN (12, 34)
- * $query->filterByNewness(array('min' => 12)); // WHERE newness > 12
- *
- *
- * @param mixed $newness 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 ChildProductVersionQuery The current query, for fluid interface
- */
- public function filterByNewness($newness = null, $comparison = null)
- {
- if (is_array($newness)) {
- $useMinMax = false;
- if (isset($newness['min'])) {
- $this->addUsingAlias(ProductVersionTableMap::NEWNESS, $newness['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($newness['max'])) {
- $this->addUsingAlias(ProductVersionTableMap::NEWNESS, $newness['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductVersionTableMap::NEWNESS, $newness, $comparison);
- }
-
- /**
- * Filter the query on the promo column
- *
- * Example usage:
- *
- * $query->filterByPromo(1234); // WHERE promo = 1234
- * $query->filterByPromo(array(12, 34)); // WHERE promo IN (12, 34)
- * $query->filterByPromo(array('min' => 12)); // WHERE promo > 12
- *
- *
- * @param mixed $promo 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 ChildProductVersionQuery The current query, for fluid interface
- */
- public function filterByPromo($promo = null, $comparison = null)
- {
- if (is_array($promo)) {
- $useMinMax = false;
- if (isset($promo['min'])) {
- $this->addUsingAlias(ProductVersionTableMap::PROMO, $promo['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($promo['max'])) {
- $this->addUsingAlias(ProductVersionTableMap::PROMO, $promo['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductVersionTableMap::PROMO, $promo, $comparison);
- }
-
- /**
- * Filter the query on the quantity column
- *
- * Example usage:
- *
- * $query->filterByQuantity(1234); // WHERE quantity = 1234
- * $query->filterByQuantity(array(12, 34)); // WHERE quantity IN (12, 34)
- * $query->filterByQuantity(array('min' => 12)); // WHERE quantity > 12
- *
- *
- * @param mixed $quantity 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 ChildProductVersionQuery The current query, for fluid interface
- */
- public function filterByQuantity($quantity = null, $comparison = null)
- {
- if (is_array($quantity)) {
- $useMinMax = false;
- if (isset($quantity['min'])) {
- $this->addUsingAlias(ProductVersionTableMap::QUANTITY, $quantity['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($quantity['max'])) {
- $this->addUsingAlias(ProductVersionTableMap::QUANTITY, $quantity['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductVersionTableMap::QUANTITY, $quantity, $comparison);
- }
-
/**
* Filter the query on the visible column
*
@@ -692,47 +418,6 @@ abstract class ProductVersionQuery extends ModelCriteria
return $this->addUsingAlias(ProductVersionTableMap::VISIBLE, $visible, $comparison);
}
- /**
- * Filter the query on the weight column
- *
- * Example usage:
- *
- * $query->filterByWeight(1234); // WHERE weight = 1234
- * $query->filterByWeight(array(12, 34)); // WHERE weight IN (12, 34)
- * $query->filterByWeight(array('min' => 12)); // WHERE weight > 12
- *
- *
- * @param mixed $weight 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 ChildProductVersionQuery The current query, for fluid interface
- */
- public function filterByWeight($weight = null, $comparison = null)
- {
- if (is_array($weight)) {
- $useMinMax = false;
- if (isset($weight['min'])) {
- $this->addUsingAlias(ProductVersionTableMap::WEIGHT, $weight['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($weight['max'])) {
- $this->addUsingAlias(ProductVersionTableMap::WEIGHT, $weight['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(ProductVersionTableMap::WEIGHT, $weight, $comparison);
- }
-
/**
* Filter the query on the position column
*
diff --git a/core/lib/Thelia/Model/Base/Resource.php b/core/lib/Thelia/Model/Base/Resource.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ResourceI18n.php b/core/lib/Thelia/Model/Base/ResourceI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ResourceI18nQuery.php b/core/lib/Thelia/Model/Base/ResourceI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/ResourceQuery.php b/core/lib/Thelia/Model/Base/ResourceQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Rewriting.php b/core/lib/Thelia/Model/Base/Rewriting.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/RewritingQuery.php b/core/lib/Thelia/Model/Base/RewritingQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/Tax.php b/core/lib/Thelia/Model/Base/Tax.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/TaxI18n.php b/core/lib/Thelia/Model/Base/TaxI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/TaxI18nQuery.php b/core/lib/Thelia/Model/Base/TaxI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/TaxQuery.php b/core/lib/Thelia/Model/Base/TaxQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/TaxRule.php b/core/lib/Thelia/Model/Base/TaxRule.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/TaxRuleCountry.php b/core/lib/Thelia/Model/Base/TaxRuleCountry.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/TaxRuleCountryQuery.php b/core/lib/Thelia/Model/Base/TaxRuleCountryQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/TaxRuleI18n.php b/core/lib/Thelia/Model/Base/TaxRuleI18n.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/TaxRuleI18nQuery.php b/core/lib/Thelia/Model/Base/TaxRuleI18nQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Base/TaxRuleQuery.php b/core/lib/Thelia/Model/Base/TaxRuleQuery.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Cart.php b/core/lib/Thelia/Model/Cart.php
index 32f51484e..8d74c6f20 100644
--- a/core/lib/Thelia/Model/Cart.php
+++ b/core/lib/Thelia/Model/Cart.php
@@ -2,9 +2,57 @@
namespace Thelia\Model;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Thelia\Model\Base\Cart as BaseCart;
+use Thelia\Model\Base\ProductSaleElementsQuery;
class Cart extends BaseCart
{
+ protected $dispatcher;
+
+ public function setDispatcher(EventDispatcherInterface $dispatcher)
+ {
+ $this->dispatcher = $dispatcher;
+ }
+
+ public function duplicate($token, Customer $customer = null)
+ {
+ $cartItems = $this->getCartItems();
+
+ $cart = new Cart();
+ $cart->setAddressDeliveryId($this->getAddressDeliveryId());
+ $cart->setAddressInvoiceId($this->getAddressInvoiceId());
+ $cart->setToken($token);
+ // TODO : set current Currency
+ $cart->setCurrencyId($this->getCurrencyId());
+
+ if ($customer){
+ $cart->setCustomer($customer);
+ }
+
+ $cart->save();
+
+ foreach ($cartItems as $cartItem){
+
+ $product = $cartItem->getProduct();
+ $productSaleElements = $cartItem->getProductSaleElements();
+ if ($product && $productSaleElements && $product->getVisible() == 1 && $productSaleElements->getQuantity() > $cartItem->getQuantity()) {
+
+ $item = new CartItem();
+ $item->setCart($cart);
+ $item->setProductId($cartItem->getProductId());
+ $item->setQuantity($cartItem->getQuantity());
+ $item->save();
+ }
+
+ }
+
+ return $cart;
+ }
+
+ protected function dispatchEvent($name)
+ {
+
+ }
}
diff --git a/core/lib/Thelia/Model/CartQuery.php b/core/lib/Thelia/Model/CartQuery.php
index f0b9c48ce..1d51262d2 100644
--- a/core/lib/Thelia/Model/CartQuery.php
+++ b/core/lib/Thelia/Model/CartQuery.php
@@ -3,7 +3,7 @@
namespace Thelia\Model;
use Thelia\Model\Base\CartQuery as BaseCartQuery;
-
+use Symfony\Component\HttpFoundation\Request;
/**
* Skeleton subclass for performing query and update operations on the 'cart' table.
@@ -18,4 +18,5 @@ use Thelia\Model\Base\CartQuery as BaseCartQuery;
class CartQuery extends BaseCartQuery
{
+
} // CartQuery
diff --git a/core/lib/Thelia/Model/Combination.php b/core/lib/Thelia/Model/Combination.php
deleted file mode 100755
index 8dc338e44..000000000
--- a/core/lib/Thelia/Model/Combination.php
+++ /dev/null
@@ -1,9 +0,0 @@
-getLastname(), 0, (strlen($this->getLastname()) >= 3) ? 3 : strlen($this->getLastname())), true);
}
public function setPassword($password)
diff --git a/core/lib/Thelia/Model/FeatureProd.php b/core/lib/Thelia/Model/FeatureProd.php
deleted file mode 100755
index 930493639..000000000
--- a/core/lib/Thelia/Model/FeatureProd.php
+++ /dev/null
@@ -1,9 +0,0 @@
- array('Id', 'Title', 'CustomerId', 'CustomerTitleId', 'Company', 'Firstname', 'Lastname', 'Address1', 'Address2', 'Address3', 'Zipcode', 'City', 'CountryId', 'Phone', 'Cellphone', 'IsDefault', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'title', 'customerId', 'customerTitleId', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'countryId', 'phone', 'cellphone', 'isDefault', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(AddressTableMap::ID, AddressTableMap::TITLE, AddressTableMap::CUSTOMER_ID, AddressTableMap::CUSTOMER_TITLE_ID, AddressTableMap::COMPANY, AddressTableMap::FIRSTNAME, AddressTableMap::LASTNAME, AddressTableMap::ADDRESS1, AddressTableMap::ADDRESS2, AddressTableMap::ADDRESS3, AddressTableMap::ZIPCODE, AddressTableMap::CITY, AddressTableMap::COUNTRY_ID, AddressTableMap::PHONE, AddressTableMap::CELLPHONE, AddressTableMap::IS_DEFAULT, AddressTableMap::CREATED_AT, AddressTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'TITLE', 'CUSTOMER_ID', 'CUSTOMER_TITLE_ID', 'COMPANY', 'FIRSTNAME', 'LASTNAME', 'ADDRESS1', 'ADDRESS2', 'ADDRESS3', 'ZIPCODE', 'CITY', 'COUNTRY_ID', 'PHONE', 'CELLPHONE', 'IS_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'title', 'customer_id', 'customer_title_id', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'country_id', 'phone', 'cellphone', 'is_default', 'created_at', 'updated_at', ),
+ self::TYPE_PHPNAME => array('Id', 'Name', 'CustomerId', 'TitleId', 'Company', 'Firstname', 'Lastname', 'Address1', 'Address2', 'Address3', 'Zipcode', 'City', 'CountryId', 'Phone', 'Cellphone', 'IsDefault', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'name', 'customerId', 'titleId', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'countryId', 'phone', 'cellphone', 'isDefault', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(AddressTableMap::ID, AddressTableMap::NAME, AddressTableMap::CUSTOMER_ID, AddressTableMap::TITLE_ID, AddressTableMap::COMPANY, AddressTableMap::FIRSTNAME, AddressTableMap::LASTNAME, AddressTableMap::ADDRESS1, AddressTableMap::ADDRESS2, AddressTableMap::ADDRESS3, AddressTableMap::ZIPCODE, AddressTableMap::CITY, AddressTableMap::COUNTRY_ID, AddressTableMap::PHONE, AddressTableMap::CELLPHONE, AddressTableMap::IS_DEFAULT, AddressTableMap::CREATED_AT, AddressTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'NAME', 'CUSTOMER_ID', 'TITLE_ID', 'COMPANY', 'FIRSTNAME', 'LASTNAME', 'ADDRESS1', 'ADDRESS2', 'ADDRESS3', 'ZIPCODE', 'CITY', 'COUNTRY_ID', 'PHONE', 'CELLPHONE', 'IS_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'name', 'customer_id', 'title_id', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'country_id', 'phone', 'cellphone', 'is_default', '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 AddressTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'Title' => 1, 'CustomerId' => 2, 'CustomerTitleId' => 3, 'Company' => 4, 'Firstname' => 5, 'Lastname' => 6, 'Address1' => 7, 'Address2' => 8, 'Address3' => 9, 'Zipcode' => 10, 'City' => 11, 'CountryId' => 12, 'Phone' => 13, 'Cellphone' => 14, 'IsDefault' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'title' => 1, 'customerId' => 2, 'customerTitleId' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'countryId' => 12, 'phone' => 13, 'cellphone' => 14, 'isDefault' => 15, 'createdAt' => 16, 'updatedAt' => 17, ),
- self::TYPE_COLNAME => array(AddressTableMap::ID => 0, AddressTableMap::TITLE => 1, AddressTableMap::CUSTOMER_ID => 2, AddressTableMap::CUSTOMER_TITLE_ID => 3, AddressTableMap::COMPANY => 4, AddressTableMap::FIRSTNAME => 5, AddressTableMap::LASTNAME => 6, AddressTableMap::ADDRESS1 => 7, AddressTableMap::ADDRESS2 => 8, AddressTableMap::ADDRESS3 => 9, AddressTableMap::ZIPCODE => 10, AddressTableMap::CITY => 11, AddressTableMap::COUNTRY_ID => 12, AddressTableMap::PHONE => 13, AddressTableMap::CELLPHONE => 14, AddressTableMap::IS_DEFAULT => 15, AddressTableMap::CREATED_AT => 16, AddressTableMap::UPDATED_AT => 17, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'TITLE' => 1, 'CUSTOMER_ID' => 2, 'CUSTOMER_TITLE_ID' => 3, 'COMPANY' => 4, 'FIRSTNAME' => 5, 'LASTNAME' => 6, 'ADDRESS1' => 7, 'ADDRESS2' => 8, 'ADDRESS3' => 9, 'ZIPCODE' => 10, 'CITY' => 11, 'COUNTRY_ID' => 12, 'PHONE' => 13, 'CELLPHONE' => 14, 'IS_DEFAULT' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'title' => 1, 'customer_id' => 2, 'customer_title_id' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'country_id' => 12, 'phone' => 13, 'cellphone' => 14, 'is_default' => 15, 'created_at' => 16, 'updated_at' => 17, ),
+ self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'CustomerId' => 2, 'TitleId' => 3, 'Company' => 4, 'Firstname' => 5, 'Lastname' => 6, 'Address1' => 7, 'Address2' => 8, 'Address3' => 9, 'Zipcode' => 10, 'City' => 11, 'CountryId' => 12, 'Phone' => 13, 'Cellphone' => 14, 'IsDefault' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'name' => 1, 'customerId' => 2, 'titleId' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'countryId' => 12, 'phone' => 13, 'cellphone' => 14, 'isDefault' => 15, 'createdAt' => 16, 'updatedAt' => 17, ),
+ self::TYPE_COLNAME => array(AddressTableMap::ID => 0, AddressTableMap::NAME => 1, AddressTableMap::CUSTOMER_ID => 2, AddressTableMap::TITLE_ID => 3, AddressTableMap::COMPANY => 4, AddressTableMap::FIRSTNAME => 5, AddressTableMap::LASTNAME => 6, AddressTableMap::ADDRESS1 => 7, AddressTableMap::ADDRESS2 => 8, AddressTableMap::ADDRESS3 => 9, AddressTableMap::ZIPCODE => 10, AddressTableMap::CITY => 11, AddressTableMap::COUNTRY_ID => 12, AddressTableMap::PHONE => 13, AddressTableMap::CELLPHONE => 14, AddressTableMap::IS_DEFAULT => 15, AddressTableMap::CREATED_AT => 16, AddressTableMap::UPDATED_AT => 17, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'NAME' => 1, 'CUSTOMER_ID' => 2, 'TITLE_ID' => 3, 'COMPANY' => 4, 'FIRSTNAME' => 5, 'LASTNAME' => 6, 'ADDRESS1' => 7, 'ADDRESS2' => 8, 'ADDRESS3' => 9, 'ZIPCODE' => 10, 'CITY' => 11, 'COUNTRY_ID' => 12, 'PHONE' => 13, 'CELLPHONE' => 14, 'IS_DEFAULT' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'customer_id' => 2, 'title_id' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'country_id' => 12, 'phone' => 13, 'cellphone' => 14, 'is_default' => 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,9 +211,9 @@ class AddressTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
- $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
+ $this->addColumn('NAME', 'Name', 'VARCHAR', false, 255, null);
$this->addForeignKey('CUSTOMER_ID', 'CustomerId', 'INTEGER', 'customer', 'ID', true, null, null);
- $this->addForeignKey('CUSTOMER_TITLE_ID', 'CustomerTitleId', 'INTEGER', 'customer_title', 'ID', false, null, null);
+ $this->addForeignKey('TITLE_ID', 'TitleId', 'INTEGER', 'customer_title', 'ID', true, null, null);
$this->addColumn('COMPANY', 'Company', 'VARCHAR', false, 255, null);
$this->addColumn('FIRSTNAME', 'Firstname', 'VARCHAR', true, 255, null);
$this->addColumn('LASTNAME', 'Lastname', 'VARCHAR', true, 255, null);
@@ -222,7 +222,7 @@ class AddressTableMap extends TableMap
$this->addColumn('ADDRESS3', 'Address3', 'VARCHAR', true, 255, null);
$this->addColumn('ZIPCODE', 'Zipcode', 'VARCHAR', true, 10, null);
$this->addColumn('CITY', 'City', 'VARCHAR', true, 255, null);
- $this->addColumn('COUNTRY_ID', 'CountryId', 'INTEGER', true, null, null);
+ $this->addForeignKey('COUNTRY_ID', 'CountryId', 'INTEGER', 'country', 'ID', true, null, null);
$this->addColumn('PHONE', 'Phone', 'VARCHAR', false, 20, null);
$this->addColumn('CELLPHONE', 'Cellphone', 'VARCHAR', false, 20, null);
$this->addColumn('IS_DEFAULT', 'IsDefault', 'TINYINT', false, null, 0);
@@ -236,7 +236,8 @@ class AddressTableMap extends TableMap
public function buildRelations()
{
$this->addRelation('Customer', '\\Thelia\\Model\\Customer', RelationMap::MANY_TO_ONE, array('customer_id' => 'id', ), 'CASCADE', 'RESTRICT');
- $this->addRelation('CustomerTitle', '\\Thelia\\Model\\CustomerTitle', RelationMap::MANY_TO_ONE, array('customer_title_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ $this->addRelation('CustomerTitle', '\\Thelia\\Model\\CustomerTitle', RelationMap::MANY_TO_ONE, array('title_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ $this->addRelation('Country', '\\Thelia\\Model\\Country', RelationMap::MANY_TO_ONE, array('country_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('CartRelatedByAddressDeliveryId', '\\Thelia\\Model\\Cart', RelationMap::ONE_TO_MANY, array('id' => 'address_delivery_id', ), null, null, 'CartsRelatedByAddressDeliveryId');
$this->addRelation('CartRelatedByAddressInvoiceId', '\\Thelia\\Model\\Cart', RelationMap::ONE_TO_MANY, array('id' => 'address_invoice_id', ), null, null, 'CartsRelatedByAddressInvoiceId');
} // buildRelations()
@@ -393,9 +394,9 @@ class AddressTableMap extends TableMap
{
if (null === $alias) {
$criteria->addSelectColumn(AddressTableMap::ID);
- $criteria->addSelectColumn(AddressTableMap::TITLE);
+ $criteria->addSelectColumn(AddressTableMap::NAME);
$criteria->addSelectColumn(AddressTableMap::CUSTOMER_ID);
- $criteria->addSelectColumn(AddressTableMap::CUSTOMER_TITLE_ID);
+ $criteria->addSelectColumn(AddressTableMap::TITLE_ID);
$criteria->addSelectColumn(AddressTableMap::COMPANY);
$criteria->addSelectColumn(AddressTableMap::FIRSTNAME);
$criteria->addSelectColumn(AddressTableMap::LASTNAME);
@@ -412,9 +413,9 @@ class AddressTableMap extends TableMap
$criteria->addSelectColumn(AddressTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
- $criteria->addSelectColumn($alias . '.TITLE');
+ $criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.CUSTOMER_ID');
- $criteria->addSelectColumn($alias . '.CUSTOMER_TITLE_ID');
+ $criteria->addSelectColumn($alias . '.TITLE_ID');
$criteria->addSelectColumn($alias . '.COMPANY');
$criteria->addSelectColumn($alias . '.FIRSTNAME');
$criteria->addSelectColumn($alias . '.LASTNAME');
diff --git a/core/lib/Thelia/Model/Map/AdminGroupTableMap.php b/core/lib/Thelia/Model/Map/AdminGroupTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/AdminLogTableMap.php b/core/lib/Thelia/Model/Map/AdminLogTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/AdminTableMap.php b/core/lib/Thelia/Model/Map/AdminTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/AreaTableMap.php b/core/lib/Thelia/Model/Map/AreaTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php b/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/AttributeAvTableMap.php b/core/lib/Thelia/Model/Map/AttributeAvTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/AttributeCategoryTableMap.php b/core/lib/Thelia/Model/Map/AttributeCategoryTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/AttributeCombinationTableMap.php b/core/lib/Thelia/Model/Map/AttributeCombinationTableMap.php
old mode 100755
new mode 100644
index b3e3584a4..a4b3520e7
--- a/core/lib/Thelia/Model/Map/AttributeCombinationTableMap.php
+++ b/core/lib/Thelia/Model/Map/AttributeCombinationTableMap.php
@@ -57,7 +57,7 @@ class AttributeCombinationTableMap extends TableMap
/**
* The total number of columns
*/
- const NUM_COLUMNS = 6;
+ const NUM_COLUMNS = 5;
/**
* The number of lazy-loaded columns
@@ -67,28 +67,23 @@ class AttributeCombinationTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 6;
-
- /**
- * the column name for the ID field
- */
- const ID = 'attribute_combination.ID';
+ const NUM_HYDRATE_COLUMNS = 5;
/**
* the column name for the ATTRIBUTE_ID field
*/
const ATTRIBUTE_ID = 'attribute_combination.ATTRIBUTE_ID';
- /**
- * the column name for the COMBINATION_ID field
- */
- const COMBINATION_ID = 'attribute_combination.COMBINATION_ID';
-
/**
* the column name for the ATTRIBUTE_AV_ID field
*/
const ATTRIBUTE_AV_ID = 'attribute_combination.ATTRIBUTE_AV_ID';
+ /**
+ * the column name for the PRODUCT_SALE_ELEMENTS_ID field
+ */
+ const PRODUCT_SALE_ELEMENTS_ID = 'attribute_combination.PRODUCT_SALE_ELEMENTS_ID';
+
/**
* the column name for the CREATED_AT field
*/
@@ -111,12 +106,12 @@ class AttributeCombinationTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'AttributeId', 'CombinationId', 'AttributeAvId', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'attributeId', 'combinationId', 'attributeAvId', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(AttributeCombinationTableMap::ID, AttributeCombinationTableMap::ATTRIBUTE_ID, AttributeCombinationTableMap::COMBINATION_ID, AttributeCombinationTableMap::ATTRIBUTE_AV_ID, AttributeCombinationTableMap::CREATED_AT, AttributeCombinationTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'ATTRIBUTE_ID', 'COMBINATION_ID', 'ATTRIBUTE_AV_ID', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'attribute_id', 'combination_id', 'attribute_av_id', 'created_at', 'updated_at', ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
+ self::TYPE_PHPNAME => array('AttributeId', 'AttributeAvId', 'ProductSaleElementsId', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('attributeId', 'attributeAvId', 'productSaleElementsId', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(AttributeCombinationTableMap::ATTRIBUTE_ID, AttributeCombinationTableMap::ATTRIBUTE_AV_ID, AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, AttributeCombinationTableMap::CREATED_AT, AttributeCombinationTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ATTRIBUTE_ID', 'ATTRIBUTE_AV_ID', 'PRODUCT_SALE_ELEMENTS_ID', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('attribute_id', 'attribute_av_id', 'product_sale_elements_id', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -126,12 +121,12 @@ class AttributeCombinationTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'AttributeId' => 1, 'CombinationId' => 2, 'AttributeAvId' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'attributeId' => 1, 'combinationId' => 2, 'attributeAvId' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
- self::TYPE_COLNAME => array(AttributeCombinationTableMap::ID => 0, AttributeCombinationTableMap::ATTRIBUTE_ID => 1, AttributeCombinationTableMap::COMBINATION_ID => 2, AttributeCombinationTableMap::ATTRIBUTE_AV_ID => 3, AttributeCombinationTableMap::CREATED_AT => 4, AttributeCombinationTableMap::UPDATED_AT => 5, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'ATTRIBUTE_ID' => 1, 'COMBINATION_ID' => 2, 'ATTRIBUTE_AV_ID' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'attribute_id' => 1, 'combination_id' => 2, 'attribute_av_id' => 3, 'created_at' => 4, 'updated_at' => 5, ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
+ self::TYPE_PHPNAME => array('AttributeId' => 0, 'AttributeAvId' => 1, 'ProductSaleElementsId' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
+ self::TYPE_STUDLYPHPNAME => array('attributeId' => 0, 'attributeAvId' => 1, 'productSaleElementsId' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
+ self::TYPE_COLNAME => array(AttributeCombinationTableMap::ATTRIBUTE_ID => 0, AttributeCombinationTableMap::ATTRIBUTE_AV_ID => 1, AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID => 2, AttributeCombinationTableMap::CREATED_AT => 3, AttributeCombinationTableMap::UPDATED_AT => 4, ),
+ self::TYPE_RAW_COLNAME => array('ATTRIBUTE_ID' => 0, 'ATTRIBUTE_AV_ID' => 1, 'PRODUCT_SALE_ELEMENTS_ID' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
+ self::TYPE_FIELDNAME => array('attribute_id' => 0, 'attribute_av_id' => 1, 'product_sale_elements_id' => 2, 'created_at' => 3, 'updated_at' => 4, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -148,12 +143,11 @@ class AttributeCombinationTableMap extends TableMap
$this->setPhpName('AttributeCombination');
$this->setClassName('\\Thelia\\Model\\AttributeCombination');
$this->setPackage('Thelia.Model');
- $this->setUseIdGenerator(true);
+ $this->setUseIdGenerator(false);
// columns
- $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignPrimaryKey('ATTRIBUTE_ID', 'AttributeId', 'INTEGER' , 'attribute', 'ID', true, null, null);
- $this->addForeignPrimaryKey('COMBINATION_ID', 'CombinationId', 'INTEGER' , 'combination', 'ID', true, null, null);
$this->addForeignPrimaryKey('ATTRIBUTE_AV_ID', 'AttributeAvId', 'INTEGER' , 'attribute_av', 'ID', true, null, null);
+ $this->addForeignPrimaryKey('PRODUCT_SALE_ELEMENTS_ID', 'ProductSaleElementsId', 'INTEGER' , 'product_sale_elements', 'ID', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -165,7 +159,7 @@ class AttributeCombinationTableMap extends TableMap
{
$this->addRelation('Attribute', '\\Thelia\\Model\\Attribute', RelationMap::MANY_TO_ONE, array('attribute_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('AttributeAv', '\\Thelia\\Model\\AttributeAv', RelationMap::MANY_TO_ONE, array('attribute_av_id' => 'id', ), 'CASCADE', 'RESTRICT');
- $this->addRelation('Combination', '\\Thelia\\Model\\Combination', RelationMap::MANY_TO_ONE, array('combination_id' => 'id', ), 'CASCADE', 'RESTRICT');
+ $this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::MANY_TO_ONE, array('product_sale_elements_id' => 'id', ), null, null);
} // buildRelations()
/**
@@ -196,7 +190,7 @@ class AttributeCombinationTableMap extends TableMap
{
if (Propel::isInstancePoolingEnabled()) {
if (null === $key) {
- $key = serialize(array((string) $obj->getId(), (string) $obj->getAttributeId(), (string) $obj->getCombinationId(), (string) $obj->getAttributeAvId()));
+ $key = serialize(array((string) $obj->getAttributeId(), (string) $obj->getAttributeAvId(), (string) $obj->getProductSaleElementsId()));
} // if key === null
self::$instances[$key] = $obj;
}
@@ -216,11 +210,11 @@ class AttributeCombinationTableMap extends TableMap
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \Thelia\Model\AttributeCombination) {
- $key = serialize(array((string) $value->getId(), (string) $value->getAttributeId(), (string) $value->getCombinationId(), (string) $value->getAttributeAvId()));
+ $key = serialize(array((string) $value->getAttributeId(), (string) $value->getAttributeAvId(), (string) $value->getProductSaleElementsId()));
- } elseif (is_array($value) && count($value) === 4) {
+ } elseif (is_array($value) && count($value) === 3) {
// assume we've been passed a primary key";
- $key = serialize(array((string) $value[0], (string) $value[1], (string) $value[2], (string) $value[3]));
+ $key = serialize(array((string) $value[0], (string) $value[1], (string) $value[2]));
} elseif ($value instanceof Criteria) {
self::$instances = [];
@@ -248,11 +242,11 @@ class AttributeCombinationTableMap extends TableMap
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
// If the PK cannot be derived from the row, return NULL.
- if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('CombinationId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 3 + $offset : static::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('ProductSaleElementsId', TableMap::TYPE_PHPNAME, $indexType)] === null) {
return null;
}
- return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('CombinationId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 3 + $offset : static::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)]));
+ return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('ProductSaleElementsId', TableMap::TYPE_PHPNAME, $indexType)]));
}
/**
@@ -368,17 +362,15 @@ class AttributeCombinationTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
- $criteria->addSelectColumn(AttributeCombinationTableMap::ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::ATTRIBUTE_ID);
- $criteria->addSelectColumn(AttributeCombinationTableMap::COMBINATION_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::ATTRIBUTE_AV_ID);
+ $criteria->addSelectColumn(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::CREATED_AT);
$criteria->addSelectColumn(AttributeCombinationTableMap::UPDATED_AT);
} else {
- $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.ATTRIBUTE_ID');
- $criteria->addSelectColumn($alias . '.COMBINATION_ID');
$criteria->addSelectColumn($alias . '.ATTRIBUTE_AV_ID');
+ $criteria->addSelectColumn($alias . '.PRODUCT_SALE_ELEMENTS_ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
@@ -439,10 +431,9 @@ class AttributeCombinationTableMap extends TableMap
$values = array($values);
}
foreach ($values as $value) {
- $criterion = $criteria->getNewCriterion(AttributeCombinationTableMap::ID, $value[0]);
- $criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_ID, $value[1]));
- $criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::COMBINATION_ID, $value[2]));
- $criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $value[3]));
+ $criterion = $criteria->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_ID, $value[0]);
+ $criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $value[1]));
+ $criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $value[2]));
$criteria->addOr($criterion);
}
}
@@ -490,10 +481,6 @@ class AttributeCombinationTableMap extends TableMap
$criteria = $criteria->buildCriteria(); // build Criteria from AttributeCombination object
}
- if ($criteria->containsKey(AttributeCombinationTableMap::ID) && $criteria->keyContainsValue(AttributeCombinationTableMap::ID) ) {
- throw new PropelException('Cannot insert a value for auto-increment primary key ('.AttributeCombinationTableMap::ID.')');
- }
-
// Set the correct dbName
$query = AttributeCombinationQuery::create()->mergeWith($criteria);
diff --git a/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php b/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/AttributeTableMap.php b/core/lib/Thelia/Model/Map/AttributeTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/CartItemTableMap.php b/core/lib/Thelia/Model/Map/CartItemTableMap.php
index c496e85c8..49335f9ec 100644
--- a/core/lib/Thelia/Model/Map/CartItemTableMap.php
+++ b/core/lib/Thelia/Model/Map/CartItemTableMap.php
@@ -90,9 +90,9 @@ class CartItemTableMap extends TableMap
const QUANTITY = 'cart_item.QUANTITY';
/**
- * the column name for the COMBINATION_ID field
+ * the column name for the PRODUCT_SALE_ELEMENTS_ID field
*/
- const COMBINATION_ID = 'cart_item.COMBINATION_ID';
+ const PRODUCT_SALE_ELEMENTS_ID = 'cart_item.PRODUCT_SALE_ELEMENTS_ID';
/**
* the column name for the CREATED_AT field
@@ -116,11 +116,11 @@ class CartItemTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'CartId', 'ProductId', 'Quantity', 'CombinationId', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'cartId', 'productId', 'quantity', 'combinationId', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(CartItemTableMap::ID, CartItemTableMap::CART_ID, CartItemTableMap::PRODUCT_ID, CartItemTableMap::QUANTITY, CartItemTableMap::COMBINATION_ID, CartItemTableMap::CREATED_AT, CartItemTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'CART_ID', 'PRODUCT_ID', 'QUANTITY', 'COMBINATION_ID', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'cart_id', 'product_id', 'quantity', 'combination_id', 'created_at', 'updated_at', ),
+ self::TYPE_PHPNAME => array('Id', 'CartId', 'ProductId', 'Quantity', 'ProductSaleElementsId', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'cartId', 'productId', 'quantity', 'productSaleElementsId', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(CartItemTableMap::ID, CartItemTableMap::CART_ID, CartItemTableMap::PRODUCT_ID, CartItemTableMap::QUANTITY, CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, CartItemTableMap::CREATED_AT, CartItemTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'CART_ID', 'PRODUCT_ID', 'QUANTITY', 'PRODUCT_SALE_ELEMENTS_ID', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'cart_id', 'product_id', 'quantity', 'product_sale_elements_id', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -131,11 +131,11 @@ class CartItemTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'CartId' => 1, 'ProductId' => 2, 'Quantity' => 3, 'CombinationId' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'cartId' => 1, 'productId' => 2, 'quantity' => 3, 'combinationId' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
- self::TYPE_COLNAME => array(CartItemTableMap::ID => 0, CartItemTableMap::CART_ID => 1, CartItemTableMap::PRODUCT_ID => 2, CartItemTableMap::QUANTITY => 3, CartItemTableMap::COMBINATION_ID => 4, CartItemTableMap::CREATED_AT => 5, CartItemTableMap::UPDATED_AT => 6, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'CART_ID' => 1, 'PRODUCT_ID' => 2, 'QUANTITY' => 3, 'COMBINATION_ID' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'cart_id' => 1, 'product_id' => 2, 'quantity' => 3, 'combination_id' => 4, 'created_at' => 5, 'updated_at' => 6, ),
+ self::TYPE_PHPNAME => array('Id' => 0, 'CartId' => 1, 'ProductId' => 2, 'Quantity' => 3, 'ProductSaleElementsId' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'cartId' => 1, 'productId' => 2, 'quantity' => 3, 'productSaleElementsId' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
+ self::TYPE_COLNAME => array(CartItemTableMap::ID => 0, CartItemTableMap::CART_ID => 1, CartItemTableMap::PRODUCT_ID => 2, CartItemTableMap::QUANTITY => 3, CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID => 4, CartItemTableMap::CREATED_AT => 5, CartItemTableMap::UPDATED_AT => 6, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'CART_ID' => 1, 'PRODUCT_ID' => 2, 'QUANTITY' => 3, 'PRODUCT_SALE_ELEMENTS_ID' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'cart_id' => 1, 'product_id' => 2, 'quantity' => 3, 'product_sale_elements_id' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -159,7 +159,7 @@ class CartItemTableMap extends TableMap
$this->addForeignKey('CART_ID', 'CartId', 'INTEGER', 'cart', 'ID', true, null, null);
$this->addForeignKey('PRODUCT_ID', 'ProductId', 'INTEGER', 'product', 'ID', true, null, null);
$this->addColumn('QUANTITY', 'Quantity', 'FLOAT', false, null, 1);
- $this->addForeignKey('COMBINATION_ID', 'CombinationId', 'INTEGER', 'combination', 'ID', false, null, null);
+ $this->addForeignKey('PRODUCT_SALE_ELEMENTS_ID', 'ProductSaleElementsId', 'INTEGER', 'product_sale_elements', 'ID', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -171,7 +171,7 @@ class CartItemTableMap extends TableMap
{
$this->addRelation('Cart', '\\Thelia\\Model\\Cart', RelationMap::MANY_TO_ONE, array('cart_id' => 'id', ), null, null);
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::MANY_TO_ONE, array('product_id' => 'id', ), null, null);
- $this->addRelation('Combination', '\\Thelia\\Model\\Combination', RelationMap::MANY_TO_ONE, array('combination_id' => 'id', ), null, null);
+ $this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::MANY_TO_ONE, array('product_sale_elements_id' => 'id', ), null, null);
} // buildRelations()
/**
@@ -329,7 +329,7 @@ class CartItemTableMap extends TableMap
$criteria->addSelectColumn(CartItemTableMap::CART_ID);
$criteria->addSelectColumn(CartItemTableMap::PRODUCT_ID);
$criteria->addSelectColumn(CartItemTableMap::QUANTITY);
- $criteria->addSelectColumn(CartItemTableMap::COMBINATION_ID);
+ $criteria->addSelectColumn(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID);
$criteria->addSelectColumn(CartItemTableMap::CREATED_AT);
$criteria->addSelectColumn(CartItemTableMap::UPDATED_AT);
} else {
@@ -337,7 +337,7 @@ class CartItemTableMap extends TableMap
$criteria->addSelectColumn($alias . '.CART_ID');
$criteria->addSelectColumn($alias . '.PRODUCT_ID');
$criteria->addSelectColumn($alias . '.QUANTITY');
- $criteria->addSelectColumn($alias . '.COMBINATION_ID');
+ $criteria->addSelectColumn($alias . '.PRODUCT_SALE_ELEMENTS_ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
diff --git a/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php b/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/CategoryTableMap.php b/core/lib/Thelia/Model/Map/CategoryTableMap.php
old mode 100755
new mode 100644
index 1bade771c..0a7247fee
--- a/core/lib/Thelia/Model/Map/CategoryTableMap.php
+++ b/core/lib/Thelia/Model/Map/CategoryTableMap.php
@@ -213,9 +213,9 @@ class CategoryTableMap extends TableMap
public function getBehaviors()
{
return array(
- 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'versionable' => array('version_column' => 'version', 'version_table' => '', 'log_created_at' => 'true', 'log_created_by' => 'true', 'log_comment' => 'false', 'version_created_at_column' => 'version_created_at', 'version_created_by_column' => 'version_created_by', 'version_comment_column' => 'version_comment', ),
+ 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
/**
diff --git a/core/lib/Thelia/Model/Map/CategoryVersionTableMap.php b/core/lib/Thelia/Model/Map/CategoryVersionTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php b/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ConfigTableMap.php b/core/lib/Thelia/Model/Map/ConfigTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ContentAssocTableMap.php b/core/lib/Thelia/Model/Map/ContentAssocTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ContentFolderTableMap.php b/core/lib/Thelia/Model/Map/ContentFolderTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ContentI18nTableMap.php b/core/lib/Thelia/Model/Map/ContentI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ContentTableMap.php b/core/lib/Thelia/Model/Map/ContentTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ContentVersionTableMap.php b/core/lib/Thelia/Model/Map/ContentVersionTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/CountryI18nTableMap.php b/core/lib/Thelia/Model/Map/CountryI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/CountryTableMap.php b/core/lib/Thelia/Model/Map/CountryTableMap.php
old mode 100755
new mode 100644
index 3060da70f..e7c356f08
--- a/core/lib/Thelia/Model/Map/CountryTableMap.php
+++ b/core/lib/Thelia/Model/Map/CountryTableMap.php
@@ -180,6 +180,7 @@ class CountryTableMap extends TableMap
{
$this->addRelation('Area', '\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('TaxRuleCountry', '\\Thelia\\Model\\TaxRuleCountry', RelationMap::ONE_TO_MANY, array('id' => 'country_id', ), 'CASCADE', 'RESTRICT', 'TaxRuleCountries');
+ $this->addRelation('Address', '\\Thelia\\Model\\Address', RelationMap::ONE_TO_MANY, array('id' => 'country_id', ), 'RESTRICT', 'RESTRICT', 'Addresses');
$this->addRelation('CountryI18n', '\\Thelia\\Model\\CountryI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CountryI18ns');
} // buildRelations()
diff --git a/core/lib/Thelia/Model/Map/CouponOrderTableMap.php b/core/lib/Thelia/Model/Map/CouponOrderTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/CouponRuleTableMap.php b/core/lib/Thelia/Model/Map/CouponRuleTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/CouponTableMap.php b/core/lib/Thelia/Model/Map/CouponTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/CurrencyI18nTableMap.php b/core/lib/Thelia/Model/Map/CurrencyI18nTableMap.php
new file mode 100644
index 000000000..c7e4725c1
--- /dev/null
+++ b/core/lib/Thelia/Model/Map/CurrencyI18nTableMap.php
@@ -0,0 +1,473 @@
+ array('Id', 'Locale', 'Name', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'name', ),
+ self::TYPE_COLNAME => array(CurrencyI18nTableMap::ID, CurrencyI18nTableMap::LOCALE, CurrencyI18nTableMap::NAME, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'NAME', ),
+ self::TYPE_FIELDNAME => array('id', 'locale', 'name', ),
+ self::TYPE_NUM => array(0, 1, 2, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Name' => 2, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'name' => 2, ),
+ self::TYPE_COLNAME => array(CurrencyI18nTableMap::ID => 0, CurrencyI18nTableMap::LOCALE => 1, CurrencyI18nTableMap::NAME => 2, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'NAME' => 2, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'name' => 2, ),
+ self::TYPE_NUM => array(0, 1, 2, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('currency_i18n');
+ $this->setPhpName('CurrencyI18n');
+ $this->setClassName('\\Thelia\\Model\\CurrencyI18n');
+ $this->setPackage('Thelia.Model');
+ $this->setUseIdGenerator(false);
+ // columns
+ $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'currency', 'ID', true, null, null);
+ $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
+ $this->addColumn('NAME', 'Name', 'VARCHAR', false, 45, null);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('Currency', '\\Thelia\\Model\\Currency', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
+ } // buildRelations()
+
+ /**
+ * Adds an object to the instance pool.
+ *
+ * Propel keeps cached copies of objects in an instance pool when they are retrieved
+ * from the database. In some cases you may need to explicitly add objects
+ * to the cache in order to ensure that the same objects are always returned by find*()
+ * and findPk*() calls.
+ *
+ * @param \Thelia\Model\CurrencyI18n $obj A \Thelia\Model\CurrencyI18n object.
+ * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
+ */
+ public static function addInstanceToPool($obj, $key = null)
+ {
+ if (Propel::isInstancePoolingEnabled()) {
+ if (null === $key) {
+ $key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
+ } // if key === null
+ self::$instances[$key] = $obj;
+ }
+ }
+
+ /**
+ * Removes an object from the instance pool.
+ *
+ * Propel keeps cached copies of objects in an instance pool when they are retrieved
+ * from the database. In some cases -- especially when you override doDelete
+ * methods in your stub classes -- you may need to explicitly remove objects
+ * from the cache in order to prevent returning objects that no longer exist.
+ *
+ * @param mixed $value A \Thelia\Model\CurrencyI18n object or a primary key value.
+ */
+ public static function removeInstanceFromPool($value)
+ {
+ if (Propel::isInstancePoolingEnabled() && null !== $value) {
+ if (is_object($value) && $value instanceof \Thelia\Model\CurrencyI18n) {
+ $key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
+
+ } elseif (is_array($value) && count($value) === 2) {
+ // assume we've been passed a primary key";
+ $key = serialize(array((string) $value[0], (string) $value[1]));
+ } elseif ($value instanceof Criteria) {
+ self::$instances = [];
+
+ return;
+ } else {
+ $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\CurrencyI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
+ throw $e;
+ }
+
+ unset(self::$instances[$key]);
+ }
+ }
+
+ /**
+ * 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.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return $pks;
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? CurrencyI18nTableMap::CLASS_DEFAULT : CurrencyI18nTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (CurrencyI18n object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = CurrencyI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = CurrencyI18nTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + CurrencyI18nTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = CurrencyI18nTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ CurrencyI18nTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = CurrencyI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = CurrencyI18nTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ CurrencyI18nTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(CurrencyI18nTableMap::ID);
+ $criteria->addSelectColumn(CurrencyI18nTableMap::LOCALE);
+ $criteria->addSelectColumn(CurrencyI18nTableMap::NAME);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.LOCALE');
+ $criteria->addSelectColumn($alias . '.NAME');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(CurrencyI18nTableMap::DATABASE_NAME)->getTable(CurrencyI18nTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(CurrencyI18nTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(CurrencyI18nTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new CurrencyI18nTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a CurrencyI18n or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or CurrencyI18n object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(CurrencyI18nTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \Thelia\Model\CurrencyI18n) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(CurrencyI18nTableMap::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ foreach ($values as $value) {
+ $criterion = $criteria->getNewCriterion(CurrencyI18nTableMap::ID, $value[0]);
+ $criterion->addAnd($criteria->getNewCriterion(CurrencyI18nTableMap::LOCALE, $value[1]));
+ $criteria->addOr($criterion);
+ }
+ }
+
+ $query = CurrencyI18nQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { CurrencyI18nTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { CurrencyI18nTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the currency_i18n table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return CurrencyI18nQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a CurrencyI18n or Criteria object.
+ *
+ * @param mixed $criteria Criteria or CurrencyI18n object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(CurrencyI18nTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from CurrencyI18n object
+ }
+
+
+ // Set the correct dbName
+ $query = CurrencyI18nQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // CurrencyI18nTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+CurrencyI18nTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/CurrencyTableMap.php b/core/lib/Thelia/Model/Map/CurrencyTableMap.php
old mode 100755
new mode 100644
index 8d2ca54ec..c9a707d9a
--- a/core/lib/Thelia/Model/Map/CurrencyTableMap.php
+++ b/core/lib/Thelia/Model/Map/CurrencyTableMap.php
@@ -57,7 +57,7 @@ class CurrencyTableMap extends TableMap
/**
* The total number of columns
*/
- const NUM_COLUMNS = 8;
+ const NUM_COLUMNS = 7;
/**
* The number of lazy-loaded columns
@@ -67,18 +67,13 @@ class CurrencyTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 8;
+ const NUM_HYDRATE_COLUMNS = 7;
/**
* the column name for the ID field
*/
const ID = 'currency.ID';
- /**
- * the column name for the NAME field
- */
- const NAME = 'currency.NAME';
-
/**
* the column name for the CODE field
*/
@@ -114,6 +109,15 @@ class CurrencyTableMap extends TableMap
*/
const DEFAULT_STRING_FORMAT = 'YAML';
+ // i18n behavior
+
+ /**
+ * The default locale to use for translations.
+ *
+ * @var string
+ */
+ const DEFAULT_LOCALE = 'en_US';
+
/**
* holds an array of fieldnames
*
@@ -121,12 +125,12 @@ class CurrencyTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'Name', 'Code', 'Symbol', 'Rate', 'ByDefault', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'name', 'code', 'symbol', 'rate', 'byDefault', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(CurrencyTableMap::ID, CurrencyTableMap::NAME, CurrencyTableMap::CODE, CurrencyTableMap::SYMBOL, CurrencyTableMap::RATE, CurrencyTableMap::BY_DEFAULT, CurrencyTableMap::CREATED_AT, CurrencyTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'NAME', 'CODE', 'SYMBOL', 'RATE', 'BY_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'name', 'code', 'symbol', 'rate', 'by_default', 'created_at', 'updated_at', ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
+ self::TYPE_PHPNAME => array('Id', 'Code', 'Symbol', 'Rate', 'ByDefault', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'code', 'symbol', 'rate', 'byDefault', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(CurrencyTableMap::ID, CurrencyTableMap::CODE, CurrencyTableMap::SYMBOL, CurrencyTableMap::RATE, CurrencyTableMap::BY_DEFAULT, CurrencyTableMap::CREATED_AT, CurrencyTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'CODE', 'SYMBOL', 'RATE', 'BY_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'code', 'symbol', 'rate', 'by_default', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
/**
@@ -136,12 +140,12 @@ class CurrencyTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'Code' => 2, 'Symbol' => 3, 'Rate' => 4, 'ByDefault' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'name' => 1, 'code' => 2, 'symbol' => 3, 'rate' => 4, 'byDefault' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
- self::TYPE_COLNAME => array(CurrencyTableMap::ID => 0, CurrencyTableMap::NAME => 1, CurrencyTableMap::CODE => 2, CurrencyTableMap::SYMBOL => 3, CurrencyTableMap::RATE => 4, CurrencyTableMap::BY_DEFAULT => 5, CurrencyTableMap::CREATED_AT => 6, CurrencyTableMap::UPDATED_AT => 7, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'NAME' => 1, 'CODE' => 2, 'SYMBOL' => 3, 'RATE' => 4, 'BY_DEFAULT' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'code' => 2, 'symbol' => 3, 'rate' => 4, 'by_default' => 5, 'created_at' => 6, 'updated_at' => 7, ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
+ self::TYPE_PHPNAME => array('Id' => 0, 'Code' => 1, 'Symbol' => 2, 'Rate' => 3, 'ByDefault' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'code' => 1, 'symbol' => 2, 'rate' => 3, 'byDefault' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
+ self::TYPE_COLNAME => array(CurrencyTableMap::ID => 0, CurrencyTableMap::CODE => 1, CurrencyTableMap::SYMBOL => 2, CurrencyTableMap::RATE => 3, CurrencyTableMap::BY_DEFAULT => 4, CurrencyTableMap::CREATED_AT => 5, CurrencyTableMap::UPDATED_AT => 6, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'CODE' => 1, 'SYMBOL' => 2, 'RATE' => 3, 'BY_DEFAULT' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'code' => 1, 'symbol' => 2, 'rate' => 3, 'by_default' => 4, 'created_at' => 5, 'updated_at' => 6, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
/**
@@ -161,7 +165,6 @@ class CurrencyTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
- $this->addColumn('NAME', 'Name', 'VARCHAR', false, 45, null);
$this->addColumn('CODE', 'Code', 'VARCHAR', false, 45, null);
$this->addColumn('SYMBOL', 'Symbol', 'VARCHAR', false, 45, null);
$this->addColumn('RATE', 'Rate', 'FLOAT', false, null, null);
@@ -177,6 +180,8 @@ class CurrencyTableMap extends TableMap
{
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), 'SET NULL', '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', ), null, null, 'ProductPrices');
+ $this->addRelation('CurrencyI18n', '\\Thelia\\Model\\CurrencyI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CurrencyI18ns');
} // buildRelations()
/**
@@ -189,6 +194,7 @@ class CurrencyTableMap extends TableMap
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
+ 'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'name', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
);
} // getBehaviors()
/**
@@ -199,6 +205,7 @@ 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();
+ CurrencyI18nTableMap::clearInstancePool();
}
/**
@@ -340,7 +347,6 @@ class CurrencyTableMap extends TableMap
{
if (null === $alias) {
$criteria->addSelectColumn(CurrencyTableMap::ID);
- $criteria->addSelectColumn(CurrencyTableMap::NAME);
$criteria->addSelectColumn(CurrencyTableMap::CODE);
$criteria->addSelectColumn(CurrencyTableMap::SYMBOL);
$criteria->addSelectColumn(CurrencyTableMap::RATE);
@@ -349,7 +355,6 @@ class CurrencyTableMap extends TableMap
$criteria->addSelectColumn(CurrencyTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
- $criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.CODE');
$criteria->addSelectColumn($alias . '.SYMBOL');
$criteria->addSelectColumn($alias . '.RATE');
diff --git a/core/lib/Thelia/Model/Map/CustomerTableMap.php b/core/lib/Thelia/Model/Map/CustomerTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php b/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php b/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php
old mode 100755
new mode 100644
index 44b16fafd..c10ce2500
--- a/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php
+++ b/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php
@@ -167,7 +167,7 @@ class CustomerTitleTableMap extends TableMap
public function buildRelations()
{
$this->addRelation('Customer', '\\Thelia\\Model\\Customer', RelationMap::ONE_TO_MANY, array('id' => 'title_id', ), 'RESTRICT', 'RESTRICT', 'Customers');
- $this->addRelation('Address', '\\Thelia\\Model\\Address', RelationMap::ONE_TO_MANY, array('id' => 'customer_title_id', ), 'RESTRICT', 'RESTRICT', 'Addresses');
+ $this->addRelation('Address', '\\Thelia\\Model\\Address', RelationMap::ONE_TO_MANY, array('id' => 'title_id', ), 'RESTRICT', 'RESTRICT', 'Addresses');
$this->addRelation('CustomerTitleI18n', '\\Thelia\\Model\\CustomerTitleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CustomerTitleI18ns');
} // buildRelations()
diff --git a/core/lib/Thelia/Model/Map/DelivzoneTableMap.php b/core/lib/Thelia/Model/Map/DelivzoneTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/DocumentI18nTableMap.php b/core/lib/Thelia/Model/Map/DocumentI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/DocumentTableMap.php b/core/lib/Thelia/Model/Map/DocumentTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php b/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/FeatureAvTableMap.php b/core/lib/Thelia/Model/Map/FeatureAvTableMap.php
old mode 100755
new mode 100644
index 972a25744..4dd944bb7
--- a/core/lib/Thelia/Model/Map/FeatureAvTableMap.php
+++ b/core/lib/Thelia/Model/Map/FeatureAvTableMap.php
@@ -57,7 +57,7 @@ class FeatureAvTableMap 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 FeatureAvTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 4;
+ const NUM_HYDRATE_COLUMNS = 5;
/**
* the column name for the ID field
@@ -79,6 +79,11 @@ class FeatureAvTableMap extends TableMap
*/
const FEATURE_ID = 'feature_av.FEATURE_ID';
+ /**
+ * the column name for the POSITION field
+ */
+ const POSITION = 'feature_av.POSITION';
+
/**
* the column name for the CREATED_AT field
*/
@@ -110,12 +115,12 @@ class FeatureAvTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'FeatureId', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'featureId', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(FeatureAvTableMap::ID, FeatureAvTableMap::FEATURE_ID, FeatureAvTableMap::CREATED_AT, FeatureAvTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'FEATURE_ID', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'feature_id', 'created_at', 'updated_at', ),
- self::TYPE_NUM => array(0, 1, 2, 3, )
+ self::TYPE_PHPNAME => array('Id', 'FeatureId', 'Position', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'featureId', 'position', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(FeatureAvTableMap::ID, FeatureAvTableMap::FEATURE_ID, FeatureAvTableMap::POSITION, FeatureAvTableMap::CREATED_AT, FeatureAvTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'FEATURE_ID', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'feature_id', 'position', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -125,12 +130,12 @@ class FeatureAvTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'FeatureId' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'featureId' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
- self::TYPE_COLNAME => array(FeatureAvTableMap::ID => 0, FeatureAvTableMap::FEATURE_ID => 1, FeatureAvTableMap::CREATED_AT => 2, FeatureAvTableMap::UPDATED_AT => 3, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'FEATURE_ID' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'feature_id' => 1, 'created_at' => 2, 'updated_at' => 3, ),
- self::TYPE_NUM => array(0, 1, 2, 3, )
+ self::TYPE_PHPNAME => array('Id' => 0, 'FeatureId' => 1, 'Position' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'featureId' => 1, 'position' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
+ self::TYPE_COLNAME => array(FeatureAvTableMap::ID => 0, FeatureAvTableMap::FEATURE_ID => 1, FeatureAvTableMap::POSITION => 2, FeatureAvTableMap::CREATED_AT => 3, FeatureAvTableMap::UPDATED_AT => 4, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'FEATURE_ID' => 1, 'POSITION' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'feature_id' => 1, 'position' => 2, 'created_at' => 3, 'updated_at' => 4, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -151,6 +156,7 @@ class FeatureAvTableMap extends TableMap
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('FEATURE_ID', 'FeatureId', 'INTEGER', 'feature', 'ID', true, null, null);
+ $this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -161,7 +167,7 @@ class FeatureAvTableMap extends TableMap
public function buildRelations()
{
$this->addRelation('Feature', '\\Thelia\\Model\\Feature', RelationMap::MANY_TO_ONE, array('feature_id' => 'id', ), 'CASCADE', 'RESTRICT');
- $this->addRelation('FeatureProd', '\\Thelia\\Model\\FeatureProd', RelationMap::ONE_TO_MANY, array('id' => 'feature_av_id', ), 'CASCADE', 'RESTRICT', 'FeatureProds');
+ $this->addRelation('FeatureProduct', '\\Thelia\\Model\\FeatureProduct', RelationMap::ONE_TO_MANY, array('id' => 'feature_av_id', ), 'CASCADE', 'RESTRICT', 'FeatureProducts');
$this->addRelation('FeatureAvI18n', '\\Thelia\\Model\\FeatureAvI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'FeatureAvI18ns');
} // buildRelations()
@@ -185,7 +191,7 @@ class FeatureAvTableMap 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.
- FeatureProdTableMap::clearInstancePool();
+ FeatureProductTableMap::clearInstancePool();
FeatureAvI18nTableMap::clearInstancePool();
}
@@ -329,11 +335,13 @@ class FeatureAvTableMap extends TableMap
if (null === $alias) {
$criteria->addSelectColumn(FeatureAvTableMap::ID);
$criteria->addSelectColumn(FeatureAvTableMap::FEATURE_ID);
+ $criteria->addSelectColumn(FeatureAvTableMap::POSITION);
$criteria->addSelectColumn(FeatureAvTableMap::CREATED_AT);
$criteria->addSelectColumn(FeatureAvTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.FEATURE_ID');
+ $criteria->addSelectColumn($alias . '.POSITION');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
diff --git a/core/lib/Thelia/Model/Map/FeatureCategoryTableMap.php b/core/lib/Thelia/Model/Map/FeatureCategoryTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php b/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/FeatureProdTableMap.php b/core/lib/Thelia/Model/Map/FeatureProductTableMap.php
old mode 100755
new mode 100644
similarity index 77%
rename from core/lib/Thelia/Model/Map/FeatureProdTableMap.php
rename to core/lib/Thelia/Model/Map/FeatureProductTableMap.php
index 9d952afc3..f0263b47c
--- a/core/lib/Thelia/Model/Map/FeatureProdTableMap.php
+++ b/core/lib/Thelia/Model/Map/FeatureProductTableMap.php
@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
-use Thelia\Model\FeatureProd;
-use Thelia\Model\FeatureProdQuery;
+use Thelia\Model\FeatureProduct;
+use Thelia\Model\FeatureProductQuery;
/**
- * This class defines the structure of the 'feature_prod' table.
+ * This class defines the structure of the 'feature_product' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\FeatureProdQuery;
* (i.e. if it's a text column type).
*
*/
-class FeatureProdTableMap extends TableMap
+class FeatureProductTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
- const CLASS_NAME = 'Thelia.Model.Map.FeatureProdTableMap';
+ const CLASS_NAME = 'Thelia.Model.Map.FeatureProductTableMap';
/**
* The default database name for this class
@@ -42,17 +42,17 @@ class FeatureProdTableMap extends TableMap
/**
* The table name for this class
*/
- const TABLE_NAME = 'feature_prod';
+ const TABLE_NAME = 'feature_product';
/**
* The related Propel class for this table
*/
- const OM_CLASS = '\\Thelia\\Model\\FeatureProd';
+ const OM_CLASS = '\\Thelia\\Model\\FeatureProduct';
/**
* A class that can be returned by this tableMap
*/
- const CLASS_DEFAULT = 'Thelia.Model.FeatureProd';
+ const CLASS_DEFAULT = 'Thelia.Model.FeatureProduct';
/**
* The total number of columns
@@ -72,42 +72,42 @@ class FeatureProdTableMap extends TableMap
/**
* the column name for the ID field
*/
- const ID = 'feature_prod.ID';
+ const ID = 'feature_product.ID';
/**
* the column name for the PRODUCT_ID field
*/
- const PRODUCT_ID = 'feature_prod.PRODUCT_ID';
+ const PRODUCT_ID = 'feature_product.PRODUCT_ID';
/**
* the column name for the FEATURE_ID field
*/
- const FEATURE_ID = 'feature_prod.FEATURE_ID';
+ const FEATURE_ID = 'feature_product.FEATURE_ID';
/**
* the column name for the FEATURE_AV_ID field
*/
- const FEATURE_AV_ID = 'feature_prod.FEATURE_AV_ID';
+ const FEATURE_AV_ID = 'feature_product.FEATURE_AV_ID';
/**
* the column name for the BY_DEFAULT field
*/
- const BY_DEFAULT = 'feature_prod.BY_DEFAULT';
+ const BY_DEFAULT = 'feature_product.BY_DEFAULT';
/**
* the column name for the POSITION field
*/
- const POSITION = 'feature_prod.POSITION';
+ const POSITION = 'feature_product.POSITION';
/**
* the column name for the CREATED_AT field
*/
- const CREATED_AT = 'feature_prod.CREATED_AT';
+ const CREATED_AT = 'feature_product.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
- const UPDATED_AT = 'feature_prod.UPDATED_AT';
+ const UPDATED_AT = 'feature_product.UPDATED_AT';
/**
* The default string format for model objects of the related table
@@ -123,7 +123,7 @@ class FeatureProdTableMap extends TableMap
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'ProductId', 'FeatureId', 'FeatureAvId', 'ByDefault', 'Position', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'featureId', 'featureAvId', 'byDefault', 'position', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(FeatureProdTableMap::ID, FeatureProdTableMap::PRODUCT_ID, FeatureProdTableMap::FEATURE_ID, FeatureProdTableMap::FEATURE_AV_ID, FeatureProdTableMap::BY_DEFAULT, FeatureProdTableMap::POSITION, FeatureProdTableMap::CREATED_AT, FeatureProdTableMap::UPDATED_AT, ),
+ self::TYPE_COLNAME => array(FeatureProductTableMap::ID, FeatureProductTableMap::PRODUCT_ID, FeatureProductTableMap::FEATURE_ID, FeatureProductTableMap::FEATURE_AV_ID, FeatureProductTableMap::BY_DEFAULT, FeatureProductTableMap::POSITION, FeatureProductTableMap::CREATED_AT, FeatureProductTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'FEATURE_ID', 'FEATURE_AV_ID', 'BY_DEFAULT', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'product_id', 'feature_id', 'feature_av_id', 'by_default', 'position', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
@@ -138,7 +138,7 @@ class FeatureProdTableMap extends TableMap
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'FeatureId' => 2, 'FeatureAvId' => 3, 'ByDefault' => 4, 'Position' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'featureId' => 2, 'featureAvId' => 3, 'byDefault' => 4, 'position' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
- self::TYPE_COLNAME => array(FeatureProdTableMap::ID => 0, FeatureProdTableMap::PRODUCT_ID => 1, FeatureProdTableMap::FEATURE_ID => 2, FeatureProdTableMap::FEATURE_AV_ID => 3, FeatureProdTableMap::BY_DEFAULT => 4, FeatureProdTableMap::POSITION => 5, FeatureProdTableMap::CREATED_AT => 6, FeatureProdTableMap::UPDATED_AT => 7, ),
+ self::TYPE_COLNAME => array(FeatureProductTableMap::ID => 0, FeatureProductTableMap::PRODUCT_ID => 1, FeatureProductTableMap::FEATURE_ID => 2, FeatureProductTableMap::FEATURE_AV_ID => 3, FeatureProductTableMap::BY_DEFAULT => 4, FeatureProductTableMap::POSITION => 5, FeatureProductTableMap::CREATED_AT => 6, FeatureProductTableMap::UPDATED_AT => 7, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'FEATURE_ID' => 2, 'FEATURE_AV_ID' => 3, 'BY_DEFAULT' => 4, 'POSITION' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'feature_id' => 2, 'feature_av_id' => 3, 'by_default' => 4, 'position' => 5, 'created_at' => 6, 'updated_at' => 7, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
@@ -154,9 +154,9 @@ class FeatureProdTableMap extends TableMap
public function initialize()
{
// attributes
- $this->setName('feature_prod');
- $this->setPhpName('FeatureProd');
- $this->setClassName('\\Thelia\\Model\\FeatureProd');
+ $this->setName('feature_product');
+ $this->setPhpName('FeatureProduct');
+ $this->setClassName('\\Thelia\\Model\\FeatureProduct');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
// columns
@@ -249,7 +249,7 @@ class FeatureProdTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
- return $withPrefix ? FeatureProdTableMap::CLASS_DEFAULT : FeatureProdTableMap::OM_CLASS;
+ return $withPrefix ? FeatureProductTableMap::CLASS_DEFAULT : FeatureProductTableMap::OM_CLASS;
}
/**
@@ -263,21 +263,21 @@ class FeatureProdTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
- * @return array (FeatureProd object, last column rank)
+ * @return array (FeatureProduct object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
- $key = FeatureProdTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
- if (null !== ($obj = FeatureProdTableMap::getInstanceFromPool($key))) {
+ $key = FeatureProductTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = FeatureProductTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $offset, true); // rehydrate
- $col = $offset + FeatureProdTableMap::NUM_HYDRATE_COLUMNS;
+ $col = $offset + FeatureProductTableMap::NUM_HYDRATE_COLUMNS;
} else {
- $cls = FeatureProdTableMap::OM_CLASS;
+ $cls = FeatureProductTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
- FeatureProdTableMap::addInstanceToPool($obj, $key);
+ FeatureProductTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -300,8 +300,8 @@ class FeatureProdTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
- $key = FeatureProdTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
- if (null !== ($obj = FeatureProdTableMap::getInstanceFromPool($key))) {
+ $key = FeatureProductTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = FeatureProductTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, 0, true); // rehydrate
@@ -310,7 +310,7 @@ class FeatureProdTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
- FeatureProdTableMap::addInstanceToPool($obj, $key);
+ FeatureProductTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -331,14 +331,14 @@ class FeatureProdTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
- $criteria->addSelectColumn(FeatureProdTableMap::ID);
- $criteria->addSelectColumn(FeatureProdTableMap::PRODUCT_ID);
- $criteria->addSelectColumn(FeatureProdTableMap::FEATURE_ID);
- $criteria->addSelectColumn(FeatureProdTableMap::FEATURE_AV_ID);
- $criteria->addSelectColumn(FeatureProdTableMap::BY_DEFAULT);
- $criteria->addSelectColumn(FeatureProdTableMap::POSITION);
- $criteria->addSelectColumn(FeatureProdTableMap::CREATED_AT);
- $criteria->addSelectColumn(FeatureProdTableMap::UPDATED_AT);
+ $criteria->addSelectColumn(FeatureProductTableMap::ID);
+ $criteria->addSelectColumn(FeatureProductTableMap::PRODUCT_ID);
+ $criteria->addSelectColumn(FeatureProductTableMap::FEATURE_ID);
+ $criteria->addSelectColumn(FeatureProductTableMap::FEATURE_AV_ID);
+ $criteria->addSelectColumn(FeatureProductTableMap::BY_DEFAULT);
+ $criteria->addSelectColumn(FeatureProductTableMap::POSITION);
+ $criteria->addSelectColumn(FeatureProductTableMap::CREATED_AT);
+ $criteria->addSelectColumn(FeatureProductTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.PRODUCT_ID');
@@ -360,7 +360,7 @@ class FeatureProdTableMap extends TableMap
*/
public static function getTableMap()
{
- return Propel::getServiceContainer()->getDatabaseMap(FeatureProdTableMap::DATABASE_NAME)->getTable(FeatureProdTableMap::TABLE_NAME);
+ return Propel::getServiceContainer()->getDatabaseMap(FeatureProductTableMap::DATABASE_NAME)->getTable(FeatureProductTableMap::TABLE_NAME);
}
/**
@@ -368,16 +368,16 @@ class FeatureProdTableMap extends TableMap
*/
public static function buildTableMap()
{
- $dbMap = Propel::getServiceContainer()->getDatabaseMap(FeatureProdTableMap::DATABASE_NAME);
- if (!$dbMap->hasTable(FeatureProdTableMap::TABLE_NAME)) {
- $dbMap->addTableObject(new FeatureProdTableMap());
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(FeatureProductTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(FeatureProductTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new FeatureProductTableMap());
}
}
/**
- * Performs a DELETE on the database, given a FeatureProd or Criteria object OR a primary key value.
+ * Performs a DELETE on the database, given a FeatureProduct or Criteria object OR a primary key value.
*
- * @param mixed $values Criteria or FeatureProd object or primary key or array of primary keys
+ * @param mixed $values Criteria or FeatureProduct object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -388,25 +388,25 @@ class FeatureProdTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureProdTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(FeatureProductTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
- } elseif ($values instanceof \Thelia\Model\FeatureProd) { // it's a model object
+ } elseif ($values instanceof \Thelia\Model\FeatureProduct) { // it's a model object
// create criteria based on pk values
$criteria = $values->buildPkeyCriteria();
} else { // it's a primary key, or an array of pks
- $criteria = new Criteria(FeatureProdTableMap::DATABASE_NAME);
- $criteria->add(FeatureProdTableMap::ID, (array) $values, Criteria::IN);
+ $criteria = new Criteria(FeatureProductTableMap::DATABASE_NAME);
+ $criteria->add(FeatureProductTableMap::ID, (array) $values, Criteria::IN);
}
- $query = FeatureProdQuery::create()->mergeWith($criteria);
+ $query = FeatureProductQuery::create()->mergeWith($criteria);
- if ($values instanceof Criteria) { FeatureProdTableMap::clearInstancePool();
+ if ($values instanceof Criteria) { FeatureProductTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
- foreach ((array) $values as $singleval) { FeatureProdTableMap::removeInstanceFromPool($singleval);
+ foreach ((array) $values as $singleval) { FeatureProductTableMap::removeInstanceFromPool($singleval);
}
}
@@ -414,20 +414,20 @@ class FeatureProdTableMap extends TableMap
}
/**
- * Deletes all rows from the feature_prod table.
+ * Deletes all rows from the feature_product table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(ConnectionInterface $con = null)
{
- return FeatureProdQuery::create()->doDeleteAll($con);
+ return FeatureProductQuery::create()->doDeleteAll($con);
}
/**
- * Performs an INSERT on the database, given a FeatureProd or Criteria object.
+ * Performs an INSERT on the database, given a FeatureProduct or Criteria object.
*
- * @param mixed $criteria Criteria or FeatureProd object containing data that is used to create the INSERT statement.
+ * @param mixed $criteria Criteria or FeatureProduct object containing data that is used to create the INSERT statement.
* @param ConnectionInterface $con the ConnectionInterface connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
@@ -436,22 +436,22 @@ class FeatureProdTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureProdTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(FeatureProductTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
- $criteria = $criteria->buildCriteria(); // build Criteria from FeatureProd object
+ $criteria = $criteria->buildCriteria(); // build Criteria from FeatureProduct object
}
- if ($criteria->containsKey(FeatureProdTableMap::ID) && $criteria->keyContainsValue(FeatureProdTableMap::ID) ) {
- throw new PropelException('Cannot insert a value for auto-increment primary key ('.FeatureProdTableMap::ID.')');
+ if ($criteria->containsKey(FeatureProductTableMap::ID) && $criteria->keyContainsValue(FeatureProductTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.FeatureProductTableMap::ID.')');
}
// Set the correct dbName
- $query = FeatureProdQuery::create()->mergeWith($criteria);
+ $query = FeatureProductQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -467,7 +467,7 @@ class FeatureProdTableMap extends TableMap
return $pk;
}
-} // FeatureProdTableMap
+} // FeatureProductTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
-FeatureProdTableMap::buildTableMap();
+FeatureProductTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/FeatureTableMap.php b/core/lib/Thelia/Model/Map/FeatureTableMap.php
old mode 100755
new mode 100644
index b1f309603..76c2fe724
--- a/core/lib/Thelia/Model/Map/FeatureTableMap.php
+++ b/core/lib/Thelia/Model/Map/FeatureTableMap.php
@@ -167,7 +167,7 @@ class FeatureTableMap extends TableMap
public function buildRelations()
{
$this->addRelation('FeatureAv', '\\Thelia\\Model\\FeatureAv', RelationMap::ONE_TO_MANY, array('id' => 'feature_id', ), 'CASCADE', 'RESTRICT', 'FeatureAvs');
- $this->addRelation('FeatureProd', '\\Thelia\\Model\\FeatureProd', RelationMap::ONE_TO_MANY, array('id' => 'feature_id', ), 'CASCADE', 'RESTRICT', 'FeatureProds');
+ $this->addRelation('FeatureProduct', '\\Thelia\\Model\\FeatureProduct', RelationMap::ONE_TO_MANY, array('id' => 'feature_id', ), 'CASCADE', 'RESTRICT', 'FeatureProducts');
$this->addRelation('FeatureCategory', '\\Thelia\\Model\\FeatureCategory', RelationMap::ONE_TO_MANY, array('id' => 'feature_id', ), 'CASCADE', 'RESTRICT', 'FeatureCategories');
$this->addRelation('FeatureI18n', '\\Thelia\\Model\\FeatureI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'FeatureI18ns');
$this->addRelation('Category', '\\Thelia\\Model\\Category', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'RESTRICT', 'Categories');
@@ -194,7 +194,7 @@ class FeatureTableMap 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.
FeatureAvTableMap::clearInstancePool();
- FeatureProdTableMap::clearInstancePool();
+ FeatureProductTableMap::clearInstancePool();
FeatureCategoryTableMap::clearInstancePool();
FeatureI18nTableMap::clearInstancePool();
}
diff --git a/core/lib/Thelia/Model/Map/FolderI18nTableMap.php b/core/lib/Thelia/Model/Map/FolderI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/FolderTableMap.php b/core/lib/Thelia/Model/Map/FolderTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/FolderVersionTableMap.php b/core/lib/Thelia/Model/Map/FolderVersionTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/GroupI18nTableMap.php b/core/lib/Thelia/Model/Map/GroupI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/GroupModuleTableMap.php b/core/lib/Thelia/Model/Map/GroupModuleTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/GroupResourceTableMap.php b/core/lib/Thelia/Model/Map/GroupResourceTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/GroupTableMap.php b/core/lib/Thelia/Model/Map/GroupTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ImageI18nTableMap.php b/core/lib/Thelia/Model/Map/ImageI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ImageTableMap.php b/core/lib/Thelia/Model/Map/ImageTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/LangTableMap.php b/core/lib/Thelia/Model/Map/LangTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/MessageI18nTableMap.php b/core/lib/Thelia/Model/Map/MessageI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/MessageTableMap.php b/core/lib/Thelia/Model/Map/MessageTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/MessageVersionTableMap.php b/core/lib/Thelia/Model/Map/MessageVersionTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php b/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ModuleTableMap.php b/core/lib/Thelia/Model/Map/ModuleTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/OrderAddressTableMap.php b/core/lib/Thelia/Model/Map/OrderAddressTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/OrderFeatureTableMap.php b/core/lib/Thelia/Model/Map/OrderFeatureTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/OrderProductTableMap.php b/core/lib/Thelia/Model/Map/OrderProductTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php b/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/OrderStatusTableMap.php b/core/lib/Thelia/Model/Map/OrderStatusTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/OrderTableMap.php b/core/lib/Thelia/Model/Map/OrderTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ProductCategoryTableMap.php b/core/lib/Thelia/Model/Map/ProductCategoryTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ProductI18nTableMap.php b/core/lib/Thelia/Model/Map/ProductI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/StockTableMap.php b/core/lib/Thelia/Model/Map/ProductPriceTableMap.php
old mode 100755
new mode 100644
similarity index 63%
rename from core/lib/Thelia/Model/Map/StockTableMap.php
rename to core/lib/Thelia/Model/Map/ProductPriceTableMap.php
index c724c9d09..2b231321b
--- a/core/lib/Thelia/Model/Map/StockTableMap.php
+++ b/core/lib/Thelia/Model/Map/ProductPriceTableMap.php
@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
-use Thelia\Model\Stock;
-use Thelia\Model\StockQuery;
+use Thelia\Model\ProductPrice;
+use Thelia\Model\ProductPriceQuery;
/**
- * This class defines the structure of the 'stock' table.
+ * This class defines the structure of the 'product_price' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\StockQuery;
* (i.e. if it's a text column type).
*
*/
-class StockTableMap extends TableMap
+class ProductPriceTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
- const CLASS_NAME = 'Thelia.Model.Map.StockTableMap';
+ const CLASS_NAME = 'Thelia.Model.Map.ProductPriceTableMap';
/**
* The default database name for this class
@@ -42,17 +42,17 @@ class StockTableMap extends TableMap
/**
* The table name for this class
*/
- const TABLE_NAME = 'stock';
+ const TABLE_NAME = 'product_price';
/**
* The related Propel class for this table
*/
- const OM_CLASS = '\\Thelia\\Model\\Stock';
+ const OM_CLASS = '\\Thelia\\Model\\ProductPrice';
/**
* A class that can be returned by this tableMap
*/
- const CLASS_DEFAULT = 'Thelia.Model.Stock';
+ const CLASS_DEFAULT = 'Thelia.Model.ProductPrice';
/**
* The total number of columns
@@ -72,37 +72,37 @@ class StockTableMap extends TableMap
/**
* the column name for the ID field
*/
- const ID = 'stock.ID';
+ const ID = 'product_price.ID';
/**
- * the column name for the COMBINATION_ID field
+ * the column name for the PRODUCT_SALE_ELEMENTS_ID field
*/
- const COMBINATION_ID = 'stock.COMBINATION_ID';
+ const PRODUCT_SALE_ELEMENTS_ID = 'product_price.PRODUCT_SALE_ELEMENTS_ID';
/**
- * the column name for the PRODUCT_ID field
+ * the column name for the CURRENCY_ID field
*/
- const PRODUCT_ID = 'stock.PRODUCT_ID';
+ const CURRENCY_ID = 'product_price.CURRENCY_ID';
/**
- * the column name for the INCREASE field
+ * the column name for the PRICE field
*/
- const INCREASE = 'stock.INCREASE';
+ const PRICE = 'product_price.PRICE';
/**
- * the column name for the QUANTITY field
+ * the column name for the PROMO_PRICE field
*/
- const QUANTITY = 'stock.QUANTITY';
+ const PROMO_PRICE = 'product_price.PROMO_PRICE';
/**
* the column name for the CREATED_AT field
*/
- const CREATED_AT = 'stock.CREATED_AT';
+ const CREATED_AT = 'product_price.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
- const UPDATED_AT = 'stock.UPDATED_AT';
+ const UPDATED_AT = 'product_price.UPDATED_AT';
/**
* The default string format for model objects of the related table
@@ -116,11 +116,11 @@ class StockTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'CombinationId', 'ProductId', 'Increase', 'Quantity', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'combinationId', 'productId', 'increase', 'quantity', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(StockTableMap::ID, StockTableMap::COMBINATION_ID, StockTableMap::PRODUCT_ID, StockTableMap::INCREASE, StockTableMap::QUANTITY, StockTableMap::CREATED_AT, StockTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'COMBINATION_ID', 'PRODUCT_ID', 'INCREASE', 'QUANTITY', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'combination_id', 'product_id', 'increase', 'quantity', 'created_at', 'updated_at', ),
+ self::TYPE_PHPNAME => array('Id', 'ProductSaleElementsId', 'CurrencyId', 'Price', 'PromoPrice', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'productSaleElementsId', 'currencyId', 'price', 'promoPrice', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(ProductPriceTableMap::ID, ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID, ProductPriceTableMap::CURRENCY_ID, ProductPriceTableMap::PRICE, ProductPriceTableMap::PROMO_PRICE, ProductPriceTableMap::CREATED_AT, ProductPriceTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_SALE_ELEMENTS_ID', 'CURRENCY_ID', 'PRICE', 'PROMO_PRICE', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'product_sale_elements_id', 'currency_id', 'price', 'promo_price', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -131,11 +131,11 @@ class StockTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'CombinationId' => 1, 'ProductId' => 2, 'Increase' => 3, 'Quantity' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'combinationId' => 1, 'productId' => 2, 'increase' => 3, 'quantity' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
- self::TYPE_COLNAME => array(StockTableMap::ID => 0, StockTableMap::COMBINATION_ID => 1, StockTableMap::PRODUCT_ID => 2, StockTableMap::INCREASE => 3, StockTableMap::QUANTITY => 4, StockTableMap::CREATED_AT => 5, StockTableMap::UPDATED_AT => 6, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'COMBINATION_ID' => 1, 'PRODUCT_ID' => 2, 'INCREASE' => 3, 'QUANTITY' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'combination_id' => 1, 'product_id' => 2, 'increase' => 3, 'quantity' => 4, 'created_at' => 5, 'updated_at' => 6, ),
+ self::TYPE_PHPNAME => array('Id' => 0, 'ProductSaleElementsId' => 1, 'CurrencyId' => 2, 'Price' => 3, 'PromoPrice' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productSaleElementsId' => 1, 'currencyId' => 2, 'price' => 3, 'promoPrice' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
+ self::TYPE_COLNAME => array(ProductPriceTableMap::ID => 0, ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID => 1, ProductPriceTableMap::CURRENCY_ID => 2, ProductPriceTableMap::PRICE => 3, ProductPriceTableMap::PROMO_PRICE => 4, ProductPriceTableMap::CREATED_AT => 5, ProductPriceTableMap::UPDATED_AT => 6, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_SALE_ELEMENTS_ID' => 1, 'CURRENCY_ID' => 2, 'PRICE' => 3, 'PROMO_PRICE' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'product_sale_elements_id' => 1, 'currency_id' => 2, 'price' => 3, 'promo_price' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -149,17 +149,17 @@ class StockTableMap extends TableMap
public function initialize()
{
// attributes
- $this->setName('stock');
- $this->setPhpName('Stock');
- $this->setClassName('\\Thelia\\Model\\Stock');
+ $this->setName('product_price');
+ $this->setPhpName('ProductPrice');
+ $this->setClassName('\\Thelia\\Model\\ProductPrice');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
- $this->addForeignKey('COMBINATION_ID', 'CombinationId', 'INTEGER', 'combination', 'ID', false, null, null);
- $this->addForeignKey('PRODUCT_ID', 'ProductId', 'INTEGER', 'product', 'ID', true, null, null);
- $this->addColumn('INCREASE', 'Increase', 'FLOAT', false, null, null);
- $this->addColumn('QUANTITY', 'Quantity', 'FLOAT', true, null, null);
+ $this->addForeignKey('PRODUCT_SALE_ELEMENTS_ID', 'ProductSaleElementsId', 'INTEGER', 'product_sale_elements', 'ID', true, null, null);
+ $this->addForeignKey('CURRENCY_ID', 'CurrencyId', 'INTEGER', 'currency', 'ID', true, null, null);
+ $this->addColumn('PRICE', 'Price', 'FLOAT', true, null, null);
+ $this->addColumn('PROMO_PRICE', 'PromoPrice', 'FLOAT', false, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -169,8 +169,8 @@ class StockTableMap extends TableMap
*/
public function buildRelations()
{
- $this->addRelation('Combination', '\\Thelia\\Model\\Combination', RelationMap::MANY_TO_ONE, array('combination_id' => 'id', ), 'SET NULL', 'RESTRICT');
- $this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::MANY_TO_ONE, array('product_id' => 'id', ), 'CASCADE', 'RESTRICT');
+ $this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::MANY_TO_ONE, array('product_sale_elements_id' => 'id', ), null, null);
+ $this->addRelation('Currency', '\\Thelia\\Model\\Currency', RelationMap::MANY_TO_ONE, array('currency_id' => 'id', ), null, null);
} // buildRelations()
/**
@@ -242,7 +242,7 @@ class StockTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
- return $withPrefix ? StockTableMap::CLASS_DEFAULT : StockTableMap::OM_CLASS;
+ return $withPrefix ? ProductPriceTableMap::CLASS_DEFAULT : ProductPriceTableMap::OM_CLASS;
}
/**
@@ -256,21 +256,21 @@ class StockTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
- * @return array (Stock object, last column rank)
+ * @return array (ProductPrice object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
- $key = StockTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
- if (null !== ($obj = StockTableMap::getInstanceFromPool($key))) {
+ $key = ProductPriceTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = ProductPriceTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $offset, true); // rehydrate
- $col = $offset + StockTableMap::NUM_HYDRATE_COLUMNS;
+ $col = $offset + ProductPriceTableMap::NUM_HYDRATE_COLUMNS;
} else {
- $cls = StockTableMap::OM_CLASS;
+ $cls = ProductPriceTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
- StockTableMap::addInstanceToPool($obj, $key);
+ ProductPriceTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -293,8 +293,8 @@ class StockTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
- $key = StockTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
- if (null !== ($obj = StockTableMap::getInstanceFromPool($key))) {
+ $key = ProductPriceTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = ProductPriceTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, 0, true); // rehydrate
@@ -303,7 +303,7 @@ class StockTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
- StockTableMap::addInstanceToPool($obj, $key);
+ ProductPriceTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -324,19 +324,19 @@ class StockTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
- $criteria->addSelectColumn(StockTableMap::ID);
- $criteria->addSelectColumn(StockTableMap::COMBINATION_ID);
- $criteria->addSelectColumn(StockTableMap::PRODUCT_ID);
- $criteria->addSelectColumn(StockTableMap::INCREASE);
- $criteria->addSelectColumn(StockTableMap::QUANTITY);
- $criteria->addSelectColumn(StockTableMap::CREATED_AT);
- $criteria->addSelectColumn(StockTableMap::UPDATED_AT);
+ $criteria->addSelectColumn(ProductPriceTableMap::ID);
+ $criteria->addSelectColumn(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID);
+ $criteria->addSelectColumn(ProductPriceTableMap::CURRENCY_ID);
+ $criteria->addSelectColumn(ProductPriceTableMap::PRICE);
+ $criteria->addSelectColumn(ProductPriceTableMap::PROMO_PRICE);
+ $criteria->addSelectColumn(ProductPriceTableMap::CREATED_AT);
+ $criteria->addSelectColumn(ProductPriceTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
- $criteria->addSelectColumn($alias . '.COMBINATION_ID');
- $criteria->addSelectColumn($alias . '.PRODUCT_ID');
- $criteria->addSelectColumn($alias . '.INCREASE');
- $criteria->addSelectColumn($alias . '.QUANTITY');
+ $criteria->addSelectColumn($alias . '.PRODUCT_SALE_ELEMENTS_ID');
+ $criteria->addSelectColumn($alias . '.CURRENCY_ID');
+ $criteria->addSelectColumn($alias . '.PRICE');
+ $criteria->addSelectColumn($alias . '.PROMO_PRICE');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
@@ -351,7 +351,7 @@ class StockTableMap extends TableMap
*/
public static function getTableMap()
{
- return Propel::getServiceContainer()->getDatabaseMap(StockTableMap::DATABASE_NAME)->getTable(StockTableMap::TABLE_NAME);
+ return Propel::getServiceContainer()->getDatabaseMap(ProductPriceTableMap::DATABASE_NAME)->getTable(ProductPriceTableMap::TABLE_NAME);
}
/**
@@ -359,16 +359,16 @@ class StockTableMap extends TableMap
*/
public static function buildTableMap()
{
- $dbMap = Propel::getServiceContainer()->getDatabaseMap(StockTableMap::DATABASE_NAME);
- if (!$dbMap->hasTable(StockTableMap::TABLE_NAME)) {
- $dbMap->addTableObject(new StockTableMap());
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(ProductPriceTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(ProductPriceTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new ProductPriceTableMap());
}
}
/**
- * Performs a DELETE on the database, given a Stock or Criteria object OR a primary key value.
+ * Performs a DELETE on the database, given a ProductPrice or Criteria object OR a primary key value.
*
- * @param mixed $values Criteria or Stock object or primary key or array of primary keys
+ * @param mixed $values Criteria or ProductPrice object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -379,25 +379,25 @@ class StockTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(StockTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductPriceTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
- } elseif ($values instanceof \Thelia\Model\Stock) { // it's a model object
+ } elseif ($values instanceof \Thelia\Model\ProductPrice) { // it's a model object
// create criteria based on pk values
$criteria = $values->buildPkeyCriteria();
} else { // it's a primary key, or an array of pks
- $criteria = new Criteria(StockTableMap::DATABASE_NAME);
- $criteria->add(StockTableMap::ID, (array) $values, Criteria::IN);
+ $criteria = new Criteria(ProductPriceTableMap::DATABASE_NAME);
+ $criteria->add(ProductPriceTableMap::ID, (array) $values, Criteria::IN);
}
- $query = StockQuery::create()->mergeWith($criteria);
+ $query = ProductPriceQuery::create()->mergeWith($criteria);
- if ($values instanceof Criteria) { StockTableMap::clearInstancePool();
+ if ($values instanceof Criteria) { ProductPriceTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
- foreach ((array) $values as $singleval) { StockTableMap::removeInstanceFromPool($singleval);
+ foreach ((array) $values as $singleval) { ProductPriceTableMap::removeInstanceFromPool($singleval);
}
}
@@ -405,20 +405,20 @@ class StockTableMap extends TableMap
}
/**
- * Deletes all rows from the stock table.
+ * Deletes all rows from the product_price table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(ConnectionInterface $con = null)
{
- return StockQuery::create()->doDeleteAll($con);
+ return ProductPriceQuery::create()->doDeleteAll($con);
}
/**
- * Performs an INSERT on the database, given a Stock or Criteria object.
+ * Performs an INSERT on the database, given a ProductPrice or Criteria object.
*
- * @param mixed $criteria Criteria or Stock object containing data that is used to create the INSERT statement.
+ * @param mixed $criteria Criteria or ProductPrice object containing data that is used to create the INSERT statement.
* @param ConnectionInterface $con the ConnectionInterface connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
@@ -427,22 +427,22 @@ class StockTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(StockTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductPriceTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
- $criteria = $criteria->buildCriteria(); // build Criteria from Stock object
+ $criteria = $criteria->buildCriteria(); // build Criteria from ProductPrice object
}
- if ($criteria->containsKey(StockTableMap::ID) && $criteria->keyContainsValue(StockTableMap::ID) ) {
- throw new PropelException('Cannot insert a value for auto-increment primary key ('.StockTableMap::ID.')');
+ if ($criteria->containsKey(ProductPriceTableMap::ID) && $criteria->keyContainsValue(ProductPriceTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.ProductPriceTableMap::ID.')');
}
// Set the correct dbName
- $query = StockQuery::create()->mergeWith($criteria);
+ $query = ProductPriceQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -458,7 +458,7 @@ class StockTableMap extends TableMap
return $pk;
}
-} // StockTableMap
+} // ProductPriceTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
-StockTableMap::buildTableMap();
+ProductPriceTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/CombinationTableMap.php b/core/lib/Thelia/Model/Map/ProductSaleElementsTableMap.php
old mode 100755
new mode 100644
similarity index 60%
rename from core/lib/Thelia/Model/Map/CombinationTableMap.php
rename to core/lib/Thelia/Model/Map/ProductSaleElementsTableMap.php
index 7134c5eaf..2eb9a0b83
--- a/core/lib/Thelia/Model/Map/CombinationTableMap.php
+++ b/core/lib/Thelia/Model/Map/ProductSaleElementsTableMap.php
@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
-use Thelia\Model\Combination;
-use Thelia\Model\CombinationQuery;
+use Thelia\Model\ProductSaleElements;
+use Thelia\Model\ProductSaleElementsQuery;
/**
- * This class defines the structure of the 'combination' table.
+ * This class defines the structure of the 'product_sale_elements' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\CombinationQuery;
* (i.e. if it's a text column type).
*
*/
-class CombinationTableMap extends TableMap
+class ProductSaleElementsTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
- const CLASS_NAME = 'Thelia.Model.Map.CombinationTableMap';
+ const CLASS_NAME = 'Thelia.Model.Map.ProductSaleElementsTableMap';
/**
* The default database name for this class
@@ -42,22 +42,22 @@ class CombinationTableMap extends TableMap
/**
* The table name for this class
*/
- const TABLE_NAME = 'combination';
+ const TABLE_NAME = 'product_sale_elements';
/**
* The related Propel class for this table
*/
- const OM_CLASS = '\\Thelia\\Model\\Combination';
+ const OM_CLASS = '\\Thelia\\Model\\ProductSaleElements';
/**
* A class that can be returned by this tableMap
*/
- const CLASS_DEFAULT = 'Thelia.Model.Combination';
+ const CLASS_DEFAULT = 'Thelia.Model.ProductSaleElements';
/**
* The total number of columns
*/
- const NUM_COLUMNS = 4;
+ const NUM_COLUMNS = 8;
/**
* The number of lazy-loaded columns
@@ -67,27 +67,47 @@ class CombinationTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 4;
+ const NUM_HYDRATE_COLUMNS = 8;
/**
* the column name for the ID field
*/
- const ID = 'combination.ID';
+ const ID = 'product_sale_elements.ID';
/**
- * the column name for the REF field
+ * the column name for the PRODUCT_ID field
*/
- const REF = 'combination.REF';
+ const PRODUCT_ID = 'product_sale_elements.PRODUCT_ID';
+
+ /**
+ * the column name for the QUANTITY field
+ */
+ const QUANTITY = 'product_sale_elements.QUANTITY';
+
+ /**
+ * the column name for the PROMO field
+ */
+ const PROMO = 'product_sale_elements.PROMO';
+
+ /**
+ * the column name for the NEWNESS field
+ */
+ const NEWNESS = 'product_sale_elements.NEWNESS';
+
+ /**
+ * the column name for the WEIGHT field
+ */
+ const WEIGHT = 'product_sale_elements.WEIGHT';
/**
* the column name for the CREATED_AT field
*/
- const CREATED_AT = 'combination.CREATED_AT';
+ const CREATED_AT = 'product_sale_elements.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
- const UPDATED_AT = 'combination.UPDATED_AT';
+ const UPDATED_AT = 'product_sale_elements.UPDATED_AT';
/**
* The default string format for model objects of the related table
@@ -101,12 +121,12 @@ class CombinationTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'Ref', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(CombinationTableMap::ID, CombinationTableMap::REF, CombinationTableMap::CREATED_AT, CombinationTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'REF', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'ref', 'created_at', 'updated_at', ),
- self::TYPE_NUM => array(0, 1, 2, 3, )
+ self::TYPE_PHPNAME => array('Id', 'ProductId', 'Quantity', 'Promo', 'Newness', 'Weight', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'quantity', 'promo', 'newness', 'weight', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(ProductSaleElementsTableMap::ID, ProductSaleElementsTableMap::PRODUCT_ID, ProductSaleElementsTableMap::QUANTITY, ProductSaleElementsTableMap::PROMO, ProductSaleElementsTableMap::NEWNESS, ProductSaleElementsTableMap::WEIGHT, ProductSaleElementsTableMap::CREATED_AT, ProductSaleElementsTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'QUANTITY', 'PROMO', 'NEWNESS', 'WEIGHT', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'product_id', 'quantity', 'promo', 'newness', 'weight', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
@@ -116,12 +136,12 @@ class CombinationTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
- self::TYPE_COLNAME => array(CombinationTableMap::ID => 0, CombinationTableMap::REF => 1, CombinationTableMap::CREATED_AT => 2, CombinationTableMap::UPDATED_AT => 3, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'created_at' => 2, 'updated_at' => 3, ),
- self::TYPE_NUM => array(0, 1, 2, 3, )
+ self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'Quantity' => 2, 'Promo' => 3, 'Newness' => 4, 'Weight' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'quantity' => 2, 'promo' => 3, 'newness' => 4, 'weight' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
+ self::TYPE_COLNAME => array(ProductSaleElementsTableMap::ID => 0, ProductSaleElementsTableMap::PRODUCT_ID => 1, ProductSaleElementsTableMap::QUANTITY => 2, ProductSaleElementsTableMap::PROMO => 3, ProductSaleElementsTableMap::NEWNESS => 4, ProductSaleElementsTableMap::WEIGHT => 5, ProductSaleElementsTableMap::CREATED_AT => 6, ProductSaleElementsTableMap::UPDATED_AT => 7, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'QUANTITY' => 2, 'PROMO' => 3, 'NEWNESS' => 4, 'WEIGHT' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'quantity' => 2, 'promo' => 3, 'newness' => 4, 'weight' => 5, 'created_at' => 6, 'updated_at' => 7, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
@@ -134,14 +154,18 @@ class CombinationTableMap extends TableMap
public function initialize()
{
// attributes
- $this->setName('combination');
- $this->setPhpName('Combination');
- $this->setClassName('\\Thelia\\Model\\Combination');
+ $this->setName('product_sale_elements');
+ $this->setPhpName('ProductSaleElements');
+ $this->setClassName('\\Thelia\\Model\\ProductSaleElements');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
- $this->addColumn('REF', 'Ref', 'VARCHAR', false, 255, null);
+ $this->addForeignKey('PRODUCT_ID', 'ProductId', 'INTEGER', 'product', 'ID', true, null, null);
+ $this->addColumn('QUANTITY', 'Quantity', 'FLOAT', true, null, null);
+ $this->addColumn('PROMO', 'Promo', 'TINYINT', false, null, 0);
+ $this->addColumn('NEWNESS', 'Newness', 'TINYINT', false, null, 0);
+ $this->addColumn('WEIGHT', 'Weight', 'FLOAT', false, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -151,9 +175,10 @@ class CombinationTableMap extends TableMap
*/
public function buildRelations()
{
- $this->addRelation('AttributeCombination', '\\Thelia\\Model\\AttributeCombination', RelationMap::ONE_TO_MANY, array('id' => 'combination_id', ), 'CASCADE', 'RESTRICT', 'AttributeCombinations');
- $this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::ONE_TO_MANY, array('id' => 'combination_id', ), 'SET NULL', 'RESTRICT', 'Stocks');
- $this->addRelation('CartItem', '\\Thelia\\Model\\CartItem', RelationMap::ONE_TO_MANY, array('id' => 'combination_id', ), null, null, 'CartItems');
+ $this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::MANY_TO_ONE, array('product_id' => 'id', ), 'CASCADE', 'RESTRICT');
+ $this->addRelation('AttributeCombination', '\\Thelia\\Model\\AttributeCombination', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), null, null, 'AttributeCombinations');
+ $this->addRelation('CartItem', '\\Thelia\\Model\\CartItem', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), null, null, 'CartItems');
+ $this->addRelation('ProductPrice', '\\Thelia\\Model\\ProductPrice', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), null, null, 'ProductPrices');
} // buildRelations()
/**
@@ -168,16 +193,6 @@ class CombinationTableMap extends TableMap
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
- /**
- * Method to invalidate the instance pool of all tables related to combination * 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.
- AttributeCombinationTableMap::clearInstancePool();
- StockTableMap::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.
@@ -235,7 +250,7 @@ class CombinationTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
- return $withPrefix ? CombinationTableMap::CLASS_DEFAULT : CombinationTableMap::OM_CLASS;
+ return $withPrefix ? ProductSaleElementsTableMap::CLASS_DEFAULT : ProductSaleElementsTableMap::OM_CLASS;
}
/**
@@ -249,21 +264,21 @@ class CombinationTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
- * @return array (Combination object, last column rank)
+ * @return array (ProductSaleElements object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
- $key = CombinationTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
- if (null !== ($obj = CombinationTableMap::getInstanceFromPool($key))) {
+ $key = ProductSaleElementsTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = ProductSaleElementsTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $offset, true); // rehydrate
- $col = $offset + CombinationTableMap::NUM_HYDRATE_COLUMNS;
+ $col = $offset + ProductSaleElementsTableMap::NUM_HYDRATE_COLUMNS;
} else {
- $cls = CombinationTableMap::OM_CLASS;
+ $cls = ProductSaleElementsTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
- CombinationTableMap::addInstanceToPool($obj, $key);
+ ProductSaleElementsTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -286,8 +301,8 @@ class CombinationTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
- $key = CombinationTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
- if (null !== ($obj = CombinationTableMap::getInstanceFromPool($key))) {
+ $key = ProductSaleElementsTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = ProductSaleElementsTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, 0, true); // rehydrate
@@ -296,7 +311,7 @@ class CombinationTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
- CombinationTableMap::addInstanceToPool($obj, $key);
+ ProductSaleElementsTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -317,13 +332,21 @@ class CombinationTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
- $criteria->addSelectColumn(CombinationTableMap::ID);
- $criteria->addSelectColumn(CombinationTableMap::REF);
- $criteria->addSelectColumn(CombinationTableMap::CREATED_AT);
- $criteria->addSelectColumn(CombinationTableMap::UPDATED_AT);
+ $criteria->addSelectColumn(ProductSaleElementsTableMap::ID);
+ $criteria->addSelectColumn(ProductSaleElementsTableMap::PRODUCT_ID);
+ $criteria->addSelectColumn(ProductSaleElementsTableMap::QUANTITY);
+ $criteria->addSelectColumn(ProductSaleElementsTableMap::PROMO);
+ $criteria->addSelectColumn(ProductSaleElementsTableMap::NEWNESS);
+ $criteria->addSelectColumn(ProductSaleElementsTableMap::WEIGHT);
+ $criteria->addSelectColumn(ProductSaleElementsTableMap::CREATED_AT);
+ $criteria->addSelectColumn(ProductSaleElementsTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
- $criteria->addSelectColumn($alias . '.REF');
+ $criteria->addSelectColumn($alias . '.PRODUCT_ID');
+ $criteria->addSelectColumn($alias . '.QUANTITY');
+ $criteria->addSelectColumn($alias . '.PROMO');
+ $criteria->addSelectColumn($alias . '.NEWNESS');
+ $criteria->addSelectColumn($alias . '.WEIGHT');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
@@ -338,7 +361,7 @@ class CombinationTableMap extends TableMap
*/
public static function getTableMap()
{
- return Propel::getServiceContainer()->getDatabaseMap(CombinationTableMap::DATABASE_NAME)->getTable(CombinationTableMap::TABLE_NAME);
+ return Propel::getServiceContainer()->getDatabaseMap(ProductSaleElementsTableMap::DATABASE_NAME)->getTable(ProductSaleElementsTableMap::TABLE_NAME);
}
/**
@@ -346,16 +369,16 @@ class CombinationTableMap extends TableMap
*/
public static function buildTableMap()
{
- $dbMap = Propel::getServiceContainer()->getDatabaseMap(CombinationTableMap::DATABASE_NAME);
- if (!$dbMap->hasTable(CombinationTableMap::TABLE_NAME)) {
- $dbMap->addTableObject(new CombinationTableMap());
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(ProductSaleElementsTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(ProductSaleElementsTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new ProductSaleElementsTableMap());
}
}
/**
- * Performs a DELETE on the database, given a Combination or Criteria object OR a primary key value.
+ * Performs a DELETE on the database, given a ProductSaleElements or Criteria object OR a primary key value.
*
- * @param mixed $values Criteria or Combination object or primary key or array of primary keys
+ * @param mixed $values Criteria or ProductSaleElements object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -366,25 +389,25 @@ class CombinationTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(CombinationTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
- } elseif ($values instanceof \Thelia\Model\Combination) { // it's a model object
+ } elseif ($values instanceof \Thelia\Model\ProductSaleElements) { // it's a model object
// create criteria based on pk values
$criteria = $values->buildPkeyCriteria();
} else { // it's a primary key, or an array of pks
- $criteria = new Criteria(CombinationTableMap::DATABASE_NAME);
- $criteria->add(CombinationTableMap::ID, (array) $values, Criteria::IN);
+ $criteria = new Criteria(ProductSaleElementsTableMap::DATABASE_NAME);
+ $criteria->add(ProductSaleElementsTableMap::ID, (array) $values, Criteria::IN);
}
- $query = CombinationQuery::create()->mergeWith($criteria);
+ $query = ProductSaleElementsQuery::create()->mergeWith($criteria);
- if ($values instanceof Criteria) { CombinationTableMap::clearInstancePool();
+ if ($values instanceof Criteria) { ProductSaleElementsTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
- foreach ((array) $values as $singleval) { CombinationTableMap::removeInstanceFromPool($singleval);
+ foreach ((array) $values as $singleval) { ProductSaleElementsTableMap::removeInstanceFromPool($singleval);
}
}
@@ -392,20 +415,20 @@ class CombinationTableMap extends TableMap
}
/**
- * Deletes all rows from the combination table.
+ * Deletes all rows from the product_sale_elements table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(ConnectionInterface $con = null)
{
- return CombinationQuery::create()->doDeleteAll($con);
+ return ProductSaleElementsQuery::create()->doDeleteAll($con);
}
/**
- * Performs an INSERT on the database, given a Combination or Criteria object.
+ * Performs an INSERT on the database, given a ProductSaleElements or Criteria object.
*
- * @param mixed $criteria Criteria or Combination object containing data that is used to create the INSERT statement.
+ * @param mixed $criteria Criteria or ProductSaleElements object containing data that is used to create the INSERT statement.
* @param ConnectionInterface $con the ConnectionInterface connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
@@ -414,22 +437,22 @@ class CombinationTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(CombinationTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
- $criteria = $criteria->buildCriteria(); // build Criteria from Combination object
+ $criteria = $criteria->buildCriteria(); // build Criteria from ProductSaleElements object
}
- if ($criteria->containsKey(CombinationTableMap::ID) && $criteria->keyContainsValue(CombinationTableMap::ID) ) {
- throw new PropelException('Cannot insert a value for auto-increment primary key ('.CombinationTableMap::ID.')');
+ if ($criteria->containsKey(ProductSaleElementsTableMap::ID) && $criteria->keyContainsValue(ProductSaleElementsTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.ProductSaleElementsTableMap::ID.')');
}
// Set the correct dbName
- $query = CombinationQuery::create()->mergeWith($criteria);
+ $query = ProductSaleElementsQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -445,7 +468,7 @@ class CombinationTableMap extends TableMap
return $pk;
}
-} // CombinationTableMap
+} // ProductSaleElementsTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
-CombinationTableMap::buildTableMap();
+ProductSaleElementsTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/ProductTableMap.php b/core/lib/Thelia/Model/Map/ProductTableMap.php
old mode 100755
new mode 100644
index 61c56dc8c..b61dd1815
--- a/core/lib/Thelia/Model/Map/ProductTableMap.php
+++ b/core/lib/Thelia/Model/Map/ProductTableMap.php
@@ -57,7 +57,7 @@ class ProductTableMap extends TableMap
/**
* The total number of columns
*/
- const NUM_COLUMNS = 17;
+ const NUM_COLUMNS = 10;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class ProductTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 17;
+ const NUM_HYDRATE_COLUMNS = 10;
/**
* the column name for the ID field
@@ -84,46 +84,11 @@ class ProductTableMap extends TableMap
*/
const REF = 'product.REF';
- /**
- * the column name for the PRICE field
- */
- const PRICE = 'product.PRICE';
-
- /**
- * the column name for the PRICE2 field
- */
- const PRICE2 = 'product.PRICE2';
-
- /**
- * the column name for the ECOTAX field
- */
- const ECOTAX = 'product.ECOTAX';
-
- /**
- * the column name for the NEWNESS field
- */
- const NEWNESS = 'product.NEWNESS';
-
- /**
- * the column name for the PROMO field
- */
- const PROMO = 'product.PROMO';
-
- /**
- * the column name for the QUANTITY field
- */
- const QUANTITY = 'product.QUANTITY';
-
/**
* the column name for the VISIBLE field
*/
const VISIBLE = 'product.VISIBLE';
- /**
- * the column name for the WEIGHT field
- */
- const WEIGHT = 'product.WEIGHT';
-
/**
* the column name for the POSITION field
*/
@@ -175,12 +140,12 @@ class ProductTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'TaxRuleId', 'Ref', 'Price', 'Price2', 'Ecotax', 'Newness', 'Promo', 'Quantity', 'Visible', 'Weight', 'Position', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'taxRuleId', 'ref', 'price', 'price2', 'ecotax', 'newness', 'promo', 'quantity', 'visible', 'weight', 'position', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ),
- self::TYPE_COLNAME => array(ProductTableMap::ID, ProductTableMap::TAX_RULE_ID, ProductTableMap::REF, ProductTableMap::PRICE, ProductTableMap::PRICE2, ProductTableMap::ECOTAX, ProductTableMap::NEWNESS, ProductTableMap::PROMO, ProductTableMap::QUANTITY, ProductTableMap::VISIBLE, ProductTableMap::WEIGHT, ProductTableMap::POSITION, ProductTableMap::CREATED_AT, ProductTableMap::UPDATED_AT, ProductTableMap::VERSION, ProductTableMap::VERSION_CREATED_AT, ProductTableMap::VERSION_CREATED_BY, ),
- self::TYPE_RAW_COLNAME => array('ID', 'TAX_RULE_ID', 'REF', 'PRICE', 'PRICE2', 'ECOTAX', 'NEWNESS', 'PROMO', 'QUANTITY', 'VISIBLE', 'WEIGHT', 'POSITION', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ),
- self::TYPE_FIELDNAME => array('id', 'tax_rule_id', 'ref', 'price', 'price2', 'ecotax', 'newness', 'promo', 'quantity', 'visible', 'weight', 'position', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
+ self::TYPE_PHPNAME => array('Id', 'TaxRuleId', 'Ref', 'Visible', 'Position', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'taxRuleId', 'ref', 'visible', 'position', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ),
+ self::TYPE_COLNAME => array(ProductTableMap::ID, ProductTableMap::TAX_RULE_ID, ProductTableMap::REF, ProductTableMap::VISIBLE, ProductTableMap::POSITION, ProductTableMap::CREATED_AT, ProductTableMap::UPDATED_AT, ProductTableMap::VERSION, ProductTableMap::VERSION_CREATED_AT, ProductTableMap::VERSION_CREATED_BY, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'TAX_RULE_ID', 'REF', 'VISIBLE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ),
+ self::TYPE_FIELDNAME => array('id', 'tax_rule_id', 'ref', 'visible', 'position', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@@ -190,12 +155,12 @@ class ProductTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'TaxRuleId' => 1, 'Ref' => 2, 'Price' => 3, 'Price2' => 4, 'Ecotax' => 5, 'Newness' => 6, 'Promo' => 7, 'Quantity' => 8, 'Visible' => 9, 'Weight' => 10, 'Position' => 11, 'CreatedAt' => 12, 'UpdatedAt' => 13, 'Version' => 14, 'VersionCreatedAt' => 15, 'VersionCreatedBy' => 16, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'taxRuleId' => 1, 'ref' => 2, 'price' => 3, 'price2' => 4, 'ecotax' => 5, 'newness' => 6, 'promo' => 7, 'quantity' => 8, 'visible' => 9, 'weight' => 10, 'position' => 11, 'createdAt' => 12, 'updatedAt' => 13, 'version' => 14, 'versionCreatedAt' => 15, 'versionCreatedBy' => 16, ),
- self::TYPE_COLNAME => array(ProductTableMap::ID => 0, ProductTableMap::TAX_RULE_ID => 1, ProductTableMap::REF => 2, ProductTableMap::PRICE => 3, ProductTableMap::PRICE2 => 4, ProductTableMap::ECOTAX => 5, ProductTableMap::NEWNESS => 6, ProductTableMap::PROMO => 7, ProductTableMap::QUANTITY => 8, ProductTableMap::VISIBLE => 9, ProductTableMap::WEIGHT => 10, ProductTableMap::POSITION => 11, ProductTableMap::CREATED_AT => 12, ProductTableMap::UPDATED_AT => 13, ProductTableMap::VERSION => 14, ProductTableMap::VERSION_CREATED_AT => 15, ProductTableMap::VERSION_CREATED_BY => 16, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'TAX_RULE_ID' => 1, 'REF' => 2, 'PRICE' => 3, 'PRICE2' => 4, 'ECOTAX' => 5, 'NEWNESS' => 6, 'PROMO' => 7, 'QUANTITY' => 8, 'VISIBLE' => 9, 'WEIGHT' => 10, 'POSITION' => 11, 'CREATED_AT' => 12, 'UPDATED_AT' => 13, 'VERSION' => 14, 'VERSION_CREATED_AT' => 15, 'VERSION_CREATED_BY' => 16, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'tax_rule_id' => 1, 'ref' => 2, 'price' => 3, 'price2' => 4, 'ecotax' => 5, 'newness' => 6, 'promo' => 7, 'quantity' => 8, 'visible' => 9, 'weight' => 10, 'position' => 11, 'created_at' => 12, 'updated_at' => 13, 'version' => 14, 'version_created_at' => 15, 'version_created_by' => 16, ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
+ self::TYPE_PHPNAME => array('Id' => 0, 'TaxRuleId' => 1, 'Ref' => 2, 'Visible' => 3, 'Position' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, 'Version' => 7, 'VersionCreatedAt' => 8, 'VersionCreatedBy' => 9, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'taxRuleId' => 1, 'ref' => 2, 'visible' => 3, 'position' => 4, 'createdAt' => 5, 'updatedAt' => 6, 'version' => 7, 'versionCreatedAt' => 8, 'versionCreatedBy' => 9, ),
+ self::TYPE_COLNAME => array(ProductTableMap::ID => 0, ProductTableMap::TAX_RULE_ID => 1, ProductTableMap::REF => 2, ProductTableMap::VISIBLE => 3, ProductTableMap::POSITION => 4, ProductTableMap::CREATED_AT => 5, ProductTableMap::UPDATED_AT => 6, ProductTableMap::VERSION => 7, ProductTableMap::VERSION_CREATED_AT => 8, ProductTableMap::VERSION_CREATED_BY => 9, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'TAX_RULE_ID' => 1, 'REF' => 2, 'VISIBLE' => 3, 'POSITION' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, 'VERSION' => 7, 'VERSION_CREATED_AT' => 8, 'VERSION_CREATED_BY' => 9, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'tax_rule_id' => 1, 'ref' => 2, 'visible' => 3, 'position' => 4, 'created_at' => 5, 'updated_at' => 6, 'version' => 7, 'version_created_at' => 8, 'version_created_by' => 9, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@@ -217,14 +182,7 @@ class ProductTableMap extends TableMap
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('TAX_RULE_ID', 'TaxRuleId', 'INTEGER', 'tax_rule', 'ID', false, null, null);
$this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null);
- $this->addColumn('PRICE', 'Price', 'FLOAT', true, null, null);
- $this->addColumn('PRICE2', 'Price2', 'FLOAT', false, null, null);
- $this->addColumn('ECOTAX', 'Ecotax', 'FLOAT', false, null, null);
- $this->addColumn('NEWNESS', 'Newness', 'TINYINT', false, null, 0);
- $this->addColumn('PROMO', 'Promo', 'TINYINT', false, null, 0);
- $this->addColumn('QUANTITY', 'Quantity', 'INTEGER', false, null, 0);
$this->addColumn('VISIBLE', 'Visible', 'TINYINT', true, null, 0);
- $this->addColumn('WEIGHT', 'Weight', 'FLOAT', false, null, null);
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
@@ -240,8 +198,8 @@ class ProductTableMap extends TableMap
{
$this->addRelation('TaxRule', '\\Thelia\\Model\\TaxRule', RelationMap::MANY_TO_ONE, array('tax_rule_id' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('ProductCategory', '\\Thelia\\Model\\ProductCategory', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProductCategories');
- $this->addRelation('FeatureProd', '\\Thelia\\Model\\FeatureProd', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'FeatureProds');
- $this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'Stocks');
+ $this->addRelation('FeatureProduct', '\\Thelia\\Model\\FeatureProduct', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'FeatureProducts');
+ $this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProductSaleElementss');
$this->addRelation('ContentAssoc', '\\Thelia\\Model\\ContentAssoc', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ContentAssocs');
$this->addRelation('Image', '\\Thelia\\Model\\Image', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'Images');
$this->addRelation('Document', '\\Thelia\\Model\\Document', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'Documents');
@@ -278,8 +236,8 @@ class ProductTableMap 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.
ProductCategoryTableMap::clearInstancePool();
- FeatureProdTableMap::clearInstancePool();
- StockTableMap::clearInstancePool();
+ FeatureProductTableMap::clearInstancePool();
+ ProductSaleElementsTableMap::clearInstancePool();
ContentAssocTableMap::clearInstancePool();
ImageTableMap::clearInstancePool();
DocumentTableMap::clearInstancePool();
@@ -430,14 +388,7 @@ class ProductTableMap extends TableMap
$criteria->addSelectColumn(ProductTableMap::ID);
$criteria->addSelectColumn(ProductTableMap::TAX_RULE_ID);
$criteria->addSelectColumn(ProductTableMap::REF);
- $criteria->addSelectColumn(ProductTableMap::PRICE);
- $criteria->addSelectColumn(ProductTableMap::PRICE2);
- $criteria->addSelectColumn(ProductTableMap::ECOTAX);
- $criteria->addSelectColumn(ProductTableMap::NEWNESS);
- $criteria->addSelectColumn(ProductTableMap::PROMO);
- $criteria->addSelectColumn(ProductTableMap::QUANTITY);
$criteria->addSelectColumn(ProductTableMap::VISIBLE);
- $criteria->addSelectColumn(ProductTableMap::WEIGHT);
$criteria->addSelectColumn(ProductTableMap::POSITION);
$criteria->addSelectColumn(ProductTableMap::CREATED_AT);
$criteria->addSelectColumn(ProductTableMap::UPDATED_AT);
@@ -448,14 +399,7 @@ class ProductTableMap extends TableMap
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.TAX_RULE_ID');
$criteria->addSelectColumn($alias . '.REF');
- $criteria->addSelectColumn($alias . '.PRICE');
- $criteria->addSelectColumn($alias . '.PRICE2');
- $criteria->addSelectColumn($alias . '.ECOTAX');
- $criteria->addSelectColumn($alias . '.NEWNESS');
- $criteria->addSelectColumn($alias . '.PROMO');
- $criteria->addSelectColumn($alias . '.QUANTITY');
$criteria->addSelectColumn($alias . '.VISIBLE');
- $criteria->addSelectColumn($alias . '.WEIGHT');
$criteria->addSelectColumn($alias . '.POSITION');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
diff --git a/core/lib/Thelia/Model/Map/ProductVersionTableMap.php b/core/lib/Thelia/Model/Map/ProductVersionTableMap.php
old mode 100755
new mode 100644
index fb285a6db..d3e69b16f
--- a/core/lib/Thelia/Model/Map/ProductVersionTableMap.php
+++ b/core/lib/Thelia/Model/Map/ProductVersionTableMap.php
@@ -57,7 +57,7 @@ class ProductVersionTableMap extends TableMap
/**
* The total number of columns
*/
- const NUM_COLUMNS = 17;
+ const NUM_COLUMNS = 10;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class ProductVersionTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 17;
+ const NUM_HYDRATE_COLUMNS = 10;
/**
* the column name for the ID field
@@ -84,46 +84,11 @@ class ProductVersionTableMap extends TableMap
*/
const REF = 'product_version.REF';
- /**
- * the column name for the PRICE field
- */
- const PRICE = 'product_version.PRICE';
-
- /**
- * the column name for the PRICE2 field
- */
- const PRICE2 = 'product_version.PRICE2';
-
- /**
- * the column name for the ECOTAX field
- */
- const ECOTAX = 'product_version.ECOTAX';
-
- /**
- * the column name for the NEWNESS field
- */
- const NEWNESS = 'product_version.NEWNESS';
-
- /**
- * the column name for the PROMO field
- */
- const PROMO = 'product_version.PROMO';
-
- /**
- * the column name for the QUANTITY field
- */
- const QUANTITY = 'product_version.QUANTITY';
-
/**
* the column name for the VISIBLE field
*/
const VISIBLE = 'product_version.VISIBLE';
- /**
- * the column name for the WEIGHT field
- */
- const WEIGHT = 'product_version.WEIGHT';
-
/**
* the column name for the POSITION field
*/
@@ -166,12 +131,12 @@ class ProductVersionTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'TaxRuleId', 'Ref', 'Price', 'Price2', 'Ecotax', 'Newness', 'Promo', 'Quantity', 'Visible', 'Weight', 'Position', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'taxRuleId', 'ref', 'price', 'price2', 'ecotax', 'newness', 'promo', 'quantity', 'visible', 'weight', 'position', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ),
- self::TYPE_COLNAME => array(ProductVersionTableMap::ID, ProductVersionTableMap::TAX_RULE_ID, ProductVersionTableMap::REF, ProductVersionTableMap::PRICE, ProductVersionTableMap::PRICE2, ProductVersionTableMap::ECOTAX, ProductVersionTableMap::NEWNESS, ProductVersionTableMap::PROMO, ProductVersionTableMap::QUANTITY, ProductVersionTableMap::VISIBLE, ProductVersionTableMap::WEIGHT, ProductVersionTableMap::POSITION, ProductVersionTableMap::CREATED_AT, ProductVersionTableMap::UPDATED_AT, ProductVersionTableMap::VERSION, ProductVersionTableMap::VERSION_CREATED_AT, ProductVersionTableMap::VERSION_CREATED_BY, ),
- self::TYPE_RAW_COLNAME => array('ID', 'TAX_RULE_ID', 'REF', 'PRICE', 'PRICE2', 'ECOTAX', 'NEWNESS', 'PROMO', 'QUANTITY', 'VISIBLE', 'WEIGHT', 'POSITION', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ),
- self::TYPE_FIELDNAME => array('id', 'tax_rule_id', 'ref', 'price', 'price2', 'ecotax', 'newness', 'promo', 'quantity', 'visible', 'weight', 'position', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
+ self::TYPE_PHPNAME => array('Id', 'TaxRuleId', 'Ref', 'Visible', 'Position', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'taxRuleId', 'ref', 'visible', 'position', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ),
+ self::TYPE_COLNAME => array(ProductVersionTableMap::ID, ProductVersionTableMap::TAX_RULE_ID, ProductVersionTableMap::REF, ProductVersionTableMap::VISIBLE, ProductVersionTableMap::POSITION, ProductVersionTableMap::CREATED_AT, ProductVersionTableMap::UPDATED_AT, ProductVersionTableMap::VERSION, ProductVersionTableMap::VERSION_CREATED_AT, ProductVersionTableMap::VERSION_CREATED_BY, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'TAX_RULE_ID', 'REF', 'VISIBLE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ),
+ self::TYPE_FIELDNAME => array('id', 'tax_rule_id', 'ref', 'visible', 'position', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@@ -181,12 +146,12 @@ class ProductVersionTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'TaxRuleId' => 1, 'Ref' => 2, 'Price' => 3, 'Price2' => 4, 'Ecotax' => 5, 'Newness' => 6, 'Promo' => 7, 'Quantity' => 8, 'Visible' => 9, 'Weight' => 10, 'Position' => 11, 'CreatedAt' => 12, 'UpdatedAt' => 13, 'Version' => 14, 'VersionCreatedAt' => 15, 'VersionCreatedBy' => 16, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'taxRuleId' => 1, 'ref' => 2, 'price' => 3, 'price2' => 4, 'ecotax' => 5, 'newness' => 6, 'promo' => 7, 'quantity' => 8, 'visible' => 9, 'weight' => 10, 'position' => 11, 'createdAt' => 12, 'updatedAt' => 13, 'version' => 14, 'versionCreatedAt' => 15, 'versionCreatedBy' => 16, ),
- self::TYPE_COLNAME => array(ProductVersionTableMap::ID => 0, ProductVersionTableMap::TAX_RULE_ID => 1, ProductVersionTableMap::REF => 2, ProductVersionTableMap::PRICE => 3, ProductVersionTableMap::PRICE2 => 4, ProductVersionTableMap::ECOTAX => 5, ProductVersionTableMap::NEWNESS => 6, ProductVersionTableMap::PROMO => 7, ProductVersionTableMap::QUANTITY => 8, ProductVersionTableMap::VISIBLE => 9, ProductVersionTableMap::WEIGHT => 10, ProductVersionTableMap::POSITION => 11, ProductVersionTableMap::CREATED_AT => 12, ProductVersionTableMap::UPDATED_AT => 13, ProductVersionTableMap::VERSION => 14, ProductVersionTableMap::VERSION_CREATED_AT => 15, ProductVersionTableMap::VERSION_CREATED_BY => 16, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'TAX_RULE_ID' => 1, 'REF' => 2, 'PRICE' => 3, 'PRICE2' => 4, 'ECOTAX' => 5, 'NEWNESS' => 6, 'PROMO' => 7, 'QUANTITY' => 8, 'VISIBLE' => 9, 'WEIGHT' => 10, 'POSITION' => 11, 'CREATED_AT' => 12, 'UPDATED_AT' => 13, 'VERSION' => 14, 'VERSION_CREATED_AT' => 15, 'VERSION_CREATED_BY' => 16, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'tax_rule_id' => 1, 'ref' => 2, 'price' => 3, 'price2' => 4, 'ecotax' => 5, 'newness' => 6, 'promo' => 7, 'quantity' => 8, 'visible' => 9, 'weight' => 10, 'position' => 11, 'created_at' => 12, 'updated_at' => 13, 'version' => 14, 'version_created_at' => 15, 'version_created_by' => 16, ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
+ self::TYPE_PHPNAME => array('Id' => 0, 'TaxRuleId' => 1, 'Ref' => 2, 'Visible' => 3, 'Position' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, 'Version' => 7, 'VersionCreatedAt' => 8, 'VersionCreatedBy' => 9, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'taxRuleId' => 1, 'ref' => 2, 'visible' => 3, 'position' => 4, 'createdAt' => 5, 'updatedAt' => 6, 'version' => 7, 'versionCreatedAt' => 8, 'versionCreatedBy' => 9, ),
+ self::TYPE_COLNAME => array(ProductVersionTableMap::ID => 0, ProductVersionTableMap::TAX_RULE_ID => 1, ProductVersionTableMap::REF => 2, ProductVersionTableMap::VISIBLE => 3, ProductVersionTableMap::POSITION => 4, ProductVersionTableMap::CREATED_AT => 5, ProductVersionTableMap::UPDATED_AT => 6, ProductVersionTableMap::VERSION => 7, ProductVersionTableMap::VERSION_CREATED_AT => 8, ProductVersionTableMap::VERSION_CREATED_BY => 9, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'TAX_RULE_ID' => 1, 'REF' => 2, 'VISIBLE' => 3, 'POSITION' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, 'VERSION' => 7, 'VERSION_CREATED_AT' => 8, 'VERSION_CREATED_BY' => 9, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'tax_rule_id' => 1, 'ref' => 2, 'visible' => 3, 'position' => 4, 'created_at' => 5, 'updated_at' => 6, 'version' => 7, 'version_created_at' => 8, 'version_created_by' => 9, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@@ -208,14 +173,7 @@ class ProductVersionTableMap extends TableMap
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product', 'ID', true, null, null);
$this->addColumn('TAX_RULE_ID', 'TaxRuleId', 'INTEGER', false, null, null);
$this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null);
- $this->addColumn('PRICE', 'Price', 'FLOAT', true, null, null);
- $this->addColumn('PRICE2', 'Price2', 'FLOAT', false, null, null);
- $this->addColumn('ECOTAX', 'Ecotax', 'FLOAT', false, null, null);
- $this->addColumn('NEWNESS', 'Newness', 'TINYINT', false, null, 0);
- $this->addColumn('PROMO', 'Promo', 'TINYINT', false, null, 0);
- $this->addColumn('QUANTITY', 'Quantity', 'INTEGER', false, null, 0);
$this->addColumn('VISIBLE', 'Visible', 'TINYINT', true, null, 0);
- $this->addColumn('WEIGHT', 'Weight', 'FLOAT', false, null, null);
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
@@ -299,11 +257,11 @@ class ProductVersionTableMap extends TableMap
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
// If the PK cannot be derived from the row, return NULL.
- if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 14 + $offset : static::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 7 + $offset : static::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)] === null) {
return null;
}
- return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 14 + $offset : static::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)]));
+ return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 7 + $offset : static::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)]));
}
/**
@@ -422,14 +380,7 @@ class ProductVersionTableMap extends TableMap
$criteria->addSelectColumn(ProductVersionTableMap::ID);
$criteria->addSelectColumn(ProductVersionTableMap::TAX_RULE_ID);
$criteria->addSelectColumn(ProductVersionTableMap::REF);
- $criteria->addSelectColumn(ProductVersionTableMap::PRICE);
- $criteria->addSelectColumn(ProductVersionTableMap::PRICE2);
- $criteria->addSelectColumn(ProductVersionTableMap::ECOTAX);
- $criteria->addSelectColumn(ProductVersionTableMap::NEWNESS);
- $criteria->addSelectColumn(ProductVersionTableMap::PROMO);
- $criteria->addSelectColumn(ProductVersionTableMap::QUANTITY);
$criteria->addSelectColumn(ProductVersionTableMap::VISIBLE);
- $criteria->addSelectColumn(ProductVersionTableMap::WEIGHT);
$criteria->addSelectColumn(ProductVersionTableMap::POSITION);
$criteria->addSelectColumn(ProductVersionTableMap::CREATED_AT);
$criteria->addSelectColumn(ProductVersionTableMap::UPDATED_AT);
@@ -440,14 +391,7 @@ class ProductVersionTableMap extends TableMap
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.TAX_RULE_ID');
$criteria->addSelectColumn($alias . '.REF');
- $criteria->addSelectColumn($alias . '.PRICE');
- $criteria->addSelectColumn($alias . '.PRICE2');
- $criteria->addSelectColumn($alias . '.ECOTAX');
- $criteria->addSelectColumn($alias . '.NEWNESS');
- $criteria->addSelectColumn($alias . '.PROMO');
- $criteria->addSelectColumn($alias . '.QUANTITY');
$criteria->addSelectColumn($alias . '.VISIBLE');
- $criteria->addSelectColumn($alias . '.WEIGHT');
$criteria->addSelectColumn($alias . '.POSITION');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
diff --git a/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php b/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/ResourceTableMap.php b/core/lib/Thelia/Model/Map/ResourceTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/RewritingTableMap.php b/core/lib/Thelia/Model/Map/RewritingTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/TaxI18nTableMap.php b/core/lib/Thelia/Model/Map/TaxI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/TaxRuleCountryTableMap.php b/core/lib/Thelia/Model/Map/TaxRuleCountryTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php b/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/TaxRuleTableMap.php b/core/lib/Thelia/Model/Map/TaxRuleTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Map/TaxTableMap.php b/core/lib/Thelia/Model/Map/TaxTableMap.php
old mode 100755
new mode 100644
diff --git a/core/lib/Thelia/Model/Product.php b/core/lib/Thelia/Model/Product.php
index 649f315dc..ca26317e0 100755
--- a/core/lib/Thelia/Model/Product.php
+++ b/core/lib/Thelia/Model/Product.php
@@ -3,7 +3,7 @@
namespace Thelia\Model;
use Thelia\Model\Base\Product as BaseProduct;
+use Thelia\Model\ProductSaleElements;
class Product extends BaseProduct {
-
}
diff --git a/core/lib/Thelia/Model/ProductPrice.php b/core/lib/Thelia/Model/ProductPrice.php
new file mode 100644
index 000000000..04222a721
--- /dev/null
+++ b/core/lib/Thelia/Model/ProductPrice.php
@@ -0,0 +1,10 @@
+. */
+/* */
+/*************************************************************************************/
+namespace Thelia\Tests\Action;
+
+use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
+use Thelia\Core\HttpFoundation\Request;
+use Thelia\Core\HttpFoundation\Session\Session;
+use Thelia\Model\Cart;
+use Thelia\Model\Customer;
+
+class CartTest extends \PHPUnit_Framework_TestCase
+{
+
+ protected $session;
+
+ protected $request;
+
+ protected $actionCart;
+
+ protected $uniqid;
+
+
+
+ public function setUp()
+ {
+ $this->session = new Session(new MockArraySessionStorage());
+ $this->request = new Request();
+
+ $this->request->setSession($this->session);
+
+ $this->uniqid = uniqid('', true);
+
+ $this->actionCart = $this->getMock(
+ "\Thelia\Action\Cart",
+ array("generateCookie")
+ );
+
+ $this->actionCart
+ ->expects($this->any())
+ ->method("generateCookie")
+ ->will($this->returnValue($this->uniqid));
+ }
+
+ /**
+ * no cart present in session and cart_id no yet exists in cookies.
+ *
+ * In this case, a new cart instance must be create
+ */
+ public function testGetCartWithoutCustomerAndWithoutExistingCart()
+ {
+ $actionCart = $this->actionCart;
+
+ $cart = $actionCart->getCart($this->request);
+
+ $this->assertInstanceOf("Thelia\Model\Cart", $cart, '$cart must be an instance of cart model Thelia\Model\Cart');
+ $this->assertNull($cart->getCustomerId());
+ $this->assertNull($cart->getAddressDeliveryId());
+ $this->assertNull($cart->getAddressInvoiceId());
+ $this->assertEquals($this->uniqid, $cart->getToken());
+
+ }
+
+ /**
+ * Customer is connected but his cart does not exists yet
+ *
+ * Cart must be created and associated to the current connected Customer
+ */
+ public function testGetCartWithCustomerAndWithoutExistingCart()
+ {
+ $actionCart = $this->actionCart;
+
+ $request = $this->request;
+
+ //create a fake customer just for test. If not persists test fails !
+ $customer = new Customer();
+ $customer->setFirstname("john");
+ $customer->setLastname("doe");
+ $customer->setTitleId(1);
+ $customer->save();
+
+ $request->getSession()->setCustomerUser($customer);
+
+ $cart = $actionCart->getCart($request);
+ $this->assertInstanceOf("Thelia\Model\Cart", $cart, '$cart must be an instance of cart model Thelia\Model\Cart');
+ $this->assertNotNull($cart->getCustomerId());
+ $this->assertEquals($customer->getId(), $cart->getCustomerId());
+ $this->assertNull($cart->getAddressDeliveryId());
+ $this->assertNull($cart->getAddressInvoiceId());
+ $this->assertEquals($this->uniqid, $cart->getToken());
+
+ }
+
+ /**
+ * Cart exists and his id put in cookies.
+ *
+ * Must return the same cart instance
+ */
+ public function testGetCartWithoutCustomerAndWithExistingCart()
+ {
+ $actionCart = $this->actionCart;
+
+ $request = $this->request;
+ $uniqid = uniqid("test1", true);
+ //create a fake cart in database;
+ $cart = new Cart();
+ $cart->setToken($uniqid);
+ $cart->save();
+
+ $request->cookies->set("thelia_cart", $uniqid);
+
+ $getCart = $actionCart->getCart($request);
+ $this->assertInstanceOf("Thelia\Model\Cart", $getCart, '$cart must be an instance of cart model Thelia\Model\Cart');
+ $this->assertNull($getCart->getCustomerId());
+ $this->assertNull($getCart->getAddressDeliveryId());
+ $this->assertNull($getCart->getAddressInvoiceId());
+ $this->assertEquals($cart->getToken(), $getCart->getToken());
+ }
+
+ /**
+ * a cart id exists in cookies but this id does not exists yet in databases
+ *
+ * a new cart must be created (different token)
+ */
+ public function testGetCartWithExistingCartButNotGoodCookies()
+ {
+ $actionCart = $this->actionCart;
+
+ $request = $this->request;
+
+ $token = "WrongToken";
+ $request->cookies->set("thelia_cart", $token);
+
+ $cart = $actionCart->getCart($request);
+ $this->assertInstanceOf("Thelia\Model\Cart", $cart, '$cart must be an instance of cart model Thelia\Model\Cart');
+ $this->assertNull($cart->getCustomerId());
+ $this->assertNull($cart->getAddressDeliveryId());
+ $this->assertNull($cart->getAddressInvoiceId());
+ $this->assertNotEquals($token, $cart->getToken());
+ }
+
+ /**
+ * cart and customer already exists. Cart and customer are linked.
+ *
+ * cart in session must be return
+ */
+ public function testGetCartWithExistingCartAndCustomer()
+ {
+ $actionCart = $this->actionCart;
+
+ $request = $this->request;
+
+
+ //create a fake customer just for test. If not persists test fails !
+ $customer = new Customer();
+ $customer->setFirstname("john");
+ $customer->setLastname("doe");
+ $customer->setTitleId(1);
+ $customer->save();
+
+ $uniqid = uniqid("test2", true);
+ //create a fake cart in database;
+ $cart = new Cart();
+ $cart->setToken($uniqid);
+ $cart->setCustomer($customer);
+ $cart->save();
+
+ $request->cookies->set("thelia_cart", $uniqid);
+
+ $request->getSession()->setCustomerUser($customer);
+
+ $getCart = $actionCart->getCart($request);
+ $this->assertInstanceOf("Thelia\Model\Cart", $getCart, '$cart must be an instance of cart model Thelia\Model\Cart');
+ $this->assertNotNull($getCart->getCustomerId());
+ $this->assertNull($getCart->getAddressDeliveryId());
+ $this->assertNull($getCart->getAddressInvoiceId());
+ $this->assertEquals($cart->getToken(), $getCart->getToken(), "token must be the same");
+ $this->assertEquals($customer->getId(), $getCart->getCustomerId());
+ }
+
+ /**
+ * Customer is connected but cart not associated to him
+ *
+ * A new cart must be created (duplicated) containing customer id
+ */
+ public function testGetCartWithExistinsCartAndCustomerButNotSameCustomerId()
+ {
+ $actionCart = $this->actionCart;
+
+ $request = $this->request;
+
+
+ //create a fake customer just for test. If not persists test fails !
+ $customer = new Customer();
+ $customer->setFirstname("john");
+ $customer->setLastname("doe");
+ $customer->setTitleId(1);
+ $customer->save();
+
+ $uniqid = uniqid("test3", true);
+ //create a fake cart in database;
+ $cart = new Cart();
+ $cart->setToken($uniqid);
+
+ $cart->save();
+
+ $request->cookies->set("thelia_cart", $uniqid);
+
+ $request->getSession()->setCustomerUser($customer);
+
+ $getCart = $actionCart->getCart($request);
+ $this->assertInstanceOf("Thelia\Model\Cart", $getCart, '$cart must be an instance of cart model Thelia\Model\Cart');
+ $this->assertNotNull($getCart->getCustomerId());
+ $this->assertNull($getCart->getAddressDeliveryId());
+ $this->assertNull($getCart->getAddressInvoiceId());
+ $this->assertNotEquals($cart->getToken(), $getCart->getToken(), "token must be different");
+ $this->assertEquals($customer->getId(), $getCart->getCustomerId());
+ }
+
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Tests/Command/BaseCommandTest.php b/core/lib/Thelia/Tests/Command/BaseCommandTest.php
index ca9d0a632..356478ab9 100644
--- a/core/lib/Thelia/Tests/Command/BaseCommandTest.php
+++ b/core/lib/Thelia/Tests/Command/BaseCommandTest.php
@@ -1,12 +1,25 @@
. */
+/* */
+/*************************************************************************************/
namespace Thelia\Tests\Command;
diff --git a/core/lib/Thelia/Tests/Core/HttpFoundation/Session/SessionTest.php b/core/lib/Thelia/Tests/Core/HttpFoundation/Session/SessionTest.php
new file mode 100644
index 000000000..67fbfd1c2
--- /dev/null
+++ b/core/lib/Thelia/Tests/Core/HttpFoundation/Session/SessionTest.php
@@ -0,0 +1,136 @@
+. */
+/* */
+/*************************************************************************************/
+
+namespace Thelia\Tests\Core\HttpFoundation\Session;
+
+use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
+use Thelia\Core\HttpFoundation\Session\Session;
+use Thelia\Model\Cart;
+use Thelia\Model\Customer;
+
+class SessionTest extends \PHPUnit_Framework_TestCase
+{
+
+ protected $session;
+
+ public function setUp()
+ {
+ $this->session = new Session(new MockArraySessionStorage());
+ }
+
+ public function testGetCartWithoutExistingCart()
+ {
+ $session = $this->session;
+
+ $cart = $session->getCart();
+
+ $this->assertNull($cart);
+ }
+
+ public function testGetCartWithExistingCartWithoutCustomerConnected()
+ {
+ $session = $this->session;
+
+ $testCart = new Cart();
+ $testCart->setToken(uniqid("testSessionGetCart1", true));
+ $testCart->save();
+
+ $session->setCart($testCart->getId());
+
+ $cart = $session->getCart();
+
+ $this->assertNotNull($cart);
+ $this->assertInstanceOf("\Thelia\Model\Cart", $cart, '$cart must be an instance of Thelia\Model\Cart');
+ $this->assertEquals($testCart->getToken(), $cart->getToken());
+
+ }
+
+ public function testGetCartWithExistingCustomerButNoCart()
+ {
+ $session = $this->session;
+
+ //create a fake customer just for test. If not persists test fails !
+ $customer = new Customer();
+ $customer->setFirstname("john test session");
+ $customer->setLastname("doe");
+ $customer->setTitleId(1);
+ $customer->save();
+
+ $session->setCustomerUser($customer);
+
+ $cart = $session->getCart();
+
+ $this->assertNull($cart);
+ }
+
+ public function testGetCartWithExistingCartAndCustomerButWithoutReferenceToCustomerInCart()
+ {
+ $session = $this->session;
+
+ //create a fake customer just for test. If not persists test fails !
+ $customer = new Customer();
+ $customer->setFirstname("john test session");
+ $customer->setLastname("doe");
+ $customer->setTitleId(1);
+ $customer->save();
+
+ $session->setCustomerUser($customer);
+
+ $testCart = new Cart();
+ $testCart->setToken(uniqid("testSessionGetCart2", true));
+ $testCart->save();
+
+ $session->setCart($testCart->getId());
+
+ $cart = $session->getCart();
+
+ $this->assertNull($cart);
+ }
+
+ public function testGetCartWithExistingCartAndCustomerAndReferencesEachOther()
+ {
+ $session = $this->session;
+
+ //create a fake customer just for test. If not persists test fails !
+ $customer = new Customer();
+ $customer->setFirstname("john test session");
+ $customer->setLastname("doe");
+ $customer->setTitleId(1);
+ $customer->save();
+
+ $session->setCustomerUser($customer);
+
+ $testCart = new Cart();
+ $testCart->setToken(uniqid("testSessionGetCart3", true));
+ $testCart->setCustomerId($customer->getId());
+ $testCart->save();
+
+ $session->setCart($testCart->getId());
+
+ $cart = $session->getCart();
+
+ $this->assertNotNull($cart);
+ $this->assertInstanceOf("\Thelia\Model\Cart", $cart, '$cart must be an instance of Thelia\Model\Cart');
+ }
+
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Tests/Form/CartAddTest.php b/core/lib/Thelia/Tests/Form/CartAddTest.php
new file mode 100644
index 000000000..d584c45d3
--- /dev/null
+++ b/core/lib/Thelia/Tests/Form/CartAddTest.php
@@ -0,0 +1,33 @@
+. */
+/* */
+/*************************************************************************************/
+namespace Thelia\Tests\Form;
+
+
+class CartAddTest extends \PHPUnit_Framework_TestCase
+{
+
+ public function testSimpleAddingToCart()
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/install/faker.php b/install/faker.php
index 925e83e5c..52572dc81 100755
--- a/install/faker.php
+++ b/install/faker.php
@@ -7,6 +7,9 @@ $faker = Faker\Factory::create();
$con = \Propel\Runtime\Propel::getConnection(Thelia\Model\Map\ProductTableMap::DATABASE_NAME);
$con->beginTransaction();
+
+$currency = \Thelia\Model\CurrencyQuery::create()->filterByCode('EUR')->findOne();
+
try {
$category = Thelia\Model\CategoryQuery::create()
@@ -52,13 +55,25 @@ try {
$product->addCategory($sweet);
$product->setTitle($faker->bs);
$product->setDescription($faker->text(250));
- $product->setQuantity($faker->randomNumber(1,50));
- $product->setPrice($faker->randomFloat(2, 20, 2500));
+/* $product->setQuantity($faker->randomNumber(1,50));
+ $product->setPrice($faker->randomFloat(2, 20, 2500));*/
$product->setVisible(1);
$product->setPosition($i);
$product->setRef($faker->text(255));
$product->save();
+ $stock = new \Thelia\Model\Stock();
+ $stock->setProduct($product);
+ $stock->setQuantity($faker->randomNumber(1,50));
+ $stock->setPromo($faker->randomNumber(0,1));
+ $stock->save();
+
+ $productPrice = new \Thelia\Model\ProductPrice();
+ $productPrice->setStock($stock);
+ $productPrice->setCurrency($currency);
+ $productPrice->setPrice($faker->randomFloat(2, 20, 2500));
+ $productPrice->save();
+
}
for ($i=1; $i <= 5; $i++) {
@@ -66,13 +81,25 @@ try {
$product->addCategory($jeans);
$product->setTitle($faker->bs);
$product->setDescription($faker->text(250));
- $product->setQuantity($faker->randomNumber(1,50));
- $product->setPrice($faker->randomFloat(2, 20, 2500));
+/* $product->setQuantity($faker->randomNumber(1,50));
+ $product->setPrice($faker->randomFloat(2, 20, 2500));*/
$product->setVisible(1);
$product->setPosition($i);
$product->setRef($faker->text(255));
$product->save();
+ $stock = new \Thelia\Model\Stock();
+ $stock->setProduct($product);
+ $stock->setQuantity($faker->randomNumber(1,50));
+ $stock->setPromo($faker->randomNumber(0,1));
+ $stock->save();
+
+ $productPrice = new \Thelia\Model\ProductPrice();
+ $productPrice->setStock($stock);
+ $productPrice->setCurrency($currency);
+ $productPrice->setPrice($faker->randomFloat(2, 20, 2500));
+ $productPrice->save();
+
}
diff --git a/install/insert.sql b/install/insert.sql
index fb6b68ab9..6518462c4 100755
--- a/install/insert.sql
+++ b/install/insert.sql
@@ -5,7 +5,8 @@ INSERT INTO `lang`(`id`,`title`,`code`,`locale`,`url`,`by_default`,`created_at`,
(4, 'Italiano', 'it', 'it_IT', '','0', NOW(), NOW());
INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES
-('session_config.default', '1', 1, 1, NOW(), NOW());
+('session_config.default', '1', 1, 1, NOW(), NOW()),
+('verifyStock', '1', 1, 0, NOW(), NOW());
INSERT INTO `module` (`code`, `type`, `activate`, `position`, `created_at`, `updated_at`) VALUES ('test', '1', '1', '1', NOW(), NOW());
@@ -22,3 +23,1075 @@ INSERT INTO `customer_title_i18n` (`id`, `locale`, `short`, `long`) VALUES
(3, 'en_US', 'Miss', 'Miss'),
(3, 'fr_FR', 'Mlle', 'Madamemoiselle');
+INSERT INTO `currency` (`id` ,`code` ,`symbol` ,`rate` ,`by_default` ,`created_at` ,`updated_at`)
+VALUES
+(1, 'EUR', '€', '1', '1', NOW() , NOW()),
+(2, 'USD', '$', '1.26', '0', NOW(), NOW()),
+(3, 'GBP', '£', '0.89', '0', NOW(), NOW());
+
+INSERT INTO `currency_i18n` (`id` ,`locale` ,`name`)
+VALUES
+(1, 'en_US', 'euro'),
+(2, 'en_US', 'dollar'),
+(3, 'en_US', 'pound');
+
+
+INSERT INTO `country` (`id`, `area_id`, `isocode`, `isoalpha2`, `isoalpha3`, `created_at`, `updated_at`) VALUES
+(1, NULL, '4', 'AF', 'AFG', NOW(), NOW()),
+(2, NULL, '710', 'ZA', 'ZAF', NOW(), NOW()),
+(3, NULL, '8', 'AL', 'ALB', NOW(), NOW()),
+(4, NULL, '12', 'DZ', 'DZA', NOW(), NOW()),
+(5, NULL, '276', 'DE', 'DEU', NOW(), NOW()),
+(6, NULL, '20', 'AD', 'AND', NOW(), NOW()),
+(7, NULL, '24', 'AO', 'AGO', NOW(), NOW()),
+(8, NULL, '28', 'AG', 'ATG', NOW(), NOW()),
+(9, NULL, '682', 'SA', 'SAU', NOW(), NOW()),
+(10, NULL, '32', 'AR', 'ARG', NOW(), NOW()),
+(11, NULL, '51', 'AM', 'ARM', NOW(), NOW()),
+(12, NULL, '36', 'AU', 'AUS', NOW(), NOW()),
+(13, NULL, '40', 'AT', 'AUT', NOW(), NOW()),
+(14, NULL, '31', 'AZ', 'AZE', NOW(), NOW()),
+(15, NULL, '44', 'BS', 'BHS', NOW(), NOW()),
+(16, NULL, '48', 'BR', 'BHR', NOW(), NOW()),
+(17, NULL, '50', 'BD', 'BGD', NOW(), NOW()),
+(18, NULL, '52', 'BB', 'BRB', NOW(), NOW()),
+(19, NULL, '585', 'PW', 'PLW', NOW(), NOW()),
+(20, NULL, '56', 'BE', 'BEL', NOW(), NOW()),
+(21, NULL, '84', 'BL', 'BLZ', NOW(), NOW()),
+(22, NULL, '204', 'BJ', 'BEN', NOW(), NOW()),
+(23, NULL, '64', 'BT', 'BTN', NOW(), NOW()),
+(24, NULL, '112', 'BY', 'BLR', NOW(), NOW()),
+(25, NULL, '104', 'MM', 'MMR', NOW(), NOW()),
+(26, NULL, '68', 'BO', 'BOL', NOW(), NOW()),
+(27, NULL, '70', 'BA', 'BIH', NOW(), NOW()),
+(28, NULL, '72', 'BW', 'BWA', NOW(), NOW()),
+(29, NULL, '76', 'BR', 'BRA', NOW(), NOW()),
+(30, NULL, '96', 'BN', 'BRN', NOW(), NOW()),
+(31, NULL, '100', 'BG', 'BGR', NOW(), NOW()),
+(32, NULL, '854', 'BF', 'BFA', NOW(), NOW()),
+(33, NULL, '108', 'BI', 'BDI', NOW(), NOW()),
+(34, NULL, '116', 'KH', 'KHM', NOW(), NOW()),
+(35, NULL, '120', 'CM', 'CMR', NOW(), NOW()),
+(37, NULL, '132', 'CV', 'CPV', NOW(), NOW()),
+(38, NULL, '152', 'CL', 'CHL', NOW(), NOW()),
+(39, NULL, '156', 'CN', 'CHN', NOW(), NOW()),
+(40, NULL, '196', 'CY', 'CYP', NOW(), NOW()),
+(41, NULL, '170', 'CO', 'COL', NOW(), NOW()),
+(42, NULL, '174', 'KM', 'COM', NOW(), NOW()),
+(43, NULL, '178', 'CG', 'COG', NOW(), NOW()),
+(44, NULL, '184', 'CK', 'COK', NOW(), NOW()),
+(45, NULL, '408', 'KP', 'PRK', NOW(), NOW()),
+(46, NULL, '410', 'KR', 'KOR', NOW(), NOW()),
+(47, NULL, '188', 'CR', 'CRI', NOW(), NOW()),
+(48, NULL, '384', 'CI', 'CIV', NOW(), NOW()),
+(49, NULL, '191', 'HR', 'HRV', NOW(), NOW()),
+(50, NULL, '192', 'CU', 'CUB', NOW(), NOW()),
+(51, NULL, '208', 'DK', 'DNK', NOW(), NOW()),
+(52, NULL, '262', 'DJ', 'DJI', NOW(), NOW()),
+(53, NULL, '212', 'DM', 'DMA', NOW(), NOW()),
+(54, NULL, '818', 'EG', 'EGY', NOW(), NOW()),
+(55, NULL, '784', 'AE', 'ARE', NOW(), NOW()),
+(56, NULL, '218', 'EC', 'ECU', NOW(), NOW()),
+(57, NULL, '232', 'ER', 'ERI', NOW(), NOW()),
+(58, NULL, '724', 'ES', 'ESP', NOW(), NOW()),
+(59, NULL, '233', 'EE', 'EST', NOW(), NOW()),
+(61, NULL, '231', 'ET', 'ETH', NOW(), NOW()),
+(62, NULL, '242', 'FJ', 'FJI', NOW(), NOW()),
+(63, NULL, '246', 'FI', 'FIN', NOW(), NOW()),
+(64, NULL, '250', 'FR', 'FRA', NOW(), NOW()),
+(65, NULL, '266', 'GA', 'GAB', NOW(), NOW()),
+(66, NULL, '270', 'GM', 'GMB', NOW(), NOW()),
+(67, NULL, '268', 'GE', 'GEO', NOW(), NOW()),
+(68, NULL, '288', 'GH', 'GHA', NOW(), NOW()),
+(69, NULL, '300', 'GR', 'GRC', NOW(), NOW()),
+(70, NULL, '308', 'GD', 'GRD', NOW(), NOW()),
+(71, NULL, '320', 'GT', 'GTM', NOW(), NOW()),
+(72, NULL, '324', 'GN', 'GIN', NOW(), NOW()),
+(73, NULL, '624', 'GW', 'GNB', NOW(), NOW()),
+(74, NULL, '226', 'GQ', 'GNQ', NOW(), NOW()),
+(75, NULL, '328', 'GY', 'GUY', NOW(), NOW()),
+(76, NULL, '332', 'HT', 'HTI', NOW(), NOW()),
+(77, NULL, '340', 'HN', 'HND', NOW(), NOW()),
+(78, NULL, '348', 'HU', 'HUN', NOW(), NOW()),
+(79, NULL, '356', 'IN', 'IND', NOW(), NOW()),
+(80, NULL, '360', 'ID', 'IDN', NOW(), NOW()),
+(81, NULL, '364', 'IR', 'IRN', NOW(), NOW()),
+(82, NULL, '368', 'IQ', 'IRQ', NOW(), NOW()),
+(83, NULL, '372', 'IE', 'IRL', NOW(), NOW()),
+(84, NULL, '352', 'IS', 'ISL', NOW(), NOW()),
+(85, NULL, '376', 'IL', 'ISR', NOW(), NOW()),
+(86, NULL, '380', 'IT', 'ITA', NOW(), NOW()),
+(87, NULL, '388', 'JM', 'JAM', NOW(), NOW()),
+(88, NULL, '392', 'JP', 'JPN', NOW(), NOW()),
+(89, NULL, '400', 'JO', 'JOR', NOW(), NOW()),
+(90, NULL, '398', 'KZ', 'KAZ', NOW(), NOW()),
+(91, NULL, '404', 'KE', 'KEN', NOW(), NOW()),
+(92, NULL, '417', 'KG', 'KGZ', NOW(), NOW()),
+(93, NULL, '296', 'KI', 'KIR', NOW(), NOW()),
+(94, NULL, '414', 'KW', 'KWT', NOW(), NOW()),
+(95, NULL, '418', 'LA', 'LAO', NOW(), NOW()),
+(96, NULL, '426', 'LS', 'LSO', NOW(), NOW()),
+(97, NULL, '428', 'LV', 'LVA', NOW(), NOW()),
+(98, NULL, '422', 'LB', 'LBN', NOW(), NOW()),
+(99, NULL, '430', 'LR', 'LBR', NOW(), NOW()),
+(100, NULL, '343', 'LY', 'LBY', NOW(), NOW()),
+(101, NULL, '438', 'LI', 'LIE', NOW(), NOW()),
+(102, NULL, '440', 'LT', 'LTU', NOW(), NOW()),
+(103, NULL, '442', 'LU', 'LUX', NOW(), NOW()),
+(104, NULL, '807', 'MK', 'MKD', NOW(), NOW()),
+(105, NULL, '450', 'MD', 'MDG', NOW(), NOW()),
+(106, NULL, '458', 'MY', 'MYS', NOW(), NOW()),
+(107, NULL, '454', 'MW', 'MWI', NOW(), NOW()),
+(108, NULL, '462', 'MV', 'MDV', NOW(), NOW()),
+(109, NULL, '466', 'ML', 'MLI', NOW(), NOW()),
+(110, NULL, '470', 'MT', 'MLT', NOW(), NOW()),
+(111, NULL, '504', 'MA', 'MAR', NOW(), NOW()),
+(112, NULL, '584', 'MH', 'MHL', NOW(), NOW()),
+(113, NULL, '480', 'MU', 'MUS', NOW(), NOW()),
+(114, NULL, '478', 'MR', 'MRT', NOW(), NOW()),
+(115, NULL, '484', 'MX', 'MEX', NOW(), NOW()),
+(116, NULL, '583', 'FM', 'FSM', NOW(), NOW()),
+(117, NULL, '498', 'MD', 'MDA', NOW(), NOW()),
+(118, NULL, '492', 'MC', 'MCO', NOW(), NOW()),
+(119, NULL, '496', 'MN', 'MNG', NOW(), NOW()),
+(120, NULL, '508', 'MZ', 'MOZ', NOW(), NOW()),
+(121, NULL, '516', 'NA', 'NAM', NOW(), NOW()),
+(122, NULL, '520', 'NR', 'NRU', NOW(), NOW()),
+(123, NULL, '524', 'NP', 'NPL', NOW(), NOW()),
+(124, NULL, '558', 'NI', 'NIC', NOW(), NOW()),
+(125, NULL, '562', 'NE', 'NER', NOW(), NOW()),
+(126, NULL, '566', 'NG', 'NGA', NOW(), NOW()),
+(127, NULL, '570', 'NU', 'NIU', NOW(), NOW()),
+(128, NULL, '578', 'NO', 'NOR', NOW(), NOW()),
+(129, NULL, '554', 'NZ', 'NZL', NOW(), NOW()),
+(130, NULL, '512', 'OM', 'OMN', NOW(), NOW()),
+(131, NULL, '800', 'UG', 'UGA', NOW(), NOW()),
+(132, NULL, '860', 'UZ', 'UZB', NOW(), NOW()),
+(133, NULL, '586', 'PK', 'PAK', NOW(), NOW()),
+(134, NULL, '591', 'PA', 'PAN', NOW(), NOW()),
+(135, NULL, '598', 'PG', 'PNG', NOW(), NOW()),
+(136, NULL, '600', 'PY', 'PRY', NOW(), NOW()),
+(137, NULL, '528', 'NL', 'NLD', NOW(), NOW()),
+(138, NULL, '604', 'PE', 'PER', NOW(), NOW()),
+(139, NULL, '608', 'PH', 'PHL', NOW(), NOW()),
+(140, NULL, '616', 'PL', 'POL', NOW(), NOW()),
+(141, NULL, '620', 'PT', 'PRT', NOW(), NOW()),
+(142, NULL, '634', 'QA', 'QAT', NOW(), NOW()),
+(143, NULL, '140', 'CF', 'CAF', NOW(), NOW()),
+(144, NULL, '214', 'DO', 'DOM', NOW(), NOW()),
+(145, NULL, '203', 'CZ', 'CZE', NOW(), NOW()),
+(146, NULL, '642', 'RO', 'ROU', NOW(), NOW()),
+(147, NULL, '826', 'GB', 'GBR', NOW(), NOW()),
+(148, NULL, '643', 'RU', 'RUS', NOW(), NOW()),
+(149, NULL, '646', 'RW', 'RWA', NOW(), NOW()),
+(150, NULL, '659', 'KN', 'KNA', NOW(), NOW()),
+(151, NULL, '662', 'LC', 'LCA', NOW(), NOW()),
+(152, NULL, '674', 'SM', 'SMR', NOW(), NOW()),
+(153, NULL, '670', 'VC', 'VCT', NOW(), NOW()),
+(154, NULL, '90', 'SB', 'SLB', NOW(), NOW()),
+(155, NULL, '222', 'SV', 'SLV', NOW(), NOW()),
+(156, NULL, '882', 'WS', 'WSM', NOW(), NOW()),
+(157, NULL, '678', 'ST', 'STP', NOW(), NOW()),
+(158, NULL, '686', 'SN', 'SEN', NOW(), NOW()),
+(159, NULL, '690', 'SC', 'SYC', NOW(), NOW()),
+(160, NULL, '694', 'SL', 'SLE', NOW(), NOW()),
+(161, NULL, '702', 'SG', 'SGP', NOW(), NOW()),
+(162, NULL, '703', 'SK', 'SVK', NOW(), NOW()),
+(163, NULL, '705', 'SI', 'SVN', NOW(), NOW()),
+(164, NULL, '706', 'SO', 'SOM', NOW(), NOW()),
+(165, NULL, '729', 'SD', 'SDN', NOW(), NOW()),
+(166, NULL, '144', 'LK', 'LKA', NOW(), NOW()),
+(167, NULL, '752', 'SE', 'SWE', NOW(), NOW()),
+(168, NULL, '756', 'CH', 'CHE', NOW(), NOW()),
+(169, NULL, '740', 'SR', 'SUR', NOW(), NOW()),
+(170, NULL, '748', 'SZ', 'SWZ', NOW(), NOW()),
+(171, NULL, '760', 'SY', 'SYR', NOW(), NOW()),
+(172, NULL, '762', 'TJ', 'TJK', NOW(), NOW()),
+(173, NULL, '834', 'TZ', 'TZA', NOW(), NOW()),
+(174, NULL, '148', 'TD', 'TCD', NOW(), NOW()),
+(175, NULL, '764', 'TH', 'THA', NOW(), NOW()),
+(176, NULL, '768', 'TG', 'TGO', NOW(), NOW()),
+(177, NULL, '776', 'TO', 'TON', NOW(), NOW()),
+(178, NULL, '780', 'TT', 'TTO', NOW(), NOW()),
+(179, NULL, '788', 'TN', 'TUN', NOW(), NOW()),
+(180, NULL, '795', 'TM', 'TKM', NOW(), NOW()),
+(181, NULL, '792', 'TR', 'TUR', NOW(), NOW()),
+(182, NULL, '798', 'TV', 'TUV', NOW(), NOW()),
+(183, NULL, '804', 'UA', 'UKR', NOW(), NOW()),
+(184, NULL, '858', 'UY', 'URY', NOW(), NOW()),
+(185, NULL, '336', 'VA', 'VAT', NOW(), NOW()),
+(186, NULL, '548', 'VU', 'VUT', NOW(), NOW()),
+(187, NULL, '862', 'VE', 'VEN', NOW(), NOW()),
+(188, NULL, '704', 'VN', 'VNM', NOW(), NOW()),
+(189, NULL, '887', 'YE', 'YEM', NOW(), NOW()),
+(190, NULL, '807', 'MK', 'MKD', NOW(), NOW()),
+(191, NULL, '180', 'CD', 'COD', NOW(), NOW()),
+(192, NULL, '894', 'ZM', 'ZMB', NOW(), NOW()),
+(193, NULL, '716', 'ZW', 'ZWE', NOW(), NOW()),
+(196, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(197, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(198, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(199, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(200, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(201, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(202, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(203, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(204, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(205, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(206, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(207, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(208, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(209, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(210, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(211, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(212, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(213, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(214, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(215, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(216, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(217, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(218, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(219, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(220, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(221, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(222, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(223, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(224, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(225, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(226, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(227, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(228, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(229, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(230, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(231, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(232, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(233, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(234, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(235, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(236, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(237, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(238, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(239, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(240, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(241, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(242, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(243, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(244, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(245, NULL, '840', 'US', 'USA', NOW(), NOW()),
+(246, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(247, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(248, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(249, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(250, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(251, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(252, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(253, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(254, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(255, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(256, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(257, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(258, NULL, '124', 'CA', 'CAN', NOW(), NOW()),
+(259, NULL, '312', 'GP', 'GLP', NOW(), NOW()),
+(260, NULL, '254', 'GF', 'GUF', NOW(), NOW()),
+(261, NULL, '474', 'MQ', 'MTQ', NOW(), NOW()),
+(262, NULL, '175', 'YT', 'MYT', NOW(), NOW()),
+(263, NULL, '638', 'RE', 'REU', NOW(), NOW()),
+(264, NULL, '666', 'PM', 'SPM', NOW(), NOW()),
+(265, NULL, '540', 'NC', 'NCL', NOW(), NOW()),
+(266, NULL, '258', 'PF', 'PYF', NOW(), NOW()),
+(267, NULL, '876', 'WF', 'WLF', NOW(), NOW()),
+(268, NULL, '840', 'US', 'USA', NOW(), NOW());
+
+INSERT INTO `country_i18n` (`id`, `locale`, `title`, `description`, `chapo`, `postscriptum`) VALUES
+(1, 'en_US', 'Afghanistan', '', '', ''),
+(1, 'es_ES', 'Afganistán', '', '', ''),
+(1, 'fr_FR', 'Afghanistan', '', '', ''),
+(2, 'en_US', 'South Africa', '', '', ''),
+(2, 'es_ES', 'Sudáfrica', '', '', ''),
+(2, 'fr_FR', 'Afrique du Sud', '', '', ''),
+(3, 'en_US', 'Albania', '', '', ''),
+(3, 'es_ES', 'Albania', '', '', ''),
+(3, 'fr_FR', 'Albanie', '', '', ''),
+(4, 'en_US', 'Algeria', '', '', ''),
+(4, 'es_ES', 'Argelia', '', '', ''),
+(4, 'fr_FR', 'Algérie', '', '', ''),
+(5, 'en_US', 'Germany', '', '', ''),
+(5, 'es_ES', 'Alemania', '', '', ''),
+(5, 'fr_FR', 'Allemagne', '', '', ''),
+(6, 'en_US', 'Andorra', '', '', ''),
+(6, 'es_ES', 'Andorra', '', '', ''),
+(6, 'fr_FR', 'Andorre', '', '', ''),
+(7, 'en_US', 'Angola', '', '', ''),
+(7, 'es_ES', 'Angola', '', '', ''),
+(7, 'fr_FR', 'Angola', '', '', ''),
+(8, 'en_US', 'Antigua and Barbuda', '', '', ''),
+(8, 'es_ES', 'Antigua y Barbuda', '', '', ''),
+(8, 'fr_FR', 'Antigua-et-Barbuda', '', '', ''),
+(9, 'en_US', 'Saudi Arabia', '', '', ''),
+(9, 'es_ES', 'Arabia Saudita', '', '', ''),
+(9, 'fr_FR', 'Arabie saoudite', '', '', ''),
+(10, 'en_US', 'Argentina', '', '', ''),
+(10, 'es_ES', 'Argentina', '', '', ''),
+(10, 'fr_FR', 'Argentine', '', '', ''),
+(11, 'en_US', 'Armenia', '', '', ''),
+(11, 'es_ES', 'Armenia', '', '', ''),
+(11, 'fr_FR', 'Arménie', '', '', ''),
+(12, 'en_US', 'Australia', '', '', ''),
+(12, 'es_ES', 'Australia', '', '', ''),
+(12, 'fr_FR', 'Australie', '', '', ''),
+(13, 'en_US', 'Austria', '', '', ''),
+(13, 'es_ES', 'Austria', '', '', ''),
+(13, 'fr_FR', 'Autriche', '', '', ''),
+(14, 'en_US', 'Azerbaijan', '', '', ''),
+(14, 'es_ES', 'Azerbaiyán', '', '', ''),
+(14, 'fr_FR', 'Azerbaïdjan', '', '', ''),
+(15, 'en_US', 'Bahamas', '', '', ''),
+(15, 'es_ES', 'Bahamas', '', '', ''),
+(15, 'fr_FR', 'Bahamas', '', '', ''),
+(16, 'en_US', 'Bahrain', '', '', ''),
+(16, 'es_ES', 'Bahrein', '', '', ''),
+(16, 'fr_FR', 'Bahreïn', '', '', ''),
+(17, 'en_US', 'Bangladesh', '', '', ''),
+(17, 'es_ES', 'Bangladesh', '', '', ''),
+(17, 'fr_FR', 'Bangladesh', '', '', ''),
+(18, 'en_US', 'Barbados', '', '', ''),
+(18, 'es_ES', 'Barbados', '', '', ''),
+(18, 'fr_FR', 'Barbade', '', '', ''),
+(19, 'en_US', 'Belarus', '', '', ''),
+(19, 'es_ES', 'Belarús', '', '', ''),
+(19, 'fr_FR', 'Belau', '', '', ''),
+(20, 'en_US', 'Belgium', '', '', ''),
+(20, 'es_ES', 'Bélgica', '', '', ''),
+(20, 'fr_FR', 'Belgique', '', '', ''),
+(21, 'en_US', 'Belize', '', '', ''),
+(21, 'es_ES', 'Belice', '', '', ''),
+(21, 'fr_FR', 'Belize', '', '', ''),
+(22, 'en_US', 'Benin', '', '', ''),
+(22, 'es_ES', 'Benin', '', '', ''),
+(22, 'fr_FR', 'Bénin', '', '', ''),
+(23, 'en_US', 'Bhutan', '', '', ''),
+(23, 'es_ES', 'Bhután', '', '', ''),
+(23, 'fr_FR', 'Bhoutan', '', '', ''),
+(24, 'en_US', 'Bielorussia', '', '', ''),
+(24, 'es_ES', 'Bielorusia', '', '', ''),
+(24, 'fr_FR', 'Biélorussie', '', '', ''),
+(25, 'en_US', 'Burma', '', '', ''),
+(25, 'es_ES', 'Birmania', '', '', ''),
+(25, 'fr_FR', 'Birmanie', '', '', ''),
+(26, 'en_US', 'Bolivia', '', '', ''),
+(26, 'es_ES', 'Bolivia', '', '', ''),
+(26, 'fr_FR', 'Bolivie', '', '', ''),
+(27, 'en_US', 'Bosnia and Herzegovina', '', '', ''),
+(27, 'es_ES', 'Bosnia y Herzegovina', '', '', ''),
+(27, 'fr_FR', 'Bosnie-Herzégovine', '', '', ''),
+(28, 'en_US', 'Botswana', '', '', ''),
+(28, 'es_ES', 'Botswana', '', '', ''),
+(28, 'fr_FR', 'Botswana', '', '', ''),
+(29, 'en_US', 'Brazil', '', '', ''),
+(29, 'es_ES', 'Brasil', '', '', ''),
+(29, 'fr_FR', 'Brésil', '', '', ''),
+(30, 'en_US', 'Brunei', '', '', ''),
+(30, 'es_ES', 'Brunei', '', '', ''),
+(30, 'fr_FR', 'Brunei', '', '', ''),
+(31, 'en_US', 'Bulgaria', '', '', ''),
+(31, 'es_ES', 'Bulgaria', '', '', ''),
+(31, 'fr_FR', 'Bulgarie', '', '', ''),
+(32, 'en_US', 'Burkina', '', '', ''),
+(32, 'es_ES', 'Burkina', '', '', ''),
+(32, 'fr_FR', 'Burkina', '', '', ''),
+(33, 'en_US', 'Burundi', '', '', ''),
+(33, 'es_ES', 'Burundi', '', '', ''),
+(33, 'fr_FR', 'Burundi', '', '', ''),
+(34, 'en_US', 'Cambodia', '', '', ''),
+(34, 'es_ES', 'Camboya', '', '', ''),
+(34, 'fr_FR', 'Cambodge', '', '', ''),
+(35, 'en_US', 'Cameroon', '', '', ''),
+(35, 'es_ES', 'Camerún', '', '', ''),
+(35, 'fr_FR', 'Cameroun', '', '', ''),
+(37, 'en_US', 'Cape Verde', '', '', ''),
+(37, 'es_ES', 'Cabo Verde', '', '', ''),
+(37, 'fr_FR', 'Cap-Vert', '', '', ''),
+(38, 'en_US', 'Chile', '', '', ''),
+(38, 'es_ES', 'Chile', '', '', ''),
+(38, 'fr_FR', 'Chili', '', '', ''),
+(39, 'en_US', 'China', '', '', ''),
+(39, 'es_ES', 'China', '', '', ''),
+(39, 'fr_FR', 'Chine', '', '', ''),
+(40, 'en_US', 'Cyprus', '', '', ''),
+(40, 'es_ES', 'Chipre', '', '', ''),
+(40, 'fr_FR', 'Chypre', '', '', ''),
+(41, 'en_US', 'Colombia', '', '', ''),
+(41, 'es_ES', 'Colombia', '', '', ''),
+(41, 'fr_FR', 'Colombie', '', '', ''),
+(42, 'en_US', 'Comoros', '', '', ''),
+(42, 'es_ES', 'Comoras', '', '', ''),
+(42, 'fr_FR', 'Comores', '', '', ''),
+(43, 'en_US', 'Congo', '', '', ''),
+(43, 'es_ES', 'Congo', '', '', ''),
+(43, 'fr_FR', 'Congo', '', '', ''),
+(44, 'en_US', 'Cook Islands', '', '', ''),
+(44, 'es_ES', 'Cook', '', '', ''),
+(44, 'fr_FR', 'Cook', '', '', ''),
+(45, 'en_US', 'North Korea', '', '', ''),
+(45, 'es_ES', 'Corea del Norte', '', '', ''),
+(45, 'fr_FR', 'Corée du Nord', '', '', ''),
+(46, 'en_US', 'South Korea', '', '', ''),
+(46, 'es_ES', 'Corea del Sur', '', '', ''),
+(46, 'fr_FR', 'Corée du Sud', '', '', ''),
+(47, 'en_US', 'Costa Rica', '', '', ''),
+(47, 'es_ES', 'Costa Rica', '', '', ''),
+(47, 'fr_FR', 'Costa Rica', '', '', ''),
+(48, 'en_US', 'Ivory Coast', '', '', ''),
+(48, 'es_ES', 'Costa de Marfil', '', '', ''),
+(48, 'fr_FR', 'Côte dIvoire', '', '', ''),
+(49, 'en_US', 'Croatia', '', '', ''),
+(49, 'es_ES', 'Croacia', '', '', ''),
+(49, 'fr_FR', 'Croatie', '', '', ''),
+(50, 'en_US', 'Cuba', '', '', ''),
+(50, 'es_ES', 'Cuba', '', '', ''),
+(50, 'fr_FR', 'Cuba', '', '', ''),
+(51, 'en_US', 'Denmark', '', '', ''),
+(51, 'es_ES', 'Dinamarca', '', '', ''),
+(51, 'fr_FR', 'Danemark', '', '', ''),
+(52, 'en_US', 'Djibouti', '', '', ''),
+(52, 'es_ES', 'Djibouti', '', '', ''),
+(52, 'fr_FR', 'Djibouti', '', '', ''),
+(53, 'en_US', 'Dominica', '', '', ''),
+(53, 'es_ES', 'Dominica', '', '', ''),
+(53, 'fr_FR', 'Dominique', '', '', ''),
+(54, 'en_US', 'Egypt', '', '', ''),
+(54, 'es_ES', 'Egipto', '', '', ''),
+(54, 'fr_FR', 'Égypte', '', '', ''),
+(55, 'en_US', 'United Arab Emirates', '', '', ''),
+(55, 'es_ES', 'Emiratos Árabes Unidos', '', '', ''),
+(55, 'fr_FR', 'Émirats arabes unis', '', '', ''),
+(56, 'en_US', 'Ecuador', '', '', ''),
+(56, 'es_ES', 'Ecuador', '', '', ''),
+(56, 'fr_FR', 'Équateur', '', '', ''),
+(57, 'en_US', 'Eritrea', '', '', ''),
+(57, 'es_ES', 'Eritrea', '', '', ''),
+(57, 'fr_FR', 'Érythrée', '', '', ''),
+(58, 'en_US', 'Spain', '', '', ''),
+(58, 'es_ES', 'España', '', '', ''),
+(58, 'fr_FR', 'Espagne', '', '', ''),
+(59, 'en_US', 'Estonia', '', '', ''),
+(59, 'es_ES', 'Estonia', '', '', ''),
+(59, 'fr_FR', 'Estonie', '', '', ''),
+(61, 'en_US', 'Ethiopia', '', '', ''),
+(61, 'es_ES', 'Etiopía', '', '', ''),
+(61, 'fr_FR', 'Éthiopie', '', '', ''),
+(62, 'en_US', 'Fiji', '', '', ''),
+(62, 'es_ES', 'Fiji', '', '', ''),
+(62, 'fr_FR', 'Fidji', '', '', ''),
+(63, 'en_US', 'Finland', '', '', ''),
+(63, 'es_ES', 'Finlandia', '', '', ''),
+(63, 'fr_FR', 'Finlande', '', '', ''),
+(64, 'en_US', 'France metropolitan', '', '', ''),
+(64, 'es_ES', 'Francia', '', '', ''),
+(64, 'fr_FR', 'France métropolitaine', '', '', ''),
+(65, 'en_US', 'Gabon', '', '', ''),
+(65, 'es_ES', 'Gabón', '', '', ''),
+(65, 'fr_FR', 'Gabon', '', '', ''),
+(66, 'en_US', 'Gambia', '', '', ''),
+(66, 'es_ES', 'Gambia', '', '', ''),
+(66, 'fr_FR', 'Gambie', '', '', ''),
+(67, 'en_US', 'Georgia', '', '', ''),
+(67, 'es_ES', 'Georgia', '', '', ''),
+(67, 'fr_FR', 'Géorgie', '', '', ''),
+(68, 'en_US', 'Ghana', '', '', ''),
+(68, 'es_ES', 'Ghana', '', '', ''),
+(68, 'fr_FR', 'Ghana', '', '', ''),
+(69, 'en_US', 'Greece', '', '', ''),
+(69, 'es_ES', 'Grecia', '', '', ''),
+(69, 'fr_FR', 'Grèce', '', '', ''),
+(70, 'en_US', 'Grenada', '', '', ''),
+(70, 'es_ES', 'Granada', '', '', ''),
+(70, 'fr_FR', 'Grenade', '', '', ''),
+(71, 'en_US', 'Guatemala', '', '', ''),
+(71, 'es_ES', 'Guatemala', '', '', ''),
+(71, 'fr_FR', 'Guatemala', '', '', ''),
+(72, 'en_US', 'Guinea', '', '', ''),
+(72, 'es_ES', 'Guinea', '', '', ''),
+(72, 'fr_FR', 'Guinée', '', '', ''),
+(73, 'en_US', 'Guinea-Bissau', '', '', ''),
+(73, 'es_ES', 'Guinea-Bissau', '', '', ''),
+(73, 'fr_FR', 'Guinée-Bissao', '', '', ''),
+(74, 'en_US', 'Equatorial Guinea', '', '', ''),
+(74, 'es_ES', 'Guinea Ecuatorial', '', '', ''),
+(74, 'fr_FR', 'Guinée équatoriale', '', '', ''),
+(75, 'en_US', 'Guyana', '', '', ''),
+(75, 'es_ES', 'Guyana', '', '', ''),
+(75, 'fr_FR', 'Guyana', '', '', ''),
+(76, 'en_US', 'Haiti', '', '', ''),
+(76, 'es_ES', 'Haití', '', '', ''),
+(76, 'fr_FR', 'Haïti', '', '', ''),
+(77, 'en_US', 'Honduras', '', '', ''),
+(77, 'es_ES', 'Honduras', '', '', ''),
+(77, 'fr_FR', 'Honduras', '', '', ''),
+(78, 'en_US', 'Hungary', '', '', ''),
+(78, 'es_ES', 'Hungría', '', '', ''),
+(78, 'fr_FR', 'Hongrie', '', '', ''),
+(79, 'en_US', 'India', '', '', ''),
+(79, 'es_ES', 'India', '', '', ''),
+(79, 'fr_FR', 'Inde', '', '', ''),
+(80, 'en_US', 'Indonesia', '', '', ''),
+(80, 'es_ES', 'Indonesia', '', '', ''),
+(80, 'fr_FR', 'Indonésie', '', '', ''),
+(81, 'en_US', 'Iran', '', '', ''),
+(81, 'es_ES', 'Irán', '', '', ''),
+(81, 'fr_FR', 'Iran', '', '', ''),
+(82, 'en_US', 'Iraq', '', '', ''),
+(82, 'es_ES', 'Iraq', '', '', ''),
+(82, 'fr_FR', 'Iraq', '', '', ''),
+(83, 'en_US', 'Ireland', '', '', ''),
+(83, 'es_ES', 'Irlanda', '', '', ''),
+(83, 'fr_FR', 'Irlande', '', '', ''),
+(84, 'en_US', 'Iceland', '', '', ''),
+(84, 'es_ES', 'Islandia', '', '', ''),
+(84, 'fr_FR', 'Islande', '', '', ''),
+(85, 'en_US', 'Israel', '', '', ''),
+(85, 'es_ES', 'Israel', '', '', ''),
+(85, 'fr_FR', 'Israël', '', '', ''),
+(86, 'en_US', 'Italy', '', '', ''),
+(86, 'es_ES', 'Italia', '', '', ''),
+(86, 'fr_FR', 'Italie', '', '', ''),
+(87, 'en_US', 'Jamaica', '', '', ''),
+(87, 'es_ES', 'Jamaica', '', '', ''),
+(87, 'fr_FR', 'Jamaïque', '', '', ''),
+(88, 'en_US', 'Japan', '', '', ''),
+(88, 'es_ES', 'Japón', '', '', ''),
+(88, 'fr_FR', 'Japon', '', '', ''),
+(89, 'en_US', 'Jordan', '', '', ''),
+(89, 'es_ES', 'Jordania', '', '', ''),
+(89, 'fr_FR', 'Jordanie', '', '', ''),
+(90, 'en_US', 'Kazakhstan', '', '', ''),
+(90, 'es_ES', 'Kazajstán', '', '', ''),
+(90, 'fr_FR', 'Kazakhstan', '', '', ''),
+(91, 'en_US', 'Kenya', '', '', ''),
+(91, 'es_ES', 'Kenia', '', '', ''),
+(91, 'fr_FR', 'Kenya', '', '', ''),
+(92, 'en_US', 'Kyrgyzstan', '', '', ''),
+(92, 'es_ES', 'Kirguistán', '', '', ''),
+(92, 'fr_FR', 'Kirghizistan', '', '', ''),
+(93, 'en_US', 'Kiribati', '', '', ''),
+(93, 'es_ES', 'Kiribati', '', '', ''),
+(93, 'fr_FR', 'Kiribati', '', '', ''),
+(94, 'en_US', 'Kuwait', '', '', ''),
+(94, 'es_ES', 'Kuwait', '', '', ''),
+(94, 'fr_FR', 'Koweït', '', '', ''),
+(95, 'en_US', 'Laos', '', '', ''),
+(95, 'es_ES', 'Laos', '', '', ''),
+(95, 'fr_FR', 'Laos', '', '', ''),
+(96, 'en_US', 'Lesotho', '', '', ''),
+(96, 'es_ES', 'Lesotho', '', '', ''),
+(96, 'fr_FR', 'Lesotho', '', '', ''),
+(97, 'en_US', 'Latvia', '', '', ''),
+(97, 'es_ES', 'Letonia', '', '', ''),
+(97, 'fr_FR', 'Lettonie', '', '', ''),
+(98, 'en_US', 'Lebanon', '', '', ''),
+(98, 'es_ES', 'Líbano', '', '', ''),
+(98, 'fr_FR', 'Liban', '', '', ''),
+(99, 'en_US', 'Liberia', '', '', ''),
+(99, 'es_ES', 'Liberia', '', '', ''),
+(99, 'fr_FR', 'Liberia', '', '', ''),
+(100, 'en_US', 'Libya', '', '', ''),
+(100, 'es_ES', 'Libia', '', '', ''),
+(100, 'fr_FR', 'Libye', '', '', ''),
+(101, 'en_US', 'Liechtenstein', '', '', ''),
+(101, 'es_ES', 'Liechtenstein', '', '', ''),
+(101, 'fr_FR', 'Liechtenstein', '', '', ''),
+(102, 'en_US', 'Lithuania', '', '', ''),
+(102, 'es_ES', 'Lituania', '', '', ''),
+(102, 'fr_FR', 'Lituanie', '', '', ''),
+(103, 'en_US', 'Luxembourg', '', '', ''),
+(103, 'es_ES', 'Luxemburgo', '', '', ''),
+(103, 'fr_FR', 'Luxembourg', '', '', ''),
+(104, 'en_US', 'Macedonia', '', '', ''),
+(104, 'es_ES', 'Macedonia', '', '', ''),
+(104, 'fr_FR', 'Macédoine', '', '', ''),
+(105, 'en_US', 'Madagascar', '', '', ''),
+(105, 'es_ES', 'Madagascar', '', '', ''),
+(105, 'fr_FR', 'Madagascar', '', '', ''),
+(106, 'en_US', 'Malaysia', '', '', ''),
+(106, 'es_ES', 'Malasia', '', '', ''),
+(106, 'fr_FR', 'Malaisie', '', '', ''),
+(107, 'en_US', 'Malawi', '', '', ''),
+(107, 'es_ES', 'Malawi', '', '', ''),
+(107, 'fr_FR', 'Malawi', '', '', ''),
+(108, 'en_US', 'Maldives', '', '', ''),
+(108, 'es_ES', 'Maldivas', '', '', ''),
+(108, 'fr_FR', 'Maldives', '', '', ''),
+(109, 'en_US', 'Mali', '', '', ''),
+(109, 'es_ES', 'Malí', '', '', ''),
+(109, 'fr_FR', 'Mali', '', '', ''),
+(110, 'en_US', 'Malta', '', '', ''),
+(110, 'es_ES', 'Malta', '', '', ''),
+(110, 'fr_FR', 'Malte', '', '', ''),
+(111, 'en_US', 'Morocco', '', '', ''),
+(111, 'es_ES', 'Marruecos', '', '', ''),
+(111, 'fr_FR', 'Maroc', '', '', ''),
+(112, 'en_US', 'Marshall Islands', '', '', ''),
+(112, 'es_ES', 'Marshall', '', '', ''),
+(112, 'fr_FR', 'Marshall', '', '', ''),
+(113, 'en_US', 'Mauritius', '', '', ''),
+(113, 'es_ES', 'Mauricio', '', '', ''),
+(113, 'fr_FR', 'Maurice', '', '', ''),
+(114, 'en_US', 'Mauritania', '', '', ''),
+(114, 'es_ES', 'Mauritania', '', '', ''),
+(114, 'fr_FR', 'Mauritanie', '', '', ''),
+(115, 'en_US', 'Mexico', '', '', ''),
+(115, 'es_ES', 'Méjico', '', '', ''),
+(115, 'fr_FR', 'Mexique', '', '', ''),
+(116, 'en_US', 'Micronesia', '', '', ''),
+(116, 'es_ES', 'Micronesia', '', '', ''),
+(116, 'fr_FR', 'Micronésie', '', '', ''),
+(117, 'en_US', 'Moldova', '', '', ''),
+(117, 'es_ES', 'Moldova', '', '', ''),
+(117, 'fr_FR', 'Moldavie', '', '', ''),
+(118, 'en_US', 'Monaco', '', '', ''),
+(118, 'es_ES', 'Mónaco', '', '', ''),
+(118, 'fr_FR', 'Monaco', '', '', ''),
+(119, 'en_US', 'Mongolia', '', '', ''),
+(119, 'es_ES', 'Mongolia', '', '', ''),
+(119, 'fr_FR', 'Mongolie', '', '', ''),
+(120, 'en_US', 'Mozambique', '', '', ''),
+(120, 'es_ES', 'Mozambique', '', '', ''),
+(120, 'fr_FR', 'Mozambique', '', '', ''),
+(121, 'en_US', 'Namibia', '', '', ''),
+(121, 'es_ES', 'Namibia', '', '', ''),
+(121, 'fr_FR', 'Namibie', '', '', ''),
+(122, 'en_US', 'Nauru', '', '', ''),
+(122, 'es_ES', 'Nauru', '', '', ''),
+(122, 'fr_FR', 'Nauru', '', '', ''),
+(123, 'en_US', 'Nepal', '', '', ''),
+(123, 'es_ES', 'Nepal', '', '', ''),
+(123, 'fr_FR', 'Népal', '', '', ''),
+(124, 'en_US', 'Nicaragua', '', '', ''),
+(124, 'es_ES', 'Nicaragua', '', '', ''),
+(124, 'fr_FR', 'Nicaragua', '', '', ''),
+(125, 'en_US', 'Niger', '', '', ''),
+(125, 'es_ES', 'Níger', '', '', ''),
+(125, 'fr_FR', 'Niger', '', '', ''),
+(126, 'en_US', 'Nigeria', '', '', ''),
+(126, 'es_ES', 'Nigeria', '', '', ''),
+(126, 'fr_FR', 'Nigeria', '', '', ''),
+(127, 'en_US', 'Niue', '', '', ''),
+(127, 'es_ES', 'Niue', '', '', ''),
+(127, 'fr_FR', 'Niue', '', '', ''),
+(128, 'en_US', 'Norway', '', '', ''),
+(128, 'es_ES', 'Noruega', '', '', ''),
+(128, 'fr_FR', 'Norvège', '', '', ''),
+(129, 'en_US', 'New Zealand', '', '', ''),
+(129, 'es_ES', 'Nueva Zelandia', '', '', ''),
+(129, 'fr_FR', 'Nouvelle-Zélande', '', '', ''),
+(130, 'en_US', 'Oman', '', '', ''),
+(130, 'es_ES', 'Omán', '', '', ''),
+(130, 'fr_FR', 'Oman', '', '', ''),
+(131, 'en_US', 'Uganda', '', '', ''),
+(131, 'es_ES', 'Uganda', '', '', ''),
+(131, 'fr_FR', 'Ouganda', '', '', ''),
+(132, 'en_US', 'Uzbekistan', '', '', ''),
+(132, 'es_ES', 'Uzbekistán', '', '', ''),
+(132, 'fr_FR', 'Ouzbékistan', '', '', ''),
+(133, 'en_US', 'Pakistan', '', '', ''),
+(133, 'es_ES', 'Pakistán', '', '', ''),
+(133, 'fr_FR', 'Pakistan', '', '', ''),
+(134, 'en_US', 'Panama', '', '', ''),
+(134, 'es_ES', 'Panamá', '', '', ''),
+(134, 'fr_FR', 'Panama', '', '', ''),
+(135, 'en_US', 'Papua Nueva Guinea', '', '', ''),
+(135, 'es_ES', 'Papua Nueva Guinea', '', '', ''),
+(135, 'fr_FR', 'Papouasie', '', '', ''),
+(136, 'en_US', 'Paraguay', '', '', ''),
+(136, 'es_ES', 'Paraguay', '', '', ''),
+(136, 'fr_FR', 'Paraguay', '', '', ''),
+(137, 'en_US', 'Netherlands', '', '', ''),
+(137, 'es_ES', 'Países Bajos', '', '', ''),
+(137, 'fr_FR', 'Pays-Bas', '', '', ''),
+(138, 'en_US', 'Peru', '', '', ''),
+(138, 'es_ES', 'Perú', '', '', ''),
+(138, 'fr_FR', 'Pérou', '', '', ''),
+(139, 'en_US', 'Philippines', '', '', ''),
+(139, 'es_ES', 'Filipinas', '', '', ''),
+(139, 'fr_FR', 'Philippines', '', '', ''),
+(140, 'en_US', 'Poland', '', '', ''),
+(140, 'es_ES', 'Polonia', '', '', ''),
+(140, 'fr_FR', 'Pologne', '', '', ''),
+(141, 'en_US', 'Portugal', '', '', ''),
+(141, 'es_ES', 'Portugal', '', '', ''),
+(141, 'fr_FR', 'Portugal', '', '', ''),
+(142, 'en_US', 'Qatar', '', '', ''),
+(142, 'es_ES', 'Qatar', '', '', ''),
+(142, 'fr_FR', 'Qatar', '', '', ''),
+(143, 'en_US', 'Central African Republic', '', '', ''),
+(143, 'es_ES', 'República Centroafricana', '', '', ''),
+(143, 'fr_FR', 'République centrafricaine', '', '', ''),
+(144, 'en_US', 'Dominican Republic', '', '', ''),
+(144, 'es_ES', 'República Dominicana', '', '', ''),
+(144, 'fr_FR', 'République dominicaine', '', '', ''),
+(145, 'en_US', 'Czech Republic', '', '', ''),
+(145, 'es_ES', 'República Checa', '', '', ''),
+(145, 'fr_FR', 'République tchèque', '', '', ''),
+(146, 'en_US', 'Romania', '', '', ''),
+(146, 'es_ES', 'Rumania', '', '', ''),
+(146, 'fr_FR', 'Roumanie', '', '', ''),
+(147, 'en_US', 'United Kingdom', '', '', ''),
+(147, 'es_ES', 'Reino Unido', '', '', ''),
+(147, 'fr_FR', 'Royaume-Uni', '', '', ''),
+(148, 'en_US', 'Russia', '', '', ''),
+(148, 'es_ES', 'Rusia', '', '', ''),
+(148, 'fr_FR', 'Russie', '', '', ''),
+(149, 'en_US', 'Rwanda', '', '', ''),
+(149, 'es_ES', 'Ruanda', '', '', ''),
+(149, 'fr_FR', 'Rwanda', '', '', ''),
+(150, 'en_US', 'Saint Kitts and Nevis', '', '', ''),
+(150, 'es_ES', 'San Cristóbal', '', '', ''),
+(150, 'fr_FR', 'Saint-Christophe-et-Niévès', '', '', ''),
+(151, 'en_US', 'Saint Lucia', '', '', ''),
+(151, 'es_ES', 'Santa Lucía', '', '', ''),
+(151, 'fr_FR', 'Sainte-Lucie', '', '', ''),
+(152, 'en_US', 'San Marino', '', '', ''),
+(152, 'es_ES', 'San Marino', '', '', ''),
+(152, 'fr_FR', 'Saint-Marin', '', '', ''),
+(153, 'en_US', 'Saint Vincent and the Grenadines', '', '', ''),
+(153, 'es_ES', 'San Vicente y las Granadinas', '', '', ''),
+(153, 'fr_FR', 'Saint-Vincent-et-les Grenadines', '', '', ''),
+(154, 'en_US', 'Solomon Islands', '', '', ''),
+(154, 'es_ES', 'Salomón', '', '', ''),
+(154, 'fr_FR', 'Salomon', '', '', ''),
+(155, 'en_US', 'El Salvador', '', '', ''),
+(155, 'es_ES', 'El Salvador', '', '', ''),
+(155, 'fr_FR', 'Salvador', '', '', ''),
+(156, 'en_US', 'Western Samoa', '', '', ''),
+(156, 'es_ES', 'Samoa', '', '', ''),
+(156, 'fr_FR', 'Samoa occidentales', '', '', ''),
+(157, 'en_US', 'Sao Tome and Principe', '', '', ''),
+(157, 'es_ES', 'Santo Tomé y Príncipe', '', '', ''),
+(157, 'fr_FR', 'Sao Tomé-et-Principe', '', '', ''),
+(158, 'en_US', 'Senegal', '', '', ''),
+(158, 'es_ES', 'Senegal', '', '', ''),
+(158, 'fr_FR', 'Sénégal', '', '', ''),
+(159, 'en_US', 'Seychelles', '', '', ''),
+(159, 'es_ES', 'Seychelles', '', '', ''),
+(159, 'fr_FR', 'Seychelles', '', '', ''),
+(160, 'en_US', 'Sierra Leone', '', '', ''),
+(160, 'es_ES', 'Sierra Leona', '', '', ''),
+(160, 'fr_FR', 'Sierra Leone', '', '', ''),
+(161, 'en_US', 'Singapore', '', '', ''),
+(161, 'es_ES', 'Singapur', '', '', ''),
+(161, 'fr_FR', 'Singapour', '', '', ''),
+(162, 'en_US', 'Slovakia', '', '', ''),
+(162, 'es_ES', 'Eslovaquia', '', '', ''),
+(162, 'fr_FR', 'Slovaquie', '', '', ''),
+(163, 'en_US', 'Slovenia', '', '', ''),
+(163, 'es_ES', 'Eslovenia', '', '', ''),
+(163, 'fr_FR', 'Slovénie', '', '', ''),
+(164, 'en_US', 'Somalia', '', '', ''),
+(164, 'es_ES', 'Somalia', '', '', ''),
+(164, 'fr_FR', 'Somalie', '', '', ''),
+(165, 'en_US', 'Sudan', '', '', ''),
+(165, 'es_ES', 'Sudán', '', '', ''),
+(165, 'fr_FR', 'Soudan', '', '', ''),
+(166, 'en_US', 'Sri Lanka', '', '', ''),
+(166, 'es_ES', 'Sri Lanka', '', '', ''),
+(166, 'fr_FR', 'Sri Lanka', '', '', ''),
+(167, 'en_US', 'Sweden', '', '', ''),
+(167, 'es_ES', 'Suecia', '', '', ''),
+(167, 'fr_FR', 'Suède', '', '', ''),
+(168, 'en_US', 'Switzerland', '', '', ''),
+(168, 'es_ES', 'Suiza', '', '', ''),
+(168, 'fr_FR', 'Suisse', '', '', ''),
+(169, 'en_US', 'Suriname', '', '', ''),
+(169, 'es_ES', 'Suriname', '', '', ''),
+(169, 'fr_FR', 'Suriname', '', '', ''),
+(170, 'en_US', 'Swaziland', '', '', ''),
+(170, 'es_ES', 'Swazilandia', '', '', ''),
+(170, 'fr_FR', 'Swaziland', '', '', ''),
+(171, 'en_US', 'Syria', '', '', ''),
+(171, 'es_ES', 'Siria', '', '', ''),
+(171, 'fr_FR', 'Syrie', '', '', ''),
+(172, 'en_US', 'Tajikistan', '', '', ''),
+(172, 'es_ES', 'Tayikistán', '', '', ''),
+(172, 'fr_FR', 'Tadjikistan', '', '', ''),
+(173, 'en_US', 'Tanzania', '', '', ''),
+(173, 'es_ES', 'Tanzanía', '', '', ''),
+(173, 'fr_FR', 'Tanzanie', '', '', ''),
+(174, 'en_US', 'Chad', '', '', ''),
+(174, 'es_ES', 'Chad', '', '', ''),
+(174, 'fr_FR', 'Tchad', '', '', ''),
+(175, 'en_US', 'Thailand', '', '', ''),
+(175, 'es_ES', 'Tailandia', '', '', ''),
+(175, 'fr_FR', 'Thaïlande', '', '', ''),
+(176, 'en_US', 'Togo', '', '', ''),
+(176, 'es_ES', 'Togo', '', '', ''),
+(176, 'fr_FR', 'Togo', '', '', ''),
+(177, 'en_US', 'Tonga', '', '', ''),
+(177, 'es_ES', 'Tonga', '', '', ''),
+(177, 'fr_FR', 'Tonga', '', '', ''),
+(178, 'en_US', 'Trinidad and Tobago', '', '', ''),
+(178, 'es_ES', 'Trinidad y Tabago', '', '', ''),
+(178, 'fr_FR', 'Trinité-et-Tobago', '', '', ''),
+(179, 'en_US', 'Tunisia', '', '', ''),
+(179, 'es_ES', 'Túnez', '', '', ''),
+(179, 'fr_FR', 'Tunisie', '', '', ''),
+(180, 'en_US', 'Turkmenistan', '', '', ''),
+(180, 'es_ES', 'Turkmenistán', '', '', ''),
+(180, 'fr_FR', 'Turkménistan', '', '', ''),
+(181, 'en_US', 'Turkey', '', '', ''),
+(181, 'es_ES', 'Turquía', '', '', ''),
+(181, 'fr_FR', 'Turquie', '', '', ''),
+(182, 'en_US', 'Tuvalu', '', '', ''),
+(182, 'es_ES', 'Tuvalu', '', '', ''),
+(182, 'fr_FR', 'Tuvalu', '', '', ''),
+(183, 'en_US', 'Ukraine', '', '', ''),
+(183, 'es_ES', 'Ucrania', '', '', ''),
+(183, 'fr_FR', 'Ukraine', '', '', ''),
+(184, 'en_US', 'Uruguay', '', '', ''),
+(184, 'es_ES', 'Uruguay', '', '', ''),
+(184, 'fr_FR', 'Uruguay', '', '', ''),
+(185, 'en_US', 'The Vatican', '', '', ''),
+(185, 'es_ES', 'El Vatican', '', '', ''),
+(185, 'fr_FR', 'Vatican', '', '', ''),
+(186, 'en_US', 'Vanuatu', '', '', ''),
+(186, 'es_ES', 'Vanuatu', '', '', ''),
+(186, 'fr_FR', 'Vanuatu', '', '', ''),
+(187, 'en_US', 'Venezuela', '', '', ''),
+(187, 'es_ES', 'Venezuela', '', '', ''),
+(187, 'fr_FR', 'Venezuela', '', '', ''),
+(188, 'en_US', 'Vietnam', '', '', ''),
+(188, 'es_ES', 'Viet Nam', '', '', ''),
+(188, 'fr_FR', 'Viêt Nam', '', '', ''),
+(189, 'en_US', 'Yemen', '', '', ''),
+(189, 'es_ES', 'Yemen', '', '', ''),
+(189, 'fr_FR', 'Yémen', '', '', ''),
+(190, 'en_US', 'Yougoslavia', '', '', ''),
+(190, 'es_ES', 'Yugoslavia', '', '', ''),
+(190, 'fr_FR', 'Yougoslavie', '', '', ''),
+(191, 'en_US', 'Zaire', '', '', ''),
+(191, 'es_ES', 'Zaire', '', '', ''),
+(191, 'fr_FR', 'Zaïre', '', '', ''),
+(192, 'en_US', 'Zambia', '', '', ''),
+(192, 'es_ES', 'Zambia', '', '', ''),
+(192, 'fr_FR', 'Zambie', '', '', ''),
+(193, 'en_US', 'Zimbabwe', '', '', ''),
+(193, 'es_ES', 'Zimbabwe', '', '', ''),
+(193, 'fr_FR', 'Zimbabwe', '', '', ''),
+(196, 'en_US', 'USA - Alaska', '', '', ''),
+(196, 'es_ES', 'USA - Alaska', '', '', ''),
+(196, 'fr_FR', 'USA - Alaska', '', '', ''),
+(197, 'en_US', 'USA - Arizona', '', '', ''),
+(197, 'es_ES', 'USA - Arizona', '', '', ''),
+(197, 'fr_FR', 'USA - Arizona', '', '', ''),
+(198, 'en_US', 'USA - Arkansas', '', '', ''),
+(198, 'es_ES', 'USA - Arkansas', '', '', ''),
+(198, 'fr_FR', 'USA - Arkansas', '', '', ''),
+(199, 'en_US', 'USA - California', '', '', ''),
+(199, 'es_ES', 'USA - California', '', '', ''),
+(199, 'fr_FR', 'USA - California', '', '', ''),
+(200, 'en_US', 'USA - Colorado', '', '', ''),
+(200, 'es_ES', 'USA - Colorado', '', '', ''),
+(200, 'fr_FR', 'USA - Colorado', '', '', ''),
+(201, 'en_US', 'USA - Connecticut', '', '', ''),
+(201, 'es_ES', 'USA - Connecticut', '', '', ''),
+(201, 'fr_FR', 'USA - Connecticut', '', '', ''),
+(202, 'en_US', 'USA - Delaware', '', '', ''),
+(202, 'es_ES', 'USA - Delaware', '', '', ''),
+(202, 'fr_FR', 'USA - Delaware', '', '', ''),
+(203, 'en_US', 'USA - District Of Columbia', '', '', ''),
+(203, 'es_ES', 'USA - District Of Columbia', '', '', ''),
+(203, 'fr_FR', 'USA - District Of Columbia', '', '', ''),
+(204, 'en_US', 'USA - Florida', '', '', ''),
+(204, 'es_ES', 'USA - Florida', '', '', ''),
+(204, 'fr_FR', 'USA - Florida', '', '', ''),
+(205, 'en_US', 'USA - Georgia', '', '', ''),
+(205, 'es_ES', 'USA - Georgia', '', '', ''),
+(205, 'fr_FR', 'USA - Georgia', '', '', ''),
+(206, 'en_US', 'USA - Hawaii', '', '', ''),
+(206, 'es_ES', 'USA - Hawaii', '', '', ''),
+(206, 'fr_FR', 'USA - Hawaii', '', '', ''),
+(207, 'en_US', 'USA - Idaho', '', '', ''),
+(207, 'es_ES', 'USA - Idaho', '', '', ''),
+(207, 'fr_FR', 'USA - Idaho', '', '', ''),
+(208, 'en_US', 'USA - Illinois', '', '', ''),
+(208, 'es_ES', 'USA - Illinois', '', '', ''),
+(208, 'fr_FR', 'USA - Illinois', '', '', ''),
+(209, 'en_US', 'USA - Indiana', '', '', ''),
+(209, 'es_ES', 'USA - Indiana', '', '', ''),
+(209, 'fr_FR', 'USA - Indiana', '', '', ''),
+(210, 'en_US', 'USA - Iowa', '', '', ''),
+(210, 'es_ES', 'USA - Iowa', '', '', ''),
+(210, 'fr_FR', 'USA - Iowa', '', '', ''),
+(211, 'en_US', 'USA - Kansas', '', '', ''),
+(211, 'es_ES', 'USA - Kansas', '', '', ''),
+(211, 'fr_FR', 'USA - Kansas', '', '', ''),
+(212, 'en_US', 'USA - Kentucky', '', '', ''),
+(212, 'es_ES', 'USA - Kentucky', '', '', ''),
+(212, 'fr_FR', 'USA - Kentucky', '', '', ''),
+(213, 'en_US', 'USA - Louisiana', '', '', ''),
+(213, 'es_ES', 'USA - Louisiana', '', '', ''),
+(213, 'fr_FR', 'USA - Louisiana', '', '', ''),
+(214, 'en_US', 'USA - Maine', '', '', ''),
+(214, 'es_ES', 'USA - Maine', '', '', ''),
+(214, 'fr_FR', 'USA - Maine', '', '', ''),
+(215, 'en_US', 'USA - Maryland', '', '', ''),
+(215, 'es_ES', 'USA - Maryland', '', '', ''),
+(215, 'fr_FR', 'USA - Maryland', '', '', ''),
+(216, 'en_US', 'USA - Massachusetts', '', '', ''),
+(216, 'es_ES', 'USA - Massachusetts', '', '', ''),
+(216, 'fr_FR', 'USA - Massachusetts', '', '', ''),
+(217, 'en_US', 'USA - Michigan', '', '', ''),
+(217, 'es_ES', 'USA - Michigan', '', '', ''),
+(217, 'fr_FR', 'USA - Michigan', '', '', ''),
+(218, 'en_US', 'USA - Minnesota', '', '', ''),
+(218, 'es_ES', 'USA - Minnesota', '', '', ''),
+(218, 'fr_FR', 'USA - Minnesota', '', '', ''),
+(219, 'en_US', 'USA - Mississippi', '', '', ''),
+(219, 'es_ES', 'USA - Mississippi', '', '', ''),
+(219, 'fr_FR', 'USA - Mississippi', '', '', ''),
+(220, 'en_US', 'USA - Missouri', '', '', ''),
+(220, 'es_ES', 'USA - Missouri', '', '', ''),
+(220, 'fr_FR', 'USA - Missouri', '', '', ''),
+(221, 'en_US', 'USA - Montana', '', '', ''),
+(221, 'es_ES', 'USA - Montana', '', '', ''),
+(221, 'fr_FR', 'USA - Montana', '', '', ''),
+(222, 'en_US', 'USA - Nebraska', '', '', ''),
+(222, 'es_ES', 'USA - Nebraska', '', '', ''),
+(222, 'fr_FR', 'USA - Nebraska', '', '', ''),
+(223, 'en_US', 'USA - Nevada', '', '', ''),
+(223, 'es_ES', 'USA - Nevada', '', '', ''),
+(223, 'fr_FR', 'USA - Nevada', '', '', ''),
+(224, 'en_US', 'USA - New Hampshire', '', '', ''),
+(224, 'es_ES', 'USA - New Hampshire', '', '', ''),
+(224, 'fr_FR', 'USA - New Hampshire', '', '', ''),
+(225, 'en_US', 'USA - New Jersey', '', '', ''),
+(225, 'es_ES', 'USA - New Jersey', '', '', ''),
+(225, 'fr_FR', 'USA - New Jersey', '', '', ''),
+(226, 'en_US', 'USA - New Mexico', '', '', ''),
+(226, 'es_ES', 'USA - New Mexico', '', '', ''),
+(226, 'fr_FR', 'USA - New Mexico', '', '', ''),
+(227, 'en_US', 'USA - New York', '', '', ''),
+(227, 'es_ES', 'USA - New York', '', '', ''),
+(227, 'fr_FR', 'USA - New York', '', '', ''),
+(228, 'en_US', 'USA - North Carolina', '', '', ''),
+(228, 'es_ES', 'USA - North Carolina', '', '', ''),
+(228, 'fr_FR', 'USA - North Carolina', '', '', ''),
+(229, 'en_US', 'USA - North Dakota', '', '', ''),
+(229, 'es_ES', 'USA - North Dakota', '', '', ''),
+(229, 'fr_FR', 'USA - North Dakota', '', '', ''),
+(230, 'en_US', 'USA - Ohio', '', '', ''),
+(230, 'es_ES', 'USA - Ohio', '', '', ''),
+(230, 'fr_FR', 'USA - Ohio', '', '', ''),
+(231, 'en_US', 'USA - Oklahoma', '', '', ''),
+(231, 'es_ES', 'USA - Oklahoma', '', '', ''),
+(231, 'fr_FR', 'USA - Oklahoma', '', '', ''),
+(232, 'en_US', 'USA - Oregon', '', '', ''),
+(232, 'es_ES', 'USA - Oregon', '', '', ''),
+(232, 'fr_FR', 'USA - Oregon', '', '', ''),
+(233, 'en_US', 'USA - Pennsylvania', '', '', ''),
+(233, 'es_ES', 'USA - Pennsylvania', '', '', ''),
+(233, 'fr_FR', 'USA - Pennsylvania', '', '', ''),
+(234, 'en_US', 'USA - Rhode Island', '', '', ''),
+(234, 'es_ES', 'USA - Rhode Island', '', '', ''),
+(234, 'fr_FR', 'USA - Rhode Island', '', '', ''),
+(235, 'en_US', 'USA - South Carolina', '', '', ''),
+(235, 'es_ES', 'USA - South Carolina', '', '', ''),
+(235, 'fr_FR', 'USA - South Carolina', '', '', ''),
+(236, 'en_US', 'USA - South Dakota', '', '', ''),
+(236, 'es_ES', 'USA - South Dakota', '', '', ''),
+(236, 'fr_FR', 'USA - South Dakota', '', '', ''),
+(237, 'en_US', 'USA - Tennessee', '', '', ''),
+(237, 'es_ES', 'USA - Tennessee', '', '', ''),
+(237, 'fr_FR', 'USA - Tennessee', '', '', ''),
+(238, 'en_US', 'USA - Texas', '', '', ''),
+(238, 'es_ES', 'USA - Texas', '', '', ''),
+(238, 'fr_FR', 'USA - Texas', '', '', ''),
+(239, 'en_US', 'USA - Utah', '', '', ''),
+(239, 'es_ES', 'USA - Utah', '', '', ''),
+(239, 'fr_FR', 'USA - Utah', '', '', ''),
+(240, 'en_US', 'USA - Vermont', '', '', ''),
+(240, 'es_ES', 'USA - Vermont', '', '', ''),
+(240, 'fr_FR', 'USA - Vermont', '', '', ''),
+(241, 'en_US', 'USA - Virginia', '', '', ''),
+(241, 'es_ES', 'USA - Virginia', '', '', ''),
+(241, 'fr_FR', 'USA - Virginia', '', '', ''),
+(242, 'en_US', 'USA - Washington', '', '', ''),
+(242, 'es_ES', 'USA - Washington', '', '', ''),
+(242, 'fr_FR', 'USA - Washington', '', '', ''),
+(243, 'en_US', 'USA - West Virginia', '', '', ''),
+(243, 'es_ES', 'USA - West Virginia', '', '', ''),
+(243, 'fr_FR', 'USA - West Virginia', '', '', ''),
+(244, 'en_US', 'USA - Wisconsin', '', '', ''),
+(244, 'es_ES', 'USA - Wisconsin', '', '', ''),
+(244, 'fr_FR', 'USA - Wisconsin', '', '', ''),
+(245, 'en_US', 'USA - Wyoming', '', '', ''),
+(245, 'es_ES', 'USA - Wyoming', '', '', ''),
+(245, 'fr_FR', 'USA - Wyoming', '', '', ''),
+(246, 'en_US', 'Canada - Colombie-Britannique', '', '', ''),
+(246, 'es_ES', 'Canada - Colombie-Britannique', '', '', ''),
+(246, 'fr_FR', 'Canada - Colombie-Britannique', '', '', ''),
+(247, 'en_US', 'Canada - Alberta', '', '', ''),
+(247, 'es_ES', 'Canada - Alberta', '', '', ''),
+(247, 'fr_FR', 'Canada - Alberta', '', '', ''),
+(248, 'en_US', 'Canada - Saskatchewan', '', '', ''),
+(248, 'es_ES', 'Canada - Saskatchewan', '', '', ''),
+(248, 'fr_FR', 'Canada - Saskatchewan', '', '', ''),
+(249, 'en_US', 'Canada - Manitoba', '', '', ''),
+(249, 'es_ES', 'Canada - Manitoba', '', '', ''),
+(249, 'fr_FR', 'Canada - Manitoba', '', '', ''),
+(250, 'en_US', 'Canada - Ontario', '', '', ''),
+(250, 'es_ES', 'Canada - Ontario', '', '', ''),
+(250, 'fr_FR', 'Canada - Ontario', '', '', ''),
+(251, 'en_US', 'Canada - Québec', '', '', ''),
+(251, 'es_ES', 'Canada - Québec', '', '', ''),
+(251, 'fr_FR', 'Canada - Québec', '', '', ''),
+(252, 'en_US', 'Canada - Nouveau-Brunswick', '', '', ''),
+(252, 'es_ES', 'Canada - Nouveau-Brunswick', '', '', ''),
+(252, 'fr_FR', 'Canada - Nouveau-Brunswick', '', '', ''),
+(253, 'en_US', 'Canada - Nouvelle-Écosse', '', '', ''),
+(253, 'es_ES', 'Canada - Nouvelle-Écosse', '', '', ''),
+(253, 'fr_FR', 'Canada - Nouvelle-Écosse', '', '', ''),
+(254, 'en_US', 'Canada - Île-du-Prince-Édouard ', '', '', ''),
+(254, 'es_ES', 'Canada - Île-du-Prince-Édouard ', '', '', ''),
+(254, 'fr_FR', 'Canada - Île-du-Prince-Édouard ', '', '', ''),
+(255, 'en_US', 'Canada - Terre-Neuve-et-Labrador ', '', '', ''),
+(255, 'es_ES', 'Canada - Terre-Neuve-et-Labrador ', '', '', ''),
+(255, 'fr_FR', 'Canada - Terre-Neuve-et-Labrador ', '', '', ''),
+(256, 'en_US', 'Canada - Yukon', '', '', ''),
+(256, 'es_ES', 'Canada - Yukon', '', '', ''),
+(256, 'fr_FR', 'Canada - Yukon', '', '', ''),
+(257, 'en_US', 'Canada - Territoires-du-Nord-Ouest', '', '', ''),
+(257, 'es_ES', 'Canada - Territoires-du-Nord-Ouest', '', '', ''),
+(257, 'fr_FR', 'Canada - Territoires-du-Nord-Ouest', '', '', ''),
+(258, 'en_US', 'Canada - Nunavut', '', '', ''),
+(258, 'es_ES', 'Canada - Nunavut', '', '', ''),
+(258, 'fr_FR', 'Canada - Nunavut', '', '', ''),
+(259, 'en_US', 'Guadeloupe', '', '', ''),
+(259, 'es_ES', 'Guadeloupe', '', '', ''),
+(259, 'fr_FR', 'Guadeloupe', '', '', ''),
+(260, 'en_US', 'Guyane Française', '', '', ''),
+(260, 'es_ES', 'Guyane Française', '', '', ''),
+(260, 'fr_FR', 'Guyane Française', '', '', ''),
+(261, 'en_US', 'Martinique', '', '', ''),
+(261, 'es_ES', 'Martinique', '', '', ''),
+(261, 'fr_FR', 'Martinique', '', '', ''),
+(262, 'en_US', 'Mayotte', '', '', ''),
+(262, 'es_ES', 'Mayotte', '', '', ''),
+(262, 'fr_FR', 'Mayotte', '', '', ''),
+(263, 'en_US', 'Réunion(La)', '', '', ''),
+(263, 'es_ES', 'Réunion(La)', '', '', ''),
+(263, 'fr_FR', 'Réunion(La)', '', '', ''),
+(264, 'en_US', 'St Pierre et Miquelon', '', '', ''),
+(264, 'es_ES', 'St Pierre et Miquelon', '', '', ''),
+(264, 'fr_FR', 'St Pierre et Miquelon', '', '', ''),
+(265, 'en_US', 'Nouvelle-Calédonie', '', '', ''),
+(265, 'es_ES', 'Nouvelle-Calédonie', '', '', ''),
+(265, 'fr_FR', 'Nouvelle-Calédonie', '', '', ''),
+(266, 'en_US', 'Polynésie française', '', '', ''),
+(266, 'es_ES', 'Polynésie française', '', '', ''),
+(266, 'fr_FR', 'Polynésie française', '', '', ''),
+(267, 'en_US', 'Wallis-et-Futuna', '', '', ''),
+(267, 'es_ES', 'Wallis-et-Futuna', '', '', ''),
+(267, 'fr_FR', 'Wallis-et-Futuna', '', '', ''),
+(268, 'en_US', 'USA - Alabama', '', '', ''),
+(268, 'es_ES', 'USA - Alabama', '', '', ''),
+(268, 'fr_FR', 'USA - Alabama', '', '', '');
diff --git a/install/thelia.sql b/install/thelia.sql
index 62326cc2e..3f587f40f 100755
--- a/install/thelia.sql
+++ b/install/thelia.sql
@@ -34,14 +34,7 @@ CREATE TABLE `product`
`id` INTEGER NOT NULL AUTO_INCREMENT,
`tax_rule_id` INTEGER,
`ref` VARCHAR(255) NOT NULL,
- `price` FLOAT NOT NULL,
- `price2` FLOAT,
- `ecotax` FLOAT,
- `newness` TINYINT DEFAULT 0,
- `promo` TINYINT DEFAULT 0,
- `quantity` INTEGER DEFAULT 0,
`visible` TINYINT DEFAULT 0 NOT NULL,
- `weight` FLOAT,
`position` INTEGER NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
@@ -71,8 +64,8 @@ CREATE TABLE `product_category`
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`product_id`,`category_id`),
- INDEX `fk_product_has_category_category1_idx` (`category_id`),
- INDEX `fk_product_has_category_product1_idx` (`product_id`),
+ INDEX `idx_product_has_category_category1` (`category_id`),
+ INDEX `idx_product_has_category_product1` (`product_id`),
CONSTRAINT `fk_product_has_category_product1`
FOREIGN KEY (`product_id`)
REFERENCES `product` (`id`)
@@ -203,6 +196,7 @@ CREATE TABLE `feature_av`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`feature_id` INTEGER NOT NULL,
+ `position` INTEGER NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
@@ -215,12 +209,12 @@ CREATE TABLE `feature_av`
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
--- feature_prod
+-- feature_product
-- ---------------------------------------------------------------------
-DROP TABLE IF EXISTS `feature_prod`;
+DROP TABLE IF EXISTS `feature_product`;
-CREATE TABLE `feature_prod`
+CREATE TABLE `feature_product`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`product_id` INTEGER NOT NULL,
@@ -316,21 +310,6 @@ CREATE TABLE `attribute_av`
ON DELETE CASCADE
) ENGINE=InnoDB;
--- ---------------------------------------------------------------------
--- combination
--- ---------------------------------------------------------------------
-
-DROP TABLE IF EXISTS `combination`;
-
-CREATE TABLE `combination`
-(
- `id` INTEGER NOT NULL AUTO_INCREMENT,
- `ref` VARCHAR(255),
- `created_at` DATETIME,
- `updated_at` DATETIME,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB;
-
-- ---------------------------------------------------------------------
-- attribute_combination
-- ---------------------------------------------------------------------
@@ -339,57 +318,49 @@ DROP TABLE IF EXISTS `attribute_combination`;
CREATE TABLE `attribute_combination`
(
- `id` INTEGER NOT NULL AUTO_INCREMENT,
`attribute_id` INTEGER NOT NULL,
- `combination_id` INTEGER NOT NULL,
`attribute_av_id` INTEGER NOT NULL,
+ `product_sale_elements_id` INTEGER NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
- PRIMARY KEY (`id`,`attribute_id`,`combination_id`,`attribute_av_id`),
- INDEX `idx_ attribute_combination_attribute_id` (`attribute_id`),
- INDEX `idx_ attribute_combination_attribute_av_id` (`attribute_av_id`),
- INDEX `idx_ attribute_combination_combination_id` (`combination_id`),
- CONSTRAINT `fk_ attribute_combination_attribute_id`
+ PRIMARY KEY (`attribute_id`,`attribute_av_id`,`product_sale_elements_id`),
+ INDEX `idx_attribute_combination_attribute_id` (`attribute_id`),
+ INDEX `idx_attribute_combination_attribute_av_id` (`attribute_av_id`),
+ INDEX `idx_attribute_combination_product_sale_elements_id` (`product_sale_elements_id`),
+ CONSTRAINT `fk_attribute_combination_attribute_id`
FOREIGN KEY (`attribute_id`)
REFERENCES `attribute` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE,
- CONSTRAINT `fk_ attribute_combination_attribute_av_id`
+ CONSTRAINT `fk_attribute_combination_attribute_av_id`
FOREIGN KEY (`attribute_av_id`)
REFERENCES `attribute_av` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE,
- CONSTRAINT `fk_ attribute_combination_combination_id`
- FOREIGN KEY (`combination_id`)
- REFERENCES `combination` (`id`)
- ON UPDATE RESTRICT
- ON DELETE CASCADE
+ CONSTRAINT `fk_attribute_combination_product_sale_elements_id`
+ FOREIGN KEY (`product_sale_elements_id`)
+ REFERENCES `product_sale_elements` (`id`)
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
--- stock
+-- product_sale_elements
-- ---------------------------------------------------------------------
-DROP TABLE IF EXISTS `stock`;
+DROP TABLE IF EXISTS `product_sale_elements`;
-CREATE TABLE `stock`
+CREATE TABLE `product_sale_elements`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
- `combination_id` INTEGER,
`product_id` INTEGER NOT NULL,
- `increase` FLOAT,
`quantity` FLOAT NOT NULL,
+ `promo` TINYINT DEFAULT 0,
+ `newness` TINYINT DEFAULT 0,
+ `weight` FLOAT,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
- INDEX `idx_stock_combination_id` (`combination_id`),
- INDEX `idx_stock_product_id` (`product_id`),
- CONSTRAINT `fk_stock_combination_id`
- FOREIGN KEY (`combination_id`)
- REFERENCES `combination` (`id`)
- ON UPDATE RESTRICT
- ON DELETE SET NULL,
- CONSTRAINT `fk_stock_product_id`
+ INDEX `idx_product_sale_element_product_id` (`product_id`),
+ CONSTRAINT `fk_product_sale_element_product_id`
FOREIGN KEY (`product_id`)
REFERENCES `product` (`id`)
ON UPDATE RESTRICT
@@ -483,9 +454,9 @@ DROP TABLE IF EXISTS `address`;
CREATE TABLE `address`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
- `title` VARCHAR(255),
+ `name` VARCHAR(255),
`customer_id` INTEGER NOT NULL,
- `customer_title_id` INTEGER,
+ `title_id` INTEGER NOT NULL,
`company` VARCHAR(255),
`firstname` VARCHAR(255) NOT NULL,
`lastname` VARCHAR(255) NOT NULL,
@@ -502,16 +473,22 @@ CREATE TABLE `address`
`updated_at` DATETIME,
PRIMARY KEY (`id`),
INDEX `idx_address_customer_id` (`customer_id`),
- INDEX `idx_address_customer_title_id` (`customer_title_id`),
+ INDEX `idx_address_customer_title_id` (`title_id`),
+ INDEX `idx_address_country_id` (`country_id`),
CONSTRAINT `fk_address_customer_id`
FOREIGN KEY (`customer_id`)
REFERENCES `customer` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE,
CONSTRAINT `fk_address_customer_title_id`
- FOREIGN KEY (`customer_title_id`)
+ FOREIGN KEY (`title_id`)
REFERENCES `customer_title` (`id`)
ON UPDATE RESTRICT
+ ON DELETE RESTRICT,
+ CONSTRAINT `fk_address_country_id`
+ FOREIGN KEY (`country_id`)
+ REFERENCES `country` (`id`)
+ ON UPDATE RESTRICT
ON DELETE RESTRICT
) ENGINE=InnoDB;
@@ -782,7 +759,6 @@ DROP TABLE IF EXISTS `currency`;
CREATE TABLE `currency`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
- `name` VARCHAR(45),
`code` VARCHAR(45),
`symbol` VARCHAR(45),
`rate` FLOAT,
@@ -1095,8 +1071,8 @@ CREATE TABLE `group_module`
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
- INDEX `id_idx` (`group_id`),
- INDEX `id_idx1` (`module_id`),
+ INDEX `idx_group_module_group_id` (`group_id`),
+ INDEX `idx_group_module_module_id` (`module_id`),
CONSTRAINT `fk_group_module_group_id`
FOREIGN KEY (`group_id`)
REFERENCES `group` (`id`)
@@ -1273,8 +1249,8 @@ CREATE TABLE `content_folder`
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`content_id`,`folder_id`),
- INDEX `fk__idx` (`content_id`),
- INDEX `fk_content_folder_folder_id_idx` (`folder_id`),
+ INDEX `idx_content_folder_content_id` (`content_id`),
+ INDEX `idx_content_folder_folder_id` (`folder_id`),
CONSTRAINT `fk_content_folder_content_id`
FOREIGN KEY (`content_id`)
REFERENCES `content` (`id`)
@@ -1335,22 +1311,48 @@ CREATE TABLE `cart_item`
`cart_id` INTEGER NOT NULL,
`product_id` INTEGER NOT NULL,
`quantity` FLOAT DEFAULT 1,
- `combination_id` INTEGER,
+ `product_sale_elements_id` INTEGER NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
INDEX `idx_cart_item_cart_id` (`cart_id`),
INDEX `idx_cart_item_product_id` (`product_id`),
- INDEX `idx_cart_item_combination_id` (`combination_id`),
+ INDEX `idx_cart_item_product_sale_elements_id` (`product_sale_elements_id`),
CONSTRAINT `fk_cart_item_cart_id`
FOREIGN KEY (`cart_id`)
REFERENCES `cart` (`id`),
CONSTRAINT `fk_cart_item_product_id`
FOREIGN KEY (`product_id`)
REFERENCES `product` (`id`),
- CONSTRAINT `fk_cart_item_combination_id`
- FOREIGN KEY (`combination_id`)
- REFERENCES `combination` (`id`)
+ CONSTRAINT `fk_cart_item_product_sale_elements_id`
+ FOREIGN KEY (`product_sale_elements_id`)
+ REFERENCES `product_sale_elements` (`id`)
+) ENGINE=InnoDB;
+
+-- ---------------------------------------------------------------------
+-- product_price
+-- ---------------------------------------------------------------------
+
+DROP TABLE IF EXISTS `product_price`;
+
+CREATE TABLE `product_price`
+(
+ `id` INTEGER NOT NULL AUTO_INCREMENT,
+ `product_sale_elements_id` INTEGER NOT NULL,
+ `currency_id` INTEGER NOT NULL,
+ `price` FLOAT NOT NULL,
+ `promo_price` FLOAT,
+ `created_at` DATETIME,
+ `updated_at` DATETIME,
+ PRIMARY KEY (`id`),
+ INDEX `idx_product_price_product_sale_elements_id` (`product_sale_elements_id`),
+ INDEX `idx_product_price_currency_id` (`currency_id`),
+ CONSTRAINT `fk_product_price_product_sale_elements_id`
+ FOREIGN KEY (`product_sale_elements_id`)
+ REFERENCES `product_sale_elements` (`id`),
+ CONSTRAINT `fk_product_price_currency_id`
+ FOREIGN KEY (`currency_id`)
+ REFERENCES `currency` (`id`)
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
@@ -1660,6 +1662,24 @@ CREATE TABLE `document_i18n`
ON DELETE CASCADE
) ENGINE=InnoDB;
+-- ---------------------------------------------------------------------
+-- currency_i18n
+-- ---------------------------------------------------------------------
+
+DROP TABLE IF EXISTS `currency_i18n`;
+
+CREATE TABLE `currency_i18n`
+(
+ `id` INTEGER NOT NULL,
+ `locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL,
+ `name` VARCHAR(45),
+ PRIMARY KEY (`id`,`locale`),
+ CONSTRAINT `currency_i18n_FK_1`
+ FOREIGN KEY (`id`)
+ REFERENCES `currency` (`id`)
+ ON DELETE CASCADE
+) ENGINE=InnoDB;
+
-- ---------------------------------------------------------------------
-- order_status_i18n
-- ---------------------------------------------------------------------
@@ -1799,14 +1819,7 @@ CREATE TABLE `product_version`
`id` INTEGER NOT NULL,
`tax_rule_id` INTEGER,
`ref` VARCHAR(255) NOT NULL,
- `price` FLOAT NOT NULL,
- `price2` FLOAT,
- `ecotax` FLOAT,
- `newness` TINYINT DEFAULT 0,
- `promo` TINYINT DEFAULT 0,
- `quantity` INTEGER DEFAULT 0,
`visible` TINYINT DEFAULT 0 NOT NULL,
- `weight` FLOAT,
`position` INTEGER NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
diff --git a/local/config/schema.xml b/local/config/schema.xml
index 2ef29e927..cea0b7763 100755
--- a/local/config/schema.xml
+++ b/local/config/schema.xml
@@ -1,4 +1,4 @@
-
+
| ID | +#ID | +
| Réference | +#REF | +
| Title | ++ {loop name="title" type="title" id="#TITLE"} + #LONG (#SHORT) + {/loop} + | +
| Firstname | +#FIRSTNAME | +
| Lastname | +#LASTNAME | +
| Is reseller | +#RESELLER | +
| Sponsor | +#SPONSOR | +
| Discount | +#DISCOUNT % | +
| ID | +#ID | +
| Name | +#NAME | +
| Title | +
+
|
+
| Company | +#COMPANY | +
| Firstname | +#FIRSTNAME | +
| Lastname | +#LASTNAME | +
| Address | +#ADDRESS1 #ADDRESS2 #ADDRESS3 |
+
| Zipcode | +#ZIPCODE | +
| City | +#CITY | +
| Country | ++ + | +
| Phone | +#PHONE | +
| Cellphone | +#CELLPHONE | +