Merge branch 'tax'

This commit is contained in:
Etienne Roudeix
2013-09-09 16:28:32 +02:00
31 changed files with 882 additions and 622 deletions

View File

@@ -1631,7 +1631,10 @@ abstract class Country implements ActiveRecordInterface
$taxRuleCountriesToDelete = $this->getTaxRuleCountries(new Criteria(), $con)->diff($taxRuleCountries);
$this->taxRuleCountriesScheduledForDeletion = $taxRuleCountriesToDelete;
//since at least one column in the foreign key is at the same time a PK
//we can not just set a PK to NULL in the lines below. We have to store
//a backup of all values, so we are able to manipulate these items based on the onDelete value later.
$this->taxRuleCountriesScheduledForDeletion = clone $taxRuleCountriesToDelete;
foreach ($taxRuleCountriesToDelete as $taxRuleCountryRemoved) {
$taxRuleCountryRemoved->setCountry(null);
@@ -1724,7 +1727,7 @@ abstract class Country implements ActiveRecordInterface
$this->taxRuleCountriesScheduledForDeletion = clone $this->collTaxRuleCountries;
$this->taxRuleCountriesScheduledForDeletion->clear();
}
$this->taxRuleCountriesScheduledForDeletion[]= $taxRuleCountry;
$this->taxRuleCountriesScheduledForDeletion[]= clone $taxRuleCountry;
$taxRuleCountry->setCountry(null);
}

View File

@@ -616,7 +616,7 @@ abstract class CountryQuery extends ModelCriteria
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function joinTaxRuleCountry($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinTaxRuleCountry($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('TaxRuleCountry');
@@ -651,7 +651,7 @@ abstract class CountryQuery extends ModelCriteria
*
* @return \Thelia\Model\TaxRuleCountryQuery A secondary query class using the current class as primary query
*/
public function useTaxRuleCountryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useTaxRuleCountryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinTaxRuleCountry($relationAlias, $joinType)

View File

@@ -791,10 +791,9 @@ abstract class Tax implements ActiveRecordInterface
if ($this->taxRuleCountriesScheduledForDeletion !== null) {
if (!$this->taxRuleCountriesScheduledForDeletion->isEmpty()) {
foreach ($this->taxRuleCountriesScheduledForDeletion as $taxRuleCountry) {
// need to save related object because we set the relation to null
$taxRuleCountry->save($con);
}
\Thelia\Model\TaxRuleCountryQuery::create()
->filterByPrimaryKeys($this->taxRuleCountriesScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->taxRuleCountriesScheduledForDeletion = null;
}
}
@@ -1346,7 +1345,10 @@ abstract class Tax implements ActiveRecordInterface
$taxRuleCountriesToDelete = $this->getTaxRuleCountries(new Criteria(), $con)->diff($taxRuleCountries);
$this->taxRuleCountriesScheduledForDeletion = $taxRuleCountriesToDelete;
//since at least one column in the foreign key is at the same time a PK
//we can not just set a PK to NULL in the lines below. We have to store
//a backup of all values, so we are able to manipulate these items based on the onDelete value later.
$this->taxRuleCountriesScheduledForDeletion = clone $taxRuleCountriesToDelete;
foreach ($taxRuleCountriesToDelete as $taxRuleCountryRemoved) {
$taxRuleCountryRemoved->setTax(null);
@@ -1439,7 +1441,7 @@ abstract class Tax implements ActiveRecordInterface
$this->taxRuleCountriesScheduledForDeletion = clone $this->collTaxRuleCountries;
$this->taxRuleCountriesScheduledForDeletion->clear();
}
$this->taxRuleCountriesScheduledForDeletion[]= $taxRuleCountry;
$this->taxRuleCountriesScheduledForDeletion[]= clone $taxRuleCountry;
$taxRuleCountry->setTax(null);
}

View File

@@ -432,7 +432,7 @@ abstract class TaxQuery extends ModelCriteria
*
* @return ChildTaxQuery The current query, for fluid interface
*/
public function joinTaxRuleCountry($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinTaxRuleCountry($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('TaxRuleCountry');
@@ -467,7 +467,7 @@ abstract class TaxQuery extends ModelCriteria
*
* @return \Thelia\Model\TaxRuleCountryQuery A secondary query class using the current class as primary query
*/
public function useTaxRuleCountryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useTaxRuleCountryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinTaxRuleCountry($relationAlias, $joinType)

View File

@@ -67,24 +67,6 @@ abstract class TaxRule implements ActiveRecordInterface
*/
protected $id;
/**
* The value for the code field.
* @var string
*/
protected $code;
/**
* The value for the title field.
* @var string
*/
protected $title;
/**
* The value for the description field.
* @var string
*/
protected $description;
/**
* The value for the created_at field.
* @var string
@@ -420,39 +402,6 @@ abstract class TaxRule implements ActiveRecordInterface
return $this->id;
}
/**
* Get the [code] column value.
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Get the [title] column value.
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Get the [description] column value.
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -514,69 +463,6 @@ abstract class TaxRule implements ActiveRecordInterface
return $this;
} // setId()
/**
* Set the value of [code] column.
*
* @param string $v new value
* @return \Thelia\Model\TaxRule The current object (for fluent API support)
*/
public function setCode($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->code !== $v) {
$this->code = $v;
$this->modifiedColumns[] = TaxRuleTableMap::CODE;
}
return $this;
} // setCode()
/**
* Set the value of [title] column.
*
* @param string $v new value
* @return \Thelia\Model\TaxRule The current object (for fluent API support)
*/
public function setTitle($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->title !== $v) {
$this->title = $v;
$this->modifiedColumns[] = TaxRuleTableMap::TITLE;
}
return $this;
} // setTitle()
/**
* Set the value of [description] column.
*
* @param string $v new value
* @return \Thelia\Model\TaxRule The current object (for fluent API support)
*/
public function setDescription($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->description !== $v) {
$this->description = $v;
$this->modifiedColumns[] = TaxRuleTableMap::DESCRIPTION;
}
return $this;
} // setDescription()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -659,22 +545,13 @@ abstract class TaxRule implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : TaxRuleTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : TaxRuleTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)];
$this->code = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : TaxRuleTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
$this->title = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : TaxRuleTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
$this->description = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : TaxRuleTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : TaxRuleTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : TaxRuleTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : TaxRuleTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -687,7 +564,7 @@ abstract class TaxRule implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 6; // 6 = TaxRuleTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 3; // 3 = TaxRuleTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\TaxRule object", 0, $e);
@@ -968,15 +845,6 @@ abstract class TaxRule implements ActiveRecordInterface
if ($this->isColumnModified(TaxRuleTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
if ($this->isColumnModified(TaxRuleTableMap::CODE)) {
$modifiedColumns[':p' . $index++] = 'CODE';
}
if ($this->isColumnModified(TaxRuleTableMap::TITLE)) {
$modifiedColumns[':p' . $index++] = 'TITLE';
}
if ($this->isColumnModified(TaxRuleTableMap::DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
}
if ($this->isColumnModified(TaxRuleTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -997,15 +865,6 @@ abstract class TaxRule implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
case 'CODE':
$stmt->bindValue($identifier, $this->code, PDO::PARAM_STR);
break;
case 'TITLE':
$stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
break;
case 'DESCRIPTION':
$stmt->bindValue($identifier, $this->description, 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;
@@ -1078,18 +937,9 @@ abstract class TaxRule implements ActiveRecordInterface
return $this->getId();
break;
case 1:
return $this->getCode();
break;
case 2:
return $this->getTitle();
break;
case 3:
return $this->getDescription();
break;
case 4:
return $this->getCreatedAt();
break;
case 5:
case 2:
return $this->getUpdatedAt();
break;
default:
@@ -1122,11 +972,8 @@ abstract class TaxRule implements ActiveRecordInterface
$keys = TaxRuleTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getCode(),
$keys[2] => $this->getTitle(),
$keys[3] => $this->getDescription(),
$keys[4] => $this->getCreatedAt(),
$keys[5] => $this->getUpdatedAt(),
$keys[1] => $this->getCreatedAt(),
$keys[2] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1182,18 +1029,9 @@ abstract class TaxRule implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
$this->setCode($value);
break;
case 2:
$this->setTitle($value);
break;
case 3:
$this->setDescription($value);
break;
case 4:
$this->setCreatedAt($value);
break;
case 5:
case 2:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1221,11 +1059,8 @@ abstract class TaxRule implements ActiveRecordInterface
$keys = TaxRuleTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setCode($arr[$keys[1]]);
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->setCreatedAt($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setUpdatedAt($arr[$keys[5]]);
if (array_key_exists($keys[1], $arr)) $this->setCreatedAt($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setUpdatedAt($arr[$keys[2]]);
}
/**
@@ -1238,9 +1073,6 @@ abstract class TaxRule implements ActiveRecordInterface
$criteria = new Criteria(TaxRuleTableMap::DATABASE_NAME);
if ($this->isColumnModified(TaxRuleTableMap::ID)) $criteria->add(TaxRuleTableMap::ID, $this->id);
if ($this->isColumnModified(TaxRuleTableMap::CODE)) $criteria->add(TaxRuleTableMap::CODE, $this->code);
if ($this->isColumnModified(TaxRuleTableMap::TITLE)) $criteria->add(TaxRuleTableMap::TITLE, $this->title);
if ($this->isColumnModified(TaxRuleTableMap::DESCRIPTION)) $criteria->add(TaxRuleTableMap::DESCRIPTION, $this->description);
if ($this->isColumnModified(TaxRuleTableMap::CREATED_AT)) $criteria->add(TaxRuleTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(TaxRuleTableMap::UPDATED_AT)) $criteria->add(TaxRuleTableMap::UPDATED_AT, $this->updated_at);
@@ -1306,9 +1138,6 @@ abstract class TaxRule implements ActiveRecordInterface
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setCode($this->getCode());
$copyObj->setTitle($this->getTitle());
$copyObj->setDescription($this->getDescription());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -1723,7 +1552,10 @@ abstract class TaxRule implements ActiveRecordInterface
$taxRuleCountriesToDelete = $this->getTaxRuleCountries(new Criteria(), $con)->diff($taxRuleCountries);
$this->taxRuleCountriesScheduledForDeletion = $taxRuleCountriesToDelete;
//since at least one column in the foreign key is at the same time a PK
//we can not just set a PK to NULL in the lines below. We have to store
//a backup of all values, so we are able to manipulate these items based on the onDelete value later.
$this->taxRuleCountriesScheduledForDeletion = clone $taxRuleCountriesToDelete;
foreach ($taxRuleCountriesToDelete as $taxRuleCountryRemoved) {
$taxRuleCountryRemoved->setTaxRule(null);
@@ -1816,7 +1648,7 @@ abstract class TaxRule implements ActiveRecordInterface
$this->taxRuleCountriesScheduledForDeletion = clone $this->collTaxRuleCountries;
$this->taxRuleCountriesScheduledForDeletion->clear();
}
$this->taxRuleCountriesScheduledForDeletion[]= $taxRuleCountry;
$this->taxRuleCountriesScheduledForDeletion[]= clone $taxRuleCountry;
$taxRuleCountry->setTaxRule(null);
}
@@ -2104,9 +1936,6 @@ abstract class TaxRule implements ActiveRecordInterface
public function clear()
{
$this->id = null;
$this->code = null;
$this->title = null;
$this->description = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
@@ -2286,6 +2115,54 @@ abstract class TaxRule implements ActiveRecordInterface
return $this->getTranslation($this->getLocale(), $con);
}
/**
* Get the [title] column value.
*
* @return string
*/
public function getTitle()
{
return $this->getCurrentTranslation()->getTitle();
}
/**
* Set the value of [title] column.
*
* @param string $v new value
* @return \Thelia\Model\TaxRuleI18n The current object (for fluent API support)
*/
public function setTitle($v)
{ $this->getCurrentTranslation()->setTitle($v);
return $this;
}
/**
* Get the [description] column value.
*
* @return string
*/
public function getDescription()
{
return $this->getCurrentTranslation()->getDescription();
}
/**
* Set the value of [description] column.
*
* @param string $v new value
* @return \Thelia\Model\TaxRuleI18n The current object (for fluent API support)
*/
public function setDescription($v)
{ $this->getCurrentTranslation()->setDescription($v);
return $this;
}
/**
* Code to be run before persisting the object
* @param ConnectionInterface $con

View File

@@ -60,12 +60,6 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
*/
protected $virtualColumns = array();
/**
* The value for the id field.
* @var int
*/
protected $id;
/**
* The value for the tax_rule_id field.
* @var int
@@ -85,10 +79,10 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
protected $tax_id;
/**
* The value for the none field.
* The value for the position field.
* @var int
*/
protected $none;
protected $position;
/**
* The value for the created_at field.
@@ -379,17 +373,6 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
return array_keys(get_object_vars($this));
}
/**
* Get the [id] column value.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Get the [tax_rule_id] column value.
*
@@ -424,14 +407,14 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
}
/**
* Get the [none] column value.
* Get the [position] column value.
*
* @return int
*/
public function getNone()
public function getPosition()
{
return $this->none;
return $this->position;
}
/**
@@ -474,27 +457,6 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
}
}
/**
* Set the value of [id] column.
*
* @param int $v new value
* @return \Thelia\Model\TaxRuleCountry The current object (for fluent API support)
*/
public function setId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = TaxRuleCountryTableMap::ID;
}
return $this;
} // setId()
/**
* Set the value of [tax_rule_id] column.
*
@@ -571,25 +533,25 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
} // setTaxId()
/**
* Set the value of [none] column.
* Set the value of [position] column.
*
* @param int $v new value
* @return \Thelia\Model\TaxRuleCountry The current object (for fluent API support)
*/
public function setNone($v)
public function setPosition($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->none !== $v) {
$this->none = $v;
$this->modifiedColumns[] = TaxRuleCountryTableMap::NONE;
if ($this->position !== $v) {
$this->position = $v;
$this->modifiedColumns[] = TaxRuleCountryTableMap::POSITION;
}
return $this;
} // setNone()
} // setPosition()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
@@ -670,28 +632,25 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : TaxRuleCountryTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : TaxRuleCountryTableMap::translateFieldName('TaxRuleId', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : TaxRuleCountryTableMap::translateFieldName('TaxRuleId', TableMap::TYPE_PHPNAME, $indexType)];
$this->tax_rule_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : TaxRuleCountryTableMap::translateFieldName('CountryId', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : TaxRuleCountryTableMap::translateFieldName('CountryId', TableMap::TYPE_PHPNAME, $indexType)];
$this->country_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : TaxRuleCountryTableMap::translateFieldName('TaxId', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : TaxRuleCountryTableMap::translateFieldName('TaxId', TableMap::TYPE_PHPNAME, $indexType)];
$this->tax_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : TaxRuleCountryTableMap::translateFieldName('None', TableMap::TYPE_PHPNAME, $indexType)];
$this->none = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : TaxRuleCountryTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
$this->position = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : TaxRuleCountryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : TaxRuleCountryTableMap::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 : TaxRuleCountryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : TaxRuleCountryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -704,7 +663,7 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 7; // 7 = TaxRuleCountryTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 6; // 6 = TaxRuleCountryTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\TaxRuleCountry object", 0, $e);
@@ -958,9 +917,6 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(TaxRuleCountryTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
if ($this->isColumnModified(TaxRuleCountryTableMap::TAX_RULE_ID)) {
$modifiedColumns[':p' . $index++] = 'TAX_RULE_ID';
}
@@ -970,8 +926,8 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
if ($this->isColumnModified(TaxRuleCountryTableMap::TAX_ID)) {
$modifiedColumns[':p' . $index++] = 'TAX_ID';
}
if ($this->isColumnModified(TaxRuleCountryTableMap::NONE)) {
$modifiedColumns[':p' . $index++] = 'NONE';
if ($this->isColumnModified(TaxRuleCountryTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION';
}
if ($this->isColumnModified(TaxRuleCountryTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
@@ -990,9 +946,6 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
$stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) {
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
case 'TAX_RULE_ID':
$stmt->bindValue($identifier, $this->tax_rule_id, PDO::PARAM_INT);
break;
@@ -1002,8 +955,8 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
case 'TAX_ID':
$stmt->bindValue($identifier, $this->tax_id, PDO::PARAM_INT);
break;
case 'NONE':
$stmt->bindValue($identifier, $this->none, PDO::PARAM_INT);
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);
@@ -1067,24 +1020,21 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
{
switch ($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getTaxRuleId();
break;
case 2:
case 1:
return $this->getCountryId();
break;
case 3:
case 2:
return $this->getTaxId();
break;
case 4:
return $this->getNone();
case 3:
return $this->getPosition();
break;
case 5:
case 4:
return $this->getCreatedAt();
break;
case 6:
case 5:
return $this->getUpdatedAt();
break;
default:
@@ -1110,19 +1060,18 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['TaxRuleCountry'][$this->getPrimaryKey()])) {
if (isset($alreadyDumpedObjects['TaxRuleCountry'][serialize($this->getPrimaryKey())])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['TaxRuleCountry'][$this->getPrimaryKey()] = true;
$alreadyDumpedObjects['TaxRuleCountry'][serialize($this->getPrimaryKey())] = true;
$keys = TaxRuleCountryTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getTaxRuleId(),
$keys[2] => $this->getCountryId(),
$keys[3] => $this->getTaxId(),
$keys[4] => $this->getNone(),
$keys[5] => $this->getCreatedAt(),
$keys[6] => $this->getUpdatedAt(),
$keys[0] => $this->getTaxRuleId(),
$keys[1] => $this->getCountryId(),
$keys[2] => $this->getTaxId(),
$keys[3] => $this->getPosition(),
$keys[4] => $this->getCreatedAt(),
$keys[5] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1175,24 +1124,21 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
{
switch ($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setTaxRuleId($value);
break;
case 2:
case 1:
$this->setCountryId($value);
break;
case 3:
case 2:
$this->setTaxId($value);
break;
case 4:
$this->setNone($value);
case 3:
$this->setPosition($value);
break;
case 5:
case 4:
$this->setCreatedAt($value);
break;
case 6:
case 5:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1219,13 +1165,12 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
{
$keys = TaxRuleCountryTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setTaxRuleId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setCountryId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setTaxId($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setNone($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[0], $arr)) $this->setTaxRuleId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setCountryId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setTaxId($arr[$keys[2]]);
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]]);
}
/**
@@ -1237,11 +1182,10 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
{
$criteria = new Criteria(TaxRuleCountryTableMap::DATABASE_NAME);
if ($this->isColumnModified(TaxRuleCountryTableMap::ID)) $criteria->add(TaxRuleCountryTableMap::ID, $this->id);
if ($this->isColumnModified(TaxRuleCountryTableMap::TAX_RULE_ID)) $criteria->add(TaxRuleCountryTableMap::TAX_RULE_ID, $this->tax_rule_id);
if ($this->isColumnModified(TaxRuleCountryTableMap::COUNTRY_ID)) $criteria->add(TaxRuleCountryTableMap::COUNTRY_ID, $this->country_id);
if ($this->isColumnModified(TaxRuleCountryTableMap::TAX_ID)) $criteria->add(TaxRuleCountryTableMap::TAX_ID, $this->tax_id);
if ($this->isColumnModified(TaxRuleCountryTableMap::NONE)) $criteria->add(TaxRuleCountryTableMap::NONE, $this->none);
if ($this->isColumnModified(TaxRuleCountryTableMap::POSITION)) $criteria->add(TaxRuleCountryTableMap::POSITION, $this->position);
if ($this->isColumnModified(TaxRuleCountryTableMap::CREATED_AT)) $criteria->add(TaxRuleCountryTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(TaxRuleCountryTableMap::UPDATED_AT)) $criteria->add(TaxRuleCountryTableMap::UPDATED_AT, $this->updated_at);
@@ -1259,29 +1203,39 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
public function buildPkeyCriteria()
{
$criteria = new Criteria(TaxRuleCountryTableMap::DATABASE_NAME);
$criteria->add(TaxRuleCountryTableMap::ID, $this->id);
$criteria->add(TaxRuleCountryTableMap::TAX_RULE_ID, $this->tax_rule_id);
$criteria->add(TaxRuleCountryTableMap::COUNTRY_ID, $this->country_id);
$criteria->add(TaxRuleCountryTableMap::TAX_ID, $this->tax_id);
return $criteria;
}
/**
* Returns the primary key for this object (row).
* @return int
* Returns the composite primary key for this object.
* The array elements will be in same order as specified in XML.
* @return array
*/
public function getPrimaryKey()
{
return $this->getId();
$pks = array();
$pks[0] = $this->getTaxRuleId();
$pks[1] = $this->getCountryId();
$pks[2] = $this->getTaxId();
return $pks;
}
/**
* Generic method to set the primary key (id column).
* Set the [composite] primary key.
*
* @param int $key Primary key.
* @param array $keys The elements of the composite key (order must match the order in XML file).
* @return void
*/
public function setPrimaryKey($key)
public function setPrimaryKey($keys)
{
$this->setId($key);
$this->setTaxRuleId($keys[0]);
$this->setCountryId($keys[1]);
$this->setTaxId($keys[2]);
}
/**
@@ -1291,7 +1245,7 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
public function isPrimaryKeyNull()
{
return null === $this->getId();
return (null === $this->getTaxRuleId()) && (null === $this->getCountryId()) && (null === $this->getTaxId());
}
/**
@@ -1307,11 +1261,10 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setId($this->getId());
$copyObj->setTaxRuleId($this->getTaxRuleId());
$copyObj->setCountryId($this->getCountryId());
$copyObj->setTaxId($this->getTaxId());
$copyObj->setNone($this->getNone());
$copyObj->setPosition($this->getPosition());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1499,11 +1452,10 @@ abstract class TaxRuleCountry implements ActiveRecordInterface
*/
public function clear()
{
$this->id = null;
$this->tax_rule_id = null;
$this->country_id = null;
$this->tax_id = null;
$this->none = null;
$this->position = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -21,19 +21,17 @@ use Thelia\Model\Map\TaxRuleCountryTableMap;
*
*
*
* @method ChildTaxRuleCountryQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildTaxRuleCountryQuery orderByTaxRuleId($order = Criteria::ASC) Order by the tax_rule_id column
* @method ChildTaxRuleCountryQuery orderByCountryId($order = Criteria::ASC) Order by the country_id column
* @method ChildTaxRuleCountryQuery orderByTaxId($order = Criteria::ASC) Order by the tax_id column
* @method ChildTaxRuleCountryQuery orderByNone($order = Criteria::ASC) Order by the none column
* @method ChildTaxRuleCountryQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildTaxRuleCountryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildTaxRuleCountryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildTaxRuleCountryQuery groupById() Group by the id column
* @method ChildTaxRuleCountryQuery groupByTaxRuleId() Group by the tax_rule_id column
* @method ChildTaxRuleCountryQuery groupByCountryId() Group by the country_id column
* @method ChildTaxRuleCountryQuery groupByTaxId() Group by the tax_id column
* @method ChildTaxRuleCountryQuery groupByNone() Group by the none column
* @method ChildTaxRuleCountryQuery groupByPosition() Group by the position column
* @method ChildTaxRuleCountryQuery groupByCreatedAt() Group by the created_at column
* @method ChildTaxRuleCountryQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -56,19 +54,17 @@ use Thelia\Model\Map\TaxRuleCountryTableMap;
* @method ChildTaxRuleCountry findOne(ConnectionInterface $con = null) Return the first ChildTaxRuleCountry matching the query
* @method ChildTaxRuleCountry findOneOrCreate(ConnectionInterface $con = null) Return the first ChildTaxRuleCountry matching the query, or a new ChildTaxRuleCountry object populated from the query conditions when no match is found
*
* @method ChildTaxRuleCountry findOneById(int $id) Return the first ChildTaxRuleCountry filtered by the id column
* @method ChildTaxRuleCountry findOneByTaxRuleId(int $tax_rule_id) Return the first ChildTaxRuleCountry filtered by the tax_rule_id column
* @method ChildTaxRuleCountry findOneByCountryId(int $country_id) Return the first ChildTaxRuleCountry filtered by the country_id column
* @method ChildTaxRuleCountry findOneByTaxId(int $tax_id) Return the first ChildTaxRuleCountry filtered by the tax_id column
* @method ChildTaxRuleCountry findOneByNone(int $none) Return the first ChildTaxRuleCountry filtered by the none column
* @method ChildTaxRuleCountry findOneByPosition(int $position) Return the first ChildTaxRuleCountry filtered by the position column
* @method ChildTaxRuleCountry findOneByCreatedAt(string $created_at) Return the first ChildTaxRuleCountry filtered by the created_at column
* @method ChildTaxRuleCountry findOneByUpdatedAt(string $updated_at) Return the first ChildTaxRuleCountry filtered by the updated_at column
*
* @method array findById(int $id) Return ChildTaxRuleCountry objects filtered by the id column
* @method array findByTaxRuleId(int $tax_rule_id) Return ChildTaxRuleCountry objects filtered by the tax_rule_id column
* @method array findByCountryId(int $country_id) Return ChildTaxRuleCountry objects filtered by the country_id column
* @method array findByTaxId(int $tax_id) Return ChildTaxRuleCountry objects filtered by the tax_id column
* @method array findByNone(int $none) Return ChildTaxRuleCountry objects filtered by the none column
* @method array findByPosition(int $position) Return ChildTaxRuleCountry objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildTaxRuleCountry objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildTaxRuleCountry objects filtered by the updated_at column
*
@@ -118,10 +114,10 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
* Go fast if the query is untouched.
*
* <code>
* $obj = $c->findPk(12, $con);
* $obj = $c->findPk(array(12, 34, 56), $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param array[$tax_rule_id, $country_id, $tax_id] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildTaxRuleCountry|array|mixed the result, formatted by the current formatter
@@ -131,7 +127,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
if ($key === null) {
return null;
}
if ((null !== ($obj = TaxRuleCountryTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
if ((null !== ($obj = TaxRuleCountryTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
@@ -159,10 +155,12 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, TAX_RULE_ID, COUNTRY_ID, TAX_ID, NONE, CREATED_AT, UPDATED_AT FROM tax_rule_country WHERE ID = :p0';
$sql = 'SELECT TAX_RULE_ID, COUNTRY_ID, TAX_ID, POSITION, CREATED_AT, UPDATED_AT FROM tax_rule_country WHERE TAX_RULE_ID = :p0 AND COUNTRY_ID = :p1 AND TAX_ID = :p2';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
$stmt->bindValue(':p2', $key[2], PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
@@ -172,7 +170,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildTaxRuleCountry();
$obj->hydrate($row);
TaxRuleCountryTableMap::addInstanceToPool($obj, (string) $key);
TaxRuleCountryTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2])));
}
$stmt->closeCursor();
@@ -201,7 +199,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
/**
* Find objects by primary key
* <code>
* $objs = $c->findPks(array(12, 56, 832), $con);
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
* </code>
* @param array $keys Primary keys to use for the query
* @param ConnectionInterface $con an optional connection object
@@ -231,8 +229,11 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(TaxRuleCountryTableMap::TAX_RULE_ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(TaxRuleCountryTableMap::COUNTRY_ID, $key[1], Criteria::EQUAL);
$this->addUsingAlias(TaxRuleCountryTableMap::TAX_ID, $key[2], Criteria::EQUAL);
return $this->addUsingAlias(TaxRuleCountryTableMap::ID, $key, Criteria::EQUAL);
return $this;
}
/**
@@ -244,49 +245,19 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(TaxRuleCountryTableMap::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @param mixed $id 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 ChildTaxRuleCountryQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
$this->addUsingAlias(TaxRuleCountryTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(TaxRuleCountryTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
if (empty($keys)) {
return $this->add(null, '1<>1', Criteria::CUSTOM);
}
foreach ($keys as $key) {
$cton0 = $this->getNewCriterion(TaxRuleCountryTableMap::TAX_RULE_ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(TaxRuleCountryTableMap::COUNTRY_ID, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$cton2 = $this->getNewCriterion(TaxRuleCountryTableMap::TAX_ID, $key[2], Criteria::EQUAL);
$cton0->addAnd($cton2);
$this->addOr($cton0);
}
return $this->addUsingAlias(TaxRuleCountryTableMap::ID, $id, $comparison);
return $this;
}
/**
@@ -419,16 +390,16 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
}
/**
* Filter the query on the none column
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByNone(1234); // WHERE none = 1234
* $query->filterByNone(array(12, 34)); // WHERE none IN (12, 34)
* $query->filterByNone(array('min' => 12)); // WHERE none > 12
* $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 $none The value to use as filter.
* @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.
@@ -436,16 +407,16 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*
* @return ChildTaxRuleCountryQuery The current query, for fluid interface
*/
public function filterByNone($none = null, $comparison = null)
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($none)) {
if (is_array($position)) {
$useMinMax = false;
if (isset($none['min'])) {
$this->addUsingAlias(TaxRuleCountryTableMap::NONE, $none['min'], Criteria::GREATER_EQUAL);
if (isset($position['min'])) {
$this->addUsingAlias(TaxRuleCountryTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($none['max'])) {
$this->addUsingAlias(TaxRuleCountryTableMap::NONE, $none['max'], Criteria::LESS_EQUAL);
if (isset($position['max'])) {
$this->addUsingAlias(TaxRuleCountryTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -456,7 +427,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
}
}
return $this->addUsingAlias(TaxRuleCountryTableMap::NONE, $none, $comparison);
return $this->addUsingAlias(TaxRuleCountryTableMap::POSITION, $position, $comparison);
}
/**
@@ -578,7 +549,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*
* @return ChildTaxRuleCountryQuery The current query, for fluid interface
*/
public function joinTax($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinTax($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Tax');
@@ -613,7 +584,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*
* @return \Thelia\Model\TaxQuery A secondary query class using the current class as primary query
*/
public function useTaxQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useTaxQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinTax($relationAlias, $joinType)
@@ -653,7 +624,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*
* @return ChildTaxRuleCountryQuery The current query, for fluid interface
*/
public function joinTaxRule($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinTaxRule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('TaxRule');
@@ -688,7 +659,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*
* @return \Thelia\Model\TaxRuleQuery A secondary query class using the current class as primary query
*/
public function useTaxRuleQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useTaxRuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinTaxRule($relationAlias, $joinType)
@@ -728,7 +699,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*
* @return ChildTaxRuleCountryQuery The current query, for fluid interface
*/
public function joinCountry($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinCountry($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Country');
@@ -763,7 +734,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
*
* @return \Thelia\Model\CountryQuery A secondary query class using the current class as primary query
*/
public function useCountryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useCountryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCountry($relationAlias, $joinType)
@@ -780,7 +751,10 @@ abstract class TaxRuleCountryQuery extends ModelCriteria
public function prune($taxRuleCountry = null)
{
if ($taxRuleCountry) {
$this->addUsingAlias(TaxRuleCountryTableMap::ID, $taxRuleCountry->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond0', $this->getAliasedColName(TaxRuleCountryTableMap::TAX_RULE_ID), $taxRuleCountry->getTaxRuleId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(TaxRuleCountryTableMap::COUNTRY_ID), $taxRuleCountry->getCountryId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond2', $this->getAliasedColName(TaxRuleCountryTableMap::TAX_ID), $taxRuleCountry->getTaxId(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1', 'pruneCond2'), Criteria::LOGICAL_OR);
}
return $this;

View File

@@ -66,6 +66,18 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
*/
protected $locale;
/**
* The value for the title field.
* @var string
*/
protected $title;
/**
* The value for the description field.
* @var string
*/
protected $description;
/**
* @var TaxRule
*/
@@ -368,6 +380,28 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
return $this->locale;
}
/**
* Get the [title] column value.
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Get the [description] column value.
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set the value of [id] column.
*
@@ -414,6 +448,48 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
return $this;
} // setLocale()
/**
* Set the value of [title] column.
*
* @param string $v new value
* @return \Thelia\Model\TaxRuleI18n The current object (for fluent API support)
*/
public function setTitle($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->title !== $v) {
$this->title = $v;
$this->modifiedColumns[] = TaxRuleI18nTableMap::TITLE;
}
return $this;
} // setTitle()
/**
* Set the value of [description] column.
*
* @param string $v new value
* @return \Thelia\Model\TaxRuleI18n The current object (for fluent API support)
*/
public function setDescription($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->description !== $v) {
$this->description = $v;
$this->modifiedColumns[] = TaxRuleI18nTableMap::DESCRIPTION;
}
return $this;
} // setDescription()
/**
* Indicates whether the columns in this object are only set to default values.
*
@@ -460,6 +536,12 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : TaxRuleI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
$this->locale = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : TaxRuleI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
$this->title = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : TaxRuleI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
$this->description = (null !== $col) ? (string) $col : null;
$this->resetModified();
$this->setNew(false);
@@ -468,7 +550,7 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 2; // 2 = TaxRuleI18nTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 4; // 4 = TaxRuleI18nTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\TaxRuleI18n object", 0, $e);
@@ -695,6 +777,12 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
if ($this->isColumnModified(TaxRuleI18nTableMap::LOCALE)) {
$modifiedColumns[':p' . $index++] = 'LOCALE';
}
if ($this->isColumnModified(TaxRuleI18nTableMap::TITLE)) {
$modifiedColumns[':p' . $index++] = 'TITLE';
}
if ($this->isColumnModified(TaxRuleI18nTableMap::DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
}
$sql = sprintf(
'INSERT INTO tax_rule_i18n (%s) VALUES (%s)',
@@ -712,6 +800,12 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
case 'LOCALE':
$stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR);
break;
case 'TITLE':
$stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
break;
case 'DESCRIPTION':
$stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
break;
}
}
$stmt->execute();
@@ -773,6 +867,12 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
case 1:
return $this->getLocale();
break;
case 2:
return $this->getTitle();
break;
case 3:
return $this->getDescription();
break;
default:
return null;
break;
@@ -804,6 +904,8 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getLocale(),
$keys[2] => $this->getTitle(),
$keys[3] => $this->getDescription(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -855,6 +957,12 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
case 1:
$this->setLocale($value);
break;
case 2:
$this->setTitle($value);
break;
case 3:
$this->setDescription($value);
break;
} // switch()
}
@@ -881,6 +989,8 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setLocale($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setTitle($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDescription($arr[$keys[3]]);
}
/**
@@ -894,6 +1004,8 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
if ($this->isColumnModified(TaxRuleI18nTableMap::ID)) $criteria->add(TaxRuleI18nTableMap::ID, $this->id);
if ($this->isColumnModified(TaxRuleI18nTableMap::LOCALE)) $criteria->add(TaxRuleI18nTableMap::LOCALE, $this->locale);
if ($this->isColumnModified(TaxRuleI18nTableMap::TITLE)) $criteria->add(TaxRuleI18nTableMap::TITLE, $this->title);
if ($this->isColumnModified(TaxRuleI18nTableMap::DESCRIPTION)) $criteria->add(TaxRuleI18nTableMap::DESCRIPTION, $this->description);
return $criteria;
}
@@ -966,6 +1078,8 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
{
$copyObj->setId($this->getId());
$copyObj->setLocale($this->getLocale());
$copyObj->setTitle($this->getTitle());
$copyObj->setDescription($this->getDescription());
if ($makeNew) {
$copyObj->setNew(true);
}
@@ -1051,6 +1165,8 @@ abstract class TaxRuleI18n implements ActiveRecordInterface
{
$this->id = null;
$this->locale = null;
$this->title = null;
$this->description = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
$this->applyDefaultValues();

View File

@@ -23,9 +23,13 @@ use Thelia\Model\Map\TaxRuleI18nTableMap;
*
* @method ChildTaxRuleI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildTaxRuleI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildTaxRuleI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildTaxRuleI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
*
* @method ChildTaxRuleI18nQuery groupById() Group by the id column
* @method ChildTaxRuleI18nQuery groupByLocale() Group by the locale column
* @method ChildTaxRuleI18nQuery groupByTitle() Group by the title column
* @method ChildTaxRuleI18nQuery groupByDescription() Group by the description column
*
* @method ChildTaxRuleI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildTaxRuleI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@@ -40,9 +44,13 @@ use Thelia\Model\Map\TaxRuleI18nTableMap;
*
* @method ChildTaxRuleI18n findOneById(int $id) Return the first ChildTaxRuleI18n filtered by the id column
* @method ChildTaxRuleI18n findOneByLocale(string $locale) Return the first ChildTaxRuleI18n filtered by the locale column
* @method ChildTaxRuleI18n findOneByTitle(string $title) Return the first ChildTaxRuleI18n filtered by the title column
* @method ChildTaxRuleI18n findOneByDescription(string $description) Return the first ChildTaxRuleI18n filtered by the description column
*
* @method array findById(int $id) Return ChildTaxRuleI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildTaxRuleI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildTaxRuleI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildTaxRuleI18n objects filtered by the description column
*
*/
abstract class TaxRuleI18nQuery extends ModelCriteria
@@ -131,7 +139,7 @@ abstract class TaxRuleI18nQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, LOCALE FROM tax_rule_i18n WHERE ID = :p0 AND LOCALE = :p1';
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION FROM tax_rule_i18n WHERE ID = :p0 AND LOCALE = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -304,6 +312,64 @@ abstract class TaxRuleI18nQuery extends ModelCriteria
return $this->addUsingAlias(TaxRuleI18nTableMap::LOCALE, $locale, $comparison);
}
/**
* Filter the query on the title column
*
* Example usage:
* <code>
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
* </code>
*
* @param string $title 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 ChildTaxRuleI18nQuery The current query, for fluid interface
*/
public function filterByTitle($title = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($title)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $title)) {
$title = str_replace('*', '%', $title);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(TaxRuleI18nTableMap::TITLE, $title, $comparison);
}
/**
* Filter the query on the description column
*
* Example usage:
* <code>
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
* </code>
*
* @param string $description 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 ChildTaxRuleI18nQuery The current query, for fluid interface
*/
public function filterByDescription($description = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($description)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $description)) {
$description = str_replace('*', '%', $description);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(TaxRuleI18nTableMap::DESCRIPTION, $description, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\TaxRule object
*

View File

@@ -23,16 +23,10 @@ use Thelia\Model\Map\TaxRuleTableMap;
*
*
* @method ChildTaxRuleQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildTaxRuleQuery orderByCode($order = Criteria::ASC) Order by the code column
* @method ChildTaxRuleQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildTaxRuleQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildTaxRuleQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildTaxRuleQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildTaxRuleQuery groupById() Group by the id column
* @method ChildTaxRuleQuery groupByCode() Group by the code column
* @method ChildTaxRuleQuery groupByTitle() Group by the title column
* @method ChildTaxRuleQuery groupByDescription() Group by the description column
* @method ChildTaxRuleQuery groupByCreatedAt() Group by the created_at column
* @method ChildTaxRuleQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -56,16 +50,10 @@ use Thelia\Model\Map\TaxRuleTableMap;
* @method ChildTaxRule findOneOrCreate(ConnectionInterface $con = null) Return the first ChildTaxRule matching the query, or a new ChildTaxRule object populated from the query conditions when no match is found
*
* @method ChildTaxRule findOneById(int $id) Return the first ChildTaxRule filtered by the id column
* @method ChildTaxRule findOneByCode(string $code) Return the first ChildTaxRule filtered by the code column
* @method ChildTaxRule findOneByTitle(string $title) Return the first ChildTaxRule filtered by the title column
* @method ChildTaxRule findOneByDescription(string $description) Return the first ChildTaxRule filtered by the description column
* @method ChildTaxRule findOneByCreatedAt(string $created_at) Return the first ChildTaxRule filtered by the created_at column
* @method ChildTaxRule findOneByUpdatedAt(string $updated_at) Return the first ChildTaxRule filtered by the updated_at column
*
* @method array findById(int $id) Return ChildTaxRule objects filtered by the id column
* @method array findByCode(string $code) Return ChildTaxRule objects filtered by the code column
* @method array findByTitle(string $title) Return ChildTaxRule objects filtered by the title column
* @method array findByDescription(string $description) Return ChildTaxRule objects filtered by the description column
* @method array findByCreatedAt(string $created_at) Return ChildTaxRule objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildTaxRule objects filtered by the updated_at column
*
@@ -156,7 +144,7 @@ abstract class TaxRuleQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CODE, TITLE, DESCRIPTION, CREATED_AT, UPDATED_AT FROM tax_rule WHERE ID = :p0';
$sql = 'SELECT ID, CREATED_AT, UPDATED_AT FROM tax_rule WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -286,93 +274,6 @@ abstract class TaxRuleQuery extends ModelCriteria
return $this->addUsingAlias(TaxRuleTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the code column
*
* Example usage:
* <code>
* $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
* $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
* </code>
*
* @param string $code 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 ChildTaxRuleQuery The current query, for fluid interface
*/
public function filterByCode($code = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($code)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $code)) {
$code = str_replace('*', '%', $code);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(TaxRuleTableMap::CODE, $code, $comparison);
}
/**
* Filter the query on the title column
*
* Example usage:
* <code>
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
* </code>
*
* @param string $title 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 ChildTaxRuleQuery The current query, for fluid interface
*/
public function filterByTitle($title = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($title)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $title)) {
$title = str_replace('*', '%', $title);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(TaxRuleTableMap::TITLE, $title, $comparison);
}
/**
* Filter the query on the description column
*
* Example usage:
* <code>
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
* </code>
*
* @param string $description 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 ChildTaxRuleQuery The current query, for fluid interface
*/
public function filterByDescription($description = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($description)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $description)) {
$description = str_replace('*', '%', $description);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(TaxRuleTableMap::DESCRIPTION, $description, $comparison);
}
/**
* Filter the query on the created_at column
*
@@ -563,7 +464,7 @@ abstract class TaxRuleQuery extends ModelCriteria
*
* @return ChildTaxRuleQuery The current query, for fluid interface
*/
public function joinTaxRuleCountry($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinTaxRuleCountry($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('TaxRuleCountry');
@@ -598,7 +499,7 @@ abstract class TaxRuleQuery extends ModelCriteria
*
* @return \Thelia\Model\TaxRuleCountryQuery A secondary query class using the current class as primary query
*/
public function useTaxRuleCountryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useTaxRuleCountryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinTaxRuleCountry($relationAlias, $joinType)