Merge branch 'catalog'

Conflicts:
	core/lib/Thelia/Config/Resources/config.xml
	core/lib/Thelia/Config/Resources/routing/admin.xml
	core/lib/Thelia/Core/Template/Loop/Country.php
	core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php
	core/lib/Thelia/Model/Country.php
	core/lib/Thelia/Model/Profile.php
	core/lib/Thelia/Model/ProfileQuery.php
	install/insert.sql
	install/thelia.sql
	local/config/schema.xml
This commit is contained in:
Franck Allimant
2013-10-24 00:16:33 +02:00
38 changed files with 3324 additions and 1903 deletions

View File

@@ -95,10 +95,18 @@ abstract class Country implements ActiveRecordInterface
/**
* The value for the by_default field.
* Note: this column has a database default value of: 0
* @var int
*/
protected $by_default;
/**
* The value for the shop_country field.
* Note: this column has a database default value of: false
* @var boolean
*/
protected $shop_country;
/**
* The value for the created_at field.
* @var string
@@ -174,11 +182,25 @@ abstract class Country implements ActiveRecordInterface
*/
protected $countryI18nsScheduledForDeletion = 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->by_default = 0;
$this->shop_country = false;
}
/**
* Initializes internal state of Thelia\Model\Base\Country object.
* @see applyDefaults()
*/
public function __construct()
{
$this->applyDefaultValues();
}
/**
@@ -498,6 +520,17 @@ abstract class Country implements ActiveRecordInterface
return $this->by_default;
}
/**
* Get the [shop_country] column value.
*
* @return boolean
*/
public function getShopCountry()
{
return $this->shop_country;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -668,6 +701,35 @@ abstract class Country implements ActiveRecordInterface
return $this;
} // setByDefault()
/**
* Sets the value of the [shop_country] column.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
*
* @param boolean|integer|string $v The new value
* @return \Thelia\Model\Country The current object (for fluent API support)
*/
public function setShopCountry($v)
{
if ($v !== null) {
if (is_string($v)) {
$v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
} else {
$v = (boolean) $v;
}
}
if ($this->shop_country !== $v) {
$this->shop_country = $v;
$this->modifiedColumns[] = CountryTableMap::SHOP_COUNTRY;
}
return $this;
} // setShopCountry()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -720,6 +782,14 @@ abstract class Country implements ActiveRecordInterface
*/
public function hasOnlyDefaultValues()
{
if ($this->by_default !== 0) {
return false;
}
if ($this->shop_country !== false) {
return false;
}
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
@@ -765,13 +835,16 @@ abstract class Country implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CountryTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
$this->by_default = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CountryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CountryTableMap::translateFieldName('ShopCountry', TableMap::TYPE_PHPNAME, $indexType)];
$this->shop_country = (null !== $col) ? (boolean) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CountryTableMap::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 : CountryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CountryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -784,7 +857,7 @@ abstract class Country implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 8; // 8 = CountryTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 9; // 9 = CountryTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\Country object", 0, $e);
@@ -1095,6 +1168,9 @@ abstract class Country implements ActiveRecordInterface
if ($this->isColumnModified(CountryTableMap::BY_DEFAULT)) {
$modifiedColumns[':p' . $index++] = 'BY_DEFAULT';
}
if ($this->isColumnModified(CountryTableMap::SHOP_COUNTRY)) {
$modifiedColumns[':p' . $index++] = 'SHOP_COUNTRY';
}
if ($this->isColumnModified(CountryTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -1130,6 +1206,9 @@ abstract class Country implements ActiveRecordInterface
case 'BY_DEFAULT':
$stmt->bindValue($identifier, $this->by_default, PDO::PARAM_INT);
break;
case 'SHOP_COUNTRY':
$stmt->bindValue($identifier, (int) $this->shop_country, 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;
@@ -1217,9 +1296,12 @@ abstract class Country implements ActiveRecordInterface
return $this->getByDefault();
break;
case 6:
return $this->getCreatedAt();
return $this->getShopCountry();
break;
case 7:
return $this->getCreatedAt();
break;
case 8:
return $this->getUpdatedAt();
break;
default:
@@ -1257,8 +1339,9 @@ abstract class Country implements ActiveRecordInterface
$keys[3] => $this->getIsoalpha2(),
$keys[4] => $this->getIsoalpha3(),
$keys[5] => $this->getByDefault(),
$keys[6] => $this->getCreatedAt(),
$keys[7] => $this->getUpdatedAt(),
$keys[6] => $this->getShopCountry(),
$keys[7] => $this->getCreatedAt(),
$keys[8] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1331,9 +1414,12 @@ abstract class Country implements ActiveRecordInterface
$this->setByDefault($value);
break;
case 6:
$this->setCreatedAt($value);
$this->setShopCountry($value);
break;
case 7:
$this->setCreatedAt($value);
break;
case 8:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1366,8 +1452,9 @@ abstract class Country implements ActiveRecordInterface
if (array_key_exists($keys[3], $arr)) $this->setIsoalpha2($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setIsoalpha3($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setByDefault($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]);
if (array_key_exists($keys[6], $arr)) $this->setShopCountry($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]]);
}
/**
@@ -1385,6 +1472,7 @@ abstract class Country implements ActiveRecordInterface
if ($this->isColumnModified(CountryTableMap::ISOALPHA2)) $criteria->add(CountryTableMap::ISOALPHA2, $this->isoalpha2);
if ($this->isColumnModified(CountryTableMap::ISOALPHA3)) $criteria->add(CountryTableMap::ISOALPHA3, $this->isoalpha3);
if ($this->isColumnModified(CountryTableMap::BY_DEFAULT)) $criteria->add(CountryTableMap::BY_DEFAULT, $this->by_default);
if ($this->isColumnModified(CountryTableMap::SHOP_COUNTRY)) $criteria->add(CountryTableMap::SHOP_COUNTRY, $this->shop_country);
if ($this->isColumnModified(CountryTableMap::CREATED_AT)) $criteria->add(CountryTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(CountryTableMap::UPDATED_AT)) $criteria->add(CountryTableMap::UPDATED_AT, $this->updated_at);
@@ -1455,6 +1543,7 @@ abstract class Country implements ActiveRecordInterface
$copyObj->setIsoalpha2($this->getIsoalpha2());
$copyObj->setIsoalpha3($this->getIsoalpha3());
$copyObj->setByDefault($this->getByDefault());
$copyObj->setShopCountry($this->getShopCountry());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -2359,10 +2448,12 @@ abstract class Country implements ActiveRecordInterface
$this->isoalpha2 = null;
$this->isoalpha3 = null;
$this->by_default = null;
$this->shop_country = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
$this->applyDefaultValues();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);

View File

@@ -28,6 +28,7 @@ use Thelia\Model\Map\CountryTableMap;
* @method ChildCountryQuery orderByIsoalpha2($order = Criteria::ASC) Order by the isoalpha2 column
* @method ChildCountryQuery orderByIsoalpha3($order = Criteria::ASC) Order by the isoalpha3 column
* @method ChildCountryQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
* @method ChildCountryQuery orderByShopCountry($order = Criteria::ASC) Order by the shop_country column
* @method ChildCountryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCountryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
@@ -37,6 +38,7 @@ use Thelia\Model\Map\CountryTableMap;
* @method ChildCountryQuery groupByIsoalpha2() Group by the isoalpha2 column
* @method ChildCountryQuery groupByIsoalpha3() Group by the isoalpha3 column
* @method ChildCountryQuery groupByByDefault() Group by the by_default column
* @method ChildCountryQuery groupByShopCountry() Group by the shop_country column
* @method ChildCountryQuery groupByCreatedAt() Group by the created_at column
* @method ChildCountryQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -69,6 +71,7 @@ use Thelia\Model\Map\CountryTableMap;
* @method ChildCountry findOneByIsoalpha2(string $isoalpha2) Return the first ChildCountry filtered by the isoalpha2 column
* @method ChildCountry findOneByIsoalpha3(string $isoalpha3) Return the first ChildCountry filtered by the isoalpha3 column
* @method ChildCountry findOneByByDefault(int $by_default) Return the first ChildCountry filtered by the by_default column
* @method ChildCountry findOneByShopCountry(boolean $shop_country) Return the first ChildCountry filtered by the shop_country column
* @method ChildCountry findOneByCreatedAt(string $created_at) Return the first ChildCountry filtered by the created_at column
* @method ChildCountry findOneByUpdatedAt(string $updated_at) Return the first ChildCountry filtered by the updated_at column
*
@@ -78,6 +81,7 @@ use Thelia\Model\Map\CountryTableMap;
* @method array findByIsoalpha2(string $isoalpha2) Return ChildCountry objects filtered by the isoalpha2 column
* @method array findByIsoalpha3(string $isoalpha3) Return ChildCountry objects filtered by the isoalpha3 column
* @method array findByByDefault(int $by_default) Return ChildCountry objects filtered by the by_default column
* @method array findByShopCountry(boolean $shop_country) Return ChildCountry objects filtered by the shop_country column
* @method array findByCreatedAt(string $created_at) Return ChildCountry objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCountry objects filtered by the updated_at column
*
@@ -168,7 +172,7 @@ abstract class CountryQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, AREA_ID, ISOCODE, ISOALPHA2, ISOALPHA3, BY_DEFAULT, CREATED_AT, UPDATED_AT FROM country WHERE ID = :p0';
$sql = 'SELECT ID, AREA_ID, ISOCODE, ISOALPHA2, ISOALPHA3, BY_DEFAULT, SHOP_COUNTRY, CREATED_AT, UPDATED_AT FROM country WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -469,6 +473,33 @@ abstract class CountryQuery extends ModelCriteria
return $this->addUsingAlias(CountryTableMap::BY_DEFAULT, $byDefault, $comparison);
}
/**
* Filter the query on the shop_country column
*
* Example usage:
* <code>
* $query->filterByShopCountry(true); // WHERE shop_country = true
* $query->filterByShopCountry('yes'); // WHERE shop_country = true
* </code>
*
* @param boolean|string $shopCountry The value to use as filter.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function filterByShopCountry($shopCountry = null, $comparison = null)
{
if (is_string($shopCountry)) {
$shop_country = in_array(strtolower($shopCountry), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(CountryTableMap::SHOP_COUNTRY, $shopCountry, $comparison);
}
/**
* Filter the query on the created_at column
*

View File

@@ -82,6 +82,13 @@ abstract class ProductPrice implements ActiveRecordInterface
*/
protected $promo_price;
/**
* The value for the from_default_currency field.
* Note: this column has a database default value of: false
* @var boolean
*/
protected $from_default_currency;
/**
* The value for the created_at field.
* @var string
@@ -112,11 +119,24 @@ abstract class ProductPrice implements ActiveRecordInterface
*/
protected $alreadyInSave = false;
/**
* 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->from_default_currency = false;
}
/**
* Initializes internal state of Thelia\Model\Base\ProductPrice object.
* @see applyDefaults()
*/
public function __construct()
{
$this->applyDefaultValues();
}
/**
@@ -414,6 +434,17 @@ abstract class ProductPrice implements ActiveRecordInterface
return $this->promo_price;
}
/**
* Get the [from_default_currency] column value.
*
* @return boolean
*/
public function getFromDefaultCurrency()
{
return $this->from_default_currency;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -546,6 +577,35 @@ abstract class ProductPrice implements ActiveRecordInterface
return $this;
} // setPromoPrice()
/**
* Sets the value of the [from_default_currency] column.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
*
* @param boolean|integer|string $v The new value
* @return \Thelia\Model\ProductPrice The current object (for fluent API support)
*/
public function setFromDefaultCurrency($v)
{
if ($v !== null) {
if (is_string($v)) {
$v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
} else {
$v = (boolean) $v;
}
}
if ($this->from_default_currency !== $v) {
$this->from_default_currency = $v;
$this->modifiedColumns[] = ProductPriceTableMap::FROM_DEFAULT_CURRENCY;
}
return $this;
} // setFromDefaultCurrency()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -598,6 +658,10 @@ abstract class ProductPrice implements ActiveRecordInterface
*/
public function hasOnlyDefaultValues()
{
if ($this->from_default_currency !== false) {
return false;
}
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
@@ -637,13 +701,16 @@ abstract class ProductPrice implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductPriceTableMap::translateFieldName('PromoPrice', TableMap::TYPE_PHPNAME, $indexType)];
$this->promo_price = (null !== $col) ? (double) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductPriceTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductPriceTableMap::translateFieldName('FromDefaultCurrency', TableMap::TYPE_PHPNAME, $indexType)];
$this->from_default_currency = (null !== $col) ? (boolean) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductPriceTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductPriceTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductPriceTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -656,7 +723,7 @@ abstract class ProductPrice implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 6; // 6 = ProductPriceTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 7; // 7 = ProductPriceTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\ProductPrice object", 0, $e);
@@ -911,6 +978,9 @@ abstract class ProductPrice implements ActiveRecordInterface
if ($this->isColumnModified(ProductPriceTableMap::PROMO_PRICE)) {
$modifiedColumns[':p' . $index++] = 'PROMO_PRICE';
}
if ($this->isColumnModified(ProductPriceTableMap::FROM_DEFAULT_CURRENCY)) {
$modifiedColumns[':p' . $index++] = 'FROM_DEFAULT_CURRENCY';
}
if ($this->isColumnModified(ProductPriceTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -940,6 +1010,9 @@ abstract class ProductPrice implements ActiveRecordInterface
case 'PROMO_PRICE':
$stmt->bindValue($identifier, $this->promo_price, PDO::PARAM_STR);
break;
case 'FROM_DEFAULT_CURRENCY':
$stmt->bindValue($identifier, (int) $this->from_default_currency, 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;
@@ -1014,9 +1087,12 @@ abstract class ProductPrice implements ActiveRecordInterface
return $this->getPromoPrice();
break;
case 4:
return $this->getCreatedAt();
return $this->getFromDefaultCurrency();
break;
case 5:
return $this->getCreatedAt();
break;
case 6:
return $this->getUpdatedAt();
break;
default:
@@ -1052,8 +1128,9 @@ abstract class ProductPrice implements ActiveRecordInterface
$keys[1] => $this->getCurrencyId(),
$keys[2] => $this->getPrice(),
$keys[3] => $this->getPromoPrice(),
$keys[4] => $this->getCreatedAt(),
$keys[5] => $this->getUpdatedAt(),
$keys[4] => $this->getFromDefaultCurrency(),
$keys[5] => $this->getCreatedAt(),
$keys[6] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1114,9 +1191,12 @@ abstract class ProductPrice implements ActiveRecordInterface
$this->setPromoPrice($value);
break;
case 4:
$this->setCreatedAt($value);
$this->setFromDefaultCurrency($value);
break;
case 5:
$this->setCreatedAt($value);
break;
case 6:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1147,8 +1227,9 @@ abstract class ProductPrice implements ActiveRecordInterface
if (array_key_exists($keys[1], $arr)) $this->setCurrencyId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setPrice($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setPromoPrice($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[4], $arr)) $this->setFromDefaultCurrency($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]]);
}
/**
@@ -1164,6 +1245,7 @@ abstract class ProductPrice implements ActiveRecordInterface
if ($this->isColumnModified(ProductPriceTableMap::CURRENCY_ID)) $criteria->add(ProductPriceTableMap::CURRENCY_ID, $this->currency_id);
if ($this->isColumnModified(ProductPriceTableMap::PRICE)) $criteria->add(ProductPriceTableMap::PRICE, $this->price);
if ($this->isColumnModified(ProductPriceTableMap::PROMO_PRICE)) $criteria->add(ProductPriceTableMap::PROMO_PRICE, $this->promo_price);
if ($this->isColumnModified(ProductPriceTableMap::FROM_DEFAULT_CURRENCY)) $criteria->add(ProductPriceTableMap::FROM_DEFAULT_CURRENCY, $this->from_default_currency);
if ($this->isColumnModified(ProductPriceTableMap::CREATED_AT)) $criteria->add(ProductPriceTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(ProductPriceTableMap::UPDATED_AT)) $criteria->add(ProductPriceTableMap::UPDATED_AT, $this->updated_at);
@@ -1240,6 +1322,7 @@ abstract class ProductPrice implements ActiveRecordInterface
$copyObj->setCurrencyId($this->getCurrencyId());
$copyObj->setPrice($this->getPrice());
$copyObj->setPromoPrice($this->getPromoPrice());
$copyObj->setFromDefaultCurrency($this->getFromDefaultCurrency());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1380,10 +1463,12 @@ abstract class ProductPrice implements ActiveRecordInterface
$this->currency_id = null;
$this->price = null;
$this->promo_price = null;
$this->from_default_currency = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
$this->applyDefaultValues();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);

View File

@@ -25,6 +25,7 @@ use Thelia\Model\Map\ProductPriceTableMap;
* @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 orderByFromDefaultCurrency($order = Criteria::ASC) Order by the from_default_currency 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
*
@@ -32,6 +33,7 @@ use Thelia\Model\Map\ProductPriceTableMap;
* @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 groupByFromDefaultCurrency() Group by the from_default_currency column
* @method ChildProductPriceQuery groupByCreatedAt() Group by the created_at column
* @method ChildProductPriceQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -54,6 +56,7 @@ use Thelia\Model\Map\ProductPriceTableMap;
* @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 findOneByFromDefaultCurrency(boolean $from_default_currency) Return the first ChildProductPrice filtered by the from_default_currency 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
*
@@ -61,6 +64,7 @@ use Thelia\Model\Map\ProductPriceTableMap;
* @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 findByFromDefaultCurrency(boolean $from_default_currency) Return ChildProductPrice objects filtered by the from_default_currency 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
*
@@ -151,7 +155,7 @@ abstract class ProductPriceQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT PRODUCT_SALE_ELEMENTS_ID, CURRENCY_ID, PRICE, PROMO_PRICE, CREATED_AT, UPDATED_AT FROM product_price WHERE PRODUCT_SALE_ELEMENTS_ID = :p0 AND CURRENCY_ID = :p1';
$sql = 'SELECT PRODUCT_SALE_ELEMENTS_ID, CURRENCY_ID, PRICE, PROMO_PRICE, FROM_DEFAULT_CURRENCY, CREATED_AT, UPDATED_AT FROM product_price WHERE PRODUCT_SALE_ELEMENTS_ID = :p0 AND CURRENCY_ID = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -420,6 +424,33 @@ abstract class ProductPriceQuery extends ModelCriteria
return $this->addUsingAlias(ProductPriceTableMap::PROMO_PRICE, $promoPrice, $comparison);
}
/**
* Filter the query on the from_default_currency column
*
* Example usage:
* <code>
* $query->filterByFromDefaultCurrency(true); // WHERE from_default_currency = true
* $query->filterByFromDefaultCurrency('yes'); // WHERE from_default_currency = true
* </code>
*
* @param boolean|string $fromDefaultCurrency The value to use as filter.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildProductPriceQuery The current query, for fluid interface
*/
public function filterByFromDefaultCurrency($fromDefaultCurrency = null, $comparison = null)
{
if (is_string($fromDefaultCurrency)) {
$from_default_currency = in_array(strtolower($fromDefaultCurrency), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(ProductPriceTableMap::FROM_DEFAULT_CURRENCY, $fromDefaultCurrency, $comparison);
}
/**
* Filter the query on the created_at column
*