change customer model

This commit is contained in:
Manuel Raynaud
2013-07-12 16:23:06 +02:00
parent 3857827b98
commit dc22d5bf59
11 changed files with 322 additions and 1954 deletions

View File

@@ -142,6 +142,19 @@ abstract class Address implements ActiveRecordInterface
*/ */
protected $phone; protected $phone;
/**
* The value for the cellphone field.
* @var string
*/
protected $cellphone;
/**
* The value for the default field.
* Note: this column has a database default value of: 0
* @var int
*/
protected $default;
/** /**
* The value for the created_at field. * The value for the created_at field.
* @var string * @var string
@@ -172,11 +185,24 @@ abstract class Address implements ActiveRecordInterface
*/ */
protected $alreadyInSave = false; protected $alreadyInSave = false;
/**
* Applies default values to this object.
* This method should be called from the object's constructor (or
* equivalent initialization method).
* @see __construct()
*/
public function applyDefaultValues()
{
$this->default = 0;
}
/** /**
* Initializes internal state of Thelia\Model\Base\Address object. * Initializes internal state of Thelia\Model\Base\Address object.
* @see applyDefaults()
*/ */
public function __construct() public function __construct()
{ {
$this->applyDefaultValues();
} }
/** /**
@@ -580,6 +606,28 @@ abstract class Address implements ActiveRecordInterface
return $this->phone; return $this->phone;
} }
/**
* Get the [cellphone] column value.
*
* @return string
*/
public function getCellphone()
{
return $this->cellphone;
}
/**
* Get the [default] column value.
*
* @return int
*/
public function getDefault()
{
return $this->default;
}
/** /**
* Get the [optionally formatted] temporal [created_at] column value. * Get the [optionally formatted] temporal [created_at] column value.
* *
@@ -922,6 +970,48 @@ abstract class Address implements ActiveRecordInterface
return $this; return $this;
} // setPhone() } // setPhone()
/**
* Set the value of [cellphone] column.
*
* @param string $v new value
* @return \Thelia\Model\Address The current object (for fluent API support)
*/
public function setCellphone($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->cellphone !== $v) {
$this->cellphone = $v;
$this->modifiedColumns[] = AddressTableMap::CELLPHONE;
}
return $this;
} // setCellphone()
/**
* Set the value of [default] column.
*
* @param int $v new value
* @return \Thelia\Model\Address The current object (for fluent API support)
*/
public function setDefault($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->default !== $v) {
$this->default = $v;
$this->modifiedColumns[] = AddressTableMap::DEFAULT;
}
return $this;
} // setDefault()
/** /**
* Sets the value of [created_at] column to a normalized version of the date/time value specified. * Sets the value of [created_at] column to a normalized version of the date/time value specified.
* *
@@ -974,6 +1064,10 @@ abstract class Address implements ActiveRecordInterface
*/ */
public function hasOnlyDefaultValues() public function hasOnlyDefaultValues()
{ {
if ($this->default !== 0) {
return false;
}
// otherwise, everything was equal, so return TRUE // otherwise, everything was equal, so return TRUE
return true; return true;
} // hasOnlyDefaultValues() } // hasOnlyDefaultValues()
@@ -1043,13 +1137,19 @@ abstract class Address implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : AddressTableMap::translateFieldName('Phone', TableMap::TYPE_PHPNAME, $indexType)]; $col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : AddressTableMap::translateFieldName('Phone', TableMap::TYPE_PHPNAME, $indexType)];
$this->phone = (null !== $col) ? (string) $col : null; $this->phone = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : AddressTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; $col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : AddressTableMap::translateFieldName('Cellphone', TableMap::TYPE_PHPNAME, $indexType)];
$this->cellphone = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : AddressTableMap::translateFieldName('Default', TableMap::TYPE_PHPNAME, $indexType)];
$this->default = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : AddressTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') { if ($col === '0000-00-00 00:00:00') {
$col = null; $col = null;
} }
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : AddressTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; $col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : AddressTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') { if ($col === '0000-00-00 00:00:00') {
$col = null; $col = null;
} }
@@ -1062,7 +1162,7 @@ abstract class Address implements ActiveRecordInterface
$this->ensureConsistency(); $this->ensureConsistency();
} }
return $startcol + 16; // 16 = AddressTableMap::NUM_HYDRATE_COLUMNS. return $startcol + 18; // 18 = AddressTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\Address object", 0, $e); throw new PropelException("Error populating \Thelia\Model\Address object", 0, $e);
@@ -1351,6 +1451,12 @@ abstract class Address implements ActiveRecordInterface
if ($this->isColumnModified(AddressTableMap::PHONE)) { if ($this->isColumnModified(AddressTableMap::PHONE)) {
$modifiedColumns[':p' . $index++] = 'PHONE'; $modifiedColumns[':p' . $index++] = 'PHONE';
} }
if ($this->isColumnModified(AddressTableMap::CELLPHONE)) {
$modifiedColumns[':p' . $index++] = 'CELLPHONE';
}
if ($this->isColumnModified(AddressTableMap::DEFAULT)) {
$modifiedColumns[':p' . $index++] = 'DEFAULT';
}
if ($this->isColumnModified(AddressTableMap::CREATED_AT)) { if ($this->isColumnModified(AddressTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = 'CREATED_AT';
} }
@@ -1410,6 +1516,12 @@ abstract class Address implements ActiveRecordInterface
case 'PHONE': case 'PHONE':
$stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR);
break; break;
case 'CELLPHONE':
$stmt->bindValue($identifier, $this->cellphone, PDO::PARAM_STR);
break;
case 'DEFAULT':
$stmt->bindValue($identifier, $this->default, PDO::PARAM_INT);
break;
case 'CREATED_AT': case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
@@ -1521,9 +1633,15 @@ abstract class Address implements ActiveRecordInterface
return $this->getPhone(); return $this->getPhone();
break; break;
case 14: case 14:
return $this->getCreatedAt(); return $this->getCellphone();
break; break;
case 15: case 15:
return $this->getDefault();
break;
case 16:
return $this->getCreatedAt();
break;
case 17:
return $this->getUpdatedAt(); return $this->getUpdatedAt();
break; break;
default: default:
@@ -1569,8 +1687,10 @@ abstract class Address implements ActiveRecordInterface
$keys[11] => $this->getCity(), $keys[11] => $this->getCity(),
$keys[12] => $this->getCountryId(), $keys[12] => $this->getCountryId(),
$keys[13] => $this->getPhone(), $keys[13] => $this->getPhone(),
$keys[14] => $this->getCreatedAt(), $keys[14] => $this->getCellphone(),
$keys[15] => $this->getUpdatedAt(), $keys[15] => $this->getDefault(),
$keys[16] => $this->getCreatedAt(),
$keys[17] => $this->getUpdatedAt(),
); );
$virtualColumns = $this->virtualColumns; $virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn) foreach($virtualColumns as $key => $virtualColumn)
@@ -1662,9 +1782,15 @@ abstract class Address implements ActiveRecordInterface
$this->setPhone($value); $this->setPhone($value);
break; break;
case 14: case 14:
$this->setCreatedAt($value); $this->setCellphone($value);
break; break;
case 15: case 15:
$this->setDefault($value);
break;
case 16:
$this->setCreatedAt($value);
break;
case 17:
$this->setUpdatedAt($value); $this->setUpdatedAt($value);
break; break;
} // switch() } // switch()
@@ -1705,8 +1831,10 @@ abstract class Address implements ActiveRecordInterface
if (array_key_exists($keys[11], $arr)) $this->setCity($arr[$keys[11]]); if (array_key_exists($keys[11], $arr)) $this->setCity($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setCountryId($arr[$keys[12]]); if (array_key_exists($keys[12], $arr)) $this->setCountryId($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setPhone($arr[$keys[13]]); if (array_key_exists($keys[13], $arr)) $this->setPhone($arr[$keys[13]]);
if (array_key_exists($keys[14], $arr)) $this->setCreatedAt($arr[$keys[14]]); if (array_key_exists($keys[14], $arr)) $this->setCellphone($arr[$keys[14]]);
if (array_key_exists($keys[15], $arr)) $this->setUpdatedAt($arr[$keys[15]]); if (array_key_exists($keys[15], $arr)) $this->setDefault($arr[$keys[15]]);
if (array_key_exists($keys[16], $arr)) $this->setCreatedAt($arr[$keys[16]]);
if (array_key_exists($keys[17], $arr)) $this->setUpdatedAt($arr[$keys[17]]);
} }
/** /**
@@ -1732,6 +1860,8 @@ abstract class Address implements ActiveRecordInterface
if ($this->isColumnModified(AddressTableMap::CITY)) $criteria->add(AddressTableMap::CITY, $this->city); if ($this->isColumnModified(AddressTableMap::CITY)) $criteria->add(AddressTableMap::CITY, $this->city);
if ($this->isColumnModified(AddressTableMap::COUNTRY_ID)) $criteria->add(AddressTableMap::COUNTRY_ID, $this->country_id); if ($this->isColumnModified(AddressTableMap::COUNTRY_ID)) $criteria->add(AddressTableMap::COUNTRY_ID, $this->country_id);
if ($this->isColumnModified(AddressTableMap::PHONE)) $criteria->add(AddressTableMap::PHONE, $this->phone); if ($this->isColumnModified(AddressTableMap::PHONE)) $criteria->add(AddressTableMap::PHONE, $this->phone);
if ($this->isColumnModified(AddressTableMap::CELLPHONE)) $criteria->add(AddressTableMap::CELLPHONE, $this->cellphone);
if ($this->isColumnModified(AddressTableMap::DEFAULT)) $criteria->add(AddressTableMap::DEFAULT, $this->default);
if ($this->isColumnModified(AddressTableMap::CREATED_AT)) $criteria->add(AddressTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(AddressTableMap::CREATED_AT)) $criteria->add(AddressTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(AddressTableMap::UPDATED_AT)) $criteria->add(AddressTableMap::UPDATED_AT, $this->updated_at); if ($this->isColumnModified(AddressTableMap::UPDATED_AT)) $criteria->add(AddressTableMap::UPDATED_AT, $this->updated_at);
@@ -1810,6 +1940,8 @@ abstract class Address implements ActiveRecordInterface
$copyObj->setCity($this->getCity()); $copyObj->setCity($this->getCity());
$copyObj->setCountryId($this->getCountryId()); $copyObj->setCountryId($this->getCountryId());
$copyObj->setPhone($this->getPhone()); $copyObj->setPhone($this->getPhone());
$copyObj->setCellphone($this->getCellphone());
$copyObj->setDefault($this->getDefault());
$copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) { if ($makeNew) {
@@ -1961,10 +2093,13 @@ abstract class Address implements ActiveRecordInterface
$this->city = null; $this->city = null;
$this->country_id = null; $this->country_id = null;
$this->phone = null; $this->phone = null;
$this->cellphone = null;
$this->default = null;
$this->created_at = null; $this->created_at = null;
$this->updated_at = null; $this->updated_at = null;
$this->alreadyInSave = false; $this->alreadyInSave = false;
$this->clearAllReferences(); $this->clearAllReferences();
$this->applyDefaultValues();
$this->resetModified(); $this->resetModified();
$this->setNew(true); $this->setNew(true);
$this->setDeleted(false); $this->setDeleted(false);

View File

@@ -35,6 +35,8 @@ use Thelia\Model\Map\AddressTableMap;
* @method ChildAddressQuery orderByCity($order = Criteria::ASC) Order by the city column * @method ChildAddressQuery orderByCity($order = Criteria::ASC) Order by the city column
* @method ChildAddressQuery orderByCountryId($order = Criteria::ASC) Order by the country_id column * @method ChildAddressQuery orderByCountryId($order = Criteria::ASC) Order by the country_id column
* @method ChildAddressQuery orderByPhone($order = Criteria::ASC) Order by the phone column * @method ChildAddressQuery orderByPhone($order = Criteria::ASC) Order by the phone column
* @method ChildAddressQuery orderByCellphone($order = Criteria::ASC) Order by the cellphone column
* @method ChildAddressQuery orderByDefault($order = Criteria::ASC) Order by the default column
* @method ChildAddressQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildAddressQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAddressQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * @method ChildAddressQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
* *
@@ -52,6 +54,8 @@ use Thelia\Model\Map\AddressTableMap;
* @method ChildAddressQuery groupByCity() Group by the city column * @method ChildAddressQuery groupByCity() Group by the city column
* @method ChildAddressQuery groupByCountryId() Group by the country_id column * @method ChildAddressQuery groupByCountryId() Group by the country_id column
* @method ChildAddressQuery groupByPhone() Group by the phone column * @method ChildAddressQuery groupByPhone() Group by the phone column
* @method ChildAddressQuery groupByCellphone() Group by the cellphone column
* @method ChildAddressQuery groupByDefault() Group by the default column
* @method ChildAddressQuery groupByCreatedAt() Group by the created_at column * @method ChildAddressQuery groupByCreatedAt() Group by the created_at column
* @method ChildAddressQuery groupByUpdatedAt() Group by the updated_at column * @method ChildAddressQuery groupByUpdatedAt() Group by the updated_at column
* *
@@ -84,6 +88,8 @@ use Thelia\Model\Map\AddressTableMap;
* @method ChildAddress findOneByCity(string $city) Return the first ChildAddress filtered by the city column * @method ChildAddress findOneByCity(string $city) Return the first ChildAddress filtered by the city column
* @method ChildAddress findOneByCountryId(int $country_id) Return the first ChildAddress filtered by the country_id column * @method ChildAddress findOneByCountryId(int $country_id) Return the first ChildAddress filtered by the country_id column
* @method ChildAddress findOneByPhone(string $phone) Return the first ChildAddress filtered by the phone column * @method ChildAddress findOneByPhone(string $phone) Return the first ChildAddress filtered by the phone column
* @method ChildAddress findOneByCellphone(string $cellphone) Return the first ChildAddress filtered by the cellphone column
* @method ChildAddress findOneByDefault(int $default) Return the first ChildAddress filtered by the default column
* @method ChildAddress findOneByCreatedAt(string $created_at) Return the first ChildAddress filtered by the created_at column * @method ChildAddress findOneByCreatedAt(string $created_at) Return the first ChildAddress filtered by the created_at column
* @method ChildAddress findOneByUpdatedAt(string $updated_at) Return the first ChildAddress filtered by the updated_at column * @method ChildAddress findOneByUpdatedAt(string $updated_at) Return the first ChildAddress filtered by the updated_at column
* *
@@ -101,6 +107,8 @@ use Thelia\Model\Map\AddressTableMap;
* @method array findByCity(string $city) Return ChildAddress objects filtered by the city column * @method array findByCity(string $city) Return ChildAddress objects filtered by the city column
* @method array findByCountryId(int $country_id) Return ChildAddress objects filtered by the country_id column * @method array findByCountryId(int $country_id) Return ChildAddress objects filtered by the country_id column
* @method array findByPhone(string $phone) Return ChildAddress objects filtered by the phone column * @method array findByPhone(string $phone) Return ChildAddress objects filtered by the phone column
* @method array findByCellphone(string $cellphone) Return ChildAddress objects filtered by the cellphone column
* @method array findByDefault(int $default) Return ChildAddress objects filtered by the default column
* @method array findByCreatedAt(string $created_at) Return ChildAddress objects filtered by the created_at column * @method array findByCreatedAt(string $created_at) Return ChildAddress objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAddress objects filtered by the updated_at column * @method array findByUpdatedAt(string $updated_at) Return ChildAddress objects filtered by the updated_at column
* *
@@ -191,7 +199,7 @@ abstract class AddressQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, TITLE, CUSTOMER_ID, CUSTOMER_TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, PHONE, CREATED_AT, UPDATED_AT FROM address WHERE ID = :p0'; $sql = 'SELECT ID, TITLE, CUSTOMER_ID, CUSTOMER_TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, PHONE, CELLPHONE, DEFAULT, CREATED_AT, UPDATED_AT FROM address WHERE ID = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -738,6 +746,76 @@ abstract class AddressQuery extends ModelCriteria
return $this->addUsingAlias(AddressTableMap::PHONE, $phone, $comparison); return $this->addUsingAlias(AddressTableMap::PHONE, $phone, $comparison);
} }
/**
* Filter the query on the cellphone column
*
* Example usage:
* <code>
* $query->filterByCellphone('fooValue'); // WHERE cellphone = 'fooValue'
* $query->filterByCellphone('%fooValue%'); // WHERE cellphone LIKE '%fooValue%'
* </code>
*
* @param string $cellphone 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 filterByCellphone($cellphone = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($cellphone)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $cellphone)) {
$cellphone = str_replace('*', '%', $cellphone);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AddressTableMap::CELLPHONE, $cellphone, $comparison);
}
/**
* Filter the query on the default column
*
* Example usage:
* <code>
* $query->filterByDefault(1234); // WHERE default = 1234
* $query->filterByDefault(array(12, 34)); // WHERE default IN (12, 34)
* $query->filterByDefault(array('min' => 12)); // WHERE default > 12
* </code>
*
* @param mixed $default The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAddressQuery The current query, for fluid interface
*/
public function filterByDefault($default = null, $comparison = null)
{
if (is_array($default)) {
$useMinMax = false;
if (isset($default['min'])) {
$this->addUsingAlias(AddressTableMap::DEFAULT, $default['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($default['max'])) {
$this->addUsingAlias(AddressTableMap::DEFAULT, $default['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AddressTableMap::DEFAULT, $default, $comparison);
}
/** /**
* Filter the query on the created_at column * Filter the query on the created_at column
* *

File diff suppressed because it is too large Load Diff

View File

@@ -23,22 +23,9 @@ use Thelia\Model\Map\CustomerTableMap;
* *
* @method ChildCustomerQuery orderById($order = Criteria::ASC) Order by the id column * @method ChildCustomerQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCustomerQuery orderByRef($order = Criteria::ASC) Order by the ref column * @method ChildCustomerQuery orderByRef($order = Criteria::ASC) Order by the ref column
* @method ChildCustomerQuery orderByCustomerTitleId($order = Criteria::ASC) Order by the customer_title_id column
* @method ChildCustomerQuery orderByCompany($order = Criteria::ASC) Order by the company 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 orderByAddress1($order = Criteria::ASC) Order by the address1 column
* @method ChildCustomerQuery orderByAddress2($order = Criteria::ASC) Order by the address2 column
* @method ChildCustomerQuery orderByAddress3($order = Criteria::ASC) Order by the address3 column
* @method ChildCustomerQuery orderByZipcode($order = Criteria::ASC) Order by the zipcode column
* @method ChildCustomerQuery orderByCity($order = Criteria::ASC) Order by the city column
* @method ChildCustomerQuery orderByCountryId($order = Criteria::ASC) Order by the country_id column
* @method ChildCustomerQuery orderByPhone($order = Criteria::ASC) Order by the phone column
* @method ChildCustomerQuery orderByCellphone($order = Criteria::ASC) Order by the cellphone column
* @method ChildCustomerQuery orderByEmail($order = Criteria::ASC) Order by the email 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 orderByPassword($order = Criteria::ASC) Order by the password column
* @method ChildCustomerQuery orderByAlgo($order = Criteria::ASC) Order by the algo column * @method ChildCustomerQuery orderByAlgo($order = Criteria::ASC) Order by the algo column
* @method ChildCustomerQuery orderBySalt($order = Criteria::ASC) Order by the salt column
* @method ChildCustomerQuery orderByReseller($order = Criteria::ASC) Order by the reseller column * @method ChildCustomerQuery orderByReseller($order = Criteria::ASC) Order by the reseller column
* @method ChildCustomerQuery orderByLang($order = Criteria::ASC) Order by the lang column * @method ChildCustomerQuery orderByLang($order = Criteria::ASC) Order by the lang column
* @method ChildCustomerQuery orderBySponsor($order = Criteria::ASC) Order by the sponsor column * @method ChildCustomerQuery orderBySponsor($order = Criteria::ASC) Order by the sponsor column
@@ -48,22 +35,9 @@ use Thelia\Model\Map\CustomerTableMap;
* *
* @method ChildCustomerQuery groupById() Group by the id column * @method ChildCustomerQuery groupById() Group by the id column
* @method ChildCustomerQuery groupByRef() Group by the ref column * @method ChildCustomerQuery groupByRef() Group by the ref column
* @method ChildCustomerQuery groupByCustomerTitleId() Group by the customer_title_id column
* @method ChildCustomerQuery groupByCompany() Group by the company column
* @method ChildCustomerQuery groupByFirstname() Group by the firstname column
* @method ChildCustomerQuery groupByLastname() Group by the lastname column
* @method ChildCustomerQuery groupByAddress1() Group by the address1 column
* @method ChildCustomerQuery groupByAddress2() Group by the address2 column
* @method ChildCustomerQuery groupByAddress3() Group by the address3 column
* @method ChildCustomerQuery groupByZipcode() Group by the zipcode column
* @method ChildCustomerQuery groupByCity() Group by the city column
* @method ChildCustomerQuery groupByCountryId() Group by the country_id column
* @method ChildCustomerQuery groupByPhone() Group by the phone column
* @method ChildCustomerQuery groupByCellphone() Group by the cellphone column
* @method ChildCustomerQuery groupByEmail() Group by the email column * @method ChildCustomerQuery groupByEmail() Group by the email column
* @method ChildCustomerQuery groupByPassword() Group by the password column * @method ChildCustomerQuery groupByPassword() Group by the password column
* @method ChildCustomerQuery groupByAlgo() Group by the algo column * @method ChildCustomerQuery groupByAlgo() Group by the algo column
* @method ChildCustomerQuery groupBySalt() Group by the salt column
* @method ChildCustomerQuery groupByReseller() Group by the reseller column * @method ChildCustomerQuery groupByReseller() Group by the reseller column
* @method ChildCustomerQuery groupByLang() Group by the lang column * @method ChildCustomerQuery groupByLang() Group by the lang column
* @method ChildCustomerQuery groupBySponsor() Group by the sponsor column * @method ChildCustomerQuery groupBySponsor() Group by the sponsor column
@@ -75,10 +49,6 @@ use Thelia\Model\Map\CustomerTableMap;
* @method ChildCustomerQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method ChildCustomerQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCustomerQuery innerJoin($relation) Adds a INNER JOIN clause to the query * @method ChildCustomerQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* *
* @method ChildCustomerQuery leftJoinCustomerTitle($relationAlias = null) Adds a LEFT JOIN clause to the query using the CustomerTitle relation
* @method ChildCustomerQuery rightJoinCustomerTitle($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CustomerTitle relation
* @method ChildCustomerQuery innerJoinCustomerTitle($relationAlias = null) Adds a INNER JOIN clause to the query using the CustomerTitle relation
*
* @method ChildCustomerQuery leftJoinAddress($relationAlias = null) Adds a LEFT JOIN clause to the query using the Address relation * @method ChildCustomerQuery leftJoinAddress($relationAlias = null) Adds a LEFT JOIN clause to the query using the Address relation
* @method ChildCustomerQuery rightJoinAddress($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Address relation * @method ChildCustomerQuery rightJoinAddress($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Address relation
* @method ChildCustomerQuery innerJoinAddress($relationAlias = null) Adds a INNER JOIN clause to the query using the Address relation * @method ChildCustomerQuery innerJoinAddress($relationAlias = null) Adds a INNER JOIN clause to the query using the Address relation
@@ -92,22 +62,9 @@ use Thelia\Model\Map\CustomerTableMap;
* *
* @method ChildCustomer findOneById(int $id) Return the first ChildCustomer filtered by the id column * @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 findOneByRef(string $ref) Return the first ChildCustomer filtered by the ref column
* @method ChildCustomer findOneByCustomerTitleId(int $customer_title_id) Return the first ChildCustomer filtered by the customer_title_id column
* @method ChildCustomer findOneByCompany(string $company) Return the first ChildCustomer filtered by the company 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 findOneByAddress1(string $address1) Return the first ChildCustomer filtered by the address1 column
* @method ChildCustomer findOneByAddress2(string $address2) Return the first ChildCustomer filtered by the address2 column
* @method ChildCustomer findOneByAddress3(string $address3) Return the first ChildCustomer filtered by the address3 column
* @method ChildCustomer findOneByZipcode(string $zipcode) Return the first ChildCustomer filtered by the zipcode column
* @method ChildCustomer findOneByCity(string $city) Return the first ChildCustomer filtered by the city column
* @method ChildCustomer findOneByCountryId(int $country_id) Return the first ChildCustomer filtered by the country_id column
* @method ChildCustomer findOneByPhone(string $phone) Return the first ChildCustomer filtered by the phone column
* @method ChildCustomer findOneByCellphone(string $cellphone) Return the first ChildCustomer filtered by the cellphone column
* @method ChildCustomer findOneByEmail(string $email) Return the first ChildCustomer filtered by the email 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 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 * @method ChildCustomer findOneByAlgo(string $algo) Return the first ChildCustomer filtered by the algo column
* @method ChildCustomer findOneBySalt(string $salt) Return the first ChildCustomer filtered by the salt column
* @method ChildCustomer findOneByReseller(int $reseller) Return the first ChildCustomer filtered by the reseller column * @method ChildCustomer findOneByReseller(int $reseller) Return the first ChildCustomer filtered by the reseller column
* @method ChildCustomer findOneByLang(string $lang) Return the first ChildCustomer filtered by the lang column * @method ChildCustomer findOneByLang(string $lang) Return the first ChildCustomer filtered by the lang column
* @method ChildCustomer findOneBySponsor(string $sponsor) Return the first ChildCustomer filtered by the sponsor column * @method ChildCustomer findOneBySponsor(string $sponsor) Return the first ChildCustomer filtered by the sponsor column
@@ -117,22 +74,9 @@ use Thelia\Model\Map\CustomerTableMap;
* *
* @method array findById(int $id) Return ChildCustomer objects filtered by the id column * @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 findByRef(string $ref) Return ChildCustomer objects filtered by the ref column
* @method array findByCustomerTitleId(int $customer_title_id) Return ChildCustomer objects filtered by the customer_title_id column
* @method array findByCompany(string $company) Return ChildCustomer objects filtered by the company 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 findByAddress1(string $address1) Return ChildCustomer objects filtered by the address1 column
* @method array findByAddress2(string $address2) Return ChildCustomer objects filtered by the address2 column
* @method array findByAddress3(string $address3) Return ChildCustomer objects filtered by the address3 column
* @method array findByZipcode(string $zipcode) Return ChildCustomer objects filtered by the zipcode column
* @method array findByCity(string $city) Return ChildCustomer objects filtered by the city column
* @method array findByCountryId(int $country_id) Return ChildCustomer objects filtered by the country_id column
* @method array findByPhone(string $phone) Return ChildCustomer objects filtered by the phone column
* @method array findByCellphone(string $cellphone) Return ChildCustomer objects filtered by the cellphone column
* @method array findByEmail(string $email) Return ChildCustomer objects filtered by the email 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 findByPassword(string $password) Return ChildCustomer objects filtered by the password column
* @method array findByAlgo(string $algo) Return ChildCustomer objects filtered by the algo column * @method array findByAlgo(string $algo) Return ChildCustomer objects filtered by the algo column
* @method array findBySalt(string $salt) Return ChildCustomer objects filtered by the salt column
* @method array findByReseller(int $reseller) Return ChildCustomer objects filtered by the reseller column * @method array findByReseller(int $reseller) Return ChildCustomer objects filtered by the reseller column
* @method array findByLang(string $lang) Return ChildCustomer objects filtered by the lang column * @method array findByLang(string $lang) Return ChildCustomer objects filtered by the lang column
* @method array findBySponsor(string $sponsor) Return ChildCustomer objects filtered by the sponsor column * @method array findBySponsor(string $sponsor) Return ChildCustomer objects filtered by the sponsor column
@@ -227,7 +171,7 @@ abstract class CustomerQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, REF, CUSTOMER_TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, PHONE, CELLPHONE, EMAIL, PASSWORD, ALGO, SALT, RESELLER, LANG, SPONSOR, DISCOUNT, CREATED_AT, UPDATED_AT FROM customer WHERE ID = :p0'; $sql = 'SELECT ID, REF, EMAIL, PASSWORD, ALGO, RESELLER, LANG, SPONSOR, DISCOUNT, CREATED_AT, UPDATED_AT FROM customer WHERE ID = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -386,380 +330,6 @@ abstract class CustomerQuery extends ModelCriteria
return $this->addUsingAlias(CustomerTableMap::REF, $ref, $comparison); return $this->addUsingAlias(CustomerTableMap::REF, $ref, $comparison);
} }
/**
* Filter the query on the customer_title_id column
*
* Example usage:
* <code>
* $query->filterByCustomerTitleId(1234); // WHERE customer_title_id = 1234
* $query->filterByCustomerTitleId(array(12, 34)); // WHERE customer_title_id IN (12, 34)
* $query->filterByCustomerTitleId(array('min' => 12)); // WHERE customer_title_id > 12
* </code>
*
* @see filterByCustomerTitle()
*
* @param mixed $customerTitleId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCustomerQuery The current query, for fluid interface
*/
public function filterByCustomerTitleId($customerTitleId = null, $comparison = null)
{
if (is_array($customerTitleId)) {
$useMinMax = false;
if (isset($customerTitleId['min'])) {
$this->addUsingAlias(CustomerTableMap::CUSTOMER_TITLE_ID, $customerTitleId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($customerTitleId['max'])) {
$this->addUsingAlias(CustomerTableMap::CUSTOMER_TITLE_ID, $customerTitleId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CustomerTableMap::CUSTOMER_TITLE_ID, $customerTitleId, $comparison);
}
/**
* Filter the query on the company column
*
* Example usage:
* <code>
* $query->filterByCompany('fooValue'); // WHERE company = 'fooValue'
* $query->filterByCompany('%fooValue%'); // WHERE company LIKE '%fooValue%'
* </code>
*
* @param string $company 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 filterByCompany($company = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($company)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $company)) {
$company = str_replace('*', '%', $company);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTableMap::COMPANY, $company, $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 address1 column
*
* Example usage:
* <code>
* $query->filterByAddress1('fooValue'); // WHERE address1 = 'fooValue'
* $query->filterByAddress1('%fooValue%'); // WHERE address1 LIKE '%fooValue%'
* </code>
*
* @param string $address1 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 filterByAddress1($address1 = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($address1)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $address1)) {
$address1 = str_replace('*', '%', $address1);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTableMap::ADDRESS1, $address1, $comparison);
}
/**
* Filter the query on the address2 column
*
* Example usage:
* <code>
* $query->filterByAddress2('fooValue'); // WHERE address2 = 'fooValue'
* $query->filterByAddress2('%fooValue%'); // WHERE address2 LIKE '%fooValue%'
* </code>
*
* @param string $address2 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 filterByAddress2($address2 = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($address2)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $address2)) {
$address2 = str_replace('*', '%', $address2);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTableMap::ADDRESS2, $address2, $comparison);
}
/**
* Filter the query on the address3 column
*
* Example usage:
* <code>
* $query->filterByAddress3('fooValue'); // WHERE address3 = 'fooValue'
* $query->filterByAddress3('%fooValue%'); // WHERE address3 LIKE '%fooValue%'
* </code>
*
* @param string $address3 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 filterByAddress3($address3 = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($address3)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $address3)) {
$address3 = str_replace('*', '%', $address3);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTableMap::ADDRESS3, $address3, $comparison);
}
/**
* Filter the query on the zipcode column
*
* Example usage:
* <code>
* $query->filterByZipcode('fooValue'); // WHERE zipcode = 'fooValue'
* $query->filterByZipcode('%fooValue%'); // WHERE zipcode LIKE '%fooValue%'
* </code>
*
* @param string $zipcode 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 filterByZipcode($zipcode = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($zipcode)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $zipcode)) {
$zipcode = str_replace('*', '%', $zipcode);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTableMap::ZIPCODE, $zipcode, $comparison);
}
/**
* Filter the query on the city column
*
* Example usage:
* <code>
* $query->filterByCity('fooValue'); // WHERE city = 'fooValue'
* $query->filterByCity('%fooValue%'); // WHERE city LIKE '%fooValue%'
* </code>
*
* @param string $city 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 filterByCity($city = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($city)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $city)) {
$city = str_replace('*', '%', $city);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTableMap::CITY, $city, $comparison);
}
/**
* Filter the query on the country_id column
*
* Example usage:
* <code>
* $query->filterByCountryId(1234); // WHERE country_id = 1234
* $query->filterByCountryId(array(12, 34)); // WHERE country_id IN (12, 34)
* $query->filterByCountryId(array('min' => 12)); // WHERE country_id > 12
* </code>
*
* @param mixed $countryId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCustomerQuery The current query, for fluid interface
*/
public function filterByCountryId($countryId = null, $comparison = null)
{
if (is_array($countryId)) {
$useMinMax = false;
if (isset($countryId['min'])) {
$this->addUsingAlias(CustomerTableMap::COUNTRY_ID, $countryId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($countryId['max'])) {
$this->addUsingAlias(CustomerTableMap::COUNTRY_ID, $countryId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CustomerTableMap::COUNTRY_ID, $countryId, $comparison);
}
/**
* Filter the query on the phone column
*
* Example usage:
* <code>
* $query->filterByPhone('fooValue'); // WHERE phone = 'fooValue'
* $query->filterByPhone('%fooValue%'); // WHERE phone LIKE '%fooValue%'
* </code>
*
* @param string $phone 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 filterByPhone($phone = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($phone)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $phone)) {
$phone = str_replace('*', '%', $phone);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTableMap::PHONE, $phone, $comparison);
}
/**
* Filter the query on the cellphone column
*
* Example usage:
* <code>
* $query->filterByCellphone('fooValue'); // WHERE cellphone = 'fooValue'
* $query->filterByCellphone('%fooValue%'); // WHERE cellphone LIKE '%fooValue%'
* </code>
*
* @param string $cellphone 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 filterByCellphone($cellphone = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($cellphone)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $cellphone)) {
$cellphone = str_replace('*', '%', $cellphone);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTableMap::CELLPHONE, $cellphone, $comparison);
}
/** /**
* Filter the query on the email column * Filter the query on the email column
* *
@@ -847,35 +417,6 @@ abstract class CustomerQuery extends ModelCriteria
return $this->addUsingAlias(CustomerTableMap::ALGO, $algo, $comparison); return $this->addUsingAlias(CustomerTableMap::ALGO, $algo, $comparison);
} }
/**
* Filter the query on the salt column
*
* Example usage:
* <code>
* $query->filterBySalt('fooValue'); // WHERE salt = 'fooValue'
* $query->filterBySalt('%fooValue%'); // WHERE salt LIKE '%fooValue%'
* </code>
*
* @param string $salt 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 filterBySalt($salt = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($salt)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $salt)) {
$salt = str_replace('*', '%', $salt);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTableMap::SALT, $salt, $comparison);
}
/** /**
* Filter the query on the reseller column * Filter the query on the reseller column
* *
@@ -1102,81 +643,6 @@ abstract class CustomerQuery extends ModelCriteria
return $this->addUsingAlias(CustomerTableMap::UPDATED_AT, $updatedAt, $comparison); return $this->addUsingAlias(CustomerTableMap::UPDATED_AT, $updatedAt, $comparison);
} }
/**
* Filter the query by a related \Thelia\Model\CustomerTitle object
*
* @param \Thelia\Model\CustomerTitle|ObjectCollection $customerTitle The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCustomerQuery The current query, for fluid interface
*/
public function filterByCustomerTitle($customerTitle, $comparison = null)
{
if ($customerTitle instanceof \Thelia\Model\CustomerTitle) {
return $this
->addUsingAlias(CustomerTableMap::CUSTOMER_TITLE_ID, $customerTitle->getId(), $comparison);
} elseif ($customerTitle instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CustomerTableMap::CUSTOMER_TITLE_ID, $customerTitle->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCustomerTitle() only accepts arguments of type \Thelia\Model\CustomerTitle or Collection');
}
}
/**
* Adds a JOIN clause to the query using the CustomerTitle relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCustomerQuery The current query, for fluid interface
*/
public function joinCustomerTitle($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CustomerTitle');
// 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, 'CustomerTitle');
}
return $this;
}
/**
* Use the CustomerTitle relation CustomerTitle 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\CustomerTitleQuery A secondary query class using the current class as primary query
*/
public function useCustomerTitleQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCustomerTitle($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerTitle', '\Thelia\Model\CustomerTitleQuery');
}
/** /**
* Filter the query by a related \Thelia\Model\Address object * Filter the query by a related \Thelia\Model\Address object
* *

View File

@@ -19,8 +19,6 @@ use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime; use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Address as ChildAddress; use Thelia\Model\Address as ChildAddress;
use Thelia\Model\AddressQuery as ChildAddressQuery; use Thelia\Model\AddressQuery as ChildAddressQuery;
use Thelia\Model\Customer as ChildCustomer;
use Thelia\Model\CustomerQuery as ChildCustomerQuery;
use Thelia\Model\CustomerTitle as ChildCustomerTitle; use Thelia\Model\CustomerTitle as ChildCustomerTitle;
use Thelia\Model\CustomerTitleI18n as ChildCustomerTitleI18n; use Thelia\Model\CustomerTitleI18n as ChildCustomerTitleI18n;
use Thelia\Model\CustomerTitleI18nQuery as ChildCustomerTitleI18nQuery; use Thelia\Model\CustomerTitleI18nQuery as ChildCustomerTitleI18nQuery;
@@ -92,12 +90,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
*/ */
protected $updated_at; protected $updated_at;
/**
* @var ObjectCollection|ChildCustomer[] Collection to store aggregation of ChildCustomer objects.
*/
protected $collCustomers;
protected $collCustomersPartial;
/** /**
* @var ObjectCollection|ChildAddress[] Collection to store aggregation of ChildAddress objects. * @var ObjectCollection|ChildAddress[] Collection to store aggregation of ChildAddress objects.
*/ */
@@ -132,12 +124,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
*/ */
protected $currentTranslations; protected $currentTranslations;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $customersScheduledForDeletion = null;
/** /**
* An array of objects scheduled for deletion. * An array of objects scheduled for deletion.
* @var ObjectCollection * @var ObjectCollection
@@ -725,8 +711,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects? if ($deep) { // also de-associate any related objects?
$this->collCustomers = null;
$this->collAddresses = null; $this->collAddresses = null;
$this->collCustomerTitleI18ns = null; $this->collCustomerTitleI18ns = null;
@@ -864,24 +848,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
$this->resetModified(); $this->resetModified();
} }
if ($this->customersScheduledForDeletion !== null) {
if (!$this->customersScheduledForDeletion->isEmpty()) {
foreach ($this->customersScheduledForDeletion as $customer) {
// need to save related object because we set the relation to null
$customer->save($con);
}
$this->customersScheduledForDeletion = null;
}
}
if ($this->collCustomers !== null) {
foreach ($this->collCustomers as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->addressesScheduledForDeletion !== null) { if ($this->addressesScheduledForDeletion !== null) {
if (!$this->addressesScheduledForDeletion->isEmpty()) { if (!$this->addressesScheduledForDeletion->isEmpty()) {
foreach ($this->addressesScheduledForDeletion as $address) { foreach ($this->addressesScheduledForDeletion as $address) {
@@ -1103,9 +1069,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
} }
if ($includeForeignObjects) { if ($includeForeignObjects) {
if (null !== $this->collCustomers) {
$result['Customers'] = $this->collCustomers->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collAddresses) { if (null !== $this->collAddresses) {
$result['Addresses'] = $this->collAddresses->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); $result['Addresses'] = $this->collAddresses->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
} }
@@ -1279,12 +1242,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
// the getter/setter methods for fkey referrer objects. // the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false); $copyObj->setNew(false);
foreach ($this->getCustomers() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addCustomer($relObj->copy($deepCopy));
}
}
foreach ($this->getAddresses() as $relObj) { foreach ($this->getAddresses() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addAddress($relObj->copy($deepCopy)); $copyObj->addAddress($relObj->copy($deepCopy));
@@ -1338,9 +1295,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
*/ */
public function initRelation($relationName) public function initRelation($relationName)
{ {
if ('Customer' == $relationName) {
return $this->initCustomers();
}
if ('Address' == $relationName) { if ('Address' == $relationName) {
return $this->initAddresses(); return $this->initAddresses();
} }
@@ -1349,224 +1303,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
} }
} }
/**
* Clears out the collCustomers 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 addCustomers()
*/
public function clearCustomers()
{
$this->collCustomers = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collCustomers collection loaded partially.
*/
public function resetPartialCustomers($v = true)
{
$this->collCustomersPartial = $v;
}
/**
* Initializes the collCustomers collection.
*
* By default this just sets the collCustomers collection to an empty array (like clearcollCustomers());
* 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 initCustomers($overrideExisting = true)
{
if (null !== $this->collCustomers && !$overrideExisting) {
return;
}
$this->collCustomers = new ObjectCollection();
$this->collCustomers->setModel('\Thelia\Model\Customer');
}
/**
* Gets an array of ChildCustomer 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 ChildCustomerTitle 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|ChildCustomer[] List of ChildCustomer objects
* @throws PropelException
*/
public function getCustomers($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collCustomersPartial && !$this->isNew();
if (null === $this->collCustomers || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collCustomers) {
// return empty collection
$this->initCustomers();
} else {
$collCustomers = ChildCustomerQuery::create(null, $criteria)
->filterByCustomerTitle($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collCustomersPartial && count($collCustomers)) {
$this->initCustomers(false);
foreach ($collCustomers as $obj) {
if (false == $this->collCustomers->contains($obj)) {
$this->collCustomers->append($obj);
}
}
$this->collCustomersPartial = true;
}
$collCustomers->getInternalIterator()->rewind();
return $collCustomers;
}
if ($partial && $this->collCustomers) {
foreach ($this->collCustomers as $obj) {
if ($obj->isNew()) {
$collCustomers[] = $obj;
}
}
}
$this->collCustomers = $collCustomers;
$this->collCustomersPartial = false;
}
}
return $this->collCustomers;
}
/**
* Sets a collection of Customer 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 $customers A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildCustomerTitle The current object (for fluent API support)
*/
public function setCustomers(Collection $customers, ConnectionInterface $con = null)
{
$customersToDelete = $this->getCustomers(new Criteria(), $con)->diff($customers);
$this->customersScheduledForDeletion = $customersToDelete;
foreach ($customersToDelete as $customerRemoved) {
$customerRemoved->setCustomerTitle(null);
}
$this->collCustomers = null;
foreach ($customers as $customer) {
$this->addCustomer($customer);
}
$this->collCustomers = $customers;
$this->collCustomersPartial = false;
return $this;
}
/**
* Returns the number of related Customer objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related Customer objects.
* @throws PropelException
*/
public function countCustomers(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collCustomersPartial && !$this->isNew();
if (null === $this->collCustomers || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collCustomers) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getCustomers());
}
$query = ChildCustomerQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByCustomerTitle($this)
->count($con);
}
return count($this->collCustomers);
}
/**
* Method called to associate a ChildCustomer object to this object
* through the ChildCustomer foreign key attribute.
*
* @param ChildCustomer $l ChildCustomer
* @return \Thelia\Model\CustomerTitle The current object (for fluent API support)
*/
public function addCustomer(ChildCustomer $l)
{
if ($this->collCustomers === null) {
$this->initCustomers();
$this->collCustomersPartial = true;
}
if (!in_array($l, $this->collCustomers->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddCustomer($l);
}
return $this;
}
/**
* @param Customer $customer The customer object to add.
*/
protected function doAddCustomer($customer)
{
$this->collCustomers[]= $customer;
$customer->setCustomerTitle($this);
}
/**
* @param Customer $customer The customer object to remove.
* @return ChildCustomerTitle The current object (for fluent API support)
*/
public function removeCustomer($customer)
{
if ($this->getCustomers()->contains($customer)) {
$this->collCustomers->remove($this->collCustomers->search($customer));
if (null === $this->customersScheduledForDeletion) {
$this->customersScheduledForDeletion = clone $this->collCustomers;
$this->customersScheduledForDeletion->clear();
}
$this->customersScheduledForDeletion[]= $customer;
$customer->setCustomerTitle(null);
}
return $this;
}
/** /**
* Clears out the collAddresses collection * Clears out the collAddresses collection
* *
@@ -2065,11 +1801,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
public function clearAllReferences($deep = false) public function clearAllReferences($deep = false)
{ {
if ($deep) { if ($deep) {
if ($this->collCustomers) {
foreach ($this->collCustomers as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collAddresses) { if ($this->collAddresses) {
foreach ($this->collAddresses as $o) { foreach ($this->collAddresses as $o) {
$o->clearAllReferences($deep); $o->clearAllReferences($deep);
@@ -2086,10 +1817,6 @@ abstract class CustomerTitle implements ActiveRecordInterface
$this->currentLocale = 'en_US'; $this->currentLocale = 'en_US';
$this->currentTranslations = null; $this->currentTranslations = null;
if ($this->collCustomers instanceof Collection) {
$this->collCustomers->clearIterator();
}
$this->collCustomers = null;
if ($this->collAddresses instanceof Collection) { if ($this->collAddresses instanceof Collection) {
$this->collAddresses->clearIterator(); $this->collAddresses->clearIterator();
} }

View File

@@ -38,10 +38,6 @@ use Thelia\Model\Map\CustomerTitleTableMap;
* @method ChildCustomerTitleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method ChildCustomerTitleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCustomerTitleQuery innerJoin($relation) Adds a INNER JOIN clause to the query * @method ChildCustomerTitleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* *
* @method ChildCustomerTitleQuery leftJoinCustomer($relationAlias = null) Adds a LEFT JOIN clause to the query using the Customer relation
* @method ChildCustomerTitleQuery rightJoinCustomer($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Customer relation
* @method ChildCustomerTitleQuery innerJoinCustomer($relationAlias = null) Adds a INNER JOIN clause to the query using the Customer relation
*
* @method ChildCustomerTitleQuery leftJoinAddress($relationAlias = null) Adds a LEFT JOIN clause to the query using the Address relation * @method ChildCustomerTitleQuery leftJoinAddress($relationAlias = null) Adds a LEFT JOIN clause to the query using the Address relation
* @method ChildCustomerTitleQuery rightJoinAddress($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Address relation * @method ChildCustomerTitleQuery rightJoinAddress($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Address relation
* @method ChildCustomerTitleQuery innerJoinAddress($relationAlias = null) Adds a INNER JOIN clause to the query using the Address relation * @method ChildCustomerTitleQuery innerJoinAddress($relationAlias = null) Adds a INNER JOIN clause to the query using the Address relation
@@ -438,79 +434,6 @@ abstract class CustomerTitleQuery extends ModelCriteria
return $this->addUsingAlias(CustomerTitleTableMap::UPDATED_AT, $updatedAt, $comparison); return $this->addUsingAlias(CustomerTitleTableMap::UPDATED_AT, $updatedAt, $comparison);
} }
/**
* Filter the query by a related \Thelia\Model\Customer object
*
* @param \Thelia\Model\Customer|ObjectCollection $customer the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function filterByCustomer($customer, $comparison = null)
{
if ($customer instanceof \Thelia\Model\Customer) {
return $this
->addUsingAlias(CustomerTitleTableMap::ID, $customer->getCustomerTitleId(), $comparison);
} elseif ($customer instanceof ObjectCollection) {
return $this
->useCustomerQuery()
->filterByPrimaryKeys($customer->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByCustomer() only accepts arguments of type \Thelia\Model\Customer or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Customer relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function joinCustomer($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Customer');
// 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, 'Customer');
}
return $this;
}
/**
* Use the Customer relation Customer 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\CustomerQuery A secondary query class using the current class as primary query
*/
public function useCustomerQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCustomer($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Customer', '\Thelia\Model\CustomerQuery');
}
/** /**
* Filter the query by a related \Thelia\Model\Address object * Filter the query by a related \Thelia\Model\Address object
* *

View File

@@ -57,7 +57,7 @@ class AddressTableMap extends TableMap
/** /**
* The total number of columns * The total number of columns
*/ */
const NUM_COLUMNS = 16; const NUM_COLUMNS = 18;
/** /**
* The number of lazy-loaded columns * The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class AddressTableMap extends TableMap
/** /**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/ */
const NUM_HYDRATE_COLUMNS = 16; const NUM_HYDRATE_COLUMNS = 18;
/** /**
* the column name for the ID field * the column name for the ID field
@@ -139,6 +139,16 @@ class AddressTableMap extends TableMap
*/ */
const PHONE = 'address.PHONE'; const PHONE = 'address.PHONE';
/**
* the column name for the CELLPHONE field
*/
const CELLPHONE = 'address.CELLPHONE';
/**
* the column name for the DEFAULT field
*/
const DEFAULT = 'address.DEFAULT';
/** /**
* the column name for the CREATED_AT field * the column name for the CREATED_AT field
*/ */
@@ -161,12 +171,12 @@ class AddressTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
protected static $fieldNames = array ( protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Title', 'CustomerId', 'CustomerTitleId', 'Company', 'Firstname', 'Lastname', 'Address1', 'Address2', 'Address3', 'Zipcode', 'City', 'CountryId', 'Phone', 'CreatedAt', 'UpdatedAt', ), self::TYPE_PHPNAME => array('Id', 'Title', 'CustomerId', 'CustomerTitleId', 'Company', 'Firstname', 'Lastname', 'Address1', 'Address2', 'Address3', 'Zipcode', 'City', 'CountryId', 'Phone', 'Cellphone', 'Default', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'title', 'customerId', 'customerTitleId', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'countryId', 'phone', 'createdAt', 'updatedAt', ), self::TYPE_STUDLYPHPNAME => array('id', 'title', 'customerId', 'customerTitleId', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'countryId', 'phone', 'cellphone', 'default', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AddressTableMap::ID, AddressTableMap::TITLE, AddressTableMap::CUSTOMER_ID, AddressTableMap::CUSTOMER_TITLE_ID, AddressTableMap::COMPANY, AddressTableMap::FIRSTNAME, AddressTableMap::LASTNAME, AddressTableMap::ADDRESS1, AddressTableMap::ADDRESS2, AddressTableMap::ADDRESS3, AddressTableMap::ZIPCODE, AddressTableMap::CITY, AddressTableMap::COUNTRY_ID, AddressTableMap::PHONE, AddressTableMap::CREATED_AT, AddressTableMap::UPDATED_AT, ), self::TYPE_COLNAME => array(AddressTableMap::ID, AddressTableMap::TITLE, AddressTableMap::CUSTOMER_ID, AddressTableMap::CUSTOMER_TITLE_ID, AddressTableMap::COMPANY, AddressTableMap::FIRSTNAME, AddressTableMap::LASTNAME, AddressTableMap::ADDRESS1, AddressTableMap::ADDRESS2, AddressTableMap::ADDRESS3, AddressTableMap::ZIPCODE, AddressTableMap::CITY, AddressTableMap::COUNTRY_ID, AddressTableMap::PHONE, AddressTableMap::CELLPHONE, AddressTableMap::DEFAULT, AddressTableMap::CREATED_AT, AddressTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'TITLE', 'CUSTOMER_ID', 'CUSTOMER_TITLE_ID', 'COMPANY', 'FIRSTNAME', 'LASTNAME', 'ADDRESS1', 'ADDRESS2', 'ADDRESS3', 'ZIPCODE', 'CITY', 'COUNTRY_ID', 'PHONE', 'CREATED_AT', 'UPDATED_AT', ), self::TYPE_RAW_COLNAME => array('ID', 'TITLE', 'CUSTOMER_ID', 'CUSTOMER_TITLE_ID', 'COMPANY', 'FIRSTNAME', 'LASTNAME', 'ADDRESS1', 'ADDRESS2', 'ADDRESS3', 'ZIPCODE', 'CITY', 'COUNTRY_ID', 'PHONE', 'CELLPHONE', 'DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'title', 'customer_id', 'customer_title_id', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'country_id', 'phone', 'created_at', 'updated_at', ), self::TYPE_FIELDNAME => array('id', 'title', 'customer_id', 'customer_title_id', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'country_id', 'phone', 'cellphone', 'default', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ) self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
); );
/** /**
@@ -176,12 +186,12 @@ class AddressTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/ */
protected static $fieldKeys = array ( protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Title' => 1, 'CustomerId' => 2, 'CustomerTitleId' => 3, 'Company' => 4, 'Firstname' => 5, 'Lastname' => 6, 'Address1' => 7, 'Address2' => 8, 'Address3' => 9, 'Zipcode' => 10, 'City' => 11, 'CountryId' => 12, 'Phone' => 13, 'CreatedAt' => 14, 'UpdatedAt' => 15, ), self::TYPE_PHPNAME => array('Id' => 0, 'Title' => 1, 'CustomerId' => 2, 'CustomerTitleId' => 3, 'Company' => 4, 'Firstname' => 5, 'Lastname' => 6, 'Address1' => 7, 'Address2' => 8, 'Address3' => 9, 'Zipcode' => 10, 'City' => 11, 'CountryId' => 12, 'Phone' => 13, 'Cellphone' => 14, 'Default' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'title' => 1, 'customerId' => 2, 'customerTitleId' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'countryId' => 12, 'phone' => 13, 'createdAt' => 14, 'updatedAt' => 15, ), self::TYPE_STUDLYPHPNAME => array('id' => 0, 'title' => 1, 'customerId' => 2, 'customerTitleId' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'countryId' => 12, 'phone' => 13, 'cellphone' => 14, 'default' => 15, 'createdAt' => 16, 'updatedAt' => 17, ),
self::TYPE_COLNAME => array(AddressTableMap::ID => 0, AddressTableMap::TITLE => 1, AddressTableMap::CUSTOMER_ID => 2, AddressTableMap::CUSTOMER_TITLE_ID => 3, AddressTableMap::COMPANY => 4, AddressTableMap::FIRSTNAME => 5, AddressTableMap::LASTNAME => 6, AddressTableMap::ADDRESS1 => 7, AddressTableMap::ADDRESS2 => 8, AddressTableMap::ADDRESS3 => 9, AddressTableMap::ZIPCODE => 10, AddressTableMap::CITY => 11, AddressTableMap::COUNTRY_ID => 12, AddressTableMap::PHONE => 13, AddressTableMap::CREATED_AT => 14, AddressTableMap::UPDATED_AT => 15, ), self::TYPE_COLNAME => array(AddressTableMap::ID => 0, AddressTableMap::TITLE => 1, AddressTableMap::CUSTOMER_ID => 2, AddressTableMap::CUSTOMER_TITLE_ID => 3, AddressTableMap::COMPANY => 4, AddressTableMap::FIRSTNAME => 5, AddressTableMap::LASTNAME => 6, AddressTableMap::ADDRESS1 => 7, AddressTableMap::ADDRESS2 => 8, AddressTableMap::ADDRESS3 => 9, AddressTableMap::ZIPCODE => 10, AddressTableMap::CITY => 11, AddressTableMap::COUNTRY_ID => 12, AddressTableMap::PHONE => 13, AddressTableMap::CELLPHONE => 14, AddressTableMap::DEFAULT => 15, AddressTableMap::CREATED_AT => 16, AddressTableMap::UPDATED_AT => 17, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'TITLE' => 1, 'CUSTOMER_ID' => 2, 'CUSTOMER_TITLE_ID' => 3, 'COMPANY' => 4, 'FIRSTNAME' => 5, 'LASTNAME' => 6, 'ADDRESS1' => 7, 'ADDRESS2' => 8, 'ADDRESS3' => 9, 'ZIPCODE' => 10, 'CITY' => 11, 'COUNTRY_ID' => 12, 'PHONE' => 13, 'CREATED_AT' => 14, 'UPDATED_AT' => 15, ), self::TYPE_RAW_COLNAME => array('ID' => 0, 'TITLE' => 1, 'CUSTOMER_ID' => 2, 'CUSTOMER_TITLE_ID' => 3, 'COMPANY' => 4, 'FIRSTNAME' => 5, 'LASTNAME' => 6, 'ADDRESS1' => 7, 'ADDRESS2' => 8, 'ADDRESS3' => 9, 'ZIPCODE' => 10, 'CITY' => 11, 'COUNTRY_ID' => 12, 'PHONE' => 13, 'CELLPHONE' => 14, 'DEFAULT' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ),
self::TYPE_FIELDNAME => array('id' => 0, 'title' => 1, 'customer_id' => 2, 'customer_title_id' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'country_id' => 12, 'phone' => 13, 'created_at' => 14, 'updated_at' => 15, ), self::TYPE_FIELDNAME => array('id' => 0, 'title' => 1, 'customer_id' => 2, 'customer_title_id' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'country_id' => 12, 'phone' => 13, 'cellphone' => 14, 'default' => 15, 'created_at' => 16, 'updated_at' => 17, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ) self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
); );
/** /**
@@ -214,6 +224,8 @@ class AddressTableMap extends TableMap
$this->addColumn('CITY', 'City', 'VARCHAR', true, 255, null); $this->addColumn('CITY', 'City', 'VARCHAR', true, 255, null);
$this->addColumn('COUNTRY_ID', 'CountryId', 'INTEGER', true, null, null); $this->addColumn('COUNTRY_ID', 'CountryId', 'INTEGER', true, null, null);
$this->addColumn('PHONE', 'Phone', 'VARCHAR', false, 20, null); $this->addColumn('PHONE', 'Phone', 'VARCHAR', false, 20, null);
$this->addColumn('CELLPHONE', 'Cellphone', 'VARCHAR', false, 20, null);
$this->addColumn('DEFAULT', 'Default', 'TINYINT', false, null, 0);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize() } // initialize()
@@ -392,6 +404,8 @@ class AddressTableMap extends TableMap
$criteria->addSelectColumn(AddressTableMap::CITY); $criteria->addSelectColumn(AddressTableMap::CITY);
$criteria->addSelectColumn(AddressTableMap::COUNTRY_ID); $criteria->addSelectColumn(AddressTableMap::COUNTRY_ID);
$criteria->addSelectColumn(AddressTableMap::PHONE); $criteria->addSelectColumn(AddressTableMap::PHONE);
$criteria->addSelectColumn(AddressTableMap::CELLPHONE);
$criteria->addSelectColumn(AddressTableMap::DEFAULT);
$criteria->addSelectColumn(AddressTableMap::CREATED_AT); $criteria->addSelectColumn(AddressTableMap::CREATED_AT);
$criteria->addSelectColumn(AddressTableMap::UPDATED_AT); $criteria->addSelectColumn(AddressTableMap::UPDATED_AT);
} else { } else {
@@ -409,6 +423,8 @@ class AddressTableMap extends TableMap
$criteria->addSelectColumn($alias . '.CITY'); $criteria->addSelectColumn($alias . '.CITY');
$criteria->addSelectColumn($alias . '.COUNTRY_ID'); $criteria->addSelectColumn($alias . '.COUNTRY_ID');
$criteria->addSelectColumn($alias . '.PHONE'); $criteria->addSelectColumn($alias . '.PHONE');
$criteria->addSelectColumn($alias . '.CELLPHONE');
$criteria->addSelectColumn($alias . '.DEFAULT');
$criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT');
} }

View File

@@ -57,7 +57,7 @@ class CustomerTableMap extends TableMap
/** /**
* The total number of columns * The total number of columns
*/ */
const NUM_COLUMNS = 24; const NUM_COLUMNS = 11;
/** /**
* The number of lazy-loaded columns * 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) * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/ */
const NUM_HYDRATE_COLUMNS = 24; const NUM_HYDRATE_COLUMNS = 11;
/** /**
* the column name for the ID field * the column name for the ID field
@@ -79,66 +79,6 @@ class CustomerTableMap extends TableMap
*/ */
const REF = 'customer.REF'; const REF = 'customer.REF';
/**
* the column name for the CUSTOMER_TITLE_ID field
*/
const CUSTOMER_TITLE_ID = 'customer.CUSTOMER_TITLE_ID';
/**
* the column name for the COMPANY field
*/
const COMPANY = 'customer.COMPANY';
/**
* 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 ADDRESS1 field
*/
const ADDRESS1 = 'customer.ADDRESS1';
/**
* the column name for the ADDRESS2 field
*/
const ADDRESS2 = 'customer.ADDRESS2';
/**
* the column name for the ADDRESS3 field
*/
const ADDRESS3 = 'customer.ADDRESS3';
/**
* the column name for the ZIPCODE field
*/
const ZIPCODE = 'customer.ZIPCODE';
/**
* the column name for the CITY field
*/
const CITY = 'customer.CITY';
/**
* the column name for the COUNTRY_ID field
*/
const COUNTRY_ID = 'customer.COUNTRY_ID';
/**
* the column name for the PHONE field
*/
const PHONE = 'customer.PHONE';
/**
* the column name for the CELLPHONE field
*/
const CELLPHONE = 'customer.CELLPHONE';
/** /**
* the column name for the EMAIL field * the column name for the EMAIL field
*/ */
@@ -154,11 +94,6 @@ class CustomerTableMap extends TableMap
*/ */
const ALGO = 'customer.ALGO'; const ALGO = 'customer.ALGO';
/**
* the column name for the SALT field
*/
const SALT = 'customer.SALT';
/** /**
* the column name for the RESELLER field * the column name for the RESELLER field
*/ */
@@ -201,12 +136,12 @@ class CustomerTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
protected static $fieldNames = array ( protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Ref', 'CustomerTitleId', 'Company', 'Firstname', 'Lastname', 'Address1', 'Address2', 'Address3', 'Zipcode', 'City', 'CountryId', 'Phone', 'Cellphone', 'Email', 'Password', 'Algo', 'Salt', 'Reseller', 'Lang', 'Sponsor', 'Discount', 'CreatedAt', 'UpdatedAt', ), self::TYPE_PHPNAME => array('Id', 'Ref', 'Email', 'Password', 'Algo', 'Reseller', 'Lang', 'Sponsor', 'Discount', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'customerTitleId', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'countryId', 'phone', 'cellphone', 'email', 'password', 'algo', 'salt', '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::CUSTOMER_TITLE_ID, CustomerTableMap::COMPANY, CustomerTableMap::FIRSTNAME, CustomerTableMap::LASTNAME, CustomerTableMap::ADDRESS1, CustomerTableMap::ADDRESS2, CustomerTableMap::ADDRESS3, CustomerTableMap::ZIPCODE, CustomerTableMap::CITY, CustomerTableMap::COUNTRY_ID, CustomerTableMap::PHONE, CustomerTableMap::CELLPHONE, CustomerTableMap::EMAIL, CustomerTableMap::PASSWORD, CustomerTableMap::ALGO, CustomerTableMap::SALT, CustomerTableMap::RESELLER, CustomerTableMap::LANG, CustomerTableMap::SPONSOR, CustomerTableMap::DISCOUNT, CustomerTableMap::CREATED_AT, CustomerTableMap::UPDATED_AT, ), 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', 'CUSTOMER_TITLE_ID', 'COMPANY', 'FIRSTNAME', 'LASTNAME', 'ADDRESS1', 'ADDRESS2', 'ADDRESS3', 'ZIPCODE', 'CITY', 'COUNTRY_ID', 'PHONE', 'CELLPHONE', 'EMAIL', 'PASSWORD', 'ALGO', 'SALT', 'RESELLER', 'LANG', 'SPONSOR', 'DISCOUNT', 'CREATED_AT', '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', 'customer_title_id', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'country_id', 'phone', 'cellphone', 'email', 'password', 'algo', 'salt', '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, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, ) self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
); );
/** /**
@@ -216,12 +151,12 @@ class CustomerTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/ */
protected static $fieldKeys = array ( protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'CustomerTitleId' => 2, 'Company' => 3, 'Firstname' => 4, 'Lastname' => 5, 'Address1' => 6, 'Address2' => 7, 'Address3' => 8, 'Zipcode' => 9, 'City' => 10, 'CountryId' => 11, 'Phone' => 12, 'Cellphone' => 13, 'Email' => 14, 'Password' => 15, 'Algo' => 16, 'Salt' => 17, 'Reseller' => 18, 'Lang' => 19, 'Sponsor' => 20, 'Discount' => 21, 'CreatedAt' => 22, 'UpdatedAt' => 23, ), 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, 'customerTitleId' => 2, 'company' => 3, 'firstname' => 4, 'lastname' => 5, 'address1' => 6, 'address2' => 7, 'address3' => 8, 'zipcode' => 9, 'city' => 10, 'countryId' => 11, 'phone' => 12, 'cellphone' => 13, 'email' => 14, 'password' => 15, 'algo' => 16, 'salt' => 17, 'reseller' => 18, 'lang' => 19, 'sponsor' => 20, 'discount' => 21, 'createdAt' => 22, 'updatedAt' => 23, ), 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::CUSTOMER_TITLE_ID => 2, CustomerTableMap::COMPANY => 3, CustomerTableMap::FIRSTNAME => 4, CustomerTableMap::LASTNAME => 5, CustomerTableMap::ADDRESS1 => 6, CustomerTableMap::ADDRESS2 => 7, CustomerTableMap::ADDRESS3 => 8, CustomerTableMap::ZIPCODE => 9, CustomerTableMap::CITY => 10, CustomerTableMap::COUNTRY_ID => 11, CustomerTableMap::PHONE => 12, CustomerTableMap::CELLPHONE => 13, CustomerTableMap::EMAIL => 14, CustomerTableMap::PASSWORD => 15, CustomerTableMap::ALGO => 16, CustomerTableMap::SALT => 17, CustomerTableMap::RESELLER => 18, CustomerTableMap::LANG => 19, CustomerTableMap::SPONSOR => 20, CustomerTableMap::DISCOUNT => 21, CustomerTableMap::CREATED_AT => 22, CustomerTableMap::UPDATED_AT => 23, ), 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, 'CUSTOMER_TITLE_ID' => 2, 'COMPANY' => 3, 'FIRSTNAME' => 4, 'LASTNAME' => 5, 'ADDRESS1' => 6, 'ADDRESS2' => 7, 'ADDRESS3' => 8, 'ZIPCODE' => 9, 'CITY' => 10, 'COUNTRY_ID' => 11, 'PHONE' => 12, 'CELLPHONE' => 13, 'EMAIL' => 14, 'PASSWORD' => 15, 'ALGO' => 16, 'SALT' => 17, 'RESELLER' => 18, 'LANG' => 19, 'SPONSOR' => 20, 'DISCOUNT' => 21, 'CREATED_AT' => 22, 'UPDATED_AT' => 23, ), 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, 'customer_title_id' => 2, 'company' => 3, 'firstname' => 4, 'lastname' => 5, 'address1' => 6, 'address2' => 7, 'address3' => 8, 'zipcode' => 9, 'city' => 10, 'country_id' => 11, 'phone' => 12, 'cellphone' => 13, 'email' => 14, 'password' => 15, 'algo' => 16, 'salt' => 17, 'reseller' => 18, 'lang' => 19, 'sponsor' => 20, 'discount' => 21, 'created_at' => 22, 'updated_at' => 23, ), 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, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, ) self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
); );
/** /**
@@ -242,22 +177,9 @@ class CustomerTableMap extends TableMap
// columns // columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('REF', 'Ref', 'VARCHAR', true, 50, null); $this->addColumn('REF', 'Ref', 'VARCHAR', true, 50, null);
$this->addForeignKey('CUSTOMER_TITLE_ID', 'CustomerTitleId', 'INTEGER', 'customer_title', 'ID', false, null, null);
$this->addColumn('COMPANY', 'Company', 'VARCHAR', false, 255, null);
$this->addColumn('FIRSTNAME', 'Firstname', 'VARCHAR', true, 255, null);
$this->addColumn('LASTNAME', 'Lastname', 'VARCHAR', true, 255, null);
$this->addColumn('ADDRESS1', 'Address1', 'VARCHAR', true, 255, null);
$this->addColumn('ADDRESS2', 'Address2', 'VARCHAR', false, 255, null);
$this->addColumn('ADDRESS3', 'Address3', 'VARCHAR', false, 255, null);
$this->addColumn('ZIPCODE', 'Zipcode', 'VARCHAR', false, 10, null);
$this->addColumn('CITY', 'City', 'VARCHAR', true, 255, null);
$this->addColumn('COUNTRY_ID', 'CountryId', 'INTEGER', true, null, null);
$this->addColumn('PHONE', 'Phone', 'VARCHAR', false, 20, null);
$this->addColumn('CELLPHONE', 'Cellphone', 'VARCHAR', false, 20, null);
$this->addColumn('EMAIL', 'Email', 'VARCHAR', false, 50, null); $this->addColumn('EMAIL', 'Email', 'VARCHAR', false, 50, null);
$this->addColumn('PASSWORD', 'Password', 'VARCHAR', false, 255, null); $this->addColumn('PASSWORD', 'Password', 'VARCHAR', false, 255, null);
$this->addColumn('ALGO', 'Algo', 'VARCHAR', false, 128, null); $this->addColumn('ALGO', 'Algo', 'VARCHAR', false, 128, null);
$this->addColumn('SALT', 'Salt', 'VARCHAR', false, 128, null);
$this->addColumn('RESELLER', 'Reseller', 'TINYINT', false, null, null); $this->addColumn('RESELLER', 'Reseller', 'TINYINT', false, null, null);
$this->addColumn('LANG', 'Lang', 'VARCHAR', false, 10, null); $this->addColumn('LANG', 'Lang', 'VARCHAR', false, 10, null);
$this->addColumn('SPONSOR', 'Sponsor', 'VARCHAR', false, 50, null); $this->addColumn('SPONSOR', 'Sponsor', 'VARCHAR', false, 50, null);
@@ -271,7 +193,6 @@ class CustomerTableMap extends TableMap
*/ */
public function buildRelations() public function buildRelations()
{ {
$this->addRelation('CustomerTitle', '\\Thelia\\Model\\CustomerTitle', RelationMap::MANY_TO_ONE, array('customer_title_id' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('Address', '\\Thelia\\Model\\Address', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'RESTRICT', 'Addresses'); $this->addRelation('Address', '\\Thelia\\Model\\Address', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'RESTRICT', 'Addresses');
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'RESTRICT', 'Orders'); $this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'RESTRICT', 'Orders');
} // buildRelations() } // buildRelations()
@@ -439,22 +360,9 @@ class CustomerTableMap extends TableMap
if (null === $alias) { if (null === $alias) {
$criteria->addSelectColumn(CustomerTableMap::ID); $criteria->addSelectColumn(CustomerTableMap::ID);
$criteria->addSelectColumn(CustomerTableMap::REF); $criteria->addSelectColumn(CustomerTableMap::REF);
$criteria->addSelectColumn(CustomerTableMap::CUSTOMER_TITLE_ID);
$criteria->addSelectColumn(CustomerTableMap::COMPANY);
$criteria->addSelectColumn(CustomerTableMap::FIRSTNAME);
$criteria->addSelectColumn(CustomerTableMap::LASTNAME);
$criteria->addSelectColumn(CustomerTableMap::ADDRESS1);
$criteria->addSelectColumn(CustomerTableMap::ADDRESS2);
$criteria->addSelectColumn(CustomerTableMap::ADDRESS3);
$criteria->addSelectColumn(CustomerTableMap::ZIPCODE);
$criteria->addSelectColumn(CustomerTableMap::CITY);
$criteria->addSelectColumn(CustomerTableMap::COUNTRY_ID);
$criteria->addSelectColumn(CustomerTableMap::PHONE);
$criteria->addSelectColumn(CustomerTableMap::CELLPHONE);
$criteria->addSelectColumn(CustomerTableMap::EMAIL); $criteria->addSelectColumn(CustomerTableMap::EMAIL);
$criteria->addSelectColumn(CustomerTableMap::PASSWORD); $criteria->addSelectColumn(CustomerTableMap::PASSWORD);
$criteria->addSelectColumn(CustomerTableMap::ALGO); $criteria->addSelectColumn(CustomerTableMap::ALGO);
$criteria->addSelectColumn(CustomerTableMap::SALT);
$criteria->addSelectColumn(CustomerTableMap::RESELLER); $criteria->addSelectColumn(CustomerTableMap::RESELLER);
$criteria->addSelectColumn(CustomerTableMap::LANG); $criteria->addSelectColumn(CustomerTableMap::LANG);
$criteria->addSelectColumn(CustomerTableMap::SPONSOR); $criteria->addSelectColumn(CustomerTableMap::SPONSOR);
@@ -464,22 +372,9 @@ class CustomerTableMap extends TableMap
} else { } else {
$criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.REF'); $criteria->addSelectColumn($alias . '.REF');
$criteria->addSelectColumn($alias . '.CUSTOMER_TITLE_ID');
$criteria->addSelectColumn($alias . '.COMPANY');
$criteria->addSelectColumn($alias . '.FIRSTNAME');
$criteria->addSelectColumn($alias . '.LASTNAME');
$criteria->addSelectColumn($alias . '.ADDRESS1');
$criteria->addSelectColumn($alias . '.ADDRESS2');
$criteria->addSelectColumn($alias . '.ADDRESS3');
$criteria->addSelectColumn($alias . '.ZIPCODE');
$criteria->addSelectColumn($alias . '.CITY');
$criteria->addSelectColumn($alias . '.COUNTRY_ID');
$criteria->addSelectColumn($alias . '.PHONE');
$criteria->addSelectColumn($alias . '.CELLPHONE');
$criteria->addSelectColumn($alias . '.EMAIL'); $criteria->addSelectColumn($alias . '.EMAIL');
$criteria->addSelectColumn($alias . '.PASSWORD'); $criteria->addSelectColumn($alias . '.PASSWORD');
$criteria->addSelectColumn($alias . '.ALGO'); $criteria->addSelectColumn($alias . '.ALGO');
$criteria->addSelectColumn($alias . '.SALT');
$criteria->addSelectColumn($alias . '.RESELLER'); $criteria->addSelectColumn($alias . '.RESELLER');
$criteria->addSelectColumn($alias . '.LANG'); $criteria->addSelectColumn($alias . '.LANG');
$criteria->addSelectColumn($alias . '.SPONSOR'); $criteria->addSelectColumn($alias . '.SPONSOR');

View File

@@ -166,7 +166,6 @@ class CustomerTitleTableMap extends TableMap
*/ */
public function buildRelations() public function buildRelations()
{ {
$this->addRelation('Customer', '\\Thelia\\Model\\Customer', RelationMap::ONE_TO_MANY, array('id' => 'customer_title_id', ), 'SET NULL', 'RESTRICT', 'Customers');
$this->addRelation('Address', '\\Thelia\\Model\\Address', RelationMap::ONE_TO_MANY, array('id' => 'customer_title_id', ), 'RESTRICT', 'RESTRICT', 'Addresses'); $this->addRelation('Address', '\\Thelia\\Model\\Address', RelationMap::ONE_TO_MANY, array('id' => 'customer_title_id', ), 'RESTRICT', 'RESTRICT', 'Addresses');
$this->addRelation('CustomerTitleI18n', '\\Thelia\\Model\\CustomerTitleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CustomerTitleI18ns'); $this->addRelation('CustomerTitleI18n', '\\Thelia\\Model\\CustomerTitleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CustomerTitleI18ns');
} // buildRelations() } // buildRelations()
@@ -191,7 +190,6 @@ class CustomerTitleTableMap extends TableMap
{ {
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CustomerTableMap::clearInstancePool();
CustomerTitleI18nTableMap::clearInstancePool(); CustomerTitleI18nTableMap::clearInstancePool();
} }

View File

@@ -453,22 +453,9 @@ CREATE TABLE `customer`
( (
`id` INTEGER NOT NULL AUTO_INCREMENT, `id` INTEGER NOT NULL AUTO_INCREMENT,
`ref` VARCHAR(50) NOT NULL, `ref` VARCHAR(50) NOT NULL,
`customer_title_id` INTEGER,
`company` VARCHAR(255),
`firstname` VARCHAR(255) NOT NULL,
`lastname` VARCHAR(255) NOT NULL,
`address1` VARCHAR(255) NOT NULL,
`address2` VARCHAR(255) COMMENT ' ',
`address3` VARCHAR(255),
`zipcode` VARCHAR(10),
`city` VARCHAR(255) NOT NULL,
`country_id` INTEGER NOT NULL,
`phone` VARCHAR(20),
`cellphone` VARCHAR(20),
`email` VARCHAR(50), `email` VARCHAR(50),
`password` VARCHAR(255), `password` VARCHAR(255),
`algo` VARCHAR(128), `algo` VARCHAR(128),
`salt` VARCHAR(128),
`reseller` TINYINT, `reseller` TINYINT,
`lang` VARCHAR(10), `lang` VARCHAR(10),
`sponsor` VARCHAR(50), `sponsor` VARCHAR(50),
@@ -476,13 +463,7 @@ CREATE TABLE `customer`
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE INDEX `ref_UNIQUE` (`ref`), UNIQUE INDEX `ref_UNIQUE` (`ref`)
INDEX `idx_customer_customer_title_id` (`customer_title_id`),
CONSTRAINT `fk_customer_customer_title_id`
FOREIGN KEY (`customer_title_id`)
REFERENCES `customer_title` (`id`)
ON UPDATE RESTRICT
ON DELETE SET NULL
) ENGINE=InnoDB; ) ENGINE=InnoDB;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
@@ -507,6 +488,8 @@ CREATE TABLE `address`
`city` VARCHAR(255) NOT NULL, `city` VARCHAR(255) NOT NULL,
`country_id` INTEGER NOT NULL, `country_id` INTEGER NOT NULL,
`phone` VARCHAR(20), `phone` VARCHAR(20),
`cellphone` VARCHAR(20),
`default` TINYINT DEFAULT 0,
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
@@ -1040,11 +1023,11 @@ DROP TABLE IF EXISTS `admin_group`;
CREATE TABLE `admin_group` CREATE TABLE `admin_group`
( (
`id` INTEGER NOT NULL AUTO_INCREMENT, `id` INTEGER NOT NULL AUTO_INCREMENT,
`group_id` INTEGER, `group_id` INTEGER NOT NULL,
`admin_id` INTEGER, `admin_id` INTEGER NOT NULL,
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`,`group_id`,`admin_id`),
INDEX `idx_admin_group_group_id` (`group_id`), INDEX `idx_admin_group_group_id` (`group_id`),
INDEX `idx_admin_group_admin_id` (`admin_id`), INDEX `idx_admin_group_admin_id` (`admin_id`),
CONSTRAINT `fk_admin_group_group_id` CONSTRAINT `fk_admin_group_group_id`
@@ -1074,8 +1057,8 @@ CREATE TABLE `group_resource`
`write` TINYINT DEFAULT 0, `write` TINYINT DEFAULT 0,
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`,`group_id`,`resource_id`),
INDEX `id_idx` (`group_id`), INDEX `id_group_resource_group_id` (`group_id`),
INDEX `idx_group_resource_resource_id` (`resource_id`), INDEX `idx_group_resource_resource_id` (`resource_id`),
CONSTRAINT `fk_group_resource_group_id` CONSTRAINT `fk_group_resource_group_id`
FOREIGN KEY (`group_id`) FOREIGN KEY (`group_id`)

View File

@@ -329,35 +329,16 @@
<table name="customer" namespace="Thelia\Model"> <table name="customer" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" /> <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="ref" required="true" size="50" type="VARCHAR" /> <column name="ref" required="true" size="50" type="VARCHAR" />
<column name="customer_title_id" type="INTEGER" />
<column name="company" size="255" type="VARCHAR" />
<column name="firstname" required="true" size="255" type="VARCHAR" />
<column name="lastname" required="true" size="255" type="VARCHAR" />
<column name="address1" required="true" size="255" type="VARCHAR" />
<column description=" " name="address2" size="255" type="VARCHAR" />
<column name="address3" size="255" type="VARCHAR" />
<column name="zipcode" size="10" type="VARCHAR" />
<column name="city" required="true" size="255" type="VARCHAR" />
<column name="country_id" required="true" type="INTEGER" />
<column name="phone" size="20" type="VARCHAR" />
<column name="cellphone" size="20" type="VARCHAR" />
<column name="email" size="50" type="VARCHAR" /> <column name="email" size="50" type="VARCHAR" />
<column name="password" size="255" type="VARCHAR" /> <column name="password" size="255" type="VARCHAR" />
<column name="algo" size="128" type="VARCHAR" /> <column name="algo" size="128" type="VARCHAR" />
<column name="salt" size="128" type="VARCHAR" />
<column name="reseller" type="TINYINT" /> <column name="reseller" type="TINYINT" />
<column name="lang" size="10" type="VARCHAR" /> <column name="lang" size="10" type="VARCHAR" />
<column name="sponsor" size="50" type="VARCHAR" /> <column name="sponsor" size="50" type="VARCHAR" />
<column name="discount" type="FLOAT" /> <column name="discount" type="FLOAT" />
<foreign-key foreignTable="customer_title" name="fk_customer_customer_title_id" onDelete="SET NULL" onUpdate="RESTRICT">
<reference foreign="id" local="customer_title_id" />
</foreign-key>
<unique name="ref_UNIQUE"> <unique name="ref_UNIQUE">
<unique-column name="ref" /> <unique-column name="ref" />
</unique> </unique>
<index name="idx_ customer_customer_title_id">
<index-column name="customer_title_id" />
</index>
<behavior name="timestampable" /> <behavior name="timestampable" />
</table> </table>
<table name="address" namespace="Thelia\Model"> <table name="address" namespace="Thelia\Model">
@@ -375,6 +356,8 @@
<column name="city" required="true" size="255" type="VARCHAR" /> <column name="city" required="true" size="255" type="VARCHAR" />
<column name="country_id" required="true" type="INTEGER" /> <column name="country_id" required="true" type="INTEGER" />
<column name="phone" size="20" type="VARCHAR" /> <column name="phone" size="20" type="VARCHAR" />
<column name="cellphone" size="20" type="VARCHAR" />
<column defaultValue="0" name="default" type="TINYINT" />
<foreign-key foreignTable="customer" name="fk_address_customer_id" onDelete="CASCADE" onUpdate="RESTRICT"> <foreign-key foreignTable="customer" name="fk_address_customer_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="customer_id" /> <reference foreign="id" local="customer_id" />
</foreign-key> </foreign-key>