regenerate modeland sql fixing typo in CartItem table

This commit is contained in:
Manuel Raynaud
2013-08-06 09:57:14 +02:00
parent 2b656336c7
commit c97f0e462a
4 changed files with 59 additions and 59 deletions

View File

@@ -104,10 +104,10 @@ abstract class CartItem implements ActiveRecordInterface
protected $promo_price;
/**
* The value for the price_end of life field.
* The value for the price_end_of_life field.
* @var string
*/
protected $price_end of life;
protected $price_end_of_life;
/**
* The value for the created_at field.
@@ -489,7 +489,7 @@ abstract class CartItem implements ActiveRecordInterface
}
/**
* Get the [optionally formatted] temporal [price_end of life] column value.
* Get the [optionally formatted] temporal [price_end_of_life] column value.
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
@@ -499,12 +499,12 @@ abstract class CartItem implements ActiveRecordInterface
*
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getPriceEnd of life($format = NULL)
public function getPriceEndOfLife($format = NULL)
{
if ($format === null) {
return $this->price_end of life;
return $this->price_end_of_life;
} else {
return $this->price_end of life !== null ? $this->price_end of life->format($format) : null;
return $this->price_end_of_life !== null ? $this->price_end_of_life->format($format) : null;
}
}
@@ -708,25 +708,25 @@ abstract class CartItem implements ActiveRecordInterface
} // setPromoPrice()
/**
* Sets the value of [price_end of life] column to a normalized version of the date/time value specified.
* Sets the value of [price_end_of_life] column to a normalized version of the date/time value specified.
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
* @return \Thelia\Model\CartItem The current object (for fluent API support)
*/
public function setPriceEnd of life($v)
public function setPriceEndOfLife($v)
{
$dt = PropelDateTime::newInstance($v, null, '\DateTime');
if ($this->price_end of life !== null || $dt !== null) {
if ($dt !== $this->price_end of life) {
$this->price_end of life = $dt;
$this->modifiedColumns[] = CartItemTableMap::PRICE_END OF LIFE;
if ($this->price_end_of_life !== null || $dt !== null) {
if ($dt !== $this->price_end_of_life) {
$this->price_end_of_life = $dt;
$this->modifiedColumns[] = CartItemTableMap::PRICE_END_OF_LIFE;
}
} // if either are not null
return $this;
} // setPriceEnd of life()
} // setPriceEndOfLife()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
@@ -832,11 +832,11 @@ abstract class CartItem implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CartItemTableMap::translateFieldName('PromoPrice', TableMap::TYPE_PHPNAME, $indexType)];
$this->promo_price = (null !== $col) ? (double) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CartItemTableMap::translateFieldName('PriceEnd of life', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CartItemTableMap::translateFieldName('PriceEndOfLife', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->price_end of life = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$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)];
if ($col === '0000-00-00 00:00:00') {
@@ -1136,8 +1136,8 @@ abstract class CartItem implements ActiveRecordInterface
if ($this->isColumnModified(CartItemTableMap::PROMO_PRICE)) {
$modifiedColumns[':p' . $index++] = 'PROMO_PRICE';
}
if ($this->isColumnModified(CartItemTableMap::PRICE_END OF LIFE)) {
$modifiedColumns[':p' . $index++] = 'PRICE_END OF LIFE';
if ($this->isColumnModified(CartItemTableMap::PRICE_END_OF_LIFE)) {
$modifiedColumns[':p' . $index++] = 'PRICE_END_OF_LIFE';
}
if ($this->isColumnModified(CartItemTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
@@ -1177,8 +1177,8 @@ abstract class CartItem implements ActiveRecordInterface
case 'PROMO_PRICE':
$stmt->bindValue($identifier, $this->promo_price, PDO::PARAM_STR);
break;
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);
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 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
@@ -1270,7 +1270,7 @@ abstract class CartItem implements ActiveRecordInterface
return $this->getPromoPrice();
break;
case 7:
return $this->getPriceEnd of life();
return $this->getPriceEndOfLife();
break;
case 8:
return $this->getCreatedAt();
@@ -1314,7 +1314,7 @@ abstract class CartItem implements ActiveRecordInterface
$keys[4] => $this->getProductSaleElementsId(),
$keys[5] => $this->getPrice(),
$keys[6] => $this->getPromoPrice(),
$keys[7] => $this->getPriceEnd of life(),
$keys[7] => $this->getPriceEndOfLife(),
$keys[8] => $this->getCreatedAt(),
$keys[9] => $this->getUpdatedAt(),
);
@@ -1390,7 +1390,7 @@ abstract class CartItem implements ActiveRecordInterface
$this->setPromoPrice($value);
break;
case 7:
$this->setPriceEnd of life($value);
$this->setPriceEndOfLife($value);
break;
case 8:
$this->setCreatedAt($value);
@@ -1429,7 +1429,7 @@ abstract class CartItem implements ActiveRecordInterface
if (array_key_exists($keys[4], $arr)) $this->setProductSaleElementsId($arr[$keys[4]]);
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->setPriceEnd of life($arr[$keys[7]]);
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]]);
}
@@ -1450,7 +1450,7 @@ abstract class CartItem implements ActiveRecordInterface
if ($this->isColumnModified(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID)) $criteria->add(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, $this->product_sale_elements_id);
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::PRICE_END_OF_LIFE)) $criteria->add(CartItemTableMap::PRICE_END_OF_LIFE, $this->price_end_of_life);
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);
@@ -1522,7 +1522,7 @@ abstract class CartItem implements ActiveRecordInterface
$copyObj->setProductSaleElementsId($this->getProductSaleElementsId());
$copyObj->setPrice($this->getPrice());
$copyObj->setPromoPrice($this->getPromoPrice());
$copyObj->setPriceEnd of life($this->getPriceEnd of life());
$copyObj->setPriceEndOfLife($this->getPriceEndOfLife());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1718,7 +1718,7 @@ abstract class CartItem implements ActiveRecordInterface
$this->product_sale_elements_id = null;
$this->price = null;
$this->promo_price = null;
$this->price_end of life = null;
$this->price_end_of_life = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -28,7 +28,7 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItemQuery orderByProductSaleElementsId($order = Criteria::ASC) Order by the product_sale_elements_id column
* @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 orderByPriceEnd of life($order = Criteria::ASC) Order by the price_end of life column
* @method ChildCartItemQuery orderByPriceEndOfLife($order = Criteria::ASC) Order by the price_end_of_life 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
*
@@ -39,7 +39,7 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItemQuery groupByProductSaleElementsId() Group by the product_sale_elements_id column
* @method ChildCartItemQuery groupByPrice() Group by the price column
* @method ChildCartItemQuery groupByPromoPrice() Group by the promo_price column
* @method ChildCartItemQuery groupByPriceEnd of life() Group by the price_end of life column
* @method ChildCartItemQuery groupByPriceEndOfLife() Group by the price_end_of_life column
* @method ChildCartItemQuery groupByCreatedAt() Group by the created_at column
* @method ChildCartItemQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -69,7 +69,7 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItem findOneByProductSaleElementsId(int $product_sale_elements_id) Return the first ChildCartItem filtered by the product_sale_elements_id column
* @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 findOneByPriceEnd of life(string $price_end of life) Return the first ChildCartItem filtered by the price_end of life column
* @method ChildCartItem findOneByPriceEndOfLife(string $price_end_of_life) Return the first ChildCartItem filtered by the price_end_of_life 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
*
@@ -80,7 +80,7 @@ use Thelia\Model\Map\CartItemTableMap;
* @method array findByProductSaleElementsId(int $product_sale_elements_id) Return ChildCartItem objects filtered by the product_sale_elements_id column
* @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 findByPriceEnd of life(string $price_end of life) Return ChildCartItem objects filtered by the price_end of life column
* @method array findByPriceEndOfLife(string $price_end_of_life) Return ChildCartItem objects filtered by the price_end_of_life 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 +171,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, CREATED_AT, UPDATED_AT FROM cart_item WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -554,16 +554,16 @@ abstract class CartItemQuery extends ModelCriteria
}
/**
* Filter the query on the price_end of life column
* Filter the query on the price_end_of_life column
*
* Example usage:
* <code>
* $query->filterByPriceEnd of life('2011-03-14'); // WHERE price_end of life = '2011-03-14'
* $query->filterByPriceEnd of life('now'); // WHERE price_end of life = '2011-03-14'
* $query->filterByPriceEnd of life(array('max' => 'yesterday')); // WHERE price_end of life > '2011-03-13'
* $query->filterByPriceEndOfLife('2011-03-14'); // WHERE price_end_of_life = '2011-03-14'
* $query->filterByPriceEndOfLife('now'); // WHERE price_end_of_life = '2011-03-14'
* $query->filterByPriceEndOfLife(array('max' => 'yesterday')); // WHERE price_end_of_life > '2011-03-13'
* </code>
*
* @param mixed $priceEnd of life The value to use as filter.
* @param mixed $priceEndOfLife 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.
@@ -573,16 +573,16 @@ abstract class CartItemQuery extends ModelCriteria
*
* @return ChildCartItemQuery The current query, for fluid interface
*/
public function filterByPriceEnd of life($priceEnd of life = null, $comparison = null)
public function filterByPriceEndOfLife($priceEndOfLife = null, $comparison = null)
{
if (is_array($priceEnd of life)) {
if (is_array($priceEndOfLife)) {
$useMinMax = false;
if (isset($priceEnd of life['min'])) {
$this->addUsingAlias(CartItemTableMap::PRICE_END OF LIFE, $priceEnd of life['min'], Criteria::GREATER_EQUAL);
if (isset($priceEndOfLife['min'])) {
$this->addUsingAlias(CartItemTableMap::PRICE_END_OF_LIFE, $priceEndOfLife['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($priceEnd of life['max'])) {
$this->addUsingAlias(CartItemTableMap::PRICE_END OF LIFE, $priceEnd of life['max'], Criteria::LESS_EQUAL);
if (isset($priceEndOfLife['max'])) {
$this->addUsingAlias(CartItemTableMap::PRICE_END_OF_LIFE, $priceEndOfLife['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -593,7 +593,7 @@ abstract class CartItemQuery extends ModelCriteria
}
}
return $this->addUsingAlias(CartItemTableMap::PRICE_END OF LIFE, $priceEnd of life, $comparison);
return $this->addUsingAlias(CartItemTableMap::PRICE_END_OF_LIFE, $priceEndOfLife, $comparison);
}
/**