update cart model
This commit is contained in:
@@ -99,6 +99,13 @@ abstract class Cart implements ActiveRecordInterface
|
||||
*/
|
||||
protected $currency_id;
|
||||
|
||||
/**
|
||||
* The value for the discount field.
|
||||
* Note: this column has a database default value of: 0
|
||||
* @var double
|
||||
*/
|
||||
protected $discount;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -151,11 +158,24 @@ abstract class Cart implements ActiveRecordInterface
|
||||
*/
|
||||
protected $cartItemsScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* Applies default values to this object.
|
||||
* This method should be called from the object's constructor (or
|
||||
* equivalent initialization method).
|
||||
* @see __construct()
|
||||
*/
|
||||
public function applyDefaultValues()
|
||||
{
|
||||
$this->discount = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes internal state of Thelia\Model\Base\Cart object.
|
||||
* @see applyDefaults()
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->applyDefaultValues();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -471,6 +491,17 @@ abstract class Cart implements ActiveRecordInterface
|
||||
return $this->currency_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [discount] column value.
|
||||
*
|
||||
* @return double
|
||||
*/
|
||||
public function getDiscount()
|
||||
{
|
||||
|
||||
return $this->discount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -653,6 +684,27 @@ abstract class Cart implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setCurrencyId()
|
||||
|
||||
/**
|
||||
* Set the value of [discount] column.
|
||||
*
|
||||
* @param double $v new value
|
||||
* @return \Thelia\Model\Cart The current object (for fluent API support)
|
||||
*/
|
||||
public function setDiscount($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (double) $v;
|
||||
}
|
||||
|
||||
if ($this->discount !== $v) {
|
||||
$this->discount = $v;
|
||||
$this->modifiedColumns[] = CartTableMap::DISCOUNT;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setDiscount()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -705,6 +757,10 @@ abstract class Cart implements ActiveRecordInterface
|
||||
*/
|
||||
public function hasOnlyDefaultValues()
|
||||
{
|
||||
if ($this->discount !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// otherwise, everything was equal, so return TRUE
|
||||
return true;
|
||||
} // hasOnlyDefaultValues()
|
||||
@@ -750,13 +806,16 @@ abstract class Cart implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CartTableMap::translateFieldName('CurrencyId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->currency_id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CartTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CartTableMap::translateFieldName('Discount', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->discount = (null !== $col) ? (double) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CartTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CartTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CartTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -769,7 +828,7 @@ abstract class Cart implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 8; // 8 = CartTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 9; // 9 = CartTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\Cart object", 0, $e);
|
||||
@@ -1075,6 +1134,9 @@ abstract class Cart implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CartTableMap::CURRENCY_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CURRENCY_ID';
|
||||
}
|
||||
if ($this->isColumnModified(CartTableMap::DISCOUNT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'DISCOUNT';
|
||||
}
|
||||
if ($this->isColumnModified(CartTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
|
||||
}
|
||||
@@ -1110,6 +1172,9 @@ abstract class Cart implements ActiveRecordInterface
|
||||
case 'CURRENCY_ID':
|
||||
$stmt->bindValue($identifier, $this->currency_id, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'DISCOUNT':
|
||||
$stmt->bindValue($identifier, $this->discount, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'CREATED_AT':
|
||||
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1197,9 +1262,12 @@ abstract class Cart implements ActiveRecordInterface
|
||||
return $this->getCurrencyId();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getCreatedAt();
|
||||
return $this->getDiscount();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1237,8 +1305,9 @@ abstract class Cart implements ActiveRecordInterface
|
||||
$keys[3] => $this->getAddressDeliveryId(),
|
||||
$keys[4] => $this->getAddressInvoiceId(),
|
||||
$keys[5] => $this->getCurrencyId(),
|
||||
$keys[6] => $this->getCreatedAt(),
|
||||
$keys[7] => $this->getUpdatedAt(),
|
||||
$keys[6] => $this->getDiscount(),
|
||||
$keys[7] => $this->getCreatedAt(),
|
||||
$keys[8] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1315,9 +1384,12 @@ abstract class Cart implements ActiveRecordInterface
|
||||
$this->setCurrencyId($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setCreatedAt($value);
|
||||
$this->setDiscount($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1350,8 +1422,9 @@ abstract class Cart implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[3], $arr)) $this->setAddressDeliveryId($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setAddressInvoiceId($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setCurrencyId($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setDiscount($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setCreatedAt($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setUpdatedAt($arr[$keys[8]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1369,6 +1442,7 @@ abstract class Cart implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CartTableMap::ADDRESS_DELIVERY_ID)) $criteria->add(CartTableMap::ADDRESS_DELIVERY_ID, $this->address_delivery_id);
|
||||
if ($this->isColumnModified(CartTableMap::ADDRESS_INVOICE_ID)) $criteria->add(CartTableMap::ADDRESS_INVOICE_ID, $this->address_invoice_id);
|
||||
if ($this->isColumnModified(CartTableMap::CURRENCY_ID)) $criteria->add(CartTableMap::CURRENCY_ID, $this->currency_id);
|
||||
if ($this->isColumnModified(CartTableMap::DISCOUNT)) $criteria->add(CartTableMap::DISCOUNT, $this->discount);
|
||||
if ($this->isColumnModified(CartTableMap::CREATED_AT)) $criteria->add(CartTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(CartTableMap::UPDATED_AT)) $criteria->add(CartTableMap::UPDATED_AT, $this->updated_at);
|
||||
|
||||
@@ -1439,6 +1513,7 @@ abstract class Cart implements ActiveRecordInterface
|
||||
$copyObj->setAddressDeliveryId($this->getAddressDeliveryId());
|
||||
$copyObj->setAddressInvoiceId($this->getAddressInvoiceId());
|
||||
$copyObj->setCurrencyId($this->getCurrencyId());
|
||||
$copyObj->setDiscount($this->getDiscount());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
|
||||
@@ -1982,10 +2057,12 @@ abstract class Cart implements ActiveRecordInterface
|
||||
$this->address_delivery_id = null;
|
||||
$this->address_invoice_id = null;
|
||||
$this->currency_id = null;
|
||||
$this->discount = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->alreadyInSave = false;
|
||||
$this->clearAllReferences();
|
||||
$this->applyDefaultValues();
|
||||
$this->resetModified();
|
||||
$this->setNew(true);
|
||||
$this->setDeleted(false);
|
||||
|
||||
@@ -109,6 +109,13 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
*/
|
||||
protected $price_end_of_life;
|
||||
|
||||
/**
|
||||
* The value for the discount field.
|
||||
* Note: this column has a database default value of: 0
|
||||
* @var double
|
||||
*/
|
||||
protected $discount;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -153,6 +160,7 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
public function applyDefaultValues()
|
||||
{
|
||||
$this->quantity = 1;
|
||||
$this->discount = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -508,6 +516,17 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [discount] column value.
|
||||
*
|
||||
* @return double
|
||||
*/
|
||||
public function getDiscount()
|
||||
{
|
||||
|
||||
return $this->discount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -728,6 +747,27 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setPriceEndOfLife()
|
||||
|
||||
/**
|
||||
* Set the value of [discount] column.
|
||||
*
|
||||
* @param double $v new value
|
||||
* @return \Thelia\Model\CartItem The current object (for fluent API support)
|
||||
*/
|
||||
public function setDiscount($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (double) $v;
|
||||
}
|
||||
|
||||
if ($this->discount !== $v) {
|
||||
$this->discount = $v;
|
||||
$this->modifiedColumns[] = CartItemTableMap::DISCOUNT;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setDiscount()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -784,6 +824,10 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->discount !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// otherwise, everything was equal, so return TRUE
|
||||
return true;
|
||||
} // hasOnlyDefaultValues()
|
||||
@@ -838,13 +882,16 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
}
|
||||
$this->price_end_of_life = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CartItemTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CartItemTableMap::translateFieldName('Discount', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->discount = (null !== $col) ? (double) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CartItemTableMap::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 ? 9 + $startcol : CartItemTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CartItemTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -857,7 +904,7 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 10; // 10 = CartItemTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 11; // 11 = CartItemTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\CartItem object", 0, $e);
|
||||
@@ -1139,6 +1186,9 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CartItemTableMap::PRICE_END_OF_LIFE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'PRICE_END_OF_LIFE';
|
||||
}
|
||||
if ($this->isColumnModified(CartItemTableMap::DISCOUNT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'DISCOUNT';
|
||||
}
|
||||
if ($this->isColumnModified(CartItemTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
|
||||
}
|
||||
@@ -1180,6 +1230,9 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
case 'PRICE_END_OF_LIFE':
|
||||
$stmt->bindValue($identifier, $this->price_end_of_life ? $this->price_end_of_life->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'DISCOUNT':
|
||||
$stmt->bindValue($identifier, $this->discount, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'CREATED_AT':
|
||||
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1273,9 +1326,12 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
return $this->getPriceEndOfLife();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getCreatedAt();
|
||||
return $this->getDiscount();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 10:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1315,8 +1371,9 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
$keys[5] => $this->getPrice(),
|
||||
$keys[6] => $this->getPromoPrice(),
|
||||
$keys[7] => $this->getPriceEndOfLife(),
|
||||
$keys[8] => $this->getCreatedAt(),
|
||||
$keys[9] => $this->getUpdatedAt(),
|
||||
$keys[8] => $this->getDiscount(),
|
||||
$keys[9] => $this->getCreatedAt(),
|
||||
$keys[10] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1393,9 +1450,12 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
$this->setPriceEndOfLife($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setCreatedAt($value);
|
||||
$this->setDiscount($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 10:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1430,8 +1490,9 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[5], $arr)) $this->setPrice($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setPromoPrice($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setPriceEndOfLife($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setCreatedAt($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setUpdatedAt($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setDiscount($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setCreatedAt($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setUpdatedAt($arr[$keys[10]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1451,6 +1512,7 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CartItemTableMap::PRICE)) $criteria->add(CartItemTableMap::PRICE, $this->price);
|
||||
if ($this->isColumnModified(CartItemTableMap::PROMO_PRICE)) $criteria->add(CartItemTableMap::PROMO_PRICE, $this->promo_price);
|
||||
if ($this->isColumnModified(CartItemTableMap::PRICE_END_OF_LIFE)) $criteria->add(CartItemTableMap::PRICE_END_OF_LIFE, $this->price_end_of_life);
|
||||
if ($this->isColumnModified(CartItemTableMap::DISCOUNT)) $criteria->add(CartItemTableMap::DISCOUNT, $this->discount);
|
||||
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);
|
||||
|
||||
@@ -1523,6 +1585,7 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
$copyObj->setPrice($this->getPrice());
|
||||
$copyObj->setPromoPrice($this->getPromoPrice());
|
||||
$copyObj->setPriceEndOfLife($this->getPriceEndOfLife());
|
||||
$copyObj->setDiscount($this->getDiscount());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
if ($makeNew) {
|
||||
@@ -1719,6 +1782,7 @@ abstract class CartItem implements ActiveRecordInterface
|
||||
$this->price = null;
|
||||
$this->promo_price = null;
|
||||
$this->price_end_of_life = null;
|
||||
$this->discount = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->alreadyInSave = false;
|
||||
|
||||
@@ -29,6 +29,7 @@ use Thelia\Model\Map\CartItemTableMap;
|
||||
* @method ChildCartItemQuery orderByPrice($order = Criteria::ASC) Order by the price column
|
||||
* @method ChildCartItemQuery orderByPromoPrice($order = Criteria::ASC) Order by the promo_price column
|
||||
* @method ChildCartItemQuery orderByPriceEndOfLife($order = Criteria::ASC) Order by the price_end_of_life column
|
||||
* @method ChildCartItemQuery orderByDiscount($order = Criteria::ASC) Order by the discount 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
|
||||
*
|
||||
@@ -40,6 +41,7 @@ use Thelia\Model\Map\CartItemTableMap;
|
||||
* @method ChildCartItemQuery groupByPrice() Group by the price column
|
||||
* @method ChildCartItemQuery groupByPromoPrice() Group by the promo_price column
|
||||
* @method ChildCartItemQuery groupByPriceEndOfLife() Group by the price_end_of_life column
|
||||
* @method ChildCartItemQuery groupByDiscount() Group by the discount column
|
||||
* @method ChildCartItemQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCartItemQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
@@ -70,6 +72,7 @@ use Thelia\Model\Map\CartItemTableMap;
|
||||
* @method ChildCartItem findOneByPrice(double $price) Return the first ChildCartItem filtered by the price column
|
||||
* @method ChildCartItem findOneByPromoPrice(double $promo_price) Return the first ChildCartItem filtered by the promo_price column
|
||||
* @method ChildCartItem findOneByPriceEndOfLife(string $price_end_of_life) Return the first ChildCartItem filtered by the price_end_of_life column
|
||||
* @method ChildCartItem findOneByDiscount(double $discount) Return the first ChildCartItem filtered by the discount 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
|
||||
*
|
||||
@@ -81,6 +84,7 @@ use Thelia\Model\Map\CartItemTableMap;
|
||||
* @method array findByPrice(double $price) Return ChildCartItem objects filtered by the price column
|
||||
* @method array findByPromoPrice(double $promo_price) Return ChildCartItem objects filtered by the promo_price column
|
||||
* @method array findByPriceEndOfLife(string $price_end_of_life) Return ChildCartItem objects filtered by the price_end_of_life column
|
||||
* @method array findByDiscount(double $discount) Return ChildCartItem objects filtered by the discount 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
|
||||
*
|
||||
@@ -171,7 +175,7 @@ abstract class CartItemQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CART_ID, PRODUCT_ID, QUANTITY, PRODUCT_SALE_ELEMENTS_ID, PRICE, PROMO_PRICE, PRICE_END_OF_LIFE, CREATED_AT, UPDATED_AT FROM cart_item WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, CART_ID, PRODUCT_ID, QUANTITY, PRODUCT_SALE_ELEMENTS_ID, PRICE, PROMO_PRICE, PRICE_END_OF_LIFE, DISCOUNT, CREATED_AT, UPDATED_AT FROM cart_item WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -596,6 +600,47 @@ abstract class CartItemQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CartItemTableMap::PRICE_END_OF_LIFE, $priceEndOfLife, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the discount column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDiscount(1234); // WHERE discount = 1234
|
||||
* $query->filterByDiscount(array(12, 34)); // WHERE discount IN (12, 34)
|
||||
* $query->filterByDiscount(array('min' => 12)); // WHERE discount > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $discount 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 ChildCartItemQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDiscount($discount = null, $comparison = null)
|
||||
{
|
||||
if (is_array($discount)) {
|
||||
$useMinMax = false;
|
||||
if (isset($discount['min'])) {
|
||||
$this->addUsingAlias(CartItemTableMap::DISCOUNT, $discount['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($discount['max'])) {
|
||||
$this->addUsingAlias(CartItemTableMap::DISCOUNT, $discount['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CartItemTableMap::DISCOUNT, $discount, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
|
||||
@@ -27,6 +27,7 @@ use Thelia\Model\Map\CartTableMap;
|
||||
* @method ChildCartQuery orderByAddressDeliveryId($order = Criteria::ASC) Order by the address_delivery_id column
|
||||
* @method ChildCartQuery orderByAddressInvoiceId($order = Criteria::ASC) Order by the address_invoice_id column
|
||||
* @method ChildCartQuery orderByCurrencyId($order = Criteria::ASC) Order by the currency_id column
|
||||
* @method ChildCartQuery orderByDiscount($order = Criteria::ASC) Order by the discount column
|
||||
* @method ChildCartQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCartQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
@@ -36,6 +37,7 @@ use Thelia\Model\Map\CartTableMap;
|
||||
* @method ChildCartQuery groupByAddressDeliveryId() Group by the address_delivery_id column
|
||||
* @method ChildCartQuery groupByAddressInvoiceId() Group by the address_invoice_id column
|
||||
* @method ChildCartQuery groupByCurrencyId() Group by the currency_id column
|
||||
* @method ChildCartQuery groupByDiscount() Group by the discount column
|
||||
* @method ChildCartQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCartQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
@@ -72,6 +74,7 @@ use Thelia\Model\Map\CartTableMap;
|
||||
* @method ChildCart findOneByAddressDeliveryId(int $address_delivery_id) Return the first ChildCart filtered by the address_delivery_id column
|
||||
* @method ChildCart findOneByAddressInvoiceId(int $address_invoice_id) Return the first ChildCart filtered by the address_invoice_id column
|
||||
* @method ChildCart findOneByCurrencyId(int $currency_id) Return the first ChildCart filtered by the currency_id column
|
||||
* @method ChildCart findOneByDiscount(double $discount) Return the first ChildCart filtered by the discount column
|
||||
* @method ChildCart findOneByCreatedAt(string $created_at) Return the first ChildCart filtered by the created_at column
|
||||
* @method ChildCart findOneByUpdatedAt(string $updated_at) Return the first ChildCart filtered by the updated_at column
|
||||
*
|
||||
@@ -81,6 +84,7 @@ use Thelia\Model\Map\CartTableMap;
|
||||
* @method array findByAddressDeliveryId(int $address_delivery_id) Return ChildCart objects filtered by the address_delivery_id column
|
||||
* @method array findByAddressInvoiceId(int $address_invoice_id) Return ChildCart objects filtered by the address_invoice_id column
|
||||
* @method array findByCurrencyId(int $currency_id) Return ChildCart objects filtered by the currency_id column
|
||||
* @method array findByDiscount(double $discount) Return ChildCart objects filtered by the discount column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCart objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCart objects filtered by the updated_at column
|
||||
*
|
||||
@@ -171,7 +175,7 @@ abstract class CartQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, TOKEN, CUSTOMER_ID, ADDRESS_DELIVERY_ID, ADDRESS_INVOICE_ID, CURRENCY_ID, CREATED_AT, UPDATED_AT FROM cart WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, TOKEN, CUSTOMER_ID, ADDRESS_DELIVERY_ID, ADDRESS_INVOICE_ID, CURRENCY_ID, DISCOUNT, CREATED_AT, UPDATED_AT FROM cart WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -502,6 +506,47 @@ abstract class CartQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CartTableMap::CURRENCY_ID, $currencyId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the discount column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDiscount(1234); // WHERE discount = 1234
|
||||
* $query->filterByDiscount(array(12, 34)); // WHERE discount IN (12, 34)
|
||||
* $query->filterByDiscount(array('min' => 12)); // WHERE discount > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $discount 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 ChildCartQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDiscount($discount = null, $comparison = null)
|
||||
{
|
||||
if (is_array($discount)) {
|
||||
$useMinMax = false;
|
||||
if (isset($discount['min'])) {
|
||||
$this->addUsingAlias(CartTableMap::DISCOUNT, $discount['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($discount['max'])) {
|
||||
$this->addUsingAlias(CartTableMap::DISCOUNT, $discount['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CartTableMap::DISCOUNT, $discount, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user