update schema for customer
This commit is contained in:
@@ -71,6 +71,18 @@ abstract class Customer implements ActiveRecordInterface
|
||||
*/
|
||||
protected $ref;
|
||||
|
||||
/**
|
||||
* The value for the firstname field.
|
||||
* @var string
|
||||
*/
|
||||
protected $firstname;
|
||||
|
||||
/**
|
||||
* The value for the lastname field.
|
||||
* @var string
|
||||
*/
|
||||
protected $lastname;
|
||||
|
||||
/**
|
||||
* The value for the email field.
|
||||
* @var string
|
||||
@@ -433,6 +445,28 @@ abstract class Customer implements ActiveRecordInterface
|
||||
return $this->ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [firstname] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstname()
|
||||
{
|
||||
|
||||
return $this->firstname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [lastname] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastname()
|
||||
{
|
||||
|
||||
return $this->lastname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [email] column value.
|
||||
*
|
||||
@@ -592,6 +626,48 @@ abstract class Customer implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setRef()
|
||||
|
||||
/**
|
||||
* Set the value of [firstname] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\Customer The current object (for fluent API support)
|
||||
*/
|
||||
public function setFirstname($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->firstname !== $v) {
|
||||
$this->firstname = $v;
|
||||
$this->modifiedColumns[] = CustomerTableMap::FIRSTNAME;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setFirstname()
|
||||
|
||||
/**
|
||||
* Set the value of [lastname] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\Customer The current object (for fluent API support)
|
||||
*/
|
||||
public function setLastname($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->lastname !== $v) {
|
||||
$this->lastname = $v;
|
||||
$this->modifiedColumns[] = CustomerTableMap::LASTNAME;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setLastname()
|
||||
|
||||
/**
|
||||
* Set the value of [email] column.
|
||||
*
|
||||
@@ -824,34 +900,40 @@ abstract class Customer implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : CustomerTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->ref = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CustomerTableMap::translateFieldName('Email', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CustomerTableMap::translateFieldName('Firstname', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->firstname = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CustomerTableMap::translateFieldName('Lastname', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->lastname = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CustomerTableMap::translateFieldName('Email', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->email = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CustomerTableMap::translateFieldName('Password', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CustomerTableMap::translateFieldName('Password', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->password = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CustomerTableMap::translateFieldName('Algo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CustomerTableMap::translateFieldName('Algo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->algo = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CustomerTableMap::translateFieldName('Reseller', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CustomerTableMap::translateFieldName('Reseller', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->reseller = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CustomerTableMap::translateFieldName('Lang', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CustomerTableMap::translateFieldName('Lang', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->lang = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CustomerTableMap::translateFieldName('Sponsor', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CustomerTableMap::translateFieldName('Sponsor', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->sponsor = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CustomerTableMap::translateFieldName('Discount', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CustomerTableMap::translateFieldName('Discount', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->discount = (null !== $col) ? (double) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CustomerTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CustomerTableMap::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 ? 10 + $startcol : CustomerTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : CustomerTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -864,7 +946,7 @@ abstract class Customer implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 11; // 11 = CustomerTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 13; // 13 = CustomerTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\Customer object", 0, $e);
|
||||
@@ -1128,6 +1210,12 @@ abstract class Customer implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CustomerTableMap::REF)) {
|
||||
$modifiedColumns[':p' . $index++] = 'REF';
|
||||
}
|
||||
if ($this->isColumnModified(CustomerTableMap::FIRSTNAME)) {
|
||||
$modifiedColumns[':p' . $index++] = 'FIRSTNAME';
|
||||
}
|
||||
if ($this->isColumnModified(CustomerTableMap::LASTNAME)) {
|
||||
$modifiedColumns[':p' . $index++] = 'LASTNAME';
|
||||
}
|
||||
if ($this->isColumnModified(CustomerTableMap::EMAIL)) {
|
||||
$modifiedColumns[':p' . $index++] = 'EMAIL';
|
||||
}
|
||||
@@ -1172,6 +1260,12 @@ abstract class Customer implements ActiveRecordInterface
|
||||
case 'REF':
|
||||
$stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'FIRSTNAME':
|
||||
$stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'LASTNAME':
|
||||
$stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'EMAIL':
|
||||
$stmt->bindValue($identifier, $this->email, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1268,30 +1362,36 @@ abstract class Customer implements ActiveRecordInterface
|
||||
return $this->getRef();
|
||||
break;
|
||||
case 2:
|
||||
return $this->getEmail();
|
||||
return $this->getFirstname();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getPassword();
|
||||
return $this->getLastname();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getAlgo();
|
||||
return $this->getEmail();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getReseller();
|
||||
return $this->getPassword();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getLang();
|
||||
return $this->getAlgo();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getSponsor();
|
||||
return $this->getReseller();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getDiscount();
|
||||
return $this->getLang();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getCreatedAt();
|
||||
return $this->getSponsor();
|
||||
break;
|
||||
case 10:
|
||||
return $this->getDiscount();
|
||||
break;
|
||||
case 11:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 12:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1325,15 +1425,17 @@ abstract class Customer implements ActiveRecordInterface
|
||||
$result = array(
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getRef(),
|
||||
$keys[2] => $this->getEmail(),
|
||||
$keys[3] => $this->getPassword(),
|
||||
$keys[4] => $this->getAlgo(),
|
||||
$keys[5] => $this->getReseller(),
|
||||
$keys[6] => $this->getLang(),
|
||||
$keys[7] => $this->getSponsor(),
|
||||
$keys[8] => $this->getDiscount(),
|
||||
$keys[9] => $this->getCreatedAt(),
|
||||
$keys[10] => $this->getUpdatedAt(),
|
||||
$keys[2] => $this->getFirstname(),
|
||||
$keys[3] => $this->getLastname(),
|
||||
$keys[4] => $this->getEmail(),
|
||||
$keys[5] => $this->getPassword(),
|
||||
$keys[6] => $this->getAlgo(),
|
||||
$keys[7] => $this->getReseller(),
|
||||
$keys[8] => $this->getLang(),
|
||||
$keys[9] => $this->getSponsor(),
|
||||
$keys[10] => $this->getDiscount(),
|
||||
$keys[11] => $this->getCreatedAt(),
|
||||
$keys[12] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1389,30 +1491,36 @@ abstract class Customer implements ActiveRecordInterface
|
||||
$this->setRef($value);
|
||||
break;
|
||||
case 2:
|
||||
$this->setEmail($value);
|
||||
$this->setFirstname($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setPassword($value);
|
||||
$this->setLastname($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setAlgo($value);
|
||||
$this->setEmail($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setReseller($value);
|
||||
$this->setPassword($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setLang($value);
|
||||
$this->setAlgo($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setSponsor($value);
|
||||
$this->setReseller($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setDiscount($value);
|
||||
$this->setLang($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setCreatedAt($value);
|
||||
$this->setSponsor($value);
|
||||
break;
|
||||
case 10:
|
||||
$this->setDiscount($value);
|
||||
break;
|
||||
case 11:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 12:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1441,15 +1549,17 @@ abstract class Customer implements ActiveRecordInterface
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setRef($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setEmail($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setPassword($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setAlgo($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setReseller($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setLang($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setSponsor($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setDiscount($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setCreatedAt($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setUpdatedAt($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setFirstname($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setLastname($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setEmail($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setPassword($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setAlgo($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setReseller($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setLang($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setSponsor($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setDiscount($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setCreatedAt($arr[$keys[11]]);
|
||||
if (array_key_exists($keys[12], $arr)) $this->setUpdatedAt($arr[$keys[12]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1463,6 +1573,8 @@ abstract class Customer implements ActiveRecordInterface
|
||||
|
||||
if ($this->isColumnModified(CustomerTableMap::ID)) $criteria->add(CustomerTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(CustomerTableMap::REF)) $criteria->add(CustomerTableMap::REF, $this->ref);
|
||||
if ($this->isColumnModified(CustomerTableMap::FIRSTNAME)) $criteria->add(CustomerTableMap::FIRSTNAME, $this->firstname);
|
||||
if ($this->isColumnModified(CustomerTableMap::LASTNAME)) $criteria->add(CustomerTableMap::LASTNAME, $this->lastname);
|
||||
if ($this->isColumnModified(CustomerTableMap::EMAIL)) $criteria->add(CustomerTableMap::EMAIL, $this->email);
|
||||
if ($this->isColumnModified(CustomerTableMap::PASSWORD)) $criteria->add(CustomerTableMap::PASSWORD, $this->password);
|
||||
if ($this->isColumnModified(CustomerTableMap::ALGO)) $criteria->add(CustomerTableMap::ALGO, $this->algo);
|
||||
@@ -1536,6 +1648,8 @@ abstract class Customer implements ActiveRecordInterface
|
||||
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
|
||||
{
|
||||
$copyObj->setRef($this->getRef());
|
||||
$copyObj->setFirstname($this->getFirstname());
|
||||
$copyObj->setLastname($this->getLastname());
|
||||
$copyObj->setEmail($this->getEmail());
|
||||
$copyObj->setPassword($this->getPassword());
|
||||
$copyObj->setAlgo($this->getAlgo());
|
||||
@@ -2180,6 +2294,8 @@ abstract class Customer implements ActiveRecordInterface
|
||||
{
|
||||
$this->id = null;
|
||||
$this->ref = null;
|
||||
$this->firstname = null;
|
||||
$this->lastname = null;
|
||||
$this->email = null;
|
||||
$this->password = null;
|
||||
$this->algo = null;
|
||||
|
||||
@@ -23,6 +23,8 @@ use Thelia\Model\Map\CustomerTableMap;
|
||||
*
|
||||
* @method ChildCustomerQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCustomerQuery orderByRef($order = Criteria::ASC) Order by the ref column
|
||||
* @method ChildCustomerQuery orderByFirstname($order = Criteria::ASC) Order by the firstname column
|
||||
* @method ChildCustomerQuery orderByLastname($order = Criteria::ASC) Order by the lastname column
|
||||
* @method ChildCustomerQuery orderByEmail($order = Criteria::ASC) Order by the email column
|
||||
* @method ChildCustomerQuery orderByPassword($order = Criteria::ASC) Order by the password column
|
||||
* @method ChildCustomerQuery orderByAlgo($order = Criteria::ASC) Order by the algo column
|
||||
@@ -35,6 +37,8 @@ use Thelia\Model\Map\CustomerTableMap;
|
||||
*
|
||||
* @method ChildCustomerQuery groupById() Group by the id column
|
||||
* @method ChildCustomerQuery groupByRef() Group by the ref column
|
||||
* @method ChildCustomerQuery groupByFirstname() Group by the firstname column
|
||||
* @method ChildCustomerQuery groupByLastname() Group by the lastname column
|
||||
* @method ChildCustomerQuery groupByEmail() Group by the email column
|
||||
* @method ChildCustomerQuery groupByPassword() Group by the password column
|
||||
* @method ChildCustomerQuery groupByAlgo() Group by the algo column
|
||||
@@ -62,6 +66,8 @@ use Thelia\Model\Map\CustomerTableMap;
|
||||
*
|
||||
* @method ChildCustomer findOneById(int $id) Return the first ChildCustomer filtered by the id column
|
||||
* @method ChildCustomer findOneByRef(string $ref) Return the first ChildCustomer filtered by the ref column
|
||||
* @method ChildCustomer findOneByFirstname(string $firstname) Return the first ChildCustomer filtered by the firstname column
|
||||
* @method ChildCustomer findOneByLastname(string $lastname) Return the first ChildCustomer filtered by the lastname column
|
||||
* @method ChildCustomer findOneByEmail(string $email) Return the first ChildCustomer filtered by the email column
|
||||
* @method ChildCustomer findOneByPassword(string $password) Return the first ChildCustomer filtered by the password column
|
||||
* @method ChildCustomer findOneByAlgo(string $algo) Return the first ChildCustomer filtered by the algo column
|
||||
@@ -74,6 +80,8 @@ use Thelia\Model\Map\CustomerTableMap;
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCustomer objects filtered by the id column
|
||||
* @method array findByRef(string $ref) Return ChildCustomer objects filtered by the ref column
|
||||
* @method array findByFirstname(string $firstname) Return ChildCustomer objects filtered by the firstname column
|
||||
* @method array findByLastname(string $lastname) Return ChildCustomer objects filtered by the lastname column
|
||||
* @method array findByEmail(string $email) Return ChildCustomer objects filtered by the email column
|
||||
* @method array findByPassword(string $password) Return ChildCustomer objects filtered by the password column
|
||||
* @method array findByAlgo(string $algo) Return ChildCustomer objects filtered by the algo column
|
||||
@@ -171,7 +179,7 @@ abstract class CustomerQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, REF, EMAIL, PASSWORD, ALGO, RESELLER, LANG, SPONSOR, DISCOUNT, CREATED_AT, UPDATED_AT FROM customer WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, REF, FIRSTNAME, LASTNAME, EMAIL, PASSWORD, ALGO, RESELLER, LANG, SPONSOR, DISCOUNT, CREATED_AT, UPDATED_AT FROM customer WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -330,6 +338,64 @@ abstract class CustomerQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CustomerTableMap::REF, $ref, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the firstname column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFirstname('fooValue'); // WHERE firstname = 'fooValue'
|
||||
* $query->filterByFirstname('%fooValue%'); // WHERE firstname LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $firstname 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 ChildCustomerQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFirstname($firstname = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($firstname)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $firstname)) {
|
||||
$firstname = str_replace('*', '%', $firstname);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CustomerTableMap::FIRSTNAME, $firstname, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the lastname column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLastname('fooValue'); // WHERE lastname = 'fooValue'
|
||||
* $query->filterByLastname('%fooValue%'); // WHERE lastname LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $lastname 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 ChildCustomerQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLastname($lastname = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($lastname)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $lastname)) {
|
||||
$lastname = str_replace('*', '%', $lastname);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CustomerTableMap::LASTNAME, $lastname, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the email column
|
||||
*
|
||||
|
||||
@@ -57,7 +57,7 @@ class CustomerTableMap extends TableMap
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 11;
|
||||
const NUM_COLUMNS = 13;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
@@ -67,7 +67,7 @@ class CustomerTableMap extends TableMap
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 11;
|
||||
const NUM_HYDRATE_COLUMNS = 13;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
@@ -79,6 +79,16 @@ class CustomerTableMap extends TableMap
|
||||
*/
|
||||
const REF = 'customer.REF';
|
||||
|
||||
/**
|
||||
* the column name for the FIRSTNAME field
|
||||
*/
|
||||
const FIRSTNAME = 'customer.FIRSTNAME';
|
||||
|
||||
/**
|
||||
* the column name for the LASTNAME field
|
||||
*/
|
||||
const LASTNAME = 'customer.LASTNAME';
|
||||
|
||||
/**
|
||||
* the column name for the EMAIL field
|
||||
*/
|
||||
@@ -136,12 +146,12 @@ class CustomerTableMap extends TableMap
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Ref', 'Email', 'Password', 'Algo', 'Reseller', 'Lang', 'Sponsor', 'Discount', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'email', 'password', 'algo', 'reseller', 'lang', 'sponsor', 'discount', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(CustomerTableMap::ID, CustomerTableMap::REF, CustomerTableMap::EMAIL, CustomerTableMap::PASSWORD, CustomerTableMap::ALGO, CustomerTableMap::RESELLER, CustomerTableMap::LANG, CustomerTableMap::SPONSOR, CustomerTableMap::DISCOUNT, CustomerTableMap::CREATED_AT, CustomerTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'REF', 'EMAIL', 'PASSWORD', 'ALGO', 'RESELLER', 'LANG', 'SPONSOR', 'DISCOUNT', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'ref', 'email', 'password', 'algo', 'reseller', 'lang', 'sponsor', 'discount', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
|
||||
self::TYPE_PHPNAME => array('Id', 'Ref', 'Firstname', 'Lastname', 'Email', 'Password', 'Algo', 'Reseller', 'Lang', 'Sponsor', 'Discount', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'firstname', 'lastname', 'email', 'password', 'algo', 'reseller', 'lang', 'sponsor', 'discount', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(CustomerTableMap::ID, CustomerTableMap::REF, CustomerTableMap::FIRSTNAME, CustomerTableMap::LASTNAME, CustomerTableMap::EMAIL, CustomerTableMap::PASSWORD, CustomerTableMap::ALGO, CustomerTableMap::RESELLER, CustomerTableMap::LANG, CustomerTableMap::SPONSOR, CustomerTableMap::DISCOUNT, CustomerTableMap::CREATED_AT, CustomerTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'REF', 'FIRSTNAME', 'LASTNAME', 'EMAIL', 'PASSWORD', 'ALGO', 'RESELLER', 'LANG', 'SPONSOR', 'DISCOUNT', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'ref', 'firstname', 'lastname', 'email', 'password', 'algo', 'reseller', 'lang', 'sponsor', 'discount', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -151,12 +161,12 @@ class CustomerTableMap extends TableMap
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'Email' => 2, 'Password' => 3, 'Algo' => 4, 'Reseller' => 5, 'Lang' => 6, 'Sponsor' => 7, 'Discount' => 8, 'CreatedAt' => 9, 'UpdatedAt' => 10, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'email' => 2, 'password' => 3, 'algo' => 4, 'reseller' => 5, 'lang' => 6, 'sponsor' => 7, 'discount' => 8, 'createdAt' => 9, 'updatedAt' => 10, ),
|
||||
self::TYPE_COLNAME => array(CustomerTableMap::ID => 0, CustomerTableMap::REF => 1, CustomerTableMap::EMAIL => 2, CustomerTableMap::PASSWORD => 3, CustomerTableMap::ALGO => 4, CustomerTableMap::RESELLER => 5, CustomerTableMap::LANG => 6, CustomerTableMap::SPONSOR => 7, CustomerTableMap::DISCOUNT => 8, CustomerTableMap::CREATED_AT => 9, CustomerTableMap::UPDATED_AT => 10, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'EMAIL' => 2, 'PASSWORD' => 3, 'ALGO' => 4, 'RESELLER' => 5, 'LANG' => 6, 'SPONSOR' => 7, 'DISCOUNT' => 8, 'CREATED_AT' => 9, 'UPDATED_AT' => 10, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'email' => 2, 'password' => 3, 'algo' => 4, 'reseller' => 5, 'lang' => 6, 'sponsor' => 7, 'discount' => 8, 'created_at' => 9, 'updated_at' => 10, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'Firstname' => 2, 'Lastname' => 3, 'Email' => 4, 'Password' => 5, 'Algo' => 6, 'Reseller' => 7, 'Lang' => 8, 'Sponsor' => 9, 'Discount' => 10, 'CreatedAt' => 11, 'UpdatedAt' => 12, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'firstname' => 2, 'lastname' => 3, 'email' => 4, 'password' => 5, 'algo' => 6, 'reseller' => 7, 'lang' => 8, 'sponsor' => 9, 'discount' => 10, 'createdAt' => 11, 'updatedAt' => 12, ),
|
||||
self::TYPE_COLNAME => array(CustomerTableMap::ID => 0, CustomerTableMap::REF => 1, CustomerTableMap::FIRSTNAME => 2, CustomerTableMap::LASTNAME => 3, CustomerTableMap::EMAIL => 4, CustomerTableMap::PASSWORD => 5, CustomerTableMap::ALGO => 6, CustomerTableMap::RESELLER => 7, CustomerTableMap::LANG => 8, CustomerTableMap::SPONSOR => 9, CustomerTableMap::DISCOUNT => 10, CustomerTableMap::CREATED_AT => 11, CustomerTableMap::UPDATED_AT => 12, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'FIRSTNAME' => 2, 'LASTNAME' => 3, 'EMAIL' => 4, 'PASSWORD' => 5, 'ALGO' => 6, 'RESELLER' => 7, 'LANG' => 8, 'SPONSOR' => 9, 'DISCOUNT' => 10, 'CREATED_AT' => 11, 'UPDATED_AT' => 12, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'firstname' => 2, 'lastname' => 3, 'email' => 4, 'password' => 5, 'algo' => 6, 'reseller' => 7, 'lang' => 8, 'sponsor' => 9, 'discount' => 10, 'created_at' => 11, 'updated_at' => 12, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -177,6 +187,8 @@ class CustomerTableMap extends TableMap
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addColumn('REF', 'Ref', 'VARCHAR', true, 50, null);
|
||||
$this->addColumn('FIRSTNAME', 'Firstname', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('LASTNAME', 'Lastname', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('EMAIL', 'Email', 'VARCHAR', false, 50, null);
|
||||
$this->addColumn('PASSWORD', 'Password', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('ALGO', 'Algo', 'VARCHAR', false, 128, null);
|
||||
@@ -360,6 +372,8 @@ class CustomerTableMap extends TableMap
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(CustomerTableMap::ID);
|
||||
$criteria->addSelectColumn(CustomerTableMap::REF);
|
||||
$criteria->addSelectColumn(CustomerTableMap::FIRSTNAME);
|
||||
$criteria->addSelectColumn(CustomerTableMap::LASTNAME);
|
||||
$criteria->addSelectColumn(CustomerTableMap::EMAIL);
|
||||
$criteria->addSelectColumn(CustomerTableMap::PASSWORD);
|
||||
$criteria->addSelectColumn(CustomerTableMap::ALGO);
|
||||
@@ -372,6 +386,8 @@ class CustomerTableMap extends TableMap
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.REF');
|
||||
$criteria->addSelectColumn($alias . '.FIRSTNAME');
|
||||
$criteria->addSelectColumn($alias . '.LASTNAME');
|
||||
$criteria->addSelectColumn($alias . '.EMAIL');
|
||||
$criteria->addSelectColumn($alias . '.PASSWORD');
|
||||
$criteria->addSelectColumn($alias . '.ALGO');
|
||||
|
||||
@@ -453,6 +453,8 @@ CREATE TABLE `customer`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`ref` VARCHAR(50) NOT NULL,
|
||||
`firstname` VARCHAR(255) NOT NULL,
|
||||
`lastname` VARCHAR(255) NOT NULL,
|
||||
`email` VARCHAR(50),
|
||||
`password` VARCHAR(255),
|
||||
`algo` VARCHAR(128),
|
||||
|
||||
@@ -329,6 +329,8 @@
|
||||
<table name="customer" namespace="Thelia\Model">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="ref" required="true" size="50" type="VARCHAR" />
|
||||
<column name="firstname" required="true" size="255" type="VARCHAR" />
|
||||
<column name="lastname" required="true" size="255" type="VARCHAR" />
|
||||
<column name="email" size="50" type="VARCHAR" />
|
||||
<column name="password" size="255" type="VARCHAR" />
|
||||
<column name="algo" size="128" type="VARCHAR" />
|
||||
|
||||
Reference in New Issue
Block a user