update address model
This commit is contained in:
@@ -70,10 +70,10 @@ abstract class Address implements ActiveRecordInterface
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* The value for the name field.
|
||||
* The value for the label field.
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* The value for the customer_id field.
|
||||
@@ -498,14 +498,14 @@ abstract class Address implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [name] column value.
|
||||
* Get the [label] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
public function getLabel()
|
||||
{
|
||||
|
||||
return $this->name;
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -724,25 +724,25 @@ abstract class Address implements ActiveRecordInterface
|
||||
} // setId()
|
||||
|
||||
/**
|
||||
* Set the value of [name] column.
|
||||
* Set the value of [label] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\Address The current object (for fluent API support)
|
||||
*/
|
||||
public function setName($v)
|
||||
public function setLabel($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->name !== $v) {
|
||||
$this->name = $v;
|
||||
$this->modifiedColumns[] = AddressTableMap::NAME;
|
||||
if ($this->label !== $v) {
|
||||
$this->label = $v;
|
||||
$this->modifiedColumns[] = AddressTableMap::LABEL;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setName()
|
||||
} // setLabel()
|
||||
|
||||
/**
|
||||
* Set the value of [customer_id] column.
|
||||
@@ -1136,8 +1136,8 @@ abstract class Address implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : AddressTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AddressTableMap::translateFieldName('Name', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->name = (null !== $col) ? (string) $col : null;
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AddressTableMap::translateFieldName('Label', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->label = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AddressTableMap::translateFieldName('CustomerId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->customer_id = (null !== $col) ? (int) $col : null;
|
||||
@@ -1501,8 +1501,8 @@ abstract class Address implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(AddressTableMap::ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'ID';
|
||||
}
|
||||
if ($this->isColumnModified(AddressTableMap::NAME)) {
|
||||
$modifiedColumns[':p' . $index++] = 'NAME';
|
||||
if ($this->isColumnModified(AddressTableMap::LABEL)) {
|
||||
$modifiedColumns[':p' . $index++] = 'LABEL';
|
||||
}
|
||||
if ($this->isColumnModified(AddressTableMap::CUSTOMER_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CUSTOMER_ID';
|
||||
@@ -1566,8 +1566,8 @@ abstract class Address implements ActiveRecordInterface
|
||||
case 'ID':
|
||||
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'NAME':
|
||||
$stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
|
||||
case 'LABEL':
|
||||
$stmt->bindValue($identifier, $this->label, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'CUSTOMER_ID':
|
||||
$stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT);
|
||||
@@ -1683,7 +1683,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
return $this->getId();
|
||||
break;
|
||||
case 1:
|
||||
return $this->getName();
|
||||
return $this->getLabel();
|
||||
break;
|
||||
case 2:
|
||||
return $this->getCustomerId();
|
||||
@@ -1763,7 +1763,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
$keys = AddressTableMap::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getName(),
|
||||
$keys[1] => $this->getLabel(),
|
||||
$keys[2] => $this->getCustomerId(),
|
||||
$keys[3] => $this->getTitleId(),
|
||||
$keys[4] => $this->getCompany(),
|
||||
@@ -1841,7 +1841,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
$this->setId($value);
|
||||
break;
|
||||
case 1:
|
||||
$this->setName($value);
|
||||
$this->setLabel($value);
|
||||
break;
|
||||
case 2:
|
||||
$this->setCustomerId($value);
|
||||
@@ -1916,7 +1916,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
$keys = AddressTableMap::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setLabel($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setCustomerId($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setTitleId($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setCompany($arr[$keys[4]]);
|
||||
@@ -1945,7 +1945,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
$criteria = new Criteria(AddressTableMap::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(AddressTableMap::ID)) $criteria->add(AddressTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(AddressTableMap::NAME)) $criteria->add(AddressTableMap::NAME, $this->name);
|
||||
if ($this->isColumnModified(AddressTableMap::LABEL)) $criteria->add(AddressTableMap::LABEL, $this->label);
|
||||
if ($this->isColumnModified(AddressTableMap::CUSTOMER_ID)) $criteria->add(AddressTableMap::CUSTOMER_ID, $this->customer_id);
|
||||
if ($this->isColumnModified(AddressTableMap::TITLE_ID)) $criteria->add(AddressTableMap::TITLE_ID, $this->title_id);
|
||||
if ($this->isColumnModified(AddressTableMap::COMPANY)) $criteria->add(AddressTableMap::COMPANY, $this->company);
|
||||
@@ -2025,7 +2025,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
*/
|
||||
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
|
||||
{
|
||||
$copyObj->setName($this->getName());
|
||||
$copyObj->setLabel($this->getLabel());
|
||||
$copyObj->setCustomerId($this->getCustomerId());
|
||||
$copyObj->setTitleId($this->getTitleId());
|
||||
$copyObj->setCompany($this->getCompany());
|
||||
@@ -2804,7 +2804,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
public function clear()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->name = null;
|
||||
$this->label = null;
|
||||
$this->customer_id = null;
|
||||
$this->title_id = null;
|
||||
$this->company = null;
|
||||
|
||||
@@ -22,7 +22,7 @@ use Thelia\Model\Map\AddressTableMap;
|
||||
*
|
||||
*
|
||||
* @method ChildAddressQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildAddressQuery orderByName($order = Criteria::ASC) Order by the name column
|
||||
* @method ChildAddressQuery orderByLabel($order = Criteria::ASC) Order by the label column
|
||||
* @method ChildAddressQuery orderByCustomerId($order = Criteria::ASC) Order by the customer_id column
|
||||
* @method ChildAddressQuery orderByTitleId($order = Criteria::ASC) Order by the title_id column
|
||||
* @method ChildAddressQuery orderByCompany($order = Criteria::ASC) Order by the company column
|
||||
@@ -41,7 +41,7 @@ use Thelia\Model\Map\AddressTableMap;
|
||||
* @method ChildAddressQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildAddressQuery groupById() Group by the id column
|
||||
* @method ChildAddressQuery groupByName() Group by the name column
|
||||
* @method ChildAddressQuery groupByLabel() Group by the label column
|
||||
* @method ChildAddressQuery groupByCustomerId() Group by the customer_id column
|
||||
* @method ChildAddressQuery groupByTitleId() Group by the title_id column
|
||||
* @method ChildAddressQuery groupByCompany() Group by the company column
|
||||
@@ -87,7 +87,7 @@ use Thelia\Model\Map\AddressTableMap;
|
||||
* @method ChildAddress findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAddress matching the query, or a new ChildAddress object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildAddress findOneById(int $id) Return the first ChildAddress filtered by the id column
|
||||
* @method ChildAddress findOneByName(string $name) Return the first ChildAddress filtered by the name column
|
||||
* @method ChildAddress findOneByLabel(string $label) Return the first ChildAddress filtered by the label column
|
||||
* @method ChildAddress findOneByCustomerId(int $customer_id) Return the first ChildAddress filtered by the customer_id column
|
||||
* @method ChildAddress findOneByTitleId(int $title_id) Return the first ChildAddress filtered by the title_id column
|
||||
* @method ChildAddress findOneByCompany(string $company) Return the first ChildAddress filtered by the company column
|
||||
@@ -106,7 +106,7 @@ use Thelia\Model\Map\AddressTableMap;
|
||||
* @method ChildAddress findOneByUpdatedAt(string $updated_at) Return the first ChildAddress filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildAddress objects filtered by the id column
|
||||
* @method array findByName(string $name) Return ChildAddress objects filtered by the name column
|
||||
* @method array findByLabel(string $label) Return ChildAddress objects filtered by the label column
|
||||
* @method array findByCustomerId(int $customer_id) Return ChildAddress objects filtered by the customer_id column
|
||||
* @method array findByTitleId(int $title_id) Return ChildAddress objects filtered by the title_id column
|
||||
* @method array findByCompany(string $company) Return ChildAddress objects filtered by the company column
|
||||
@@ -211,7 +211,7 @@ abstract class AddressQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, NAME, CUSTOMER_ID, TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, PHONE, CELLPHONE, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM address WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, LABEL, CUSTOMER_ID, TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, PHONE, CELLPHONE, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM address WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -342,32 +342,32 @@ abstract class AddressQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the name column
|
||||
* Filter the query on the label column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByName('fooValue'); // WHERE name = 'fooValue'
|
||||
* $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
|
||||
* $query->filterByLabel('fooValue'); // WHERE label = 'fooValue'
|
||||
* $query->filterByLabel('%fooValue%'); // WHERE label LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $name The value to use as filter.
|
||||
* @param string $label 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 ChildAddressQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByName($name = null, $comparison = null)
|
||||
public function filterByLabel($label = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($name)) {
|
||||
if (is_array($label)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $name)) {
|
||||
$name = str_replace('*', '%', $name);
|
||||
} elseif (preg_match('/[\%\*]/', $label)) {
|
||||
$label = str_replace('*', '%', $label);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AddressTableMap::NAME, $name, $comparison);
|
||||
return $this->addUsingAlias(AddressTableMap::LABEL, $label, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,8 +20,6 @@ use Propel\Runtime\Util\PropelDateTime;
|
||||
use Thelia\Model\Coupon as ChildCoupon;
|
||||
use Thelia\Model\CouponI18n as ChildCouponI18n;
|
||||
use Thelia\Model\CouponI18nQuery as ChildCouponI18nQuery;
|
||||
use Thelia\Model\CouponOrder as ChildCouponOrder;
|
||||
use Thelia\Model\CouponOrderQuery as ChildCouponOrderQuery;
|
||||
use Thelia\Model\CouponQuery as ChildCouponQuery;
|
||||
use Thelia\Model\CouponVersion as ChildCouponVersion;
|
||||
use Thelia\Model\CouponVersionQuery as ChildCouponVersionQuery;
|
||||
@@ -80,24 +78,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* The value for the title field.
|
||||
* @var string
|
||||
*/
|
||||
protected $title;
|
||||
|
||||
/**
|
||||
* The value for the short_description field.
|
||||
* @var string
|
||||
*/
|
||||
protected $short_description;
|
||||
|
||||
/**
|
||||
* The value for the description field.
|
||||
* @var string
|
||||
*/
|
||||
protected $description;
|
||||
|
||||
/**
|
||||
* The value for the amount field.
|
||||
* @var double
|
||||
@@ -171,12 +151,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
*/
|
||||
protected $version;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildCouponOrder[] Collection to store aggregation of ChildCouponOrder objects.
|
||||
*/
|
||||
protected $collCouponOrders;
|
||||
protected $collCouponOrdersPartial;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildCouponI18n[] Collection to store aggregation of ChildCouponI18n objects.
|
||||
*/
|
||||
@@ -219,12 +193,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
*/
|
||||
protected $enforceVersion = false;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var ObjectCollection
|
||||
*/
|
||||
protected $couponOrdersScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var ObjectCollection
|
||||
@@ -537,39 +505,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [title] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [short_description] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShortDescription()
|
||||
{
|
||||
|
||||
return $this->short_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [description] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [amount] column value.
|
||||
*
|
||||
@@ -792,69 +727,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setType()
|
||||
|
||||
/**
|
||||
* Set the value of [title] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\Coupon 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[] = CouponTableMap::TITLE;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setTitle()
|
||||
|
||||
/**
|
||||
* Set the value of [short_description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\Coupon The current object (for fluent API support)
|
||||
*/
|
||||
public function setShortDescription($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->short_description !== $v) {
|
||||
$this->short_description = $v;
|
||||
$this->modifiedColumns[] = CouponTableMap::SHORT_DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setShortDescription()
|
||||
|
||||
/**
|
||||
* Set the value of [description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\Coupon 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[] = CouponTableMap::DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setDescription()
|
||||
|
||||
/**
|
||||
* Set the value of [amount] column.
|
||||
*
|
||||
@@ -1165,58 +1037,49 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CouponTableMap::translateFieldName('Type', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->type = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CouponTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->title = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CouponTableMap::translateFieldName('ShortDescription', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->short_description = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CouponTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->description = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CouponTableMap::translateFieldName('Amount', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CouponTableMap::translateFieldName('Amount', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->amount = (null !== $col) ? (double) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CouponTableMap::translateFieldName('IsUsed', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CouponTableMap::translateFieldName('IsUsed', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_used = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CouponTableMap::translateFieldName('IsEnabled', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CouponTableMap::translateFieldName('IsEnabled', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_enabled = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CouponTableMap::translateFieldName('ExpirationDate', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CouponTableMap::translateFieldName('ExpirationDate', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->expiration_date = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CouponTableMap::translateFieldName('SerializedRules', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CouponTableMap::translateFieldName('SerializedRules', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->serialized_rules = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CouponTableMap::translateFieldName('IsCumulative', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CouponTableMap::translateFieldName('IsCumulative', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_cumulative = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : CouponTableMap::translateFieldName('IsRemovingPostage', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CouponTableMap::translateFieldName('IsRemovingPostage', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_removing_postage = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : CouponTableMap::translateFieldName('MaxUsage', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CouponTableMap::translateFieldName('MaxUsage', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->max_usage = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : CouponTableMap::translateFieldName('IsAvailableOnSpecialOffers', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CouponTableMap::translateFieldName('IsAvailableOnSpecialOffers', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_available_on_special_offers = (null !== $col) ? (boolean) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : CouponTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : CouponTableMap::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 ? 16 + $startcol : CouponTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : CouponTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->updated_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : CouponTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : CouponTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version = (null !== $col) ? (int) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
@@ -1226,7 +1089,7 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 18; // 18 = CouponTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 15; // 15 = CouponTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\Coupon object", 0, $e);
|
||||
@@ -1287,8 +1150,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
|
||||
if ($deep) { // also de-associate any related objects?
|
||||
|
||||
$this->collCouponOrders = null;
|
||||
|
||||
$this->collCouponI18ns = null;
|
||||
|
||||
$this->collCouponVersions = null;
|
||||
@@ -1435,23 +1296,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$this->resetModified();
|
||||
}
|
||||
|
||||
if ($this->couponOrdersScheduledForDeletion !== null) {
|
||||
if (!$this->couponOrdersScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\CouponOrderQuery::create()
|
||||
->filterByPrimaryKeys($this->couponOrdersScheduledForDeletion->getPrimaryKeys(false))
|
||||
->delete($con);
|
||||
$this->couponOrdersScheduledForDeletion = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collCouponOrders !== null) {
|
||||
foreach ($this->collCouponOrders as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->couponI18nsScheduledForDeletion !== null) {
|
||||
if (!$this->couponI18nsScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\CouponI18nQuery::create()
|
||||
@@ -1521,15 +1365,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponTableMap::TYPE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'TYPE';
|
||||
}
|
||||
if ($this->isColumnModified(CouponTableMap::TITLE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'TITLE';
|
||||
}
|
||||
if ($this->isColumnModified(CouponTableMap::SHORT_DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'SHORT_DESCRIPTION';
|
||||
}
|
||||
if ($this->isColumnModified(CouponTableMap::DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
|
||||
}
|
||||
if ($this->isColumnModified(CouponTableMap::AMOUNT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'AMOUNT';
|
||||
}
|
||||
@@ -1586,15 +1421,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
case 'TYPE':
|
||||
$stmt->bindValue($identifier, $this->type, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'TITLE':
|
||||
$stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'SHORT_DESCRIPTION':
|
||||
$stmt->bindValue($identifier, $this->short_description, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'DESCRIPTION':
|
||||
$stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'AMOUNT':
|
||||
$stmt->bindValue($identifier, $this->amount, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1703,48 +1529,39 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
return $this->getType();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getTitle();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getShortDescription();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getDescription();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getAmount();
|
||||
break;
|
||||
case 7:
|
||||
case 4:
|
||||
return $this->getIsUsed();
|
||||
break;
|
||||
case 8:
|
||||
case 5:
|
||||
return $this->getIsEnabled();
|
||||
break;
|
||||
case 9:
|
||||
case 6:
|
||||
return $this->getExpirationDate();
|
||||
break;
|
||||
case 10:
|
||||
case 7:
|
||||
return $this->getSerializedRules();
|
||||
break;
|
||||
case 11:
|
||||
case 8:
|
||||
return $this->getIsCumulative();
|
||||
break;
|
||||
case 12:
|
||||
case 9:
|
||||
return $this->getIsRemovingPostage();
|
||||
break;
|
||||
case 13:
|
||||
case 10:
|
||||
return $this->getMaxUsage();
|
||||
break;
|
||||
case 14:
|
||||
case 11:
|
||||
return $this->getIsAvailableOnSpecialOffers();
|
||||
break;
|
||||
case 15:
|
||||
case 12:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 16:
|
||||
case 13:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
case 17:
|
||||
case 14:
|
||||
return $this->getVersion();
|
||||
break;
|
||||
default:
|
||||
@@ -1779,21 +1596,18 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getCode(),
|
||||
$keys[2] => $this->getType(),
|
||||
$keys[3] => $this->getTitle(),
|
||||
$keys[4] => $this->getShortDescription(),
|
||||
$keys[5] => $this->getDescription(),
|
||||
$keys[6] => $this->getAmount(),
|
||||
$keys[7] => $this->getIsUsed(),
|
||||
$keys[8] => $this->getIsEnabled(),
|
||||
$keys[9] => $this->getExpirationDate(),
|
||||
$keys[10] => $this->getSerializedRules(),
|
||||
$keys[11] => $this->getIsCumulative(),
|
||||
$keys[12] => $this->getIsRemovingPostage(),
|
||||
$keys[13] => $this->getMaxUsage(),
|
||||
$keys[14] => $this->getIsAvailableOnSpecialOffers(),
|
||||
$keys[15] => $this->getCreatedAt(),
|
||||
$keys[16] => $this->getUpdatedAt(),
|
||||
$keys[17] => $this->getVersion(),
|
||||
$keys[3] => $this->getAmount(),
|
||||
$keys[4] => $this->getIsUsed(),
|
||||
$keys[5] => $this->getIsEnabled(),
|
||||
$keys[6] => $this->getExpirationDate(),
|
||||
$keys[7] => $this->getSerializedRules(),
|
||||
$keys[8] => $this->getIsCumulative(),
|
||||
$keys[9] => $this->getIsRemovingPostage(),
|
||||
$keys[10] => $this->getMaxUsage(),
|
||||
$keys[11] => $this->getIsAvailableOnSpecialOffers(),
|
||||
$keys[12] => $this->getCreatedAt(),
|
||||
$keys[13] => $this->getUpdatedAt(),
|
||||
$keys[14] => $this->getVersion(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1802,9 +1616,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->collCouponOrders) {
|
||||
$result['CouponOrders'] = $this->collCouponOrders->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collCouponI18ns) {
|
||||
$result['CouponI18ns'] = $this->collCouponI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
@@ -1855,48 +1666,39 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$this->setType($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setTitle($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setShortDescription($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setDescription($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setAmount($value);
|
||||
break;
|
||||
case 7:
|
||||
case 4:
|
||||
$this->setIsUsed($value);
|
||||
break;
|
||||
case 8:
|
||||
case 5:
|
||||
$this->setIsEnabled($value);
|
||||
break;
|
||||
case 9:
|
||||
case 6:
|
||||
$this->setExpirationDate($value);
|
||||
break;
|
||||
case 10:
|
||||
case 7:
|
||||
$this->setSerializedRules($value);
|
||||
break;
|
||||
case 11:
|
||||
case 8:
|
||||
$this->setIsCumulative($value);
|
||||
break;
|
||||
case 12:
|
||||
case 9:
|
||||
$this->setIsRemovingPostage($value);
|
||||
break;
|
||||
case 13:
|
||||
case 10:
|
||||
$this->setMaxUsage($value);
|
||||
break;
|
||||
case 14:
|
||||
case 11:
|
||||
$this->setIsAvailableOnSpecialOffers($value);
|
||||
break;
|
||||
case 15:
|
||||
case 12:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 16:
|
||||
case 13:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
case 17:
|
||||
case 14:
|
||||
$this->setVersion($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1926,21 +1728,18 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
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->setType($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setTitle($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setShortDescription($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setDescription($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setAmount($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setIsUsed($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setIsEnabled($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setExpirationDate($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setSerializedRules($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setIsCumulative($arr[$keys[11]]);
|
||||
if (array_key_exists($keys[12], $arr)) $this->setIsRemovingPostage($arr[$keys[12]]);
|
||||
if (array_key_exists($keys[13], $arr)) $this->setMaxUsage($arr[$keys[13]]);
|
||||
if (array_key_exists($keys[14], $arr)) $this->setIsAvailableOnSpecialOffers($arr[$keys[14]]);
|
||||
if (array_key_exists($keys[15], $arr)) $this->setCreatedAt($arr[$keys[15]]);
|
||||
if (array_key_exists($keys[16], $arr)) $this->setUpdatedAt($arr[$keys[16]]);
|
||||
if (array_key_exists($keys[17], $arr)) $this->setVersion($arr[$keys[17]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setAmount($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setIsUsed($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setIsEnabled($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setExpirationDate($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setSerializedRules($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setIsCumulative($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setIsRemovingPostage($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setMaxUsage($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setIsAvailableOnSpecialOffers($arr[$keys[11]]);
|
||||
if (array_key_exists($keys[12], $arr)) $this->setCreatedAt($arr[$keys[12]]);
|
||||
if (array_key_exists($keys[13], $arr)) $this->setUpdatedAt($arr[$keys[13]]);
|
||||
if (array_key_exists($keys[14], $arr)) $this->setVersion($arr[$keys[14]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1955,9 +1754,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponTableMap::ID)) $criteria->add(CouponTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(CouponTableMap::CODE)) $criteria->add(CouponTableMap::CODE, $this->code);
|
||||
if ($this->isColumnModified(CouponTableMap::TYPE)) $criteria->add(CouponTableMap::TYPE, $this->type);
|
||||
if ($this->isColumnModified(CouponTableMap::TITLE)) $criteria->add(CouponTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(CouponTableMap::SHORT_DESCRIPTION)) $criteria->add(CouponTableMap::SHORT_DESCRIPTION, $this->short_description);
|
||||
if ($this->isColumnModified(CouponTableMap::DESCRIPTION)) $criteria->add(CouponTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(CouponTableMap::AMOUNT)) $criteria->add(CouponTableMap::AMOUNT, $this->amount);
|
||||
if ($this->isColumnModified(CouponTableMap::IS_USED)) $criteria->add(CouponTableMap::IS_USED, $this->is_used);
|
||||
if ($this->isColumnModified(CouponTableMap::IS_ENABLED)) $criteria->add(CouponTableMap::IS_ENABLED, $this->is_enabled);
|
||||
@@ -2035,9 +1831,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
{
|
||||
$copyObj->setCode($this->getCode());
|
||||
$copyObj->setType($this->getType());
|
||||
$copyObj->setTitle($this->getTitle());
|
||||
$copyObj->setShortDescription($this->getShortDescription());
|
||||
$copyObj->setDescription($this->getDescription());
|
||||
$copyObj->setAmount($this->getAmount());
|
||||
$copyObj->setIsUsed($this->getIsUsed());
|
||||
$copyObj->setIsEnabled($this->getIsEnabled());
|
||||
@@ -2056,12 +1849,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
// the getter/setter methods for fkey referrer objects.
|
||||
$copyObj->setNew(false);
|
||||
|
||||
foreach ($this->getCouponOrders() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCouponOrder($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCouponI18ns() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCouponI18n($relObj->copy($deepCopy));
|
||||
@@ -2115,9 +1902,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
*/
|
||||
public function initRelation($relationName)
|
||||
{
|
||||
if ('CouponOrder' == $relationName) {
|
||||
return $this->initCouponOrders();
|
||||
}
|
||||
if ('CouponI18n' == $relationName) {
|
||||
return $this->initCouponI18ns();
|
||||
}
|
||||
@@ -2126,249 +1910,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCouponOrders collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return void
|
||||
* @see addCouponOrders()
|
||||
*/
|
||||
public function clearCouponOrders()
|
||||
{
|
||||
$this->collCouponOrders = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset is the collCouponOrders collection loaded partially.
|
||||
*/
|
||||
public function resetPartialCouponOrders($v = true)
|
||||
{
|
||||
$this->collCouponOrdersPartial = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collCouponOrders collection.
|
||||
*
|
||||
* By default this just sets the collCouponOrders collection to an empty array (like clearcollCouponOrders());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
* @param boolean $overrideExisting If set to true, the method call initializes
|
||||
* the collection even if it is not empty
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initCouponOrders($overrideExisting = true)
|
||||
{
|
||||
if (null !== $this->collCouponOrders && !$overrideExisting) {
|
||||
return;
|
||||
}
|
||||
$this->collCouponOrders = new ObjectCollection();
|
||||
$this->collCouponOrders->setModel('\Thelia\Model\CouponOrder');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of ChildCouponOrder objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
* Next time the same method is called without $criteria, the cached collection is returned.
|
||||
* If this ChildCoupon is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @return Collection|ChildCouponOrder[] List of ChildCouponOrder objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCouponOrders($criteria = null, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collCouponOrdersPartial && !$this->isNew();
|
||||
if (null === $this->collCouponOrders || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collCouponOrders) {
|
||||
// return empty collection
|
||||
$this->initCouponOrders();
|
||||
} else {
|
||||
$collCouponOrders = ChildCouponOrderQuery::create(null, $criteria)
|
||||
->filterByCoupon($this)
|
||||
->find($con);
|
||||
|
||||
if (null !== $criteria) {
|
||||
if (false !== $this->collCouponOrdersPartial && count($collCouponOrders)) {
|
||||
$this->initCouponOrders(false);
|
||||
|
||||
foreach ($collCouponOrders as $obj) {
|
||||
if (false == $this->collCouponOrders->contains($obj)) {
|
||||
$this->collCouponOrders->append($obj);
|
||||
}
|
||||
}
|
||||
|
||||
$this->collCouponOrdersPartial = true;
|
||||
}
|
||||
|
||||
$collCouponOrders->getInternalIterator()->rewind();
|
||||
|
||||
return $collCouponOrders;
|
||||
}
|
||||
|
||||
if ($partial && $this->collCouponOrders) {
|
||||
foreach ($this->collCouponOrders as $obj) {
|
||||
if ($obj->isNew()) {
|
||||
$collCouponOrders[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->collCouponOrders = $collCouponOrders;
|
||||
$this->collCouponOrdersPartial = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->collCouponOrders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a collection of CouponOrder objects related by a one-to-many relationship
|
||||
* to the current object.
|
||||
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
|
||||
* and new objects from the given Propel collection.
|
||||
*
|
||||
* @param Collection $couponOrders A Propel collection.
|
||||
* @param ConnectionInterface $con Optional connection object
|
||||
* @return ChildCoupon The current object (for fluent API support)
|
||||
*/
|
||||
public function setCouponOrders(Collection $couponOrders, ConnectionInterface $con = null)
|
||||
{
|
||||
$couponOrdersToDelete = $this->getCouponOrders(new Criteria(), $con)->diff($couponOrders);
|
||||
|
||||
|
||||
$this->couponOrdersScheduledForDeletion = $couponOrdersToDelete;
|
||||
|
||||
foreach ($couponOrdersToDelete as $couponOrderRemoved) {
|
||||
$couponOrderRemoved->setCoupon(null);
|
||||
}
|
||||
|
||||
$this->collCouponOrders = null;
|
||||
foreach ($couponOrders as $couponOrder) {
|
||||
$this->addCouponOrder($couponOrder);
|
||||
}
|
||||
|
||||
$this->collCouponOrders = $couponOrders;
|
||||
$this->collCouponOrdersPartial = false;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related CouponOrder objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param ConnectionInterface $con
|
||||
* @return int Count of related CouponOrder objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countCouponOrders(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collCouponOrdersPartial && !$this->isNew();
|
||||
if (null === $this->collCouponOrders || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collCouponOrders) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($partial && !$criteria) {
|
||||
return count($this->getCouponOrders());
|
||||
}
|
||||
|
||||
$query = ChildCouponOrderQuery::create(null, $criteria);
|
||||
if ($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
|
||||
return $query
|
||||
->filterByCoupon($this)
|
||||
->count($con);
|
||||
}
|
||||
|
||||
return count($this->collCouponOrders);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a ChildCouponOrder object to this object
|
||||
* through the ChildCouponOrder foreign key attribute.
|
||||
*
|
||||
* @param ChildCouponOrder $l ChildCouponOrder
|
||||
* @return \Thelia\Model\Coupon The current object (for fluent API support)
|
||||
*/
|
||||
public function addCouponOrder(ChildCouponOrder $l)
|
||||
{
|
||||
if ($this->collCouponOrders === null) {
|
||||
$this->initCouponOrders();
|
||||
$this->collCouponOrdersPartial = true;
|
||||
}
|
||||
|
||||
if (!in_array($l, $this->collCouponOrders->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddCouponOrder($l);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CouponOrder $couponOrder The couponOrder object to add.
|
||||
*/
|
||||
protected function doAddCouponOrder($couponOrder)
|
||||
{
|
||||
$this->collCouponOrders[]= $couponOrder;
|
||||
$couponOrder->setCoupon($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CouponOrder $couponOrder The couponOrder object to remove.
|
||||
* @return ChildCoupon The current object (for fluent API support)
|
||||
*/
|
||||
public function removeCouponOrder($couponOrder)
|
||||
{
|
||||
if ($this->getCouponOrders()->contains($couponOrder)) {
|
||||
$this->collCouponOrders->remove($this->collCouponOrders->search($couponOrder));
|
||||
if (null === $this->couponOrdersScheduledForDeletion) {
|
||||
$this->couponOrdersScheduledForDeletion = clone $this->collCouponOrders;
|
||||
$this->couponOrdersScheduledForDeletion->clear();
|
||||
}
|
||||
$this->couponOrdersScheduledForDeletion[]= clone $couponOrder;
|
||||
$couponOrder->setCoupon(null);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this Coupon is new, it will return
|
||||
* an empty collection; or if this Coupon has previously
|
||||
* been saved, it will retrieve related CouponOrders from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in Coupon.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return Collection|ChildCouponOrder[] List of ChildCouponOrder objects
|
||||
*/
|
||||
public function getCouponOrdersJoinOrder($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildCouponOrderQuery::create(null, $criteria);
|
||||
$query->joinWith('Order', $joinBehavior);
|
||||
|
||||
return $this->getCouponOrders($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCouponI18ns collection
|
||||
*
|
||||
@@ -2823,9 +2364,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$this->id = null;
|
||||
$this->code = null;
|
||||
$this->type = null;
|
||||
$this->title = null;
|
||||
$this->short_description = null;
|
||||
$this->description = null;
|
||||
$this->amount = null;
|
||||
$this->is_used = null;
|
||||
$this->is_enabled = null;
|
||||
@@ -2858,11 +2396,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
public function clearAllReferences($deep = false)
|
||||
{
|
||||
if ($deep) {
|
||||
if ($this->collCouponOrders) {
|
||||
foreach ($this->collCouponOrders as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCouponI18ns) {
|
||||
foreach ($this->collCouponI18ns as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
@@ -2879,10 +2412,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$this->currentLocale = 'en_US';
|
||||
$this->currentTranslations = null;
|
||||
|
||||
if ($this->collCouponOrders instanceof Collection) {
|
||||
$this->collCouponOrders->clearIterator();
|
||||
}
|
||||
$this->collCouponOrders = null;
|
||||
if ($this->collCouponI18ns instanceof Collection) {
|
||||
$this->collCouponI18ns->clearIterator();
|
||||
}
|
||||
@@ -3016,6 +2545,78 @@ abstract class Coupon 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\CouponI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setTitle($v)
|
||||
{ $this->getCurrentTranslation()->setTitle($v);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the [short_description] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShortDescription()
|
||||
{
|
||||
return $this->getCurrentTranslation()->getShortDescription();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of [short_description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\CouponI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setShortDescription($v)
|
||||
{ $this->getCurrentTranslation()->setShortDescription($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\CouponI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setDescription($v)
|
||||
{ $this->getCurrentTranslation()->setDescription($v);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
// versionable behavior
|
||||
|
||||
/**
|
||||
@@ -3067,9 +2668,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$version->setId($this->getId());
|
||||
$version->setCode($this->getCode());
|
||||
$version->setType($this->getType());
|
||||
$version->setTitle($this->getTitle());
|
||||
$version->setShortDescription($this->getShortDescription());
|
||||
$version->setDescription($this->getDescription());
|
||||
$version->setAmount($this->getAmount());
|
||||
$version->setIsUsed($this->getIsUsed());
|
||||
$version->setIsEnabled($this->getIsEnabled());
|
||||
@@ -3122,9 +2720,6 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$this->setId($version->getId());
|
||||
$this->setCode($version->getCode());
|
||||
$this->setType($version->getType());
|
||||
$this->setTitle($version->getTitle());
|
||||
$this->setShortDescription($version->getShortDescription());
|
||||
$this->setDescription($version->getDescription());
|
||||
$this->setAmount($version->getAmount());
|
||||
$this->setIsUsed($version->getIsUsed());
|
||||
$this->setIsEnabled($version->getIsEnabled());
|
||||
|
||||
@@ -66,6 +66,24 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
*/
|
||||
protected $locale;
|
||||
|
||||
/**
|
||||
* The value for the title field.
|
||||
* @var string
|
||||
*/
|
||||
protected $title;
|
||||
|
||||
/**
|
||||
* The value for the short_description field.
|
||||
* @var string
|
||||
*/
|
||||
protected $short_description;
|
||||
|
||||
/**
|
||||
* The value for the description field.
|
||||
* @var string
|
||||
*/
|
||||
protected $description;
|
||||
|
||||
/**
|
||||
* @var Coupon
|
||||
*/
|
||||
@@ -368,6 +386,39 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
return $this->locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [title] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [short_description] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShortDescription()
|
||||
{
|
||||
|
||||
return $this->short_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [description] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
@@ -414,6 +465,69 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setLocale()
|
||||
|
||||
/**
|
||||
* Set the value of [title] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\CouponI18n 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[] = CouponI18nTableMap::TITLE;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setTitle()
|
||||
|
||||
/**
|
||||
* Set the value of [short_description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\CouponI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setShortDescription($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->short_description !== $v) {
|
||||
$this->short_description = $v;
|
||||
$this->modifiedColumns[] = CouponI18nTableMap::SHORT_DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setShortDescription()
|
||||
|
||||
/**
|
||||
* Set the value of [description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\CouponI18n 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[] = CouponI18nTableMap::DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setDescription()
|
||||
|
||||
/**
|
||||
* Indicates whether the columns in this object are only set to default values.
|
||||
*
|
||||
@@ -460,6 +574,15 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : CouponI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->locale = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CouponI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->title = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CouponI18nTableMap::translateFieldName('ShortDescription', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->short_description = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CouponI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->description = (null !== $col) ? (string) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
@@ -468,7 +591,7 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 2; // 2 = CouponI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 5; // 5 = CouponI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\CouponI18n object", 0, $e);
|
||||
@@ -695,6 +818,15 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponI18nTableMap::LOCALE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'LOCALE';
|
||||
}
|
||||
if ($this->isColumnModified(CouponI18nTableMap::TITLE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'TITLE';
|
||||
}
|
||||
if ($this->isColumnModified(CouponI18nTableMap::SHORT_DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'SHORT_DESCRIPTION';
|
||||
}
|
||||
if ($this->isColumnModified(CouponI18nTableMap::DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'INSERT INTO coupon_i18n (%s) VALUES (%s)',
|
||||
@@ -712,6 +844,15 @@ abstract class CouponI18n 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 'SHORT_DESCRIPTION':
|
||||
$stmt->bindValue($identifier, $this->short_description, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'DESCRIPTION':
|
||||
$stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$stmt->execute();
|
||||
@@ -773,6 +914,15 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
case 1:
|
||||
return $this->getLocale();
|
||||
break;
|
||||
case 2:
|
||||
return $this->getTitle();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getShortDescription();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getDescription();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -804,6 +954,9 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
$result = array(
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getLocale(),
|
||||
$keys[2] => $this->getTitle(),
|
||||
$keys[3] => $this->getShortDescription(),
|
||||
$keys[4] => $this->getDescription(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -855,6 +1008,15 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
case 1:
|
||||
$this->setLocale($value);
|
||||
break;
|
||||
case 2:
|
||||
$this->setTitle($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setShortDescription($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setDescription($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -881,6 +1043,9 @@ abstract class CouponI18n 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->setShortDescription($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setDescription($arr[$keys[4]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -894,6 +1059,9 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->isColumnModified(CouponI18nTableMap::ID)) $criteria->add(CouponI18nTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(CouponI18nTableMap::LOCALE)) $criteria->add(CouponI18nTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(CouponI18nTableMap::TITLE)) $criteria->add(CouponI18nTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(CouponI18nTableMap::SHORT_DESCRIPTION)) $criteria->add(CouponI18nTableMap::SHORT_DESCRIPTION, $this->short_description);
|
||||
if ($this->isColumnModified(CouponI18nTableMap::DESCRIPTION)) $criteria->add(CouponI18nTableMap::DESCRIPTION, $this->description);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -966,6 +1134,9 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
{
|
||||
$copyObj->setId($this->getId());
|
||||
$copyObj->setLocale($this->getLocale());
|
||||
$copyObj->setTitle($this->getTitle());
|
||||
$copyObj->setShortDescription($this->getShortDescription());
|
||||
$copyObj->setDescription($this->getDescription());
|
||||
if ($makeNew) {
|
||||
$copyObj->setNew(true);
|
||||
}
|
||||
@@ -1051,6 +1222,9 @@ abstract class CouponI18n implements ActiveRecordInterface
|
||||
{
|
||||
$this->id = null;
|
||||
$this->locale = null;
|
||||
$this->title = null;
|
||||
$this->short_description = null;
|
||||
$this->description = null;
|
||||
$this->alreadyInSave = false;
|
||||
$this->clearAllReferences();
|
||||
$this->applyDefaultValues();
|
||||
|
||||
@@ -23,9 +23,15 @@ use Thelia\Model\Map\CouponI18nTableMap;
|
||||
*
|
||||
* @method ChildCouponI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCouponI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildCouponI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildCouponI18nQuery orderByShortDescription($order = Criteria::ASC) Order by the short_description column
|
||||
* @method ChildCouponI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
*
|
||||
* @method ChildCouponI18nQuery groupById() Group by the id column
|
||||
* @method ChildCouponI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildCouponI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildCouponI18nQuery groupByShortDescription() Group by the short_description column
|
||||
* @method ChildCouponI18nQuery groupByDescription() Group by the description column
|
||||
*
|
||||
* @method ChildCouponI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCouponI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
@@ -40,9 +46,15 @@ use Thelia\Model\Map\CouponI18nTableMap;
|
||||
*
|
||||
* @method ChildCouponI18n findOneById(int $id) Return the first ChildCouponI18n filtered by the id column
|
||||
* @method ChildCouponI18n findOneByLocale(string $locale) Return the first ChildCouponI18n filtered by the locale column
|
||||
* @method ChildCouponI18n findOneByTitle(string $title) Return the first ChildCouponI18n filtered by the title column
|
||||
* @method ChildCouponI18n findOneByShortDescription(string $short_description) Return the first ChildCouponI18n filtered by the short_description column
|
||||
* @method ChildCouponI18n findOneByDescription(string $description) Return the first ChildCouponI18n filtered by the description column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCouponI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildCouponI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildCouponI18n objects filtered by the title column
|
||||
* @method array findByShortDescription(string $short_description) Return ChildCouponI18n objects filtered by the short_description column
|
||||
* @method array findByDescription(string $description) Return ChildCouponI18n objects filtered by the description column
|
||||
*
|
||||
*/
|
||||
abstract class CouponI18nQuery extends ModelCriteria
|
||||
@@ -131,7 +143,7 @@ abstract class CouponI18nQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE FROM coupon_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, SHORT_DESCRIPTION, DESCRIPTION FROM coupon_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
@@ -304,6 +316,93 @@ abstract class CouponI18nQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CouponI18nTableMap::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 ChildCouponI18nQuery 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(CouponI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the short_description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByShortDescription('fooValue'); // WHERE short_description = 'fooValue'
|
||||
* $query->filterByShortDescription('%fooValue%'); // WHERE short_description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $shortDescription 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 ChildCouponI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByShortDescription($shortDescription = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($shortDescription)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $shortDescription)) {
|
||||
$shortDescription = str_replace('*', '%', $shortDescription);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CouponI18nTableMap::SHORT_DESCRIPTION, $shortDescription, $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 ChildCouponI18nQuery 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(CouponI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Coupon object
|
||||
*
|
||||
|
||||
@@ -16,10 +16,8 @@ use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Parser\AbstractParser;
|
||||
use Propel\Runtime\Util\PropelDateTime;
|
||||
use Thelia\Model\Coupon as ChildCoupon;
|
||||
use Thelia\Model\CouponOrder as ChildCouponOrder;
|
||||
use Thelia\Model\CouponOrderQuery as ChildCouponOrderQuery;
|
||||
use Thelia\Model\CouponQuery as ChildCouponQuery;
|
||||
use Thelia\Model\Order as ChildOrder;
|
||||
use Thelia\Model\OrderQuery as ChildOrderQuery;
|
||||
use Thelia\Model\Map\CouponOrderTableMap;
|
||||
@@ -70,12 +68,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
*/
|
||||
protected $order_id;
|
||||
|
||||
/**
|
||||
* The value for the code field.
|
||||
* @var string
|
||||
*/
|
||||
protected $code;
|
||||
|
||||
/**
|
||||
* The value for the value field.
|
||||
* @var double
|
||||
@@ -99,11 +91,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
*/
|
||||
protected $aOrder;
|
||||
|
||||
/**
|
||||
* @var Coupon
|
||||
*/
|
||||
protected $aCoupon;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
@@ -388,17 +375,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
return $this->order_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [code] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [value] column value.
|
||||
*
|
||||
@@ -496,31 +472,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setOrderId()
|
||||
|
||||
/**
|
||||
* Set the value of [code] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\CouponOrder 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[] = CouponOrderTableMap::CODE;
|
||||
}
|
||||
|
||||
if ($this->aCoupon !== null && $this->aCoupon->getCode() !== $v) {
|
||||
$this->aCoupon = null;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setCode()
|
||||
|
||||
/**
|
||||
* Set the value of [value] column.
|
||||
*
|
||||
@@ -627,19 +578,16 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : CouponOrderTableMap::translateFieldName('OrderId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->order_id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CouponOrderTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->code = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CouponOrderTableMap::translateFieldName('Value', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CouponOrderTableMap::translateFieldName('Value', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->value = (null !== $col) ? (double) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CouponOrderTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CouponOrderTableMap::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 : CouponOrderTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CouponOrderTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -652,7 +600,7 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 6; // 6 = CouponOrderTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 5; // 5 = CouponOrderTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\CouponOrder object", 0, $e);
|
||||
@@ -677,9 +625,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
if ($this->aOrder !== null && $this->order_id !== $this->aOrder->getId()) {
|
||||
$this->aOrder = null;
|
||||
}
|
||||
if ($this->aCoupon !== null && $this->code !== $this->aCoupon->getCode()) {
|
||||
$this->aCoupon = null;
|
||||
}
|
||||
} // ensureConsistency
|
||||
|
||||
/**
|
||||
@@ -720,7 +665,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
if ($deep) { // also de-associate any related objects?
|
||||
|
||||
$this->aOrder = null;
|
||||
$this->aCoupon = null;
|
||||
} // if (deep)
|
||||
}
|
||||
|
||||
@@ -855,13 +799,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
$this->setOrder($this->aOrder);
|
||||
}
|
||||
|
||||
if ($this->aCoupon !== null) {
|
||||
if ($this->aCoupon->isModified() || $this->aCoupon->isNew()) {
|
||||
$affectedRows += $this->aCoupon->save($con);
|
||||
}
|
||||
$this->setCoupon($this->aCoupon);
|
||||
}
|
||||
|
||||
if ($this->isNew() || $this->isModified()) {
|
||||
// persist changes
|
||||
if ($this->isNew()) {
|
||||
@@ -905,9 +842,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponOrderTableMap::ORDER_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'ORDER_ID';
|
||||
}
|
||||
if ($this->isColumnModified(CouponOrderTableMap::CODE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CODE';
|
||||
}
|
||||
if ($this->isColumnModified(CouponOrderTableMap::VALUE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'VALUE';
|
||||
}
|
||||
@@ -934,9 +868,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
case 'ORDER_ID':
|
||||
$stmt->bindValue($identifier, $this->order_id, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'CODE':
|
||||
$stmt->bindValue($identifier, $this->code, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'VALUE':
|
||||
$stmt->bindValue($identifier, $this->value, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1015,15 +946,12 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
return $this->getOrderId();
|
||||
break;
|
||||
case 2:
|
||||
return $this->getCode();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getValue();
|
||||
break;
|
||||
case 4:
|
||||
case 3:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 5:
|
||||
case 4:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1057,10 +985,9 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
$result = array(
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getOrderId(),
|
||||
$keys[2] => $this->getCode(),
|
||||
$keys[3] => $this->getValue(),
|
||||
$keys[4] => $this->getCreatedAt(),
|
||||
$keys[5] => $this->getUpdatedAt(),
|
||||
$keys[2] => $this->getValue(),
|
||||
$keys[3] => $this->getCreatedAt(),
|
||||
$keys[4] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1072,9 +999,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
if (null !== $this->aOrder) {
|
||||
$result['Order'] = $this->aOrder->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
}
|
||||
if (null !== $this->aCoupon) {
|
||||
$result['Coupon'] = $this->aCoupon->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
@@ -1116,15 +1040,12 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
$this->setOrderId($value);
|
||||
break;
|
||||
case 2:
|
||||
$this->setCode($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setValue($value);
|
||||
break;
|
||||
case 4:
|
||||
case 3:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 5:
|
||||
case 4:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1153,10 +1074,9 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setOrderId($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setCode($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setValue($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[2], $arr)) $this->setValue($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]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1170,7 +1090,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
|
||||
if ($this->isColumnModified(CouponOrderTableMap::ID)) $criteria->add(CouponOrderTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(CouponOrderTableMap::ORDER_ID)) $criteria->add(CouponOrderTableMap::ORDER_ID, $this->order_id);
|
||||
if ($this->isColumnModified(CouponOrderTableMap::CODE)) $criteria->add(CouponOrderTableMap::CODE, $this->code);
|
||||
if ($this->isColumnModified(CouponOrderTableMap::VALUE)) $criteria->add(CouponOrderTableMap::VALUE, $this->value);
|
||||
if ($this->isColumnModified(CouponOrderTableMap::CREATED_AT)) $criteria->add(CouponOrderTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(CouponOrderTableMap::UPDATED_AT)) $criteria->add(CouponOrderTableMap::UPDATED_AT, $this->updated_at);
|
||||
@@ -1238,7 +1157,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
|
||||
{
|
||||
$copyObj->setOrderId($this->getOrderId());
|
||||
$copyObj->setCode($this->getCode());
|
||||
$copyObj->setValue($this->getValue());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
@@ -1321,59 +1239,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
return $this->aOrder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a ChildCoupon object.
|
||||
*
|
||||
* @param ChildCoupon $v
|
||||
* @return \Thelia\Model\CouponOrder The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setCoupon(ChildCoupon $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setCode(NULL);
|
||||
} else {
|
||||
$this->setCode($v->getCode());
|
||||
}
|
||||
|
||||
$this->aCoupon = $v;
|
||||
|
||||
// Add binding for other direction of this n:n relationship.
|
||||
// If this object has already been added to the ChildCoupon object, it will not be re-added.
|
||||
if ($v !== null) {
|
||||
$v->addCouponOrder($this);
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the associated ChildCoupon object
|
||||
*
|
||||
* @param ConnectionInterface $con Optional Connection object.
|
||||
* @return ChildCoupon The associated ChildCoupon object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCoupon(ConnectionInterface $con = null)
|
||||
{
|
||||
if ($this->aCoupon === null && (($this->code !== "" && $this->code !== null))) {
|
||||
$this->aCoupon = ChildCouponQuery::create()
|
||||
->filterByCouponOrder($this) // here
|
||||
->findOne($con);
|
||||
/* The following can be used additionally to
|
||||
guarantee the related object contains a reference
|
||||
to this object. This level of coupling may, however, be
|
||||
undesirable since it could result in an only partially populated collection
|
||||
in the referenced object.
|
||||
$this->aCoupon->addCouponOrders($this);
|
||||
*/
|
||||
}
|
||||
|
||||
return $this->aCoupon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the current object and sets all attributes to their default values
|
||||
*/
|
||||
@@ -1381,7 +1246,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
{
|
||||
$this->id = null;
|
||||
$this->order_id = null;
|
||||
$this->code = null;
|
||||
$this->value = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
@@ -1407,7 +1271,6 @@ abstract class CouponOrder implements ActiveRecordInterface
|
||||
} // if ($deep)
|
||||
|
||||
$this->aOrder = null;
|
||||
$this->aCoupon = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,14 +23,12 @@ use Thelia\Model\Map\CouponOrderTableMap;
|
||||
*
|
||||
* @method ChildCouponOrderQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCouponOrderQuery orderByOrderId($order = Criteria::ASC) Order by the order_id column
|
||||
* @method ChildCouponOrderQuery orderByCode($order = Criteria::ASC) Order by the code column
|
||||
* @method ChildCouponOrderQuery orderByValue($order = Criteria::ASC) Order by the value column
|
||||
* @method ChildCouponOrderQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCouponOrderQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildCouponOrderQuery groupById() Group by the id column
|
||||
* @method ChildCouponOrderQuery groupByOrderId() Group by the order_id column
|
||||
* @method ChildCouponOrderQuery groupByCode() Group by the code column
|
||||
* @method ChildCouponOrderQuery groupByValue() Group by the value column
|
||||
* @method ChildCouponOrderQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCouponOrderQuery groupByUpdatedAt() Group by the updated_at column
|
||||
@@ -43,23 +41,17 @@ use Thelia\Model\Map\CouponOrderTableMap;
|
||||
* @method ChildCouponOrderQuery rightJoinOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Order relation
|
||||
* @method ChildCouponOrderQuery innerJoinOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the Order relation
|
||||
*
|
||||
* @method ChildCouponOrderQuery leftJoinCoupon($relationAlias = null) Adds a LEFT JOIN clause to the query using the Coupon relation
|
||||
* @method ChildCouponOrderQuery rightJoinCoupon($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Coupon relation
|
||||
* @method ChildCouponOrderQuery innerJoinCoupon($relationAlias = null) Adds a INNER JOIN clause to the query using the Coupon relation
|
||||
*
|
||||
* @method ChildCouponOrder findOne(ConnectionInterface $con = null) Return the first ChildCouponOrder matching the query
|
||||
* @method ChildCouponOrder findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCouponOrder matching the query, or a new ChildCouponOrder object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildCouponOrder findOneById(int $id) Return the first ChildCouponOrder filtered by the id column
|
||||
* @method ChildCouponOrder findOneByOrderId(int $order_id) Return the first ChildCouponOrder filtered by the order_id column
|
||||
* @method ChildCouponOrder findOneByCode(string $code) Return the first ChildCouponOrder filtered by the code column
|
||||
* @method ChildCouponOrder findOneByValue(double $value) Return the first ChildCouponOrder filtered by the value column
|
||||
* @method ChildCouponOrder findOneByCreatedAt(string $created_at) Return the first ChildCouponOrder filtered by the created_at column
|
||||
* @method ChildCouponOrder findOneByUpdatedAt(string $updated_at) Return the first ChildCouponOrder filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCouponOrder objects filtered by the id column
|
||||
* @method array findByOrderId(int $order_id) Return ChildCouponOrder objects filtered by the order_id column
|
||||
* @method array findByCode(string $code) Return ChildCouponOrder objects filtered by the code column
|
||||
* @method array findByValue(double $value) Return ChildCouponOrder objects filtered by the value column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCouponOrder objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCouponOrder objects filtered by the updated_at column
|
||||
@@ -151,7 +143,7 @@ abstract class CouponOrderQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, ORDER_ID, CODE, VALUE, CREATED_AT, UPDATED_AT FROM coupon_order WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, ORDER_ID, VALUE, CREATED_AT, UPDATED_AT FROM coupon_order WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -324,35 +316,6 @@ abstract class CouponOrderQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CouponOrderTableMap::ORDER_ID, $orderId, $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 ChildCouponOrderQuery 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(CouponOrderTableMap::CODE, $code, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the value column
|
||||
*
|
||||
@@ -555,81 +518,6 @@ abstract class CouponOrderQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'Order', '\Thelia\Model\OrderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Coupon object
|
||||
*
|
||||
* @param \Thelia\Model\Coupon|ObjectCollection $coupon The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCouponOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCoupon($coupon, $comparison = null)
|
||||
{
|
||||
if ($coupon instanceof \Thelia\Model\Coupon) {
|
||||
return $this
|
||||
->addUsingAlias(CouponOrderTableMap::CODE, $coupon->getCode(), $comparison);
|
||||
} elseif ($coupon instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CouponOrderTableMap::CODE, $coupon->toKeyValue('PrimaryKey', 'Code'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCoupon() only accepts arguments of type \Thelia\Model\Coupon or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Coupon relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCouponOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCoupon($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Coupon');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Coupon');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Coupon relation Coupon object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CouponQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCouponQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCoupon($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Coupon', '\Thelia\Model\CouponQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
|
||||
@@ -25,9 +25,6 @@ use Thelia\Model\Map\CouponTableMap;
|
||||
* @method ChildCouponQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCouponQuery orderByCode($order = Criteria::ASC) Order by the code column
|
||||
* @method ChildCouponQuery orderByType($order = Criteria::ASC) Order by the type column
|
||||
* @method ChildCouponQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildCouponQuery orderByShortDescription($order = Criteria::ASC) Order by the short_description column
|
||||
* @method ChildCouponQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildCouponQuery orderByAmount($order = Criteria::ASC) Order by the amount column
|
||||
* @method ChildCouponQuery orderByIsUsed($order = Criteria::ASC) Order by the is_used column
|
||||
* @method ChildCouponQuery orderByIsEnabled($order = Criteria::ASC) Order by the is_enabled column
|
||||
@@ -44,9 +41,6 @@ use Thelia\Model\Map\CouponTableMap;
|
||||
* @method ChildCouponQuery groupById() Group by the id column
|
||||
* @method ChildCouponQuery groupByCode() Group by the code column
|
||||
* @method ChildCouponQuery groupByType() Group by the type column
|
||||
* @method ChildCouponQuery groupByTitle() Group by the title column
|
||||
* @method ChildCouponQuery groupByShortDescription() Group by the short_description column
|
||||
* @method ChildCouponQuery groupByDescription() Group by the description column
|
||||
* @method ChildCouponQuery groupByAmount() Group by the amount column
|
||||
* @method ChildCouponQuery groupByIsUsed() Group by the is_used column
|
||||
* @method ChildCouponQuery groupByIsEnabled() Group by the is_enabled column
|
||||
@@ -64,10 +58,6 @@ use Thelia\Model\Map\CouponTableMap;
|
||||
* @method ChildCouponQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildCouponQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildCouponQuery leftJoinCouponOrder($relationAlias = null) Adds a LEFT JOIN clause to the query using the CouponOrder relation
|
||||
* @method ChildCouponQuery rightJoinCouponOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CouponOrder relation
|
||||
* @method ChildCouponQuery innerJoinCouponOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the CouponOrder relation
|
||||
*
|
||||
* @method ChildCouponQuery leftJoinCouponI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CouponI18n relation
|
||||
* @method ChildCouponQuery rightJoinCouponI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CouponI18n relation
|
||||
* @method ChildCouponQuery innerJoinCouponI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CouponI18n relation
|
||||
@@ -82,9 +72,6 @@ use Thelia\Model\Map\CouponTableMap;
|
||||
* @method ChildCoupon findOneById(int $id) Return the first ChildCoupon filtered by the id column
|
||||
* @method ChildCoupon findOneByCode(string $code) Return the first ChildCoupon filtered by the code column
|
||||
* @method ChildCoupon findOneByType(string $type) Return the first ChildCoupon filtered by the type column
|
||||
* @method ChildCoupon findOneByTitle(string $title) Return the first ChildCoupon filtered by the title column
|
||||
* @method ChildCoupon findOneByShortDescription(string $short_description) Return the first ChildCoupon filtered by the short_description column
|
||||
* @method ChildCoupon findOneByDescription(string $description) Return the first ChildCoupon filtered by the description column
|
||||
* @method ChildCoupon findOneByAmount(double $amount) Return the first ChildCoupon filtered by the amount column
|
||||
* @method ChildCoupon findOneByIsUsed(int $is_used) Return the first ChildCoupon filtered by the is_used column
|
||||
* @method ChildCoupon findOneByIsEnabled(int $is_enabled) Return the first ChildCoupon filtered by the is_enabled column
|
||||
@@ -101,9 +88,6 @@ use Thelia\Model\Map\CouponTableMap;
|
||||
* @method array findById(int $id) Return ChildCoupon objects filtered by the id column
|
||||
* @method array findByCode(string $code) Return ChildCoupon objects filtered by the code column
|
||||
* @method array findByType(string $type) Return ChildCoupon objects filtered by the type column
|
||||
* @method array findByTitle(string $title) Return ChildCoupon objects filtered by the title column
|
||||
* @method array findByShortDescription(string $short_description) Return ChildCoupon objects filtered by the short_description column
|
||||
* @method array findByDescription(string $description) Return ChildCoupon objects filtered by the description column
|
||||
* @method array findByAmount(double $amount) Return ChildCoupon objects filtered by the amount column
|
||||
* @method array findByIsUsed(int $is_used) Return ChildCoupon objects filtered by the is_used column
|
||||
* @method array findByIsEnabled(int $is_enabled) Return ChildCoupon objects filtered by the is_enabled column
|
||||
@@ -211,7 +195,7 @@ abstract class CouponQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CODE, TYPE, TITLE, SHORT_DESCRIPTION, DESCRIPTION, AMOUNT, IS_USED, IS_ENABLED, EXPIRATION_DATE, SERIALIZED_RULES, IS_CUMULATIVE, IS_REMOVING_POSTAGE, MAX_USAGE, IS_AVAILABLE_ON_SPECIAL_OFFERS, CREATED_AT, UPDATED_AT, VERSION FROM coupon WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, CODE, TYPE, AMOUNT, IS_USED, IS_ENABLED, EXPIRATION_DATE, SERIALIZED_RULES, IS_CUMULATIVE, IS_REMOVING_POSTAGE, MAX_USAGE, IS_AVAILABLE_ON_SPECIAL_OFFERS, CREATED_AT, UPDATED_AT, VERSION FROM coupon WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -399,93 +383,6 @@ abstract class CouponQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CouponTableMap::TYPE, $type, $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 ChildCouponQuery 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(CouponTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the short_description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByShortDescription('fooValue'); // WHERE short_description = 'fooValue'
|
||||
* $query->filterByShortDescription('%fooValue%'); // WHERE short_description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $shortDescription 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 ChildCouponQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByShortDescription($shortDescription = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($shortDescription)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $shortDescription)) {
|
||||
$shortDescription = str_replace('*', '%', $shortDescription);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CouponTableMap::SHORT_DESCRIPTION, $shortDescription, $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 ChildCouponQuery 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(CouponTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the amount column
|
||||
*
|
||||
@@ -958,79 +855,6 @@ abstract class CouponQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CouponTableMap::VERSION, $version, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CouponOrder object
|
||||
*
|
||||
* @param \Thelia\Model\CouponOrder|ObjectCollection $couponOrder the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCouponQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCouponOrder($couponOrder, $comparison = null)
|
||||
{
|
||||
if ($couponOrder instanceof \Thelia\Model\CouponOrder) {
|
||||
return $this
|
||||
->addUsingAlias(CouponTableMap::CODE, $couponOrder->getCode(), $comparison);
|
||||
} elseif ($couponOrder instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useCouponOrderQuery()
|
||||
->filterByPrimaryKeys($couponOrder->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCouponOrder() only accepts arguments of type \Thelia\Model\CouponOrder or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CouponOrder relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCouponQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCouponOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CouponOrder');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CouponOrder');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CouponOrder relation CouponOrder object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CouponOrderQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCouponOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCouponOrder($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CouponOrder', '\Thelia\Model\CouponOrderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CouponI18n object
|
||||
*
|
||||
|
||||
@@ -73,24 +73,6 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* The value for the title field.
|
||||
* @var string
|
||||
*/
|
||||
protected $title;
|
||||
|
||||
/**
|
||||
* The value for the short_description field.
|
||||
* @var string
|
||||
*/
|
||||
protected $short_description;
|
||||
|
||||
/**
|
||||
* The value for the description field.
|
||||
* @var string
|
||||
*/
|
||||
protected $description;
|
||||
|
||||
/**
|
||||
* The value for the amount field.
|
||||
* @var double
|
||||
@@ -477,39 +459,6 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [title] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [short_description] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShortDescription()
|
||||
{
|
||||
|
||||
return $this->short_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [description] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [amount] column value.
|
||||
*
|
||||
@@ -736,69 +685,6 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setType()
|
||||
|
||||
/**
|
||||
* Set the value of [title] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\CouponVersion 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[] = CouponVersionTableMap::TITLE;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setTitle()
|
||||
|
||||
/**
|
||||
* Set the value of [short_description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\CouponVersion The current object (for fluent API support)
|
||||
*/
|
||||
public function setShortDescription($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->short_description !== $v) {
|
||||
$this->short_description = $v;
|
||||
$this->modifiedColumns[] = CouponVersionTableMap::SHORT_DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setShortDescription()
|
||||
|
||||
/**
|
||||
* Set the value of [description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\CouponVersion 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[] = CouponVersionTableMap::DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setDescription()
|
||||
|
||||
/**
|
||||
* Set the value of [amount] column.
|
||||
*
|
||||
@@ -1109,58 +995,49 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CouponVersionTableMap::translateFieldName('Type', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->type = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CouponVersionTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->title = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CouponVersionTableMap::translateFieldName('ShortDescription', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->short_description = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CouponVersionTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->description = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CouponVersionTableMap::translateFieldName('Amount', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CouponVersionTableMap::translateFieldName('Amount', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->amount = (null !== $col) ? (double) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CouponVersionTableMap::translateFieldName('IsUsed', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CouponVersionTableMap::translateFieldName('IsUsed', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_used = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CouponVersionTableMap::translateFieldName('IsEnabled', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CouponVersionTableMap::translateFieldName('IsEnabled', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_enabled = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CouponVersionTableMap::translateFieldName('ExpirationDate', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CouponVersionTableMap::translateFieldName('ExpirationDate', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->expiration_date = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CouponVersionTableMap::translateFieldName('SerializedRules', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CouponVersionTableMap::translateFieldName('SerializedRules', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->serialized_rules = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CouponVersionTableMap::translateFieldName('IsCumulative', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CouponVersionTableMap::translateFieldName('IsCumulative', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_cumulative = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : CouponVersionTableMap::translateFieldName('IsRemovingPostage', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CouponVersionTableMap::translateFieldName('IsRemovingPostage', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_removing_postage = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : CouponVersionTableMap::translateFieldName('MaxUsage', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CouponVersionTableMap::translateFieldName('MaxUsage', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->max_usage = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : CouponVersionTableMap::translateFieldName('IsAvailableOnSpecialOffers', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CouponVersionTableMap::translateFieldName('IsAvailableOnSpecialOffers', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->is_available_on_special_offers = (null !== $col) ? (boolean) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : CouponVersionTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : CouponVersionTableMap::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 ? 16 + $startcol : CouponVersionTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : CouponVersionTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->updated_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : CouponVersionTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : CouponVersionTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version = (null !== $col) ? (int) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
@@ -1170,7 +1047,7 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 18; // 18 = CouponVersionTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 15; // 15 = CouponVersionTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\CouponVersion object", 0, $e);
|
||||
@@ -1400,15 +1277,6 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponVersionTableMap::TYPE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'TYPE';
|
||||
}
|
||||
if ($this->isColumnModified(CouponVersionTableMap::TITLE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'TITLE';
|
||||
}
|
||||
if ($this->isColumnModified(CouponVersionTableMap::SHORT_DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'SHORT_DESCRIPTION';
|
||||
}
|
||||
if ($this->isColumnModified(CouponVersionTableMap::DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
|
||||
}
|
||||
if ($this->isColumnModified(CouponVersionTableMap::AMOUNT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'AMOUNT';
|
||||
}
|
||||
@@ -1465,15 +1333,6 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
case 'TYPE':
|
||||
$stmt->bindValue($identifier, $this->type, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'TITLE':
|
||||
$stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'SHORT_DESCRIPTION':
|
||||
$stmt->bindValue($identifier, $this->short_description, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'DESCRIPTION':
|
||||
$stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'AMOUNT':
|
||||
$stmt->bindValue($identifier, $this->amount, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1575,48 +1434,39 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
return $this->getType();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getTitle();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getShortDescription();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getDescription();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getAmount();
|
||||
break;
|
||||
case 7:
|
||||
case 4:
|
||||
return $this->getIsUsed();
|
||||
break;
|
||||
case 8:
|
||||
case 5:
|
||||
return $this->getIsEnabled();
|
||||
break;
|
||||
case 9:
|
||||
case 6:
|
||||
return $this->getExpirationDate();
|
||||
break;
|
||||
case 10:
|
||||
case 7:
|
||||
return $this->getSerializedRules();
|
||||
break;
|
||||
case 11:
|
||||
case 8:
|
||||
return $this->getIsCumulative();
|
||||
break;
|
||||
case 12:
|
||||
case 9:
|
||||
return $this->getIsRemovingPostage();
|
||||
break;
|
||||
case 13:
|
||||
case 10:
|
||||
return $this->getMaxUsage();
|
||||
break;
|
||||
case 14:
|
||||
case 11:
|
||||
return $this->getIsAvailableOnSpecialOffers();
|
||||
break;
|
||||
case 15:
|
||||
case 12:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 16:
|
||||
case 13:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
case 17:
|
||||
case 14:
|
||||
return $this->getVersion();
|
||||
break;
|
||||
default:
|
||||
@@ -1651,21 +1501,18 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getCode(),
|
||||
$keys[2] => $this->getType(),
|
||||
$keys[3] => $this->getTitle(),
|
||||
$keys[4] => $this->getShortDescription(),
|
||||
$keys[5] => $this->getDescription(),
|
||||
$keys[6] => $this->getAmount(),
|
||||
$keys[7] => $this->getIsUsed(),
|
||||
$keys[8] => $this->getIsEnabled(),
|
||||
$keys[9] => $this->getExpirationDate(),
|
||||
$keys[10] => $this->getSerializedRules(),
|
||||
$keys[11] => $this->getIsCumulative(),
|
||||
$keys[12] => $this->getIsRemovingPostage(),
|
||||
$keys[13] => $this->getMaxUsage(),
|
||||
$keys[14] => $this->getIsAvailableOnSpecialOffers(),
|
||||
$keys[15] => $this->getCreatedAt(),
|
||||
$keys[16] => $this->getUpdatedAt(),
|
||||
$keys[17] => $this->getVersion(),
|
||||
$keys[3] => $this->getAmount(),
|
||||
$keys[4] => $this->getIsUsed(),
|
||||
$keys[5] => $this->getIsEnabled(),
|
||||
$keys[6] => $this->getExpirationDate(),
|
||||
$keys[7] => $this->getSerializedRules(),
|
||||
$keys[8] => $this->getIsCumulative(),
|
||||
$keys[9] => $this->getIsRemovingPostage(),
|
||||
$keys[10] => $this->getMaxUsage(),
|
||||
$keys[11] => $this->getIsAvailableOnSpecialOffers(),
|
||||
$keys[12] => $this->getCreatedAt(),
|
||||
$keys[13] => $this->getUpdatedAt(),
|
||||
$keys[14] => $this->getVersion(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1721,48 +1568,39 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$this->setType($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setTitle($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setShortDescription($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setDescription($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setAmount($value);
|
||||
break;
|
||||
case 7:
|
||||
case 4:
|
||||
$this->setIsUsed($value);
|
||||
break;
|
||||
case 8:
|
||||
case 5:
|
||||
$this->setIsEnabled($value);
|
||||
break;
|
||||
case 9:
|
||||
case 6:
|
||||
$this->setExpirationDate($value);
|
||||
break;
|
||||
case 10:
|
||||
case 7:
|
||||
$this->setSerializedRules($value);
|
||||
break;
|
||||
case 11:
|
||||
case 8:
|
||||
$this->setIsCumulative($value);
|
||||
break;
|
||||
case 12:
|
||||
case 9:
|
||||
$this->setIsRemovingPostage($value);
|
||||
break;
|
||||
case 13:
|
||||
case 10:
|
||||
$this->setMaxUsage($value);
|
||||
break;
|
||||
case 14:
|
||||
case 11:
|
||||
$this->setIsAvailableOnSpecialOffers($value);
|
||||
break;
|
||||
case 15:
|
||||
case 12:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 16:
|
||||
case 13:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
case 17:
|
||||
case 14:
|
||||
$this->setVersion($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1792,21 +1630,18 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
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->setType($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setTitle($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setShortDescription($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setDescription($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setAmount($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setIsUsed($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setIsEnabled($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setExpirationDate($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setSerializedRules($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setIsCumulative($arr[$keys[11]]);
|
||||
if (array_key_exists($keys[12], $arr)) $this->setIsRemovingPostage($arr[$keys[12]]);
|
||||
if (array_key_exists($keys[13], $arr)) $this->setMaxUsage($arr[$keys[13]]);
|
||||
if (array_key_exists($keys[14], $arr)) $this->setIsAvailableOnSpecialOffers($arr[$keys[14]]);
|
||||
if (array_key_exists($keys[15], $arr)) $this->setCreatedAt($arr[$keys[15]]);
|
||||
if (array_key_exists($keys[16], $arr)) $this->setUpdatedAt($arr[$keys[16]]);
|
||||
if (array_key_exists($keys[17], $arr)) $this->setVersion($arr[$keys[17]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setAmount($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setIsUsed($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setIsEnabled($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setExpirationDate($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setSerializedRules($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setIsCumulative($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setIsRemovingPostage($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setMaxUsage($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setIsAvailableOnSpecialOffers($arr[$keys[11]]);
|
||||
if (array_key_exists($keys[12], $arr)) $this->setCreatedAt($arr[$keys[12]]);
|
||||
if (array_key_exists($keys[13], $arr)) $this->setUpdatedAt($arr[$keys[13]]);
|
||||
if (array_key_exists($keys[14], $arr)) $this->setVersion($arr[$keys[14]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1821,9 +1656,6 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponVersionTableMap::ID)) $criteria->add(CouponVersionTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::CODE)) $criteria->add(CouponVersionTableMap::CODE, $this->code);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::TYPE)) $criteria->add(CouponVersionTableMap::TYPE, $this->type);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::TITLE)) $criteria->add(CouponVersionTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::SHORT_DESCRIPTION)) $criteria->add(CouponVersionTableMap::SHORT_DESCRIPTION, $this->short_description);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::DESCRIPTION)) $criteria->add(CouponVersionTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::AMOUNT)) $criteria->add(CouponVersionTableMap::AMOUNT, $this->amount);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::IS_USED)) $criteria->add(CouponVersionTableMap::IS_USED, $this->is_used);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::IS_ENABLED)) $criteria->add(CouponVersionTableMap::IS_ENABLED, $this->is_enabled);
|
||||
@@ -1909,9 +1741,6 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$copyObj->setId($this->getId());
|
||||
$copyObj->setCode($this->getCode());
|
||||
$copyObj->setType($this->getType());
|
||||
$copyObj->setTitle($this->getTitle());
|
||||
$copyObj->setShortDescription($this->getShortDescription());
|
||||
$copyObj->setDescription($this->getDescription());
|
||||
$copyObj->setAmount($this->getAmount());
|
||||
$copyObj->setIsUsed($this->getIsUsed());
|
||||
$copyObj->setIsEnabled($this->getIsEnabled());
|
||||
@@ -2010,9 +1839,6 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$this->id = null;
|
||||
$this->code = null;
|
||||
$this->type = null;
|
||||
$this->title = null;
|
||||
$this->short_description = null;
|
||||
$this->description = null;
|
||||
$this->amount = null;
|
||||
$this->is_used = null;
|
||||
$this->is_enabled = null;
|
||||
|
||||
@@ -24,9 +24,6 @@ use Thelia\Model\Map\CouponVersionTableMap;
|
||||
* @method ChildCouponVersionQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCouponVersionQuery orderByCode($order = Criteria::ASC) Order by the code column
|
||||
* @method ChildCouponVersionQuery orderByType($order = Criteria::ASC) Order by the type column
|
||||
* @method ChildCouponVersionQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildCouponVersionQuery orderByShortDescription($order = Criteria::ASC) Order by the short_description column
|
||||
* @method ChildCouponVersionQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildCouponVersionQuery orderByAmount($order = Criteria::ASC) Order by the amount column
|
||||
* @method ChildCouponVersionQuery orderByIsUsed($order = Criteria::ASC) Order by the is_used column
|
||||
* @method ChildCouponVersionQuery orderByIsEnabled($order = Criteria::ASC) Order by the is_enabled column
|
||||
@@ -43,9 +40,6 @@ use Thelia\Model\Map\CouponVersionTableMap;
|
||||
* @method ChildCouponVersionQuery groupById() Group by the id column
|
||||
* @method ChildCouponVersionQuery groupByCode() Group by the code column
|
||||
* @method ChildCouponVersionQuery groupByType() Group by the type column
|
||||
* @method ChildCouponVersionQuery groupByTitle() Group by the title column
|
||||
* @method ChildCouponVersionQuery groupByShortDescription() Group by the short_description column
|
||||
* @method ChildCouponVersionQuery groupByDescription() Group by the description column
|
||||
* @method ChildCouponVersionQuery groupByAmount() Group by the amount column
|
||||
* @method ChildCouponVersionQuery groupByIsUsed() Group by the is_used column
|
||||
* @method ChildCouponVersionQuery groupByIsEnabled() Group by the is_enabled column
|
||||
@@ -73,9 +67,6 @@ use Thelia\Model\Map\CouponVersionTableMap;
|
||||
* @method ChildCouponVersion findOneById(int $id) Return the first ChildCouponVersion filtered by the id column
|
||||
* @method ChildCouponVersion findOneByCode(string $code) Return the first ChildCouponVersion filtered by the code column
|
||||
* @method ChildCouponVersion findOneByType(string $type) Return the first ChildCouponVersion filtered by the type column
|
||||
* @method ChildCouponVersion findOneByTitle(string $title) Return the first ChildCouponVersion filtered by the title column
|
||||
* @method ChildCouponVersion findOneByShortDescription(string $short_description) Return the first ChildCouponVersion filtered by the short_description column
|
||||
* @method ChildCouponVersion findOneByDescription(string $description) Return the first ChildCouponVersion filtered by the description column
|
||||
* @method ChildCouponVersion findOneByAmount(double $amount) Return the first ChildCouponVersion filtered by the amount column
|
||||
* @method ChildCouponVersion findOneByIsUsed(int $is_used) Return the first ChildCouponVersion filtered by the is_used column
|
||||
* @method ChildCouponVersion findOneByIsEnabled(int $is_enabled) Return the first ChildCouponVersion filtered by the is_enabled column
|
||||
@@ -92,9 +83,6 @@ use Thelia\Model\Map\CouponVersionTableMap;
|
||||
* @method array findById(int $id) Return ChildCouponVersion objects filtered by the id column
|
||||
* @method array findByCode(string $code) Return ChildCouponVersion objects filtered by the code column
|
||||
* @method array findByType(string $type) Return ChildCouponVersion objects filtered by the type column
|
||||
* @method array findByTitle(string $title) Return ChildCouponVersion objects filtered by the title column
|
||||
* @method array findByShortDescription(string $short_description) Return ChildCouponVersion objects filtered by the short_description column
|
||||
* @method array findByDescription(string $description) Return ChildCouponVersion objects filtered by the description column
|
||||
* @method array findByAmount(double $amount) Return ChildCouponVersion objects filtered by the amount column
|
||||
* @method array findByIsUsed(int $is_used) Return ChildCouponVersion objects filtered by the is_used column
|
||||
* @method array findByIsEnabled(int $is_enabled) Return ChildCouponVersion objects filtered by the is_enabled column
|
||||
@@ -195,7 +183,7 @@ abstract class CouponVersionQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CODE, TYPE, TITLE, SHORT_DESCRIPTION, DESCRIPTION, AMOUNT, IS_USED, IS_ENABLED, EXPIRATION_DATE, SERIALIZED_RULES, IS_CUMULATIVE, IS_REMOVING_POSTAGE, MAX_USAGE, IS_AVAILABLE_ON_SPECIAL_OFFERS, CREATED_AT, UPDATED_AT, VERSION FROM coupon_version WHERE ID = :p0 AND VERSION = :p1';
|
||||
$sql = 'SELECT ID, CODE, TYPE, AMOUNT, IS_USED, IS_ENABLED, EXPIRATION_DATE, SERIALIZED_RULES, IS_CUMULATIVE, IS_REMOVING_POSTAGE, MAX_USAGE, IS_AVAILABLE_ON_SPECIAL_OFFERS, CREATED_AT, UPDATED_AT, VERSION FROM coupon_version WHERE ID = :p0 AND VERSION = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
@@ -397,93 +385,6 @@ abstract class CouponVersionQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CouponVersionTableMap::TYPE, $type, $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 ChildCouponVersionQuery 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(CouponVersionTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the short_description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByShortDescription('fooValue'); // WHERE short_description = 'fooValue'
|
||||
* $query->filterByShortDescription('%fooValue%'); // WHERE short_description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $shortDescription 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 ChildCouponVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByShortDescription($shortDescription = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($shortDescription)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $shortDescription)) {
|
||||
$shortDescription = str_replace('*', '%', $shortDescription);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CouponVersionTableMap::SHORT_DESCRIPTION, $shortDescription, $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 ChildCouponVersionQuery 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(CouponVersionTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the amount column
|
||||
*
|
||||
|
||||
@@ -2842,31 +2842,6 @@ abstract class Order implements ActiveRecordInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this Order is new, it will return
|
||||
* an empty collection; or if this Order has previously
|
||||
* been saved, it will retrieve related CouponOrders from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in Order.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return Collection|ChildCouponOrder[] List of ChildCouponOrder objects
|
||||
*/
|
||||
public function getCouponOrdersJoinCoupon($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildCouponOrderQuery::create(null, $criteria);
|
||||
$query->joinWith('Coupon', $joinBehavior);
|
||||
|
||||
return $this->getCouponOrders($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the current object and sets all attributes to their default values
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user