update thelia model
This commit is contained in:
@@ -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 getAttributeCombinationsJoinStock($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildAttributeCombinationQuery::create(null, $criteria);
|
||||
$query->joinWith('Combination', $joinBehavior);
|
||||
$query->joinWith('Stock', $joinBehavior);
|
||||
|
||||
return $this->getAttributeCombinations($query, $con);
|
||||
}
|
||||
|
||||
@@ -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 getAttributeCombinationsJoinStock($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildAttributeCombinationQuery::create(null, $criteria);
|
||||
$query->joinWith('Combination', $joinBehavior);
|
||||
$query->joinWith('Stock', $joinBehavior);
|
||||
|
||||
return $this->getAttributeCombinations($query, $con);
|
||||
}
|
||||
|
||||
@@ -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\Stock as ChildStock;
|
||||
use Thelia\Model\StockQuery as ChildStockQuery;
|
||||
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 stock_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $stock_id;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -107,9 +101,9 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
protected $aAttributeAv;
|
||||
|
||||
/**
|
||||
* @var Combination
|
||||
* @var Stock
|
||||
*/
|
||||
protected $aCombination;
|
||||
protected $aStock;
|
||||
|
||||
/**
|
||||
* 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 [stock_id] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getStockId()
|
||||
{
|
||||
|
||||
return $this->stock_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 [stock_id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\AttributeCombination The current object (for fluent API support)
|
||||
*/
|
||||
public function setStockId($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->stock_id !== $v) {
|
||||
$this->stock_id = $v;
|
||||
$this->modifiedColumns[] = AttributeCombinationTableMap::STOCK_ID;
|
||||
}
|
||||
|
||||
if ($this->aStock !== null && $this->aStock->getId() !== $v) {
|
||||
$this->aStock = null;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setStockId()
|
||||
|
||||
/**
|
||||
* 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('StockId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->stock_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->aStock !== null && $this->stock_id !== $this->aStock->getId()) {
|
||||
$this->aStock = null;
|
||||
}
|
||||
} // ensureConsistency
|
||||
|
||||
/**
|
||||
@@ -735,7 +694,7 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
|
||||
$this->aAttribute = null;
|
||||
$this->aAttributeAv = null;
|
||||
$this->aCombination = null;
|
||||
$this->aStock = 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->aStock !== null) {
|
||||
if ($this->aStock->isModified() || $this->aStock->isNew()) {
|
||||
$affectedRows += $this->aStock->save($con);
|
||||
}
|
||||
$this->setCombination($this->aCombination);
|
||||
$this->setStock($this->aStock);
|
||||
}
|
||||
|
||||
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::STOCK_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'STOCK_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 'STOCK_ID':
|
||||
$stmt->bindValue($identifier, $this->stock_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->getStockId();
|
||||
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->getStockId(),
|
||||
$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->aStock) {
|
||||
$result['Stock'] = $this->aStock->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->setStockId($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->setStockId($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::STOCK_ID)) $criteria->add(AttributeCombinationTableMap::STOCK_ID, $this->stock_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::STOCK_ID, $this->stock_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->getStockId();
|
||||
|
||||
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->setStockId($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->getStockId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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->setStockId($this->getStockId());
|
||||
$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 ChildStock object.
|
||||
*
|
||||
* @param ChildCombination $v
|
||||
* @param ChildStock $v
|
||||
* @return \Thelia\Model\AttributeCombination The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setCombination(ChildCombination $v = null)
|
||||
public function setStock(ChildStock $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setCombinationId(NULL);
|
||||
$this->setStockId(NULL);
|
||||
} else {
|
||||
$this->setCombinationId($v->getId());
|
||||
$this->setStockId($v->getId());
|
||||
}
|
||||
|
||||
$this->aCombination = $v;
|
||||
$this->aStock = $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 ChildStock 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 ChildStock object
|
||||
*
|
||||
* @param ConnectionInterface $con Optional Connection object.
|
||||
* @return ChildCombination The associated ChildCombination object.
|
||||
* @return ChildStock The associated ChildStock object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCombination(ConnectionInterface $con = null)
|
||||
public function getStock(ConnectionInterface $con = null)
|
||||
{
|
||||
if ($this->aCombination === null && ($this->combination_id !== null)) {
|
||||
$this->aCombination = ChildCombinationQuery::create()->findPk($this->combination_id, $con);
|
||||
if ($this->aStock === null && ($this->stock_id !== null)) {
|
||||
$this->aStock = ChildStockQuery::create()->findPk($this->stock_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->aStock->addAttributeCombinations($this);
|
||||
*/
|
||||
}
|
||||
|
||||
return $this->aCombination;
|
||||
return $this->aStock;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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->stock_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->aStock = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 orderByStockId($order = Criteria::ASC) Order by the stock_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 groupByStockId() Group by the stock_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 leftJoinStock($relationAlias = null) Adds a LEFT JOIN clause to the query using the Stock relation
|
||||
* @method ChildAttributeCombinationQuery rightJoinStock($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Stock relation
|
||||
* @method ChildAttributeCombinationQuery innerJoinStock($relationAlias = null) Adds a INNER JOIN clause to the query using the Stock 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 findOneByStockId(int $stock_id) Return the first ChildAttributeCombination filtered by the stock_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 findByStockId(int $stock_id) Return ChildAttributeCombination objects filtered by the stock_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.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(array(12, 34, 56, 78), $con);
|
||||
* $obj = $c->findPk(array(12, 34, 56), $con);
|
||||
* </code>
|
||||
*
|
||||
* @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, $stock_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, STOCK_ID, CREATED_AT, UPDATED_AT FROM attribute_combination WHERE ATTRIBUTE_ID = :p0 AND ATTRIBUTE_AV_ID = :p1 AND STOCK_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::STOCK_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::STOCK_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:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $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
|
||||
* </code>
|
||||
*
|
||||
* @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 stock_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByStockId(1234); // WHERE stock_id = 1234
|
||||
* $query->filterByStockId(array(12, 34)); // WHERE stock_id IN (12, 34)
|
||||
* $query->filterByStockId(array('min' => 12)); // WHERE stock_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByStock()
|
||||
*
|
||||
* @param mixed $stockId 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 filterByStockId($stockId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($stockId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($stockId['min'])) {
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::STOCK_ID, $stockId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($stockId['max'])) {
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::STOCK_ID, $stockId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::STOCK_ID, $stockId, $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\Stock object
|
||||
*
|
||||
* @param \Thelia\Model\Combination|ObjectCollection $combination The related object(s) to use as filter
|
||||
* @param \Thelia\Model\Stock|ObjectCollection $stock 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 filterByStock($stock, $comparison = null)
|
||||
{
|
||||
if ($combination instanceof \Thelia\Model\Combination) {
|
||||
if ($stock instanceof \Thelia\Model\Stock) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combination->getId(), $comparison);
|
||||
} elseif ($combination instanceof ObjectCollection) {
|
||||
->addUsingAlias(AttributeCombinationTableMap::STOCK_ID, $stock->getId(), $comparison);
|
||||
} elseif ($stock instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combination->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AttributeCombinationTableMap::STOCK_ID, $stock->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCombination() only accepts arguments of type \Thelia\Model\Combination or Collection');
|
||||
throw new PropelException('filterByStock() only accepts arguments of type \Thelia\Model\Stock or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Combination relation
|
||||
* 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 ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
public function joinStock($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Combination');
|
||||
$relationMap = $tableMap->getRelation('Stock');
|
||||
|
||||
// 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, 'Stock');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Combination relation Combination object
|
||||
* Use the Stock relation Stock 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\StockQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCombinationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
public function useStockQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCombination($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Combination', '\Thelia\Model\CombinationQuery');
|
||||
->joinStock($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Stock', '\Thelia\Model\StockQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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::STOCK_ID), $attributeCombination->getStockId(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1', 'pruneCond2'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -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 getCartItemsJoinStock($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildCartItemQuery::create(null, $criteria);
|
||||
$query->joinWith('Combination', $joinBehavior);
|
||||
$query->joinWith('Stock', $joinBehavior);
|
||||
|
||||
return $this->getCartItems($query, $con);
|
||||
}
|
||||
|
||||
@@ -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\Stock as ChildStock;
|
||||
use Thelia\Model\StockQuery as ChildStockQuery;
|
||||
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 stock_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $combination_id;
|
||||
protected $stock_id;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
@@ -114,9 +114,9 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
protected $aProduct;
|
||||
|
||||
/**
|
||||
* @var Combination
|
||||
* @var Stock
|
||||
*/
|
||||
protected $aCombination;
|
||||
protected $aStock;
|
||||
|
||||
/**
|
||||
* 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 [stock_id] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCombinationId()
|
||||
public function getStockId()
|
||||
{
|
||||
|
||||
return $this->combination_id;
|
||||
return $this->stock_id;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -581,29 +581,29 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
} // setQuantity()
|
||||
|
||||
/**
|
||||
* Set the value of [combination_id] column.
|
||||
* Set the value of [stock_id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\CartItem The current object (for fluent API support)
|
||||
*/
|
||||
public function setCombinationId($v)
|
||||
public function setStockId($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->combination_id !== $v) {
|
||||
$this->combination_id = $v;
|
||||
$this->modifiedColumns[] = CartItemTableMap::COMBINATION_ID;
|
||||
if ($this->stock_id !== $v) {
|
||||
$this->stock_id = $v;
|
||||
$this->modifiedColumns[] = CartItemTableMap::STOCK_ID;
|
||||
}
|
||||
|
||||
if ($this->aCombination !== null && $this->aCombination->getId() !== $v) {
|
||||
$this->aCombination = null;
|
||||
if ($this->aStock !== null && $this->aStock->getId() !== $v) {
|
||||
$this->aStock = null;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setCombinationId()
|
||||
} // setStockId()
|
||||
|
||||
/**
|
||||
* 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('StockId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->stock_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->aStock !== null && $this->stock_id !== $this->aStock->getId()) {
|
||||
$this->aStock = null;
|
||||
}
|
||||
} // ensureConsistency
|
||||
|
||||
@@ -794,7 +794,7 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
|
||||
$this->aCart = null;
|
||||
$this->aProduct = null;
|
||||
$this->aCombination = null;
|
||||
$this->aStock = 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->aStock !== null) {
|
||||
if ($this->aStock->isModified() || $this->aStock->isNew()) {
|
||||
$affectedRows += $this->aStock->save($con);
|
||||
}
|
||||
$this->setCombination($this->aCombination);
|
||||
$this->setStock($this->aStock);
|
||||
}
|
||||
|
||||
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::STOCK_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'STOCK_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 'STOCK_ID':
|
||||
$stmt->bindValue($identifier, $this->stock_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->getStockId();
|
||||
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->getStockId(),
|
||||
$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->aStock) {
|
||||
$result['Stock'] = $this->aStock->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1216,7 +1216,7 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
$this->setQuantity($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setCombinationId($value);
|
||||
$this->setStockId($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->setStockId($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::STOCK_ID)) $criteria->add(CartItemTableMap::STOCK_ID, $this->stock_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->setStockId($this->getStockId());
|
||||
$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 ChildStock object.
|
||||
*
|
||||
* @param ChildCombination $v
|
||||
* @param ChildStock $v
|
||||
* @return \Thelia\Model\CartItem The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setCombination(ChildCombination $v = null)
|
||||
public function setStock(ChildStock $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setCombinationId(NULL);
|
||||
$this->setStockId(NULL);
|
||||
} else {
|
||||
$this->setCombinationId($v->getId());
|
||||
$this->setStockId($v->getId());
|
||||
}
|
||||
|
||||
$this->aCombination = $v;
|
||||
$this->aStock = $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 ChildStock 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 ChildStock object
|
||||
*
|
||||
* @param ConnectionInterface $con Optional Connection object.
|
||||
* @return ChildCombination The associated ChildCombination object.
|
||||
* @return ChildStock The associated ChildStock object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCombination(ConnectionInterface $con = null)
|
||||
public function getStock(ConnectionInterface $con = null)
|
||||
{
|
||||
if ($this->aCombination === null && ($this->combination_id !== null)) {
|
||||
$this->aCombination = ChildCombinationQuery::create()->findPk($this->combination_id, $con);
|
||||
if ($this->aStock === null && ($this->stock_id !== null)) {
|
||||
$this->aStock = ChildStockQuery::create()->findPk($this->stock_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->aStock->addCartItems($this);
|
||||
*/
|
||||
}
|
||||
|
||||
return $this->aCombination;
|
||||
return $this->aStock;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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->stock_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->aStock = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 orderByStockId($order = Criteria::ASC) Order by the stock_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 groupByStockId() Group by the stock_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 leftJoinStock($relationAlias = null) Adds a LEFT JOIN clause to the query using the Stock relation
|
||||
* @method ChildCartItemQuery rightJoinStock($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Stock relation
|
||||
* @method ChildCartItemQuery innerJoinStock($relationAlias = null) Adds a INNER JOIN clause to the query using the Stock 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 findOneByStockId(int $stock_id) Return the first ChildCartItem filtered by the stock_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 findByStockId(int $stock_id) Return ChildCartItem objects filtered by the stock_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, STOCK_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 stock_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $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->filterByStockId(1234); // WHERE stock_id = 1234
|
||||
* $query->filterByStockId(array(12, 34)); // WHERE stock_id IN (12, 34)
|
||||
* $query->filterByStockId(array('min' => 12)); // WHERE stock_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCombination()
|
||||
* @see filterByStock()
|
||||
*
|
||||
* @param mixed $combinationId The value to use as filter.
|
||||
* @param mixed $stockId 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 filterByStockId($stockId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($combinationId)) {
|
||||
if (is_array($stockId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($combinationId['min'])) {
|
||||
$this->addUsingAlias(CartItemTableMap::COMBINATION_ID, $combinationId['min'], Criteria::GREATER_EQUAL);
|
||||
if (isset($stockId['min'])) {
|
||||
$this->addUsingAlias(CartItemTableMap::STOCK_ID, $stockId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($combinationId['max'])) {
|
||||
$this->addUsingAlias(CartItemTableMap::COMBINATION_ID, $combinationId['max'], Criteria::LESS_EQUAL);
|
||||
if (isset($stockId['max'])) {
|
||||
$this->addUsingAlias(CartItemTableMap::STOCK_ID, $stockId['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::STOCK_ID, $stockId, $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\Stock object
|
||||
*
|
||||
* @param \Thelia\Model\Combination|ObjectCollection $combination The related object(s) to use as filter
|
||||
* @param \Thelia\Model\Stock|ObjectCollection $stock 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 filterByStock($stock, $comparison = null)
|
||||
{
|
||||
if ($combination instanceof \Thelia\Model\Combination) {
|
||||
if ($stock instanceof \Thelia\Model\Stock) {
|
||||
return $this
|
||||
->addUsingAlias(CartItemTableMap::COMBINATION_ID, $combination->getId(), $comparison);
|
||||
} elseif ($combination instanceof ObjectCollection) {
|
||||
->addUsingAlias(CartItemTableMap::STOCK_ID, $stock->getId(), $comparison);
|
||||
} elseif ($stock instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CartItemTableMap::COMBINATION_ID, $combination->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(CartItemTableMap::STOCK_ID, $stock->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCombination() only accepts arguments of type \Thelia\Model\Combination or Collection');
|
||||
throw new PropelException('filterByStock() only accepts arguments of type \Thelia\Model\Stock or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Combination relation
|
||||
* 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 ChildCartItemQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCombination($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinStock($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Combination');
|
||||
$relationMap = $tableMap->getRelation('Stock');
|
||||
|
||||
// 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, 'Stock');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Combination relation Combination object
|
||||
* Use the Stock relation Stock 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\StockQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCombinationQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function useStockQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCombination($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Combination', '\Thelia\Model\CombinationQuery');
|
||||
->joinStock($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Stock', '\Thelia\Model\StockQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,6 +23,8 @@ use Thelia\Model\Currency as ChildCurrency;
|
||||
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
|
||||
@@ -119,6 +121,12 @@ abstract class Currency implements ActiveRecordInterface
|
||||
protected $collCarts;
|
||||
protected $collCartsPartial;
|
||||
|
||||
/**
|
||||
* @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.
|
||||
@@ -139,6 +147,12 @@ abstract class Currency implements ActiveRecordInterface
|
||||
*/
|
||||
protected $cartsScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var ObjectCollection
|
||||
*/
|
||||
protected $productPricesScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* Initializes internal state of Thelia\Model\Base\Currency object.
|
||||
*/
|
||||
@@ -806,6 +820,8 @@ abstract class Currency implements ActiveRecordInterface
|
||||
|
||||
$this->collCarts = null;
|
||||
|
||||
$this->collProductPrices = null;
|
||||
|
||||
} // if (deep)
|
||||
}
|
||||
|
||||
@@ -975,6 +991,23 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->alreadyInSave = false;
|
||||
|
||||
}
|
||||
@@ -1197,6 +1230,9 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
@@ -1394,6 +1430,12 @@ 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));
|
||||
}
|
||||
}
|
||||
|
||||
} // if ($deepCopy)
|
||||
|
||||
if ($makeNew) {
|
||||
@@ -1441,6 +1483,9 @@ abstract class Currency implements ActiveRecordInterface
|
||||
if ('Cart' == $relationName) {
|
||||
return $this->initCarts();
|
||||
}
|
||||
if ('ProductPrice' == $relationName) {
|
||||
return $this->initProductPrices();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2054,6 +2099,249 @@ 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 getProductPricesJoinStock($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildProductPriceQuery::create(null, $criteria);
|
||||
$query->joinWith('Stock', $joinBehavior);
|
||||
|
||||
return $this->getProductPrices($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the current object and sets all attributes to their default values
|
||||
*/
|
||||
@@ -2096,6 +2384,11 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collProductPrices) {
|
||||
foreach ($this->collProductPrices as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
} // if ($deep)
|
||||
|
||||
if ($this->collOrders instanceof Collection) {
|
||||
@@ -2106,6 +2399,10 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$this->collCarts->clearIterator();
|
||||
}
|
||||
$this->collCarts = null;
|
||||
if ($this->collProductPrices instanceof Collection) {
|
||||
$this->collProductPrices->clearIterator();
|
||||
}
|
||||
$this->collProductPrices = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,6 +51,10 @@ 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 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
|
||||
*
|
||||
@@ -690,6 +694,79 @@ 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');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
|
||||
@@ -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
|
||||
@@ -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);
|
||||
@@ -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)
|
||||
@@ -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());
|
||||
@@ -3423,31 +3006,6 @@ abstract class Product implements ActiveRecordInterface
|
||||
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 getCartItemsJoinStock($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildCartItemQuery::create(null, $criteria);
|
||||
$query->joinWith('Combination', $joinBehavior);
|
||||
$query->joinWith('Stock', $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;
|
||||
@@ -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());
|
||||
|
||||
1611
core/lib/Thelia/Model/Base/ProductPrice.php
Normal file
1611
core/lib/Thelia/Model/Base/ProductPrice.php
Normal file
File diff suppressed because it is too large
Load Diff
849
core/lib/Thelia/Model/Base/ProductPriceQuery.php
Normal file
849
core/lib/Thelia/Model/Base/ProductPriceQuery.php
Normal file
@@ -0,0 +1,849 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ProductPrice as ChildProductPrice;
|
||||
use Thelia\Model\ProductPriceQuery as ChildProductPriceQuery;
|
||||
use Thelia\Model\Map\ProductPriceTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'product_price' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildProductPriceQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildProductPriceQuery orderByStockId($order = Criteria::ASC) Order by the stock_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 ChildProductPriceQuery groupById() Group by the id column
|
||||
* @method ChildProductPriceQuery groupByStockId() Group by the stock_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 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 ChildProductPriceQuery leftJoinStock($relationAlias = null) Adds a LEFT JOIN clause to the query using the Stock relation
|
||||
* @method ChildProductPriceQuery rightJoinStock($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Stock relation
|
||||
* @method ChildProductPriceQuery innerJoinStock($relationAlias = null) Adds a INNER JOIN clause to the query using the Stock 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 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 ChildProductPrice findOneById(int $id) Return the first ChildProductPrice filtered by the id column
|
||||
* @method ChildProductPrice findOneByStockId(int $stock_id) Return the first ChildProductPrice filtered by the stock_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 ChildProductPrice objects filtered by the id column
|
||||
* @method array findByStockId(int $stock_id) Return ChildProductPrice objects filtered by the stock_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 ProductPriceQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* 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\\ProductPrice', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ChildProductPriceQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ProductPriceQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ProductPriceQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->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.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @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 = ProductPriceTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProductPriceTableMap::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 ChildProductPrice A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, STOCK_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);
|
||||
$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 ChildProductPrice();
|
||||
$obj->hydrate($row);
|
||||
ProductPriceTableMap::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 ChildProductPrice|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
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @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 ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProductPriceTableMap::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 ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProductPriceTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @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 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(ProductPriceTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductPriceTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the stock_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByStockId(1234); // WHERE stock_id = 1234
|
||||
* $query->filterByStockId(array(12, 34)); // WHERE stock_id IN (12, 34)
|
||||
* $query->filterByStockId(array('min' => 12)); // WHERE stock_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByStock()
|
||||
*
|
||||
* @param mixed $stockId 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 ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByStockId($stockId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($stockId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($stockId['min'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::STOCK_ID, $stockId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($stockId['max'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::STOCK_ID, $stockId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductPriceTableMap::STOCK_ID, $stockId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the currency_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $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
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCurrency()
|
||||
*
|
||||
* @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 ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCurrencyId($currencyId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($currencyId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($currencyId['min'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::CURRENCY_ID, $currencyId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($currencyId['max'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::CURRENCY_ID, $currencyId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductPriceTableMap::CURRENCY_ID, $currencyId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the price column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPrice(1234); // WHERE price = 1234
|
||||
* $query->filterByPrice(array(12, 34)); // WHERE price IN (12, 34)
|
||||
* $query->filterByPrice(array('min' => 12)); // WHERE price > 12
|
||||
* </code>
|
||||
*
|
||||
* @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 ChildProductPriceQuery 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(ProductPriceTableMap::PRICE, $price['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($price['max'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::PRICE, $price['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductPriceTableMap::PRICE, $price, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the promo_price column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $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
|
||||
* </code>
|
||||
*
|
||||
* @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 ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPromoPrice($promoPrice = null, $comparison = null)
|
||||
{
|
||||
if (is_array($promoPrice)) {
|
||||
$useMinMax = false;
|
||||
if (isset($promoPrice['min'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::PROMO_PRICE, $promoPrice['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($promoPrice['max'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::PROMO_PRICE, $promoPrice['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductPriceTableMap::PROMO_PRICE, $promoPrice, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $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'
|
||||
* </code>
|
||||
*
|
||||
* @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 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(ProductPriceTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductPriceTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $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'
|
||||
* </code>
|
||||
*
|
||||
* @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 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(ProductPriceTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductPriceTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Stock object
|
||||
*
|
||||
* @param \Thelia\Model\Stock|ObjectCollection $stock The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByStock($stock, $comparison = null)
|
||||
{
|
||||
if ($stock instanceof \Thelia\Model\Stock) {
|
||||
return $this
|
||||
->addUsingAlias(ProductPriceTableMap::STOCK_ID, $stock->getId(), $comparison);
|
||||
} elseif ($stock instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ProductPriceTableMap::STOCK_ID, $stock->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} 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 ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinStock($relationAlias = null, $joinType = Criteria::INNER_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::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinStock($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Stock', '\Thelia\Model\StockQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCurrency($currency, $comparison = null)
|
||||
{
|
||||
if ($currency instanceof \Thelia\Model\Currency) {
|
||||
return $this
|
||||
->addUsingAlias(ProductPriceTableMap::CURRENCY_ID, $currency->getId(), $comparison);
|
||||
} elseif ($currency instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ProductPriceTableMap::CURRENCY_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 ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCurrency($relationAlias = null, $joinType = Criteria::INNER_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 = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCurrency($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Currency', '\Thelia\Model\CurrencyQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildProductPrice $productPrice Object to remove from the list of results
|
||||
*
|
||||
* @return ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($productPrice = null)
|
||||
{
|
||||
if ($productPrice) {
|
||||
$this->addUsingAlias(ProductPriceTableMap::ID, $productPrice->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProductPriceTableMap::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).
|
||||
ProductPriceTableMap::clearInstancePool();
|
||||
ProductPriceTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildProductPrice or Criteria object OR a primary key value.
|
||||
*
|
||||
* @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
|
||||
* 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(ProductPriceTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ProductPriceTableMap::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();
|
||||
|
||||
|
||||
ProductPriceTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ProductPriceTableMap::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 ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProductPriceTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProductPriceTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProductPriceTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProductPriceTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProductPriceTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildProductPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProductPriceTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
} // ProductPriceQuery
|
||||
@@ -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
|
||||
@@ -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:
|
||||
* <code>
|
||||
* $query->filterByPrice(1234); // WHERE price = 1234
|
||||
* $query->filterByPrice(array(12, 34)); // WHERE price IN (12, 34)
|
||||
* $query->filterByPrice(array('min' => 12)); // WHERE price > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByPrice2(1234); // WHERE price2 = 1234
|
||||
* $query->filterByPrice2(array(12, 34)); // WHERE price2 IN (12, 34)
|
||||
* $query->filterByPrice2(array('min' => 12)); // WHERE price2 > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByEcotax(1234); // WHERE ecotax = 1234
|
||||
* $query->filterByEcotax(array(12, 34)); // WHERE ecotax IN (12, 34)
|
||||
* $query->filterByEcotax(array('min' => 12)); // WHERE ecotax > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByNewness(1234); // WHERE newness = 1234
|
||||
* $query->filterByNewness(array(12, 34)); // WHERE newness IN (12, 34)
|
||||
* $query->filterByNewness(array('min' => 12)); // WHERE newness > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByPromo(1234); // WHERE promo = 1234
|
||||
* $query->filterByPromo(array(12, 34)); // WHERE promo IN (12, 34)
|
||||
* $query->filterByPromo(array('min' => 12)); // WHERE promo > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByQuantity(1234); // WHERE quantity = 1234
|
||||
* $query->filterByQuantity(array(12, 34)); // WHERE quantity IN (12, 34)
|
||||
* $query->filterByQuantity(array('min' => 12)); // WHERE quantity > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByWeight(1234); // WHERE weight = 1234
|
||||
* $query->filterByWeight(array(12, 34)); // WHERE weight IN (12, 34)
|
||||
* $query->filterByWeight(array('min' => 12)); // WHERE weight > 12
|
||||
* </code>
|
||||
*
|
||||
* @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
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
* <code>
|
||||
* $query->filterByPrice(1234); // WHERE price = 1234
|
||||
* $query->filterByPrice(array(12, 34)); // WHERE price IN (12, 34)
|
||||
* $query->filterByPrice(array('min' => 12)); // WHERE price > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByPrice2(1234); // WHERE price2 = 1234
|
||||
* $query->filterByPrice2(array(12, 34)); // WHERE price2 IN (12, 34)
|
||||
* $query->filterByPrice2(array('min' => 12)); // WHERE price2 > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByEcotax(1234); // WHERE ecotax = 1234
|
||||
* $query->filterByEcotax(array(12, 34)); // WHERE ecotax IN (12, 34)
|
||||
* $query->filterByEcotax(array('min' => 12)); // WHERE ecotax > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByNewness(1234); // WHERE newness = 1234
|
||||
* $query->filterByNewness(array(12, 34)); // WHERE newness IN (12, 34)
|
||||
* $query->filterByNewness(array('min' => 12)); // WHERE newness > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByPromo(1234); // WHERE promo = 1234
|
||||
* $query->filterByPromo(array(12, 34)); // WHERE promo IN (12, 34)
|
||||
* $query->filterByPromo(array('min' => 12)); // WHERE promo > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByQuantity(1234); // WHERE quantity = 1234
|
||||
* $query->filterByQuantity(array(12, 34)); // WHERE quantity IN (12, 34)
|
||||
* $query->filterByQuantity(array('min' => 12)); // WHERE quantity > 12
|
||||
* </code>
|
||||
*
|
||||
* @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:
|
||||
* <code>
|
||||
* $query->filterByWeight(1234); // WHERE weight = 1234
|
||||
* $query->filterByWeight(array(12, 34)); // WHERE weight IN (12, 34)
|
||||
* $query->filterByWeight(array('min' => 12)); // WHERE weight > 12
|
||||
* </code>
|
||||
*
|
||||
* @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
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,9 @@ use Thelia\Model\Map\StockTableMap;
|
||||
* @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 orderByPromo($order = Criteria::ASC) Order by the promo column
|
||||
* @method ChildStockQuery orderByNewness($order = Criteria::ASC) Order by the newness column
|
||||
* @method ChildStockQuery orderByWeight($order = Criteria::ASC) Order by the weight 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
|
||||
*
|
||||
@@ -34,6 +37,9 @@ use Thelia\Model\Map\StockTableMap;
|
||||
* @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 groupByPromo() Group by the promo column
|
||||
* @method ChildStockQuery groupByNewness() Group by the newness column
|
||||
* @method ChildStockQuery groupByWeight() Group by the weight column
|
||||
* @method ChildStockQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildStockQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
@@ -41,14 +47,22 @@ use Thelia\Model\Map\StockTableMap;
|
||||
* @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 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 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 ChildStockQuery leftJoinAttributeCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeCombination relation
|
||||
* @method ChildStockQuery rightJoinAttributeCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCombination relation
|
||||
* @method ChildStockQuery innerJoinAttributeCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCombination relation
|
||||
*
|
||||
* @method ChildStockQuery leftJoinCartItem($relationAlias = null) Adds a LEFT JOIN clause to the query using the CartItem relation
|
||||
* @method ChildStockQuery rightJoinCartItem($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CartItem relation
|
||||
* @method ChildStockQuery innerJoinCartItem($relationAlias = null) Adds a INNER JOIN clause to the query using the CartItem relation
|
||||
*
|
||||
* @method ChildStockQuery leftJoinProductPrice($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductPrice relation
|
||||
* @method ChildStockQuery rightJoinProductPrice($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductPrice relation
|
||||
* @method ChildStockQuery innerJoinProductPrice($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductPrice 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
|
||||
*
|
||||
@@ -57,6 +71,9 @@ use Thelia\Model\Map\StockTableMap;
|
||||
* @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 findOneByPromo(int $promo) Return the first ChildStock filtered by the promo column
|
||||
* @method ChildStock findOneByNewness(int $newness) Return the first ChildStock filtered by the newness column
|
||||
* @method ChildStock findOneByWeight(double $weight) Return the first ChildStock filtered by the weight 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
|
||||
*
|
||||
@@ -65,6 +82,9 @@ use Thelia\Model\Map\StockTableMap;
|
||||
* @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 findByPromo(int $promo) Return ChildStock objects filtered by the promo column
|
||||
* @method array findByNewness(int $newness) Return ChildStock objects filtered by the newness column
|
||||
* @method array findByWeight(double $weight) Return ChildStock objects filtered by the weight 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
|
||||
*
|
||||
@@ -155,7 +175,7 @@ abstract class StockQuery extends ModelCriteria
|
||||
*/
|
||||
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, COMBINATION_ID, PRODUCT_ID, INCREASE, QUANTITY, PROMO, NEWNESS, WEIGHT, CREATED_AT, UPDATED_AT FROM stock WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -295,8 +315,6 @@ abstract class StockQuery extends ModelCriteria
|
||||
* $query->filterByCombinationId(array('min' => 12)); // WHERE combination_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCombination()
|
||||
*
|
||||
* @param mixed $combinationId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
@@ -453,6 +471,129 @@ abstract class StockQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(StockTableMap::QUANTITY, $quantity, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the promo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPromo(1234); // WHERE promo = 1234
|
||||
* $query->filterByPromo(array(12, 34)); // WHERE promo IN (12, 34)
|
||||
* $query->filterByPromo(array('min' => 12)); // WHERE promo > 12
|
||||
* </code>
|
||||
*
|
||||
* @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 ChildStockQuery 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(StockTableMap::PROMO, $promo['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($promo['max'])) {
|
||||
$this->addUsingAlias(StockTableMap::PROMO, $promo['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(StockTableMap::PROMO, $promo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the newness column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByNewness(1234); // WHERE newness = 1234
|
||||
* $query->filterByNewness(array(12, 34)); // WHERE newness IN (12, 34)
|
||||
* $query->filterByNewness(array('min' => 12)); // WHERE newness > 12
|
||||
* </code>
|
||||
*
|
||||
* @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 ChildStockQuery 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(StockTableMap::NEWNESS, $newness['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($newness['max'])) {
|
||||
$this->addUsingAlias(StockTableMap::NEWNESS, $newness['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(StockTableMap::NEWNESS, $newness, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the weight column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByWeight(1234); // WHERE weight = 1234
|
||||
* $query->filterByWeight(array(12, 34)); // WHERE weight IN (12, 34)
|
||||
* $query->filterByWeight(array('min' => 12)); // WHERE weight > 12
|
||||
* </code>
|
||||
*
|
||||
* @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 ChildStockQuery 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(StockTableMap::WEIGHT, $weight['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($weight['max'])) {
|
||||
$this->addUsingAlias(StockTableMap::WEIGHT, $weight['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(StockTableMap::WEIGHT, $weight, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
@@ -539,81 +680,6 @@ abstract class StockQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(StockTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Combination object
|
||||
*
|
||||
* @param \Thelia\Model\Combination|ObjectCollection $combination 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
|
||||
*/
|
||||
public function filterByCombination($combination, $comparison = null)
|
||||
{
|
||||
if ($combination instanceof \Thelia\Model\Combination) {
|
||||
return $this
|
||||
->addUsingAlias(StockTableMap::COMBINATION_ID, $combination->getId(), $comparison);
|
||||
} elseif ($combination instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(StockTableMap::COMBINATION_ID, $combination->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCombination() only accepts arguments of type \Thelia\Model\Combination or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Combination 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
|
||||
*/
|
||||
public function joinCombination($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Combination');
|
||||
|
||||
// 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, 'Combination');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Combination relation Combination 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\CombinationQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCombinationQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCombination($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Combination', '\Thelia\Model\CombinationQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Product object
|
||||
*
|
||||
@@ -689,6 +755,225 @@ abstract class StockQuery extends ModelCriteria
|
||||
->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 ChildStockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttributeCombination($attributeCombination, $comparison = null)
|
||||
{
|
||||
if ($attributeCombination instanceof \Thelia\Model\AttributeCombination) {
|
||||
return $this
|
||||
->addUsingAlias(StockTableMap::ID, $attributeCombination->getStockId(), $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 ChildStockQuery 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 ChildStockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCartItem($cartItem, $comparison = null)
|
||||
{
|
||||
if ($cartItem instanceof \Thelia\Model\CartItem) {
|
||||
return $this
|
||||
->addUsingAlias(StockTableMap::ID, $cartItem->getStockId(), $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 ChildStockQuery 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 ChildStockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProductPrice($productPrice, $comparison = null)
|
||||
{
|
||||
if ($productPrice instanceof \Thelia\Model\ProductPrice) {
|
||||
return $this
|
||||
->addUsingAlias(StockTableMap::ID, $productPrice->getStockId(), $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 ChildStockQuery 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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user