order admin

This commit is contained in:
Etienne Roudeix
2013-09-24 17:04:32 +02:00
parent 4600727163
commit 7bd511c420
40 changed files with 1197 additions and 555 deletions

View File

@@ -71,12 +71,6 @@ abstract class Attribute implements ActiveRecordInterface
*/
protected $id;
/**
* The value for the position field.
* @var int
*/
protected $position;
/**
* The value for the created_at field.
* @var string
@@ -435,17 +429,6 @@ abstract class Attribute implements ActiveRecordInterface
return $this->id;
}
/**
* Get the [position] column value.
*
* @return int
*/
public function getPosition()
{
return $this->position;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -507,27 +490,6 @@ abstract class Attribute implements ActiveRecordInterface
return $this;
} // setId()
/**
* Set the value of [position] column.
*
* @param int $v new value
* @return \Thelia\Model\Attribute The current object (for fluent API support)
*/
public function setPosition($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->position !== $v) {
$this->position = $v;
$this->modifiedColumns[] = AttributeTableMap::POSITION;
}
return $this;
} // setPosition()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -610,16 +572,13 @@ abstract class Attribute implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : AttributeTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AttributeTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
$this->position = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AttributeTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AttributeTableMap::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 ? 3 + $startcol : AttributeTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AttributeTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -632,7 +591,7 @@ abstract class Attribute implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 4; // 4 = AttributeTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 3; // 3 = AttributeTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\Attribute object", 0, $e);
@@ -959,9 +918,6 @@ abstract class Attribute implements ActiveRecordInterface
if ($this->isColumnModified(AttributeTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
if ($this->isColumnModified(AttributeTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION';
}
if ($this->isColumnModified(AttributeTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -982,9 +938,6 @@ abstract class Attribute implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
case 'POSITION':
$stmt->bindValue($identifier, $this->position, 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;
@@ -1057,12 +1010,9 @@ abstract class Attribute implements ActiveRecordInterface
return $this->getId();
break;
case 1:
return $this->getPosition();
break;
case 2:
return $this->getCreatedAt();
break;
case 3:
case 2:
return $this->getUpdatedAt();
break;
default:
@@ -1095,9 +1045,8 @@ abstract class Attribute implements ActiveRecordInterface
$keys = AttributeTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getPosition(),
$keys[2] => $this->getCreatedAt(),
$keys[3] => $this->getUpdatedAt(),
$keys[1] => $this->getCreatedAt(),
$keys[2] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1156,12 +1105,9 @@ abstract class Attribute implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
$this->setPosition($value);
break;
case 2:
$this->setCreatedAt($value);
break;
case 3:
case 2:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1189,9 +1135,8 @@ abstract class Attribute implements ActiveRecordInterface
$keys = AttributeTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setPosition($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setCreatedAt($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]);
if (array_key_exists($keys[1], $arr)) $this->setCreatedAt($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setUpdatedAt($arr[$keys[2]]);
}
/**
@@ -1204,7 +1149,6 @@ abstract class Attribute implements ActiveRecordInterface
$criteria = new Criteria(AttributeTableMap::DATABASE_NAME);
if ($this->isColumnModified(AttributeTableMap::ID)) $criteria->add(AttributeTableMap::ID, $this->id);
if ($this->isColumnModified(AttributeTableMap::POSITION)) $criteria->add(AttributeTableMap::POSITION, $this->position);
if ($this->isColumnModified(AttributeTableMap::CREATED_AT)) $criteria->add(AttributeTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(AttributeTableMap::UPDATED_AT)) $criteria->add(AttributeTableMap::UPDATED_AT, $this->updated_at);
@@ -1270,7 +1214,6 @@ abstract class Attribute implements ActiveRecordInterface
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setPosition($this->getPosition());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -2504,7 +2447,6 @@ abstract class Attribute implements ActiveRecordInterface
public function clear()
{
$this->id = null;
$this->position = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -23,12 +23,10 @@ use Thelia\Model\Map\AttributeTableMap;
*
*
* @method ChildAttributeQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAttributeQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildAttributeQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAttributeQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAttributeQuery groupById() Group by the id column
* @method ChildAttributeQuery groupByPosition() Group by the position column
* @method ChildAttributeQuery groupByCreatedAt() Group by the created_at column
* @method ChildAttributeQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -56,12 +54,10 @@ use Thelia\Model\Map\AttributeTableMap;
* @method ChildAttribute findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAttribute matching the query, or a new ChildAttribute object populated from the query conditions when no match is found
*
* @method ChildAttribute findOneById(int $id) Return the first ChildAttribute filtered by the id column
* @method ChildAttribute findOneByPosition(int $position) Return the first ChildAttribute filtered by the position column
* @method ChildAttribute findOneByCreatedAt(string $created_at) Return the first ChildAttribute filtered by the created_at column
* @method ChildAttribute findOneByUpdatedAt(string $updated_at) Return the first ChildAttribute filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAttribute objects filtered by the id column
* @method array findByPosition(int $position) Return ChildAttribute objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildAttribute objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAttribute objects filtered by the updated_at column
*
@@ -152,7 +148,7 @@ abstract class AttributeQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, POSITION, CREATED_AT, UPDATED_AT FROM attribute WHERE ID = :p0';
$sql = 'SELECT ID, CREATED_AT, UPDATED_AT FROM attribute WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -282,47 +278,6 @@ abstract class AttributeQuery extends ModelCriteria
return $this->addUsingAlias(AttributeTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position 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 ChildAttributeQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($position)) {
$useMinMax = false;
if (isset($position['min'])) {
$this->addUsingAlias(AttributeTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(AttributeTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeTableMap::POSITION, $position, $comparison);
}
/**
* Filter the query on the created_at column
*

View File

@@ -76,6 +76,18 @@ abstract class AttributeTemplate implements ActiveRecordInterface
*/
protected $template_id;
/**
* The value for the position field.
* @var int
*/
protected $position;
/**
* The value for the attribute_templatecol field.
* @var string
*/
protected $attribute_templatecol;
/**
* The value for the created_at field.
* @var string
@@ -393,6 +405,28 @@ abstract class AttributeTemplate implements ActiveRecordInterface
return $this->template_id;
}
/**
* Get the [position] column value.
*
* @return int
*/
public function getPosition()
{
return $this->position;
}
/**
* Get the [attribute_templatecol] column value.
*
* @return string
*/
public function getAttributeTemplatecol()
{
return $this->attribute_templatecol;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -504,6 +538,48 @@ abstract class AttributeTemplate implements ActiveRecordInterface
return $this;
} // setTemplateId()
/**
* Set the value of [position] column.
*
* @param int $v new value
* @return \Thelia\Model\AttributeTemplate The current object (for fluent API support)
*/
public function setPosition($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->position !== $v) {
$this->position = $v;
$this->modifiedColumns[] = AttributeTemplateTableMap::POSITION;
}
return $this;
} // setPosition()
/**
* Set the value of [attribute_templatecol] column.
*
* @param string $v new value
* @return \Thelia\Model\AttributeTemplate The current object (for fluent API support)
*/
public function setAttributeTemplatecol($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->attribute_templatecol !== $v) {
$this->attribute_templatecol = $v;
$this->modifiedColumns[] = AttributeTemplateTableMap::ATTRIBUTE_TEMPLATECOL;
}
return $this;
} // setAttributeTemplatecol()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -592,13 +668,19 @@ abstract class AttributeTemplate implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AttributeTemplateTableMap::translateFieldName('TemplateId', TableMap::TYPE_PHPNAME, $indexType)];
$this->template_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AttributeTemplateTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AttributeTemplateTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
$this->position = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AttributeTemplateTableMap::translateFieldName('AttributeTemplatecol', TableMap::TYPE_PHPNAME, $indexType)];
$this->attribute_templatecol = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : AttributeTemplateTableMap::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 ? 4 + $startcol : AttributeTemplateTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : AttributeTemplateTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -611,7 +693,7 @@ abstract class AttributeTemplate implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 5; // 5 = AttributeTemplateTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 7; // 7 = AttributeTemplateTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\AttributeTemplate object", 0, $e);
@@ -867,6 +949,12 @@ abstract class AttributeTemplate implements ActiveRecordInterface
if ($this->isColumnModified(AttributeTemplateTableMap::TEMPLATE_ID)) {
$modifiedColumns[':p' . $index++] = 'TEMPLATE_ID';
}
if ($this->isColumnModified(AttributeTemplateTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION';
}
if ($this->isColumnModified(AttributeTemplateTableMap::ATTRIBUTE_TEMPLATECOL)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_TEMPLATECOL';
}
if ($this->isColumnModified(AttributeTemplateTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -893,6 +981,12 @@ abstract class AttributeTemplate implements ActiveRecordInterface
case 'TEMPLATE_ID':
$stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT);
break;
case 'POSITION':
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
break;
case 'ATTRIBUTE_TEMPLATECOL':
$stmt->bindValue($identifier, $this->attribute_templatecol, 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;
@@ -971,9 +1065,15 @@ abstract class AttributeTemplate implements ActiveRecordInterface
return $this->getTemplateId();
break;
case 3:
return $this->getCreatedAt();
return $this->getPosition();
break;
case 4:
return $this->getAttributeTemplatecol();
break;
case 5:
return $this->getCreatedAt();
break;
case 6:
return $this->getUpdatedAt();
break;
default:
@@ -1008,8 +1108,10 @@ abstract class AttributeTemplate implements ActiveRecordInterface
$keys[0] => $this->getId(),
$keys[1] => $this->getAttributeId(),
$keys[2] => $this->getTemplateId(),
$keys[3] => $this->getCreatedAt(),
$keys[4] => $this->getUpdatedAt(),
$keys[3] => $this->getPosition(),
$keys[4] => $this->getAttributeTemplatecol(),
$keys[5] => $this->getCreatedAt(),
$keys[6] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1068,9 +1170,15 @@ abstract class AttributeTemplate implements ActiveRecordInterface
$this->setTemplateId($value);
break;
case 3:
$this->setCreatedAt($value);
$this->setPosition($value);
break;
case 4:
$this->setAttributeTemplatecol($value);
break;
case 5:
$this->setCreatedAt($value);
break;
case 6:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1100,8 +1208,10 @@ abstract class AttributeTemplate implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setAttributeId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setTemplateId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
if (array_key_exists($keys[3], $arr)) $this->setPosition($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setAttributeTemplatecol($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]]);
}
/**
@@ -1116,6 +1226,8 @@ abstract class AttributeTemplate implements ActiveRecordInterface
if ($this->isColumnModified(AttributeTemplateTableMap::ID)) $criteria->add(AttributeTemplateTableMap::ID, $this->id);
if ($this->isColumnModified(AttributeTemplateTableMap::ATTRIBUTE_ID)) $criteria->add(AttributeTemplateTableMap::ATTRIBUTE_ID, $this->attribute_id);
if ($this->isColumnModified(AttributeTemplateTableMap::TEMPLATE_ID)) $criteria->add(AttributeTemplateTableMap::TEMPLATE_ID, $this->template_id);
if ($this->isColumnModified(AttributeTemplateTableMap::POSITION)) $criteria->add(AttributeTemplateTableMap::POSITION, $this->position);
if ($this->isColumnModified(AttributeTemplateTableMap::ATTRIBUTE_TEMPLATECOL)) $criteria->add(AttributeTemplateTableMap::ATTRIBUTE_TEMPLATECOL, $this->attribute_templatecol);
if ($this->isColumnModified(AttributeTemplateTableMap::CREATED_AT)) $criteria->add(AttributeTemplateTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(AttributeTemplateTableMap::UPDATED_AT)) $criteria->add(AttributeTemplateTableMap::UPDATED_AT, $this->updated_at);
@@ -1183,6 +1295,8 @@ abstract class AttributeTemplate implements ActiveRecordInterface
{
$copyObj->setAttributeId($this->getAttributeId());
$copyObj->setTemplateId($this->getTemplateId());
$copyObj->setPosition($this->getPosition());
$copyObj->setAttributeTemplatecol($this->getAttributeTemplatecol());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1323,6 +1437,8 @@ abstract class AttributeTemplate implements ActiveRecordInterface
$this->id = null;
$this->attribute_id = null;
$this->template_id = null;
$this->position = null;
$this->attribute_templatecol = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -24,12 +24,16 @@ use Thelia\Model\Map\AttributeTemplateTableMap;
* @method ChildAttributeTemplateQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAttributeTemplateQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
* @method ChildAttributeTemplateQuery orderByTemplateId($order = Criteria::ASC) Order by the template_id column
* @method ChildAttributeTemplateQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildAttributeTemplateQuery orderByAttributeTemplatecol($order = Criteria::ASC) Order by the attribute_templatecol column
* @method ChildAttributeTemplateQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAttributeTemplateQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAttributeTemplateQuery groupById() Group by the id column
* @method ChildAttributeTemplateQuery groupByAttributeId() Group by the attribute_id column
* @method ChildAttributeTemplateQuery groupByTemplateId() Group by the template_id column
* @method ChildAttributeTemplateQuery groupByPosition() Group by the position column
* @method ChildAttributeTemplateQuery groupByAttributeTemplatecol() Group by the attribute_templatecol column
* @method ChildAttributeTemplateQuery groupByCreatedAt() Group by the created_at column
* @method ChildAttributeTemplateQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -51,12 +55,16 @@ use Thelia\Model\Map\AttributeTemplateTableMap;
* @method ChildAttributeTemplate findOneById(int $id) Return the first ChildAttributeTemplate filtered by the id column
* @method ChildAttributeTemplate findOneByAttributeId(int $attribute_id) Return the first ChildAttributeTemplate filtered by the attribute_id column
* @method ChildAttributeTemplate findOneByTemplateId(int $template_id) Return the first ChildAttributeTemplate filtered by the template_id column
* @method ChildAttributeTemplate findOneByPosition(int $position) Return the first ChildAttributeTemplate filtered by the position column
* @method ChildAttributeTemplate findOneByAttributeTemplatecol(string $attribute_templatecol) Return the first ChildAttributeTemplate filtered by the attribute_templatecol column
* @method ChildAttributeTemplate findOneByCreatedAt(string $created_at) Return the first ChildAttributeTemplate filtered by the created_at column
* @method ChildAttributeTemplate findOneByUpdatedAt(string $updated_at) Return the first ChildAttributeTemplate filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAttributeTemplate objects filtered by the id column
* @method array findByAttributeId(int $attribute_id) Return ChildAttributeTemplate objects filtered by the attribute_id column
* @method array findByTemplateId(int $template_id) Return ChildAttributeTemplate objects filtered by the template_id column
* @method array findByPosition(int $position) Return ChildAttributeTemplate objects filtered by the position column
* @method array findByAttributeTemplatecol(string $attribute_templatecol) Return ChildAttributeTemplate objects filtered by the attribute_templatecol column
* @method array findByCreatedAt(string $created_at) Return ChildAttributeTemplate objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAttributeTemplate objects filtered by the updated_at column
*
@@ -147,7 +155,7 @@ abstract class AttributeTemplateQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, ATTRIBUTE_ID, TEMPLATE_ID, CREATED_AT, UPDATED_AT FROM attribute_template WHERE ID = :p0';
$sql = 'SELECT ID, ATTRIBUTE_ID, TEMPLATE_ID, POSITION, ATTRIBUTE_TEMPLATECOL, CREATED_AT, UPDATED_AT FROM attribute_template WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -363,6 +371,76 @@ abstract class AttributeTemplateQuery extends ModelCriteria
return $this->addUsingAlias(AttributeTemplateTableMap::TEMPLATE_ID, $templateId, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position 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 ChildAttributeTemplateQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($position)) {
$useMinMax = false;
if (isset($position['min'])) {
$this->addUsingAlias(AttributeTemplateTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(AttributeTemplateTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeTemplateTableMap::POSITION, $position, $comparison);
}
/**
* Filter the query on the attribute_templatecol column
*
* Example usage:
* <code>
* $query->filterByAttributeTemplatecol('fooValue'); // WHERE attribute_templatecol = 'fooValue'
* $query->filterByAttributeTemplatecol('%fooValue%'); // WHERE attribute_templatecol LIKE '%fooValue%'
* </code>
*
* @param string $attributeTemplatecol The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeTemplateQuery The current query, for fluid interface
*/
public function filterByAttributeTemplatecol($attributeTemplatecol = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($attributeTemplatecol)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $attributeTemplatecol)) {
$attributeTemplatecol = str_replace('*', '%', $attributeTemplatecol);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AttributeTemplateTableMap::ATTRIBUTE_TEMPLATECOL, $attributeTemplatecol, $comparison);
}
/**
* Filter the query on the created_at column
*

View File

@@ -78,12 +78,6 @@ abstract class Feature implements ActiveRecordInterface
*/
protected $visible;
/**
* The value for the position field.
* @var int
*/
protected $position;
/**
* The value for the created_at field.
* @var string
@@ -466,17 +460,6 @@ abstract class Feature implements ActiveRecordInterface
return $this->visible;
}
/**
* Get the [position] column value.
*
* @return int
*/
public function getPosition()
{
return $this->position;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -559,27 +542,6 @@ abstract class Feature implements ActiveRecordInterface
return $this;
} // setVisible()
/**
* Set the value of [position] column.
*
* @param int $v new value
* @return \Thelia\Model\Feature The current object (for fluent API support)
*/
public function setPosition($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->position !== $v) {
$this->position = $v;
$this->modifiedColumns[] = FeatureTableMap::POSITION;
}
return $this;
} // setPosition()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -669,16 +631,13 @@ abstract class Feature implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : FeatureTableMap::translateFieldName('Visible', TableMap::TYPE_PHPNAME, $indexType)];
$this->visible = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FeatureTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
$this->position = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FeatureTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FeatureTableMap::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 ? 4 + $startcol : FeatureTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FeatureTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -691,7 +650,7 @@ abstract class Feature implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 5; // 5 = FeatureTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 4; // 4 = FeatureTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\Feature object", 0, $e);
@@ -1021,9 +980,6 @@ abstract class Feature implements ActiveRecordInterface
if ($this->isColumnModified(FeatureTableMap::VISIBLE)) {
$modifiedColumns[':p' . $index++] = 'VISIBLE';
}
if ($this->isColumnModified(FeatureTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION';
}
if ($this->isColumnModified(FeatureTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -1047,9 +1003,6 @@ abstract class Feature implements ActiveRecordInterface
case 'VISIBLE':
$stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT);
break;
case 'POSITION':
$stmt->bindValue($identifier, $this->position, 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;
@@ -1125,12 +1078,9 @@ abstract class Feature implements ActiveRecordInterface
return $this->getVisible();
break;
case 2:
return $this->getPosition();
break;
case 3:
return $this->getCreatedAt();
break;
case 4:
case 3:
return $this->getUpdatedAt();
break;
default:
@@ -1164,9 +1114,8 @@ abstract class Feature implements ActiveRecordInterface
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getVisible(),
$keys[2] => $this->getPosition(),
$keys[3] => $this->getCreatedAt(),
$keys[4] => $this->getUpdatedAt(),
$keys[2] => $this->getCreatedAt(),
$keys[3] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1228,12 +1177,9 @@ abstract class Feature implements ActiveRecordInterface
$this->setVisible($value);
break;
case 2:
$this->setPosition($value);
break;
case 3:
$this->setCreatedAt($value);
break;
case 4:
case 3:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1262,9 +1208,8 @@ abstract class Feature implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setVisible($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setPosition($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
if (array_key_exists($keys[2], $arr)) $this->setCreatedAt($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]);
}
/**
@@ -1278,7 +1223,6 @@ abstract class Feature implements ActiveRecordInterface
if ($this->isColumnModified(FeatureTableMap::ID)) $criteria->add(FeatureTableMap::ID, $this->id);
if ($this->isColumnModified(FeatureTableMap::VISIBLE)) $criteria->add(FeatureTableMap::VISIBLE, $this->visible);
if ($this->isColumnModified(FeatureTableMap::POSITION)) $criteria->add(FeatureTableMap::POSITION, $this->position);
if ($this->isColumnModified(FeatureTableMap::CREATED_AT)) $criteria->add(FeatureTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(FeatureTableMap::UPDATED_AT)) $criteria->add(FeatureTableMap::UPDATED_AT, $this->updated_at);
@@ -1345,7 +1289,6 @@ abstract class Feature implements ActiveRecordInterface
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setVisible($this->getVisible());
$copyObj->setPosition($this->getPosition());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -2577,7 +2520,6 @@ abstract class Feature implements ActiveRecordInterface
{
$this->id = null;
$this->visible = null;
$this->position = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -85,10 +85,10 @@ abstract class FeatureProduct implements ActiveRecordInterface
protected $feature_av_id;
/**
* The value for the by_default field.
* The value for the free_text_value field.
* @var string
*/
protected $by_default;
protected $free_text_value;
/**
* The value for the position field.
@@ -430,14 +430,14 @@ abstract class FeatureProduct implements ActiveRecordInterface
}
/**
* Get the [by_default] column value.
* Get the [free_text_value] column value.
*
* @return string
*/
public function getByDefault()
public function getFreeTextValue()
{
return $this->by_default;
return $this->free_text_value;
}
/**
@@ -588,25 +588,25 @@ abstract class FeatureProduct implements ActiveRecordInterface
} // setFeatureAvId()
/**
* Set the value of [by_default] column.
* Set the value of [free_text_value] column.
*
* @param string $v new value
* @return \Thelia\Model\FeatureProduct The current object (for fluent API support)
*/
public function setByDefault($v)
public function setFreeTextValue($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->by_default !== $v) {
$this->by_default = $v;
$this->modifiedColumns[] = FeatureProductTableMap::BY_DEFAULT;
if ($this->free_text_value !== $v) {
$this->free_text_value = $v;
$this->modifiedColumns[] = FeatureProductTableMap::FREE_TEXT_VALUE;
}
return $this;
} // setByDefault()
} // setFreeTextValue()
/**
* Set the value of [position] column.
@@ -720,8 +720,8 @@ abstract class FeatureProduct implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FeatureProductTableMap::translateFieldName('FeatureAvId', TableMap::TYPE_PHPNAME, $indexType)];
$this->feature_av_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : FeatureProductTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
$this->by_default = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : FeatureProductTableMap::translateFieldName('FreeTextValue', TableMap::TYPE_PHPNAME, $indexType)];
$this->free_text_value = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : FeatureProductTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
$this->position = (null !== $col) ? (int) $col : null;
@@ -1015,8 +1015,8 @@ abstract class FeatureProduct implements ActiveRecordInterface
if ($this->isColumnModified(FeatureProductTableMap::FEATURE_AV_ID)) {
$modifiedColumns[':p' . $index++] = 'FEATURE_AV_ID';
}
if ($this->isColumnModified(FeatureProductTableMap::BY_DEFAULT)) {
$modifiedColumns[':p' . $index++] = 'BY_DEFAULT';
if ($this->isColumnModified(FeatureProductTableMap::FREE_TEXT_VALUE)) {
$modifiedColumns[':p' . $index++] = 'FREE_TEXT_VALUE';
}
if ($this->isColumnModified(FeatureProductTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION';
@@ -1050,8 +1050,8 @@ abstract class FeatureProduct implements ActiveRecordInterface
case 'FEATURE_AV_ID':
$stmt->bindValue($identifier, $this->feature_av_id, PDO::PARAM_INT);
break;
case 'BY_DEFAULT':
$stmt->bindValue($identifier, $this->by_default, PDO::PARAM_STR);
case 'FREE_TEXT_VALUE':
$stmt->bindValue($identifier, $this->free_text_value, PDO::PARAM_STR);
break;
case 'POSITION':
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
@@ -1137,7 +1137,7 @@ abstract class FeatureProduct implements ActiveRecordInterface
return $this->getFeatureAvId();
break;
case 4:
return $this->getByDefault();
return $this->getFreeTextValue();
break;
case 5:
return $this->getPosition();
@@ -1181,7 +1181,7 @@ abstract class FeatureProduct implements ActiveRecordInterface
$keys[1] => $this->getProductId(),
$keys[2] => $this->getFeatureId(),
$keys[3] => $this->getFeatureAvId(),
$keys[4] => $this->getByDefault(),
$keys[4] => $this->getFreeTextValue(),
$keys[5] => $this->getPosition(),
$keys[6] => $this->getCreatedAt(),
$keys[7] => $this->getUpdatedAt(),
@@ -1249,7 +1249,7 @@ abstract class FeatureProduct implements ActiveRecordInterface
$this->setFeatureAvId($value);
break;
case 4:
$this->setByDefault($value);
$this->setFreeTextValue($value);
break;
case 5:
$this->setPosition($value);
@@ -1288,7 +1288,7 @@ abstract class FeatureProduct implements ActiveRecordInterface
if (array_key_exists($keys[1], $arr)) $this->setProductId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setFeatureId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setFeatureAvId($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setByDefault($arr[$keys[4]]);
if (array_key_exists($keys[4], $arr)) $this->setFreeTextValue($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setPosition($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]]);
@@ -1307,7 +1307,7 @@ abstract class FeatureProduct implements ActiveRecordInterface
if ($this->isColumnModified(FeatureProductTableMap::PRODUCT_ID)) $criteria->add(FeatureProductTableMap::PRODUCT_ID, $this->product_id);
if ($this->isColumnModified(FeatureProductTableMap::FEATURE_ID)) $criteria->add(FeatureProductTableMap::FEATURE_ID, $this->feature_id);
if ($this->isColumnModified(FeatureProductTableMap::FEATURE_AV_ID)) $criteria->add(FeatureProductTableMap::FEATURE_AV_ID, $this->feature_av_id);
if ($this->isColumnModified(FeatureProductTableMap::BY_DEFAULT)) $criteria->add(FeatureProductTableMap::BY_DEFAULT, $this->by_default);
if ($this->isColumnModified(FeatureProductTableMap::FREE_TEXT_VALUE)) $criteria->add(FeatureProductTableMap::FREE_TEXT_VALUE, $this->free_text_value);
if ($this->isColumnModified(FeatureProductTableMap::POSITION)) $criteria->add(FeatureProductTableMap::POSITION, $this->position);
if ($this->isColumnModified(FeatureProductTableMap::CREATED_AT)) $criteria->add(FeatureProductTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(FeatureProductTableMap::UPDATED_AT)) $criteria->add(FeatureProductTableMap::UPDATED_AT, $this->updated_at);
@@ -1377,7 +1377,7 @@ abstract class FeatureProduct implements ActiveRecordInterface
$copyObj->setProductId($this->getProductId());
$copyObj->setFeatureId($this->getFeatureId());
$copyObj->setFeatureAvId($this->getFeatureAvId());
$copyObj->setByDefault($this->getByDefault());
$copyObj->setFreeTextValue($this->getFreeTextValue());
$copyObj->setPosition($this->getPosition());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -1571,7 +1571,7 @@ abstract class FeatureProduct implements ActiveRecordInterface
$this->product_id = null;
$this->feature_id = null;
$this->feature_av_id = null;
$this->by_default = null;
$this->free_text_value = null;
$this->position = null;
$this->created_at = null;
$this->updated_at = null;

View File

@@ -25,7 +25,7 @@ use Thelia\Model\Map\FeatureProductTableMap;
* @method ChildFeatureProductQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
* @method ChildFeatureProductQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
* @method ChildFeatureProductQuery orderByFeatureAvId($order = Criteria::ASC) Order by the feature_av_id column
* @method ChildFeatureProductQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
* @method ChildFeatureProductQuery orderByFreeTextValue($order = Criteria::ASC) Order by the free_text_value column
* @method ChildFeatureProductQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildFeatureProductQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildFeatureProductQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
@@ -34,7 +34,7 @@ use Thelia\Model\Map\FeatureProductTableMap;
* @method ChildFeatureProductQuery groupByProductId() Group by the product_id column
* @method ChildFeatureProductQuery groupByFeatureId() Group by the feature_id column
* @method ChildFeatureProductQuery groupByFeatureAvId() Group by the feature_av_id column
* @method ChildFeatureProductQuery groupByByDefault() Group by the by_default column
* @method ChildFeatureProductQuery groupByFreeTextValue() Group by the free_text_value column
* @method ChildFeatureProductQuery groupByPosition() Group by the position column
* @method ChildFeatureProductQuery groupByCreatedAt() Group by the created_at column
* @method ChildFeatureProductQuery groupByUpdatedAt() Group by the updated_at column
@@ -62,7 +62,7 @@ use Thelia\Model\Map\FeatureProductTableMap;
* @method ChildFeatureProduct findOneByProductId(int $product_id) Return the first ChildFeatureProduct filtered by the product_id column
* @method ChildFeatureProduct findOneByFeatureId(int $feature_id) Return the first ChildFeatureProduct filtered by the feature_id column
* @method ChildFeatureProduct findOneByFeatureAvId(int $feature_av_id) Return the first ChildFeatureProduct filtered by the feature_av_id column
* @method ChildFeatureProduct findOneByByDefault(string $by_default) Return the first ChildFeatureProduct filtered by the by_default column
* @method ChildFeatureProduct findOneByFreeTextValue(string $free_text_value) Return the first ChildFeatureProduct filtered by the free_text_value column
* @method ChildFeatureProduct findOneByPosition(int $position) Return the first ChildFeatureProduct filtered by the position column
* @method ChildFeatureProduct findOneByCreatedAt(string $created_at) Return the first ChildFeatureProduct filtered by the created_at column
* @method ChildFeatureProduct findOneByUpdatedAt(string $updated_at) Return the first ChildFeatureProduct filtered by the updated_at column
@@ -71,7 +71,7 @@ use Thelia\Model\Map\FeatureProductTableMap;
* @method array findByProductId(int $product_id) Return ChildFeatureProduct objects filtered by the product_id column
* @method array findByFeatureId(int $feature_id) Return ChildFeatureProduct objects filtered by the feature_id column
* @method array findByFeatureAvId(int $feature_av_id) Return ChildFeatureProduct objects filtered by the feature_av_id column
* @method array findByByDefault(string $by_default) Return ChildFeatureProduct objects filtered by the by_default column
* @method array findByFreeTextValue(string $free_text_value) Return ChildFeatureProduct objects filtered by the free_text_value column
* @method array findByPosition(int $position) Return ChildFeatureProduct objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildFeatureProduct objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildFeatureProduct objects filtered by the updated_at column
@@ -163,7 +163,7 @@ abstract class FeatureProductQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, PRODUCT_ID, FEATURE_ID, FEATURE_AV_ID, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM feature_product WHERE ID = :p0';
$sql = 'SELECT ID, PRODUCT_ID, FEATURE_ID, FEATURE_AV_ID, FREE_TEXT_VALUE, POSITION, CREATED_AT, UPDATED_AT FROM feature_product WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -423,32 +423,32 @@ abstract class FeatureProductQuery extends ModelCriteria
}
/**
* Filter the query on the by_default column
* Filter the query on the free_text_value column
*
* Example usage:
* <code>
* $query->filterByByDefault('fooValue'); // WHERE by_default = 'fooValue'
* $query->filterByByDefault('%fooValue%'); // WHERE by_default LIKE '%fooValue%'
* $query->filterByFreeTextValue('fooValue'); // WHERE free_text_value = 'fooValue'
* $query->filterByFreeTextValue('%fooValue%'); // WHERE free_text_value LIKE '%fooValue%'
* </code>
*
* @param string $byDefault The value to use as filter.
* @param string $freeTextValue The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureProductQuery The current query, for fluid interface
*/
public function filterByByDefault($byDefault = null, $comparison = null)
public function filterByFreeTextValue($freeTextValue = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($byDefault)) {
if (is_array($freeTextValue)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $byDefault)) {
$byDefault = str_replace('*', '%', $byDefault);
} elseif (preg_match('/[\%\*]/', $freeTextValue)) {
$freeTextValue = str_replace('*', '%', $freeTextValue);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(FeatureProductTableMap::BY_DEFAULT, $byDefault, $comparison);
return $this->addUsingAlias(FeatureProductTableMap::FREE_TEXT_VALUE, $freeTextValue, $comparison);
}
/**

View File

@@ -24,13 +24,11 @@ use Thelia\Model\Map\FeatureTableMap;
*
* @method ChildFeatureQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildFeatureQuery orderByVisible($order = Criteria::ASC) Order by the visible column
* @method ChildFeatureQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildFeatureQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildFeatureQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildFeatureQuery groupById() Group by the id column
* @method ChildFeatureQuery groupByVisible() Group by the visible column
* @method ChildFeatureQuery groupByPosition() Group by the position column
* @method ChildFeatureQuery groupByCreatedAt() Group by the created_at column
* @method ChildFeatureQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -59,13 +57,11 @@ use Thelia\Model\Map\FeatureTableMap;
*
* @method ChildFeature findOneById(int $id) Return the first ChildFeature filtered by the id column
* @method ChildFeature findOneByVisible(int $visible) Return the first ChildFeature filtered by the visible column
* @method ChildFeature findOneByPosition(int $position) Return the first ChildFeature filtered by the position column
* @method ChildFeature findOneByCreatedAt(string $created_at) Return the first ChildFeature filtered by the created_at column
* @method ChildFeature findOneByUpdatedAt(string $updated_at) Return the first ChildFeature filtered by the updated_at column
*
* @method array findById(int $id) Return ChildFeature objects filtered by the id column
* @method array findByVisible(int $visible) Return ChildFeature objects filtered by the visible column
* @method array findByPosition(int $position) Return ChildFeature objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildFeature objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildFeature objects filtered by the updated_at column
*
@@ -156,7 +152,7 @@ abstract class FeatureQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, VISIBLE, POSITION, CREATED_AT, UPDATED_AT FROM feature WHERE ID = :p0';
$sql = 'SELECT ID, VISIBLE, CREATED_AT, UPDATED_AT FROM feature WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -327,47 +323,6 @@ abstract class FeatureQuery extends ModelCriteria
return $this->addUsingAlias(FeatureTableMap::VISIBLE, $visible, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position 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 ChildFeatureQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($position)) {
$useMinMax = false;
if (isset($position['min'])) {
$this->addUsingAlias(FeatureTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(FeatureTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureTableMap::POSITION, $position, $comparison);
}
/**
* Filter the query on the created_at column
*

View File

@@ -76,6 +76,12 @@ abstract class FeatureTemplate implements ActiveRecordInterface
*/
protected $template_id;
/**
* The value for the position field.
* @var int
*/
protected $position;
/**
* The value for the created_at field.
* @var string
@@ -393,6 +399,17 @@ abstract class FeatureTemplate implements ActiveRecordInterface
return $this->template_id;
}
/**
* Get the [position] column value.
*
* @return int
*/
public function getPosition()
{
return $this->position;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -504,6 +521,27 @@ abstract class FeatureTemplate implements ActiveRecordInterface
return $this;
} // setTemplateId()
/**
* Set the value of [position] column.
*
* @param int $v new value
* @return \Thelia\Model\FeatureTemplate The current object (for fluent API support)
*/
public function setPosition($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->position !== $v) {
$this->position = $v;
$this->modifiedColumns[] = FeatureTemplateTableMap::POSITION;
}
return $this;
} // setPosition()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -592,13 +630,16 @@ abstract class FeatureTemplate implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FeatureTemplateTableMap::translateFieldName('TemplateId', TableMap::TYPE_PHPNAME, $indexType)];
$this->template_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FeatureTemplateTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FeatureTemplateTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
$this->position = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : FeatureTemplateTableMap::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 ? 4 + $startcol : FeatureTemplateTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : FeatureTemplateTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -611,7 +652,7 @@ abstract class FeatureTemplate implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 5; // 5 = FeatureTemplateTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 6; // 6 = FeatureTemplateTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\FeatureTemplate object", 0, $e);
@@ -867,6 +908,9 @@ abstract class FeatureTemplate implements ActiveRecordInterface
if ($this->isColumnModified(FeatureTemplateTableMap::TEMPLATE_ID)) {
$modifiedColumns[':p' . $index++] = 'TEMPLATE_ID';
}
if ($this->isColumnModified(FeatureTemplateTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION';
}
if ($this->isColumnModified(FeatureTemplateTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -893,6 +937,9 @@ abstract class FeatureTemplate implements ActiveRecordInterface
case 'TEMPLATE_ID':
$stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT);
break;
case 'POSITION':
$stmt->bindValue($identifier, $this->position, 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;
@@ -971,9 +1018,12 @@ abstract class FeatureTemplate implements ActiveRecordInterface
return $this->getTemplateId();
break;
case 3:
return $this->getCreatedAt();
return $this->getPosition();
break;
case 4:
return $this->getCreatedAt();
break;
case 5:
return $this->getUpdatedAt();
break;
default:
@@ -1008,8 +1058,9 @@ abstract class FeatureTemplate implements ActiveRecordInterface
$keys[0] => $this->getId(),
$keys[1] => $this->getFeatureId(),
$keys[2] => $this->getTemplateId(),
$keys[3] => $this->getCreatedAt(),
$keys[4] => $this->getUpdatedAt(),
$keys[3] => $this->getPosition(),
$keys[4] => $this->getCreatedAt(),
$keys[5] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1068,9 +1119,12 @@ abstract class FeatureTemplate implements ActiveRecordInterface
$this->setTemplateId($value);
break;
case 3:
$this->setCreatedAt($value);
$this->setPosition($value);
break;
case 4:
$this->setCreatedAt($value);
break;
case 5:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1100,8 +1154,9 @@ abstract class FeatureTemplate implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setFeatureId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setTemplateId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
if (array_key_exists($keys[3], $arr)) $this->setPosition($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]]);
}
/**
@@ -1116,6 +1171,7 @@ abstract class FeatureTemplate implements ActiveRecordInterface
if ($this->isColumnModified(FeatureTemplateTableMap::ID)) $criteria->add(FeatureTemplateTableMap::ID, $this->id);
if ($this->isColumnModified(FeatureTemplateTableMap::FEATURE_ID)) $criteria->add(FeatureTemplateTableMap::FEATURE_ID, $this->feature_id);
if ($this->isColumnModified(FeatureTemplateTableMap::TEMPLATE_ID)) $criteria->add(FeatureTemplateTableMap::TEMPLATE_ID, $this->template_id);
if ($this->isColumnModified(FeatureTemplateTableMap::POSITION)) $criteria->add(FeatureTemplateTableMap::POSITION, $this->position);
if ($this->isColumnModified(FeatureTemplateTableMap::CREATED_AT)) $criteria->add(FeatureTemplateTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(FeatureTemplateTableMap::UPDATED_AT)) $criteria->add(FeatureTemplateTableMap::UPDATED_AT, $this->updated_at);
@@ -1183,6 +1239,7 @@ abstract class FeatureTemplate implements ActiveRecordInterface
{
$copyObj->setFeatureId($this->getFeatureId());
$copyObj->setTemplateId($this->getTemplateId());
$copyObj->setPosition($this->getPosition());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1323,6 +1380,7 @@ abstract class FeatureTemplate implements ActiveRecordInterface
$this->id = null;
$this->feature_id = null;
$this->template_id = null;
$this->position = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -24,12 +24,14 @@ use Thelia\Model\Map\FeatureTemplateTableMap;
* @method ChildFeatureTemplateQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildFeatureTemplateQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
* @method ChildFeatureTemplateQuery orderByTemplateId($order = Criteria::ASC) Order by the template_id column
* @method ChildFeatureTemplateQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildFeatureTemplateQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildFeatureTemplateQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildFeatureTemplateQuery groupById() Group by the id column
* @method ChildFeatureTemplateQuery groupByFeatureId() Group by the feature_id column
* @method ChildFeatureTemplateQuery groupByTemplateId() Group by the template_id column
* @method ChildFeatureTemplateQuery groupByPosition() Group by the position column
* @method ChildFeatureTemplateQuery groupByCreatedAt() Group by the created_at column
* @method ChildFeatureTemplateQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -51,12 +53,14 @@ use Thelia\Model\Map\FeatureTemplateTableMap;
* @method ChildFeatureTemplate findOneById(int $id) Return the first ChildFeatureTemplate filtered by the id column
* @method ChildFeatureTemplate findOneByFeatureId(int $feature_id) Return the first ChildFeatureTemplate filtered by the feature_id column
* @method ChildFeatureTemplate findOneByTemplateId(int $template_id) Return the first ChildFeatureTemplate filtered by the template_id column
* @method ChildFeatureTemplate findOneByPosition(int $position) Return the first ChildFeatureTemplate filtered by the position column
* @method ChildFeatureTemplate findOneByCreatedAt(string $created_at) Return the first ChildFeatureTemplate filtered by the created_at column
* @method ChildFeatureTemplate findOneByUpdatedAt(string $updated_at) Return the first ChildFeatureTemplate filtered by the updated_at column
*
* @method array findById(int $id) Return ChildFeatureTemplate objects filtered by the id column
* @method array findByFeatureId(int $feature_id) Return ChildFeatureTemplate objects filtered by the feature_id column
* @method array findByTemplateId(int $template_id) Return ChildFeatureTemplate objects filtered by the template_id column
* @method array findByPosition(int $position) Return ChildFeatureTemplate objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildFeatureTemplate objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildFeatureTemplate objects filtered by the updated_at column
*
@@ -147,7 +151,7 @@ abstract class FeatureTemplateQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, FEATURE_ID, TEMPLATE_ID, CREATED_AT, UPDATED_AT FROM feature_template WHERE ID = :p0';
$sql = 'SELECT ID, FEATURE_ID, TEMPLATE_ID, POSITION, CREATED_AT, UPDATED_AT FROM feature_template WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -363,6 +367,47 @@ abstract class FeatureTemplateQuery extends ModelCriteria
return $this->addUsingAlias(FeatureTemplateTableMap::TEMPLATE_ID, $templateId, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position 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 ChildFeatureTemplateQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($position)) {
$useMinMax = false;
if (isset($position['min'])) {
$this->addUsingAlias(FeatureTemplateTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(FeatureTemplateTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureTemplateTableMap::POSITION, $position, $comparison);
}
/**
* Filter the query on the created_at column
*

View File

@@ -87,10 +87,10 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
protected $attribute_description;
/**
* The value for the attribute_postscriptumn field.
* The value for the attribute_postscriptum field.
* @var string
*/
protected $attribute_postscriptumn;
protected $attribute_postscriptum;
/**
* The value for the attribute_av_title field.
@@ -451,14 +451,14 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
}
/**
* Get the [attribute_postscriptumn] column value.
* Get the [attribute_postscriptum] column value.
*
* @return string
*/
public function getAttributePostscriptumn()
public function getAttributePostscriptum()
{
return $this->attribute_postscriptumn;
return $this->attribute_postscriptum;
}
/**
@@ -655,25 +655,25 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
} // setAttributeDescription()
/**
* Set the value of [attribute_postscriptumn] column.
* Set the value of [attribute_postscriptum] column.
*
* @param string $v new value
* @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
*/
public function setAttributePostscriptumn($v)
public function setAttributePostscriptum($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->attribute_postscriptumn !== $v) {
$this->attribute_postscriptumn = $v;
$this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN;
if ($this->attribute_postscriptum !== $v) {
$this->attribute_postscriptum = $v;
$this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUM;
}
return $this;
} // setAttributePostscriptumn()
} // setAttributePostscriptum()
/**
* Set the value of [attribute_av_title] column.
@@ -853,8 +853,8 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributeDescription', TableMap::TYPE_PHPNAME, $indexType)];
$this->attribute_description = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributePostscriptumn', TableMap::TYPE_PHPNAME, $indexType)];
$this->attribute_postscriptumn = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributePostscriptum', TableMap::TYPE_PHPNAME, $indexType)];
$this->attribute_postscriptum = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributeAvTitle', TableMap::TYPE_PHPNAME, $indexType)];
$this->attribute_av_title = (null !== $col) ? (string) $col : null;
@@ -1138,8 +1138,8 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_DESCRIPTION';
}
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_POSTSCRIPTUMN';
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUM)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_POSTSCRIPTUM';
}
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_TITLE';
@@ -1185,8 +1185,8 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
case 'ATTRIBUTE_DESCRIPTION':
$stmt->bindValue($identifier, $this->attribute_description, PDO::PARAM_STR);
break;
case 'ATTRIBUTE_POSTSCRIPTUMN':
$stmt->bindValue($identifier, $this->attribute_postscriptumn, PDO::PARAM_STR);
case 'ATTRIBUTE_POSTSCRIPTUM':
$stmt->bindValue($identifier, $this->attribute_postscriptum, PDO::PARAM_STR);
break;
case 'ATTRIBUTE_AV_TITLE':
$stmt->bindValue($identifier, $this->attribute_av_title, PDO::PARAM_STR);
@@ -1284,7 +1284,7 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
return $this->getAttributeDescription();
break;
case 5:
return $this->getAttributePostscriptumn();
return $this->getAttributePostscriptum();
break;
case 6:
return $this->getAttributeAvTitle();
@@ -1338,7 +1338,7 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
$keys[2] => $this->getAttributeTitle(),
$keys[3] => $this->getAttributeChapo(),
$keys[4] => $this->getAttributeDescription(),
$keys[5] => $this->getAttributePostscriptumn(),
$keys[5] => $this->getAttributePostscriptum(),
$keys[6] => $this->getAttributeAvTitle(),
$keys[7] => $this->getAttributeAvChapo(),
$keys[8] => $this->getAttributeAvDescription(),
@@ -1406,7 +1406,7 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
$this->setAttributeDescription($value);
break;
case 5:
$this->setAttributePostscriptumn($value);
$this->setAttributePostscriptum($value);
break;
case 6:
$this->setAttributeAvTitle($value);
@@ -1455,7 +1455,7 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
if (array_key_exists($keys[2], $arr)) $this->setAttributeTitle($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setAttributeChapo($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setAttributeDescription($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setAttributePostscriptumn($arr[$keys[5]]);
if (array_key_exists($keys[5], $arr)) $this->setAttributePostscriptum($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setAttributeAvTitle($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setAttributeAvChapo($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setAttributeAvDescription($arr[$keys[8]]);
@@ -1478,7 +1478,7 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE, $this->attribute_title);
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO, $this->attribute_chapo);
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION, $this->attribute_description);
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN, $this->attribute_postscriptumn);
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUM)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUM, $this->attribute_postscriptum);
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE, $this->attribute_av_title);
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO, $this->attribute_av_chapo);
if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION, $this->attribute_av_description);
@@ -1552,7 +1552,7 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
$copyObj->setAttributeTitle($this->getAttributeTitle());
$copyObj->setAttributeChapo($this->getAttributeChapo());
$copyObj->setAttributeDescription($this->getAttributeDescription());
$copyObj->setAttributePostscriptumn($this->getAttributePostscriptumn());
$copyObj->setAttributePostscriptum($this->getAttributePostscriptum());
$copyObj->setAttributeAvTitle($this->getAttributeAvTitle());
$copyObj->setAttributeAvChapo($this->getAttributeAvChapo());
$copyObj->setAttributeAvDescription($this->getAttributeAvDescription());
@@ -1648,7 +1648,7 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface
$this->attribute_title = null;
$this->attribute_chapo = null;
$this->attribute_description = null;
$this->attribute_postscriptumn = null;
$this->attribute_postscriptum = null;
$this->attribute_av_title = null;
$this->attribute_av_chapo = null;
$this->attribute_av_description = null;

View File

@@ -26,7 +26,7 @@ use Thelia\Model\Map\OrderProductAttributeCombinationTableMap;
* @method ChildOrderProductAttributeCombinationQuery orderByAttributeTitle($order = Criteria::ASC) Order by the attribute_title column
* @method ChildOrderProductAttributeCombinationQuery orderByAttributeChapo($order = Criteria::ASC) Order by the attribute_chapo column
* @method ChildOrderProductAttributeCombinationQuery orderByAttributeDescription($order = Criteria::ASC) Order by the attribute_description column
* @method ChildOrderProductAttributeCombinationQuery orderByAttributePostscriptumn($order = Criteria::ASC) Order by the attribute_postscriptumn column
* @method ChildOrderProductAttributeCombinationQuery orderByAttributePostscriptum($order = Criteria::ASC) Order by the attribute_postscriptum column
* @method ChildOrderProductAttributeCombinationQuery orderByAttributeAvTitle($order = Criteria::ASC) Order by the attribute_av_title column
* @method ChildOrderProductAttributeCombinationQuery orderByAttributeAvChapo($order = Criteria::ASC) Order by the attribute_av_chapo column
* @method ChildOrderProductAttributeCombinationQuery orderByAttributeAvDescription($order = Criteria::ASC) Order by the attribute_av_description column
@@ -39,7 +39,7 @@ use Thelia\Model\Map\OrderProductAttributeCombinationTableMap;
* @method ChildOrderProductAttributeCombinationQuery groupByAttributeTitle() Group by the attribute_title column
* @method ChildOrderProductAttributeCombinationQuery groupByAttributeChapo() Group by the attribute_chapo column
* @method ChildOrderProductAttributeCombinationQuery groupByAttributeDescription() Group by the attribute_description column
* @method ChildOrderProductAttributeCombinationQuery groupByAttributePostscriptumn() Group by the attribute_postscriptumn column
* @method ChildOrderProductAttributeCombinationQuery groupByAttributePostscriptum() Group by the attribute_postscriptum column
* @method ChildOrderProductAttributeCombinationQuery groupByAttributeAvTitle() Group by the attribute_av_title column
* @method ChildOrderProductAttributeCombinationQuery groupByAttributeAvChapo() Group by the attribute_av_chapo column
* @method ChildOrderProductAttributeCombinationQuery groupByAttributeAvDescription() Group by the attribute_av_description column
@@ -63,7 +63,7 @@ use Thelia\Model\Map\OrderProductAttributeCombinationTableMap;
* @method ChildOrderProductAttributeCombination findOneByAttributeTitle(string $attribute_title) Return the first ChildOrderProductAttributeCombination filtered by the attribute_title column
* @method ChildOrderProductAttributeCombination findOneByAttributeChapo(string $attribute_chapo) Return the first ChildOrderProductAttributeCombination filtered by the attribute_chapo column
* @method ChildOrderProductAttributeCombination findOneByAttributeDescription(string $attribute_description) Return the first ChildOrderProductAttributeCombination filtered by the attribute_description column
* @method ChildOrderProductAttributeCombination findOneByAttributePostscriptumn(string $attribute_postscriptumn) Return the first ChildOrderProductAttributeCombination filtered by the attribute_postscriptumn column
* @method ChildOrderProductAttributeCombination findOneByAttributePostscriptum(string $attribute_postscriptum) Return the first ChildOrderProductAttributeCombination filtered by the attribute_postscriptum column
* @method ChildOrderProductAttributeCombination findOneByAttributeAvTitle(string $attribute_av_title) Return the first ChildOrderProductAttributeCombination filtered by the attribute_av_title column
* @method ChildOrderProductAttributeCombination findOneByAttributeAvChapo(string $attribute_av_chapo) Return the first ChildOrderProductAttributeCombination filtered by the attribute_av_chapo column
* @method ChildOrderProductAttributeCombination findOneByAttributeAvDescription(string $attribute_av_description) Return the first ChildOrderProductAttributeCombination filtered by the attribute_av_description column
@@ -76,7 +76,7 @@ use Thelia\Model\Map\OrderProductAttributeCombinationTableMap;
* @method array findByAttributeTitle(string $attribute_title) Return ChildOrderProductAttributeCombination objects filtered by the attribute_title column
* @method array findByAttributeChapo(string $attribute_chapo) Return ChildOrderProductAttributeCombination objects filtered by the attribute_chapo column
* @method array findByAttributeDescription(string $attribute_description) Return ChildOrderProductAttributeCombination objects filtered by the attribute_description column
* @method array findByAttributePostscriptumn(string $attribute_postscriptumn) Return ChildOrderProductAttributeCombination objects filtered by the attribute_postscriptumn column
* @method array findByAttributePostscriptum(string $attribute_postscriptum) Return ChildOrderProductAttributeCombination objects filtered by the attribute_postscriptum column
* @method array findByAttributeAvTitle(string $attribute_av_title) Return ChildOrderProductAttributeCombination objects filtered by the attribute_av_title column
* @method array findByAttributeAvChapo(string $attribute_av_chapo) Return ChildOrderProductAttributeCombination objects filtered by the attribute_av_chapo column
* @method array findByAttributeAvDescription(string $attribute_av_description) Return ChildOrderProductAttributeCombination objects filtered by the attribute_av_description column
@@ -171,7 +171,7 @@ abstract class OrderProductAttributeCombinationQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, ORDER_PRODUCT_ID, ATTRIBUTE_TITLE, ATTRIBUTE_CHAPO, ATTRIBUTE_DESCRIPTION, ATTRIBUTE_POSTSCRIPTUMN, ATTRIBUTE_AV_TITLE, ATTRIBUTE_AV_CHAPO, ATTRIBUTE_AV_DESCRIPTION, ATTRIBUTE_AV_POSTSCRIPTUM, CREATED_AT, UPDATED_AT FROM order_product_attribute_combination WHERE ID = :p0';
$sql = 'SELECT ID, ORDER_PRODUCT_ID, ATTRIBUTE_TITLE, ATTRIBUTE_CHAPO, ATTRIBUTE_DESCRIPTION, ATTRIBUTE_POSTSCRIPTUM, ATTRIBUTE_AV_TITLE, ATTRIBUTE_AV_CHAPO, ATTRIBUTE_AV_DESCRIPTION, ATTRIBUTE_AV_POSTSCRIPTUM, CREATED_AT, UPDATED_AT FROM order_product_attribute_combination WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -432,32 +432,32 @@ abstract class OrderProductAttributeCombinationQuery extends ModelCriteria
}
/**
* Filter the query on the attribute_postscriptumn column
* Filter the query on the attribute_postscriptum column
*
* Example usage:
* <code>
* $query->filterByAttributePostscriptumn('fooValue'); // WHERE attribute_postscriptumn = 'fooValue'
* $query->filterByAttributePostscriptumn('%fooValue%'); // WHERE attribute_postscriptumn LIKE '%fooValue%'
* $query->filterByAttributePostscriptum('fooValue'); // WHERE attribute_postscriptum = 'fooValue'
* $query->filterByAttributePostscriptum('%fooValue%'); // WHERE attribute_postscriptum LIKE '%fooValue%'
* </code>
*
* @param string $attributePostscriptumn The value to use as filter.
* @param string $attributePostscriptum The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
*/
public function filterByAttributePostscriptumn($attributePostscriptumn = null, $comparison = null)
public function filterByAttributePostscriptum($attributePostscriptum = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($attributePostscriptumn)) {
if (is_array($attributePostscriptum)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $attributePostscriptumn)) {
$attributePostscriptumn = str_replace('*', '%', $attributePostscriptumn);
} elseif (preg_match('/[\%\*]/', $attributePostscriptum)) {
$attributePostscriptum = str_replace('*', '%', $attributePostscriptum);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN, $attributePostscriptumn, $comparison);
return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUM, $attributePostscriptum, $comparison);
}
/**

View File

@@ -86,6 +86,12 @@ abstract class OrderProductTax implements ActiveRecordInterface
*/
protected $amount;
/**
* The value for the promo_amount field.
* @var double
*/
protected $promo_amount;
/**
* The value for the created_at field.
* @var string
@@ -420,6 +426,17 @@ abstract class OrderProductTax implements ActiveRecordInterface
return $this->amount;
}
/**
* Get the [promo_amount] column value.
*
* @return double
*/
public function getPromoAmount()
{
return $this->promo_amount;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -569,6 +586,27 @@ abstract class OrderProductTax implements ActiveRecordInterface
return $this;
} // setAmount()
/**
* Set the value of [promo_amount] column.
*
* @param double $v new value
* @return \Thelia\Model\OrderProductTax The current object (for fluent API support)
*/
public function setPromoAmount($v)
{
if ($v !== null) {
$v = (double) $v;
}
if ($this->promo_amount !== $v) {
$this->promo_amount = $v;
$this->modifiedColumns[] = OrderProductTaxTableMap::PROMO_AMOUNT;
}
return $this;
} // setPromoAmount()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -663,13 +701,16 @@ abstract class OrderProductTax implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : OrderProductTaxTableMap::translateFieldName('Amount', TableMap::TYPE_PHPNAME, $indexType)];
$this->amount = (null !== $col) ? (double) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : OrderProductTaxTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : OrderProductTaxTableMap::translateFieldName('PromoAmount', TableMap::TYPE_PHPNAME, $indexType)];
$this->promo_amount = (null !== $col) ? (double) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : OrderProductTaxTableMap::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 ? 6 + $startcol : OrderProductTaxTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : OrderProductTaxTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -682,7 +723,7 @@ abstract class OrderProductTax implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 7; // 7 = OrderProductTaxTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 8; // 8 = OrderProductTaxTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\OrderProductTax object", 0, $e);
@@ -933,6 +974,9 @@ abstract class OrderProductTax implements ActiveRecordInterface
if ($this->isColumnModified(OrderProductTaxTableMap::AMOUNT)) {
$modifiedColumns[':p' . $index++] = 'AMOUNT';
}
if ($this->isColumnModified(OrderProductTaxTableMap::PROMO_AMOUNT)) {
$modifiedColumns[':p' . $index++] = 'PROMO_AMOUNT';
}
if ($this->isColumnModified(OrderProductTaxTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -965,6 +1009,9 @@ abstract class OrderProductTax implements ActiveRecordInterface
case 'AMOUNT':
$stmt->bindValue($identifier, $this->amount, PDO::PARAM_STR);
break;
case 'PROMO_AMOUNT':
$stmt->bindValue($identifier, $this->promo_amount, 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;
@@ -1049,9 +1096,12 @@ abstract class OrderProductTax implements ActiveRecordInterface
return $this->getAmount();
break;
case 5:
return $this->getCreatedAt();
return $this->getPromoAmount();
break;
case 6:
return $this->getCreatedAt();
break;
case 7:
return $this->getUpdatedAt();
break;
default:
@@ -1088,8 +1138,9 @@ abstract class OrderProductTax implements ActiveRecordInterface
$keys[2] => $this->getTitle(),
$keys[3] => $this->getDescription(),
$keys[4] => $this->getAmount(),
$keys[5] => $this->getCreatedAt(),
$keys[6] => $this->getUpdatedAt(),
$keys[5] => $this->getPromoAmount(),
$keys[6] => $this->getCreatedAt(),
$keys[7] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1151,9 +1202,12 @@ abstract class OrderProductTax implements ActiveRecordInterface
$this->setAmount($value);
break;
case 5:
$this->setCreatedAt($value);
$this->setPromoAmount($value);
break;
case 6:
$this->setCreatedAt($value);
break;
case 7:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1185,8 +1239,9 @@ abstract class OrderProductTax implements ActiveRecordInterface
if (array_key_exists($keys[2], $arr)) $this->setTitle($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDescription($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setAmount($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
if (array_key_exists($keys[5], $arr)) $this->setPromoAmount($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]]);
}
/**
@@ -1203,6 +1258,7 @@ abstract class OrderProductTax implements ActiveRecordInterface
if ($this->isColumnModified(OrderProductTaxTableMap::TITLE)) $criteria->add(OrderProductTaxTableMap::TITLE, $this->title);
if ($this->isColumnModified(OrderProductTaxTableMap::DESCRIPTION)) $criteria->add(OrderProductTaxTableMap::DESCRIPTION, $this->description);
if ($this->isColumnModified(OrderProductTaxTableMap::AMOUNT)) $criteria->add(OrderProductTaxTableMap::AMOUNT, $this->amount);
if ($this->isColumnModified(OrderProductTaxTableMap::PROMO_AMOUNT)) $criteria->add(OrderProductTaxTableMap::PROMO_AMOUNT, $this->promo_amount);
if ($this->isColumnModified(OrderProductTaxTableMap::CREATED_AT)) $criteria->add(OrderProductTaxTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(OrderProductTaxTableMap::UPDATED_AT)) $criteria->add(OrderProductTaxTableMap::UPDATED_AT, $this->updated_at);
@@ -1272,6 +1328,7 @@ abstract class OrderProductTax implements ActiveRecordInterface
$copyObj->setTitle($this->getTitle());
$copyObj->setDescription($this->getDescription());
$copyObj->setAmount($this->getAmount());
$copyObj->setPromoAmount($this->getPromoAmount());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1363,6 +1420,7 @@ abstract class OrderProductTax implements ActiveRecordInterface
$this->title = null;
$this->description = null;
$this->amount = null;
$this->promo_amount = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -26,6 +26,7 @@ use Thelia\Model\Map\OrderProductTaxTableMap;
* @method ChildOrderProductTaxQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildOrderProductTaxQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildOrderProductTaxQuery orderByAmount($order = Criteria::ASC) Order by the amount column
* @method ChildOrderProductTaxQuery orderByPromoAmount($order = Criteria::ASC) Order by the promo_amount column
* @method ChildOrderProductTaxQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildOrderProductTaxQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
@@ -34,6 +35,7 @@ use Thelia\Model\Map\OrderProductTaxTableMap;
* @method ChildOrderProductTaxQuery groupByTitle() Group by the title column
* @method ChildOrderProductTaxQuery groupByDescription() Group by the description column
* @method ChildOrderProductTaxQuery groupByAmount() Group by the amount column
* @method ChildOrderProductTaxQuery groupByPromoAmount() Group by the promo_amount column
* @method ChildOrderProductTaxQuery groupByCreatedAt() Group by the created_at column
* @method ChildOrderProductTaxQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -53,6 +55,7 @@ use Thelia\Model\Map\OrderProductTaxTableMap;
* @method ChildOrderProductTax findOneByTitle(string $title) Return the first ChildOrderProductTax filtered by the title column
* @method ChildOrderProductTax findOneByDescription(string $description) Return the first ChildOrderProductTax filtered by the description column
* @method ChildOrderProductTax findOneByAmount(double $amount) Return the first ChildOrderProductTax filtered by the amount column
* @method ChildOrderProductTax findOneByPromoAmount(double $promo_amount) Return the first ChildOrderProductTax filtered by the promo_amount column
* @method ChildOrderProductTax findOneByCreatedAt(string $created_at) Return the first ChildOrderProductTax filtered by the created_at column
* @method ChildOrderProductTax findOneByUpdatedAt(string $updated_at) Return the first ChildOrderProductTax filtered by the updated_at column
*
@@ -61,6 +64,7 @@ use Thelia\Model\Map\OrderProductTaxTableMap;
* @method array findByTitle(string $title) Return ChildOrderProductTax objects filtered by the title column
* @method array findByDescription(string $description) Return ChildOrderProductTax objects filtered by the description column
* @method array findByAmount(double $amount) Return ChildOrderProductTax objects filtered by the amount column
* @method array findByPromoAmount(double $promo_amount) Return ChildOrderProductTax objects filtered by the promo_amount column
* @method array findByCreatedAt(string $created_at) Return ChildOrderProductTax objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildOrderProductTax objects filtered by the updated_at column
*
@@ -151,7 +155,7 @@ abstract class OrderProductTaxQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, ORDER_PRODUCT_ID, TITLE, DESCRIPTION, AMOUNT, CREATED_AT, UPDATED_AT FROM order_product_tax WHERE ID = :p0';
$sql = 'SELECT ID, ORDER_PRODUCT_ID, TITLE, DESCRIPTION, AMOUNT, PROMO_AMOUNT, CREATED_AT, UPDATED_AT FROM order_product_tax WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -423,6 +427,47 @@ abstract class OrderProductTaxQuery extends ModelCriteria
return $this->addUsingAlias(OrderProductTaxTableMap::AMOUNT, $amount, $comparison);
}
/**
* Filter the query on the promo_amount column
*
* Example usage:
* <code>
* $query->filterByPromoAmount(1234); // WHERE promo_amount = 1234
* $query->filterByPromoAmount(array(12, 34)); // WHERE promo_amount IN (12, 34)
* $query->filterByPromoAmount(array('min' => 12)); // WHERE promo_amount > 12
* </code>
*
* @param mixed $promoAmount 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 ChildOrderProductTaxQuery The current query, for fluid interface
*/
public function filterByPromoAmount($promoAmount = null, $comparison = null)
{
if (is_array($promoAmount)) {
$useMinMax = false;
if (isset($promoAmount['min'])) {
$this->addUsingAlias(OrderProductTaxTableMap::PROMO_AMOUNT, $promoAmount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($promoAmount['max'])) {
$this->addUsingAlias(OrderProductTaxTableMap::PROMO_AMOUNT, $promoAmount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(OrderProductTaxTableMap::PROMO_AMOUNT, $promoAmount, $comparison);
}
/**
* Filter the query on the created_at column
*

View File

@@ -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;

View File

@@ -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
*