Merge branch 'master' of https://github.com/thelia/thelia into coupon
# By Manuel Raynaud (22) and others # Via Manuel Raynaud (7) and others * 'master' of https://github.com/thelia/thelia: (32 commits) refactor name for updating actions choose UPDATE word for name actions add update address action and create tests 404 not found management Working Fix unset namespace modify travis script test rewriting exception Fixed minor bug in Currencies Finished currency edition Added route methods address action implementation hot fix rewriting add address create controller and event Added AdminUtilities Smarty plugin, optimized templates update customer model createOrUpdate method update address model fix redirect process in viewListener refactor reset_install script refactor install process, database management in dedicated class ... Conflicts: local/config/schema.xml reset_install.sh
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user