Finished product feature values
This commit is contained in:
@@ -78,13 +78,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
*/
|
||||
protected $product_sale_elements_id;
|
||||
|
||||
/**
|
||||
* The value for the is_default field.
|
||||
* Note: this column has a database default value of: false
|
||||
* @var boolean
|
||||
*/
|
||||
protected $is_default;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -120,24 +113,11 @@ abstract class AttributeCombination 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->is_default = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes internal state of Thelia\Model\Base\AttributeCombination object.
|
||||
* @see applyDefaults()
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->applyDefaultValues();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -420,17 +400,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
return $this->product_sale_elements_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [is_default] column value.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsDefault()
|
||||
{
|
||||
|
||||
return $this->is_default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -546,35 +515,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setProductSaleElementsId()
|
||||
|
||||
/**
|
||||
* Sets the value of the [is_default] 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\AttributeCombination The current object (for fluent API support)
|
||||
*/
|
||||
public function setIsDefault($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->is_default !== $v) {
|
||||
$this->is_default = $v;
|
||||
$this->modifiedColumns[] = AttributeCombinationTableMap::IS_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setIsDefault()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -627,10 +567,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
*/
|
||||
public function hasOnlyDefaultValues()
|
||||
{
|
||||
if ($this->is_default !== false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// otherwise, everything was equal, so return TRUE
|
||||
return true;
|
||||
} // hasOnlyDefaultValues()
|
||||
@@ -667,16 +603,13 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AttributeCombinationTableMap::translateFieldName('ProductSaleElementsId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->product_sale_elements_id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AttributeCombinationTableMap::translateFieldName('IsDefault', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_default = (null !== $col) ? (boolean) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AttributeCombinationTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$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;
|
||||
}
|
||||
@@ -689,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);
|
||||
@@ -952,9 +885,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_ID';
|
||||
}
|
||||
if ($this->isColumnModified(AttributeCombinationTableMap::IS_DEFAULT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'IS_DEFAULT';
|
||||
}
|
||||
if ($this->isColumnModified(AttributeCombinationTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
|
||||
}
|
||||
@@ -981,9 +911,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
case 'PRODUCT_SALE_ELEMENTS_ID':
|
||||
$stmt->bindValue($identifier, $this->product_sale_elements_id, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'IS_DEFAULT':
|
||||
$stmt->bindValue($identifier, (int) $this->is_default, 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;
|
||||
@@ -1055,12 +982,9 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
return $this->getProductSaleElementsId();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getIsDefault();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 5:
|
||||
case 4:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1095,9 +1019,8 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
$keys[0] => $this->getAttributeId(),
|
||||
$keys[1] => $this->getAttributeAvId(),
|
||||
$keys[2] => $this->getProductSaleElementsId(),
|
||||
$keys[3] => $this->getIsDefault(),
|
||||
$keys[4] => $this->getCreatedAt(),
|
||||
$keys[5] => $this->getUpdatedAt(),
|
||||
$keys[3] => $this->getCreatedAt(),
|
||||
$keys[4] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1159,12 +1082,9 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
$this->setProductSaleElementsId($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setIsDefault($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 5:
|
||||
case 4:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1194,9 +1114,8 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[0], $arr)) $this->setAttributeId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setAttributeAvId($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setProductSaleElementsId($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setIsDefault($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[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1211,7 +1130,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_ID)) $criteria->add(AttributeCombinationTableMap::ATTRIBUTE_ID, $this->attribute_id);
|
||||
if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_AV_ID)) $criteria->add(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $this->attribute_av_id);
|
||||
if ($this->isColumnModified(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID)) $criteria->add(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $this->product_sale_elements_id);
|
||||
if ($this->isColumnModified(AttributeCombinationTableMap::IS_DEFAULT)) $criteria->add(AttributeCombinationTableMap::IS_DEFAULT, $this->is_default);
|
||||
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);
|
||||
|
||||
@@ -1290,7 +1208,6 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
$copyObj->setAttributeId($this->getAttributeId());
|
||||
$copyObj->setAttributeAvId($this->getAttributeAvId());
|
||||
$copyObj->setProductSaleElementsId($this->getProductSaleElementsId());
|
||||
$copyObj->setIsDefault($this->getIsDefault());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
if ($makeNew) {
|
||||
@@ -1481,12 +1398,10 @@ abstract class AttributeCombination implements ActiveRecordInterface
|
||||
$this->attribute_id = null;
|
||||
$this->attribute_av_id = null;
|
||||
$this->product_sale_elements_id = null;
|
||||
$this->is_default = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->alreadyInSave = false;
|
||||
$this->clearAllReferences();
|
||||
$this->applyDefaultValues();
|
||||
$this->resetModified();
|
||||
$this->setNew(true);
|
||||
$this->setDeleted(false);
|
||||
|
||||
@@ -24,14 +24,12 @@ use Thelia\Model\Map\AttributeCombinationTableMap;
|
||||
* @method ChildAttributeCombinationQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
|
||||
* @method ChildAttributeCombinationQuery orderByAttributeAvId($order = Criteria::ASC) Order by the attribute_av_id column
|
||||
* @method ChildAttributeCombinationQuery orderByProductSaleElementsId($order = Criteria::ASC) Order by the product_sale_elements_id column
|
||||
* @method ChildAttributeCombinationQuery orderByIsDefault($order = Criteria::ASC) Order by the is_default 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 groupByAttributeId() Group by the attribute_id column
|
||||
* @method ChildAttributeCombinationQuery groupByAttributeAvId() Group by the attribute_av_id column
|
||||
* @method ChildAttributeCombinationQuery groupByProductSaleElementsId() Group by the product_sale_elements_id column
|
||||
* @method ChildAttributeCombinationQuery groupByIsDefault() Group by the is_default column
|
||||
* @method ChildAttributeCombinationQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildAttributeCombinationQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
@@ -57,14 +55,12 @@ use Thelia\Model\Map\AttributeCombinationTableMap;
|
||||
* @method ChildAttributeCombination findOneByAttributeId(int $attribute_id) Return the first ChildAttributeCombination filtered by the attribute_id column
|
||||
* @method ChildAttributeCombination findOneByAttributeAvId(int $attribute_av_id) Return the first ChildAttributeCombination filtered by the attribute_av_id column
|
||||
* @method ChildAttributeCombination findOneByProductSaleElementsId(int $product_sale_elements_id) Return the first ChildAttributeCombination filtered by the product_sale_elements_id column
|
||||
* @method ChildAttributeCombination findOneByIsDefault(boolean $is_default) Return the first ChildAttributeCombination filtered by the is_default 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 findByAttributeId(int $attribute_id) Return ChildAttributeCombination objects filtered by the attribute_id column
|
||||
* @method array findByAttributeAvId(int $attribute_av_id) Return ChildAttributeCombination objects filtered by the attribute_av_id column
|
||||
* @method array findByProductSaleElementsId(int $product_sale_elements_id) Return ChildAttributeCombination objects filtered by the product_sale_elements_id column
|
||||
* @method array findByIsDefault(boolean $is_default) Return ChildAttributeCombination objects filtered by the is_default 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
|
||||
*
|
||||
@@ -155,7 +151,7 @@ abstract class AttributeCombinationQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ATTRIBUTE_ID, ATTRIBUTE_AV_ID, PRODUCT_SALE_ELEMENTS_ID, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM attribute_combination WHERE ATTRIBUTE_ID = :p0 AND ATTRIBUTE_AV_ID = :p1 AND PRODUCT_SALE_ELEMENTS_ID = :p2';
|
||||
$sql = 'SELECT ATTRIBUTE_ID, ATTRIBUTE_AV_ID, PRODUCT_SALE_ELEMENTS_ID, CREATED_AT, UPDATED_AT FROM attribute_combination WHERE ATTRIBUTE_ID = :p0 AND ATTRIBUTE_AV_ID = :p1 AND PRODUCT_SALE_ELEMENTS_ID = :p2';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
@@ -389,33 +385,6 @@ abstract class AttributeCombinationQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $productSaleElementsId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the is_default column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByIsDefault(true); // WHERE is_default = true
|
||||
* $query->filterByIsDefault('yes'); // WHERE is_default = true
|
||||
* </code>
|
||||
*
|
||||
* @param boolean|string $isDefault 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 ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByIsDefault($isDefault = null, $comparison = null)
|
||||
{
|
||||
if (is_string($isDefault)) {
|
||||
$is_default = in_array(strtolower($isDefault), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::IS_DEFAULT, $isDefault, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
|
||||
@@ -103,10 +103,18 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
|
||||
/**
|
||||
* The value for the weight field.
|
||||
* Note: this column has a database default value of: 0
|
||||
* @var double
|
||||
*/
|
||||
protected $weight;
|
||||
|
||||
/**
|
||||
* The value for the is_default field.
|
||||
* Note: this column has a database default value of: false
|
||||
* @var boolean
|
||||
*/
|
||||
protected $is_default;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -178,6 +186,8 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
{
|
||||
$this->promo = 0;
|
||||
$this->newness = 0;
|
||||
$this->weight = 0;
|
||||
$this->is_default = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -513,6 +523,17 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
return $this->weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [is_default] column value.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsDefault()
|
||||
{
|
||||
|
||||
return $this->is_default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -704,6 +725,35 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setWeight()
|
||||
|
||||
/**
|
||||
* Sets the value of the [is_default] 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\ProductSaleElements The current object (for fluent API support)
|
||||
*/
|
||||
public function setIsDefault($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->is_default !== $v) {
|
||||
$this->is_default = $v;
|
||||
$this->modifiedColumns[] = ProductSaleElementsTableMap::IS_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setIsDefault()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -764,6 +814,14 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->weight !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->is_default !== false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// otherwise, everything was equal, so return TRUE
|
||||
return true;
|
||||
} // hasOnlyDefaultValues()
|
||||
@@ -812,13 +870,16 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductSaleElementsTableMap::translateFieldName('Weight', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->weight = (null !== $col) ? (double) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductSaleElementsTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductSaleElementsTableMap::translateFieldName('IsDefault', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_default = (null !== $col) ? (boolean) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductSaleElementsTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductSaleElementsTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductSaleElementsTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -831,7 +892,7 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 9; // 9 = ProductSaleElementsTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 10; // 10 = ProductSaleElementsTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\ProductSaleElements object", 0, $e);
|
||||
@@ -1145,6 +1206,9 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(ProductSaleElementsTableMap::WEIGHT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'WEIGHT';
|
||||
}
|
||||
if ($this->isColumnModified(ProductSaleElementsTableMap::IS_DEFAULT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'IS_DEFAULT';
|
||||
}
|
||||
if ($this->isColumnModified(ProductSaleElementsTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
|
||||
}
|
||||
@@ -1183,6 +1247,9 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
case 'WEIGHT':
|
||||
$stmt->bindValue($identifier, $this->weight, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'IS_DEFAULT':
|
||||
$stmt->bindValue($identifier, (int) $this->is_default, 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;
|
||||
@@ -1273,9 +1340,12 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
return $this->getWeight();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getCreatedAt();
|
||||
return $this->getIsDefault();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1314,8 +1384,9 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
$keys[4] => $this->getPromo(),
|
||||
$keys[5] => $this->getNewness(),
|
||||
$keys[6] => $this->getWeight(),
|
||||
$keys[7] => $this->getCreatedAt(),
|
||||
$keys[8] => $this->getUpdatedAt(),
|
||||
$keys[7] => $this->getIsDefault(),
|
||||
$keys[8] => $this->getCreatedAt(),
|
||||
$keys[9] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1392,9 +1463,12 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
$this->setWeight($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setCreatedAt($value);
|
||||
$this->setIsDefault($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1428,8 +1502,9 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[4], $arr)) $this->setPromo($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setNewness($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setWeight($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]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setIsDefault($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]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1448,6 +1523,7 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(ProductSaleElementsTableMap::PROMO)) $criteria->add(ProductSaleElementsTableMap::PROMO, $this->promo);
|
||||
if ($this->isColumnModified(ProductSaleElementsTableMap::NEWNESS)) $criteria->add(ProductSaleElementsTableMap::NEWNESS, $this->newness);
|
||||
if ($this->isColumnModified(ProductSaleElementsTableMap::WEIGHT)) $criteria->add(ProductSaleElementsTableMap::WEIGHT, $this->weight);
|
||||
if ($this->isColumnModified(ProductSaleElementsTableMap::IS_DEFAULT)) $criteria->add(ProductSaleElementsTableMap::IS_DEFAULT, $this->is_default);
|
||||
if ($this->isColumnModified(ProductSaleElementsTableMap::CREATED_AT)) $criteria->add(ProductSaleElementsTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(ProductSaleElementsTableMap::UPDATED_AT)) $criteria->add(ProductSaleElementsTableMap::UPDATED_AT, $this->updated_at);
|
||||
|
||||
@@ -1519,6 +1595,7 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
$copyObj->setPromo($this->getPromo());
|
||||
$copyObj->setNewness($this->getNewness());
|
||||
$copyObj->setWeight($this->getWeight());
|
||||
$copyObj->setIsDefault($this->getIsDefault());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
|
||||
@@ -2445,6 +2522,7 @@ abstract class ProductSaleElements implements ActiveRecordInterface
|
||||
$this->promo = null;
|
||||
$this->newness = null;
|
||||
$this->weight = null;
|
||||
$this->is_default = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->alreadyInSave = false;
|
||||
|
||||
@@ -28,6 +28,7 @@ use Thelia\Model\Map\ProductSaleElementsTableMap;
|
||||
* @method ChildProductSaleElementsQuery orderByPromo($order = Criteria::ASC) Order by the promo column
|
||||
* @method ChildProductSaleElementsQuery orderByNewness($order = Criteria::ASC) Order by the newness column
|
||||
* @method ChildProductSaleElementsQuery orderByWeight($order = Criteria::ASC) Order by the weight column
|
||||
* @method ChildProductSaleElementsQuery orderByIsDefault($order = Criteria::ASC) Order by the is_default column
|
||||
* @method ChildProductSaleElementsQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildProductSaleElementsQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
@@ -38,6 +39,7 @@ use Thelia\Model\Map\ProductSaleElementsTableMap;
|
||||
* @method ChildProductSaleElementsQuery groupByPromo() Group by the promo column
|
||||
* @method ChildProductSaleElementsQuery groupByNewness() Group by the newness column
|
||||
* @method ChildProductSaleElementsQuery groupByWeight() Group by the weight column
|
||||
* @method ChildProductSaleElementsQuery groupByIsDefault() Group by the is_default column
|
||||
* @method ChildProductSaleElementsQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildProductSaleElementsQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
@@ -71,6 +73,7 @@ use Thelia\Model\Map\ProductSaleElementsTableMap;
|
||||
* @method ChildProductSaleElements findOneByPromo(int $promo) Return the first ChildProductSaleElements filtered by the promo column
|
||||
* @method ChildProductSaleElements findOneByNewness(int $newness) Return the first ChildProductSaleElements filtered by the newness column
|
||||
* @method ChildProductSaleElements findOneByWeight(double $weight) Return the first ChildProductSaleElements filtered by the weight column
|
||||
* @method ChildProductSaleElements findOneByIsDefault(boolean $is_default) Return the first ChildProductSaleElements filtered by the is_default column
|
||||
* @method ChildProductSaleElements findOneByCreatedAt(string $created_at) Return the first ChildProductSaleElements filtered by the created_at column
|
||||
* @method ChildProductSaleElements findOneByUpdatedAt(string $updated_at) Return the first ChildProductSaleElements filtered by the updated_at column
|
||||
*
|
||||
@@ -81,6 +84,7 @@ use Thelia\Model\Map\ProductSaleElementsTableMap;
|
||||
* @method array findByPromo(int $promo) Return ChildProductSaleElements objects filtered by the promo column
|
||||
* @method array findByNewness(int $newness) Return ChildProductSaleElements objects filtered by the newness column
|
||||
* @method array findByWeight(double $weight) Return ChildProductSaleElements objects filtered by the weight column
|
||||
* @method array findByIsDefault(boolean $is_default) Return ChildProductSaleElements objects filtered by the is_default column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildProductSaleElements objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildProductSaleElements objects filtered by the updated_at column
|
||||
*
|
||||
@@ -171,7 +175,7 @@ abstract class ProductSaleElementsQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, PRODUCT_ID, REF, QUANTITY, PROMO, NEWNESS, WEIGHT, CREATED_AT, UPDATED_AT FROM product_sale_elements WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, PRODUCT_ID, REF, QUANTITY, PROMO, NEWNESS, WEIGHT, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM product_sale_elements WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -537,6 +541,33 @@ abstract class ProductSaleElementsQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(ProductSaleElementsTableMap::WEIGHT, $weight, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the is_default column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByIsDefault(true); // WHERE is_default = true
|
||||
* $query->filterByIsDefault('yes'); // WHERE is_default = true
|
||||
* </code>
|
||||
*
|
||||
* @param boolean|string $isDefault 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 ChildProductSaleElementsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByIsDefault($isDefault = null, $comparison = null)
|
||||
{
|
||||
if (is_string($isDefault)) {
|
||||
$is_default = in_array(strtolower($isDefault), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductSaleElementsTableMap::IS_DEFAULT, $isDefault, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user