From dc22d5bf597e3f55926ff5f19aac58ccdd5029e3 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 12 Jul 2013 16:23:06 +0200 Subject: [PATCH] change customer model --- core/lib/Thelia/Model/Base/Address.php | 153 ++- core/lib/Thelia/Model/Base/AddressQuery.php | 80 +- core/lib/Thelia/Model/Base/Customer.php | 924 +----------------- core/lib/Thelia/Model/Base/CustomerQuery.php | 536 +--------- core/lib/Thelia/Model/Base/CustomerTitle.php | 273 ------ .../Thelia/Model/Base/CustomerTitleQuery.php | 77 -- core/lib/Thelia/Model/Map/AddressTableMap.php | 44 +- .../lib/Thelia/Model/Map/CustomerTableMap.php | 133 +-- .../Model/Map/CustomerTitleTableMap.php | 2 - install/thelia.sql | 33 +- local/config/schema.xml | 21 +- 11 files changed, 322 insertions(+), 1954 deletions(-) diff --git a/core/lib/Thelia/Model/Base/Address.php b/core/lib/Thelia/Model/Base/Address.php index fe734960b..208d43cdb 100755 --- a/core/lib/Thelia/Model/Base/Address.php +++ b/core/lib/Thelia/Model/Base/Address.php @@ -142,6 +142,19 @@ abstract class Address implements ActiveRecordInterface */ 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. * @var string @@ -172,11 +185,24 @@ abstract class Address implements ActiveRecordInterface */ 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. + * @see applyDefaults() */ public function __construct() { + $this->applyDefaultValues(); } /** @@ -580,6 +606,28 @@ abstract class Address implements ActiveRecordInterface 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. * @@ -922,6 +970,48 @@ abstract class Address implements ActiveRecordInterface return $this; } // 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. * @@ -974,6 +1064,10 @@ abstract class Address implements ActiveRecordInterface */ public function hasOnlyDefaultValues() { + if ($this->default !== 0) { + return false; + } + // otherwise, everything was equal, so return TRUE return true; } // 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)]; $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') { $col = 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') { $col = null; } @@ -1062,7 +1162,7 @@ abstract class Address implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 16; // 16 = AddressTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 18; // 18 = AddressTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $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)) { $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)) { $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } @@ -1410,6 +1516,12 @@ abstract class Address implements ActiveRecordInterface case 'PHONE': $stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR); 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': $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); break; @@ -1521,9 +1633,15 @@ abstract class Address implements ActiveRecordInterface return $this->getPhone(); break; case 14: - return $this->getCreatedAt(); + return $this->getCellphone(); break; case 15: + return $this->getDefault(); + break; + case 16: + return $this->getCreatedAt(); + break; + case 17: return $this->getUpdatedAt(); break; default: @@ -1569,8 +1687,10 @@ abstract class Address implements ActiveRecordInterface $keys[11] => $this->getCity(), $keys[12] => $this->getCountryId(), $keys[13] => $this->getPhone(), - $keys[14] => $this->getCreatedAt(), - $keys[15] => $this->getUpdatedAt(), + $keys[14] => $this->getCellphone(), + $keys[15] => $this->getDefault(), + $keys[16] => $this->getCreatedAt(), + $keys[17] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach($virtualColumns as $key => $virtualColumn) @@ -1662,9 +1782,15 @@ abstract class Address implements ActiveRecordInterface $this->setPhone($value); break; case 14: - $this->setCreatedAt($value); + $this->setCellphone($value); break; case 15: + $this->setDefault($value); + break; + case 16: + $this->setCreatedAt($value); + break; + case 17: $this->setUpdatedAt($value); break; } // 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[12], $arr)) $this->setCountryId($arr[$keys[12]]); 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[15], $arr)) $this->setUpdatedAt($arr[$keys[15]]); + if (array_key_exists($keys[14], $arr)) $this->setCellphone($arr[$keys[14]]); + 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::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::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::UPDATED_AT)) $criteria->add(AddressTableMap::UPDATED_AT, $this->updated_at); @@ -1810,6 +1940,8 @@ abstract class Address implements ActiveRecordInterface $copyObj->setCity($this->getCity()); $copyObj->setCountryId($this->getCountryId()); $copyObj->setPhone($this->getPhone()); + $copyObj->setCellphone($this->getCellphone()); + $copyObj->setDefault($this->getDefault()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); if ($makeNew) { @@ -1961,10 +2093,13 @@ abstract class Address implements ActiveRecordInterface $this->city = null; $this->country_id = null; $this->phone = null; + $this->cellphone = null; + $this->default = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; $this->clearAllReferences(); + $this->applyDefaultValues(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); diff --git a/core/lib/Thelia/Model/Base/AddressQuery.php b/core/lib/Thelia/Model/Base/AddressQuery.php index 8611f14a8..c0b32975d 100755 --- a/core/lib/Thelia/Model/Base/AddressQuery.php +++ b/core/lib/Thelia/Model/Base/AddressQuery.php @@ -35,6 +35,8 @@ use Thelia\Model\Map\AddressTableMap; * @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 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 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 groupByCountryId() Group by the country_id 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 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 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 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 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 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 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 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) { - $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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -738,6 +746,76 @@ abstract class AddressQuery extends ModelCriteria return $this->addUsingAlias(AddressTableMap::PHONE, $phone, $comparison); } + /** + * Filter the query on the cellphone column + * + * Example usage: + * + * $query->filterByCellphone('fooValue'); // WHERE cellphone = 'fooValue' + * $query->filterByCellphone('%fooValue%'); // WHERE cellphone LIKE '%fooValue%' + * + * + * @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: + * + * $query->filterByDefault(1234); // WHERE default = 1234 + * $query->filterByDefault(array(12, 34)); // WHERE default IN (12, 34) + * $query->filterByDefault(array('min' => 12)); // WHERE default > 12 + * + * + * @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 * diff --git a/core/lib/Thelia/Model/Base/Customer.php b/core/lib/Thelia/Model/Base/Customer.php index 6941594a0..5fe9080fd 100755 --- a/core/lib/Thelia/Model/Base/Customer.php +++ b/core/lib/Thelia/Model/Base/Customer.php @@ -21,8 +21,6 @@ use Thelia\Model\Address as ChildAddress; 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\CustomerTitleQuery as ChildCustomerTitleQuery; use Thelia\Model\Order as ChildOrder; use Thelia\Model\OrderQuery as ChildOrderQuery; use Thelia\Model\Map\CustomerTableMap; @@ -73,78 +71,6 @@ abstract class Customer implements ActiveRecordInterface */ protected $ref; - /** - * The value for the customer_title_id field. - * @var int - */ - protected $customer_title_id; - - /** - * The value for the company field. - * @var string - */ - protected $company; - - /** - * The value for the firstname field. - * @var string - */ - protected $firstname; - - /** - * The value for the lastname field. - * @var string - */ - protected $lastname; - - /** - * The value for the address1 field. - * @var string - */ - protected $address1; - - /** - * The value for the address2 field. - * @var string - */ - protected $address2; - - /** - * The value for the address3 field. - * @var string - */ - protected $address3; - - /** - * The value for the zipcode field. - * @var string - */ - protected $zipcode; - - /** - * The value for the city field. - * @var string - */ - protected $city; - - /** - * The value for the country_id field. - * @var int - */ - protected $country_id; - - /** - * The value for the phone field. - * @var string - */ - protected $phone; - - /** - * The value for the cellphone field. - * @var string - */ - protected $cellphone; - /** * The value for the email field. * @var string @@ -163,12 +89,6 @@ abstract class Customer implements ActiveRecordInterface */ protected $algo; - /** - * The value for the salt field. - * @var string - */ - protected $salt; - /** * The value for the reseller field. * @var int @@ -205,11 +125,6 @@ abstract class Customer implements ActiveRecordInterface */ protected $updated_at; - /** - * @var CustomerTitle - */ - protected $aCustomerTitle; - /** * @var ObjectCollection|ChildAddress[] Collection to store aggregation of ChildAddress objects. */ @@ -518,138 +433,6 @@ abstract class Customer implements ActiveRecordInterface return $this->ref; } - /** - * Get the [customer_title_id] column value. - * - * @return int - */ - public function getCustomerTitleId() - { - - return $this->customer_title_id; - } - - /** - * Get the [company] column value. - * - * @return string - */ - public function getCompany() - { - - return $this->company; - } - - /** - * Get the [firstname] column value. - * - * @return string - */ - public function getFirstname() - { - - return $this->firstname; - } - - /** - * Get the [lastname] column value. - * - * @return string - */ - public function getLastname() - { - - return $this->lastname; - } - - /** - * Get the [address1] column value. - * - * @return string - */ - public function getAddress1() - { - - return $this->address1; - } - - /** - * Get the [address2] column value. - * - * @return string - */ - public function getAddress2() - { - - return $this->address2; - } - - /** - * Get the [address3] column value. - * - * @return string - */ - public function getAddress3() - { - - return $this->address3; - } - - /** - * Get the [zipcode] column value. - * - * @return string - */ - public function getZipcode() - { - - return $this->zipcode; - } - - /** - * Get the [city] column value. - * - * @return string - */ - public function getCity() - { - - return $this->city; - } - - /** - * Get the [country_id] column value. - * - * @return int - */ - public function getCountryId() - { - - return $this->country_id; - } - - /** - * Get the [phone] column value. - * - * @return string - */ - public function getPhone() - { - - return $this->phone; - } - - /** - * Get the [cellphone] column value. - * - * @return string - */ - public function getCellphone() - { - - return $this->cellphone; - } - /** * Get the [email] column value. * @@ -683,17 +466,6 @@ abstract class Customer implements ActiveRecordInterface return $this->algo; } - /** - * Get the [salt] column value. - * - * @return string - */ - public function getSalt() - { - - return $this->salt; - } - /** * Get the [reseller] column value. * @@ -820,262 +592,6 @@ abstract class Customer implements ActiveRecordInterface return $this; } // setRef() - /** - * Set the value of [customer_title_id] column. - * - * @param int $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setCustomerTitleId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->customer_title_id !== $v) { - $this->customer_title_id = $v; - $this->modifiedColumns[] = CustomerTableMap::CUSTOMER_TITLE_ID; - } - - if ($this->aCustomerTitle !== null && $this->aCustomerTitle->getId() !== $v) { - $this->aCustomerTitle = null; - } - - - return $this; - } // setCustomerTitleId() - - /** - * Set the value of [company] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setCompany($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->company !== $v) { - $this->company = $v; - $this->modifiedColumns[] = CustomerTableMap::COMPANY; - } - - - return $this; - } // setCompany() - - /** - * Set the value of [firstname] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setFirstname($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->firstname !== $v) { - $this->firstname = $v; - $this->modifiedColumns[] = CustomerTableMap::FIRSTNAME; - } - - - return $this; - } // setFirstname() - - /** - * Set the value of [lastname] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setLastname($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->lastname !== $v) { - $this->lastname = $v; - $this->modifiedColumns[] = CustomerTableMap::LASTNAME; - } - - - return $this; - } // setLastname() - - /** - * Set the value of [address1] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setAddress1($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->address1 !== $v) { - $this->address1 = $v; - $this->modifiedColumns[] = CustomerTableMap::ADDRESS1; - } - - - return $this; - } // setAddress1() - - /** - * Set the value of [address2] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setAddress2($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->address2 !== $v) { - $this->address2 = $v; - $this->modifiedColumns[] = CustomerTableMap::ADDRESS2; - } - - - return $this; - } // setAddress2() - - /** - * Set the value of [address3] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setAddress3($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->address3 !== $v) { - $this->address3 = $v; - $this->modifiedColumns[] = CustomerTableMap::ADDRESS3; - } - - - return $this; - } // setAddress3() - - /** - * Set the value of [zipcode] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setZipcode($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->zipcode !== $v) { - $this->zipcode = $v; - $this->modifiedColumns[] = CustomerTableMap::ZIPCODE; - } - - - return $this; - } // setZipcode() - - /** - * Set the value of [city] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setCity($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->city !== $v) { - $this->city = $v; - $this->modifiedColumns[] = CustomerTableMap::CITY; - } - - - return $this; - } // setCity() - - /** - * Set the value of [country_id] column. - * - * @param int $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setCountryId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->country_id !== $v) { - $this->country_id = $v; - $this->modifiedColumns[] = CustomerTableMap::COUNTRY_ID; - } - - - return $this; - } // setCountryId() - - /** - * Set the value of [phone] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setPhone($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->phone !== $v) { - $this->phone = $v; - $this->modifiedColumns[] = CustomerTableMap::PHONE; - } - - - return $this; - } // setPhone() - - /** - * Set the value of [cellphone] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer 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[] = CustomerTableMap::CELLPHONE; - } - - - return $this; - } // setCellphone() - /** * Set the value of [email] column. * @@ -1139,27 +655,6 @@ abstract class Customer implements ActiveRecordInterface return $this; } // setAlgo() - /** - * Set the value of [salt] column. - * - * @param string $v new value - * @return \Thelia\Model\Customer The current object (for fluent API support) - */ - public function setSalt($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->salt !== $v) { - $this->salt = $v; - $this->modifiedColumns[] = CustomerTableMap::SALT; - } - - - return $this; - } // setSalt() - /** * Set the value of [reseller] column. * @@ -1329,73 +824,34 @@ abstract class Customer implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : CustomerTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)]; $this->ref = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CustomerTableMap::translateFieldName('CustomerTitleId', TableMap::TYPE_PHPNAME, $indexType)]; - $this->customer_title_id = (null !== $col) ? (int) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CustomerTableMap::translateFieldName('Company', TableMap::TYPE_PHPNAME, $indexType)]; - $this->company = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CustomerTableMap::translateFieldName('Firstname', TableMap::TYPE_PHPNAME, $indexType)]; - $this->firstname = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CustomerTableMap::translateFieldName('Lastname', TableMap::TYPE_PHPNAME, $indexType)]; - $this->lastname = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CustomerTableMap::translateFieldName('Address1', TableMap::TYPE_PHPNAME, $indexType)]; - $this->address1 = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CustomerTableMap::translateFieldName('Address2', TableMap::TYPE_PHPNAME, $indexType)]; - $this->address2 = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CustomerTableMap::translateFieldName('Address3', TableMap::TYPE_PHPNAME, $indexType)]; - $this->address3 = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CustomerTableMap::translateFieldName('Zipcode', TableMap::TYPE_PHPNAME, $indexType)]; - $this->zipcode = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CustomerTableMap::translateFieldName('City', TableMap::TYPE_PHPNAME, $indexType)]; - $this->city = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CustomerTableMap::translateFieldName('CountryId', TableMap::TYPE_PHPNAME, $indexType)]; - $this->country_id = (null !== $col) ? (int) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : CustomerTableMap::translateFieldName('Phone', TableMap::TYPE_PHPNAME, $indexType)]; - $this->phone = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : CustomerTableMap::translateFieldName('Cellphone', TableMap::TYPE_PHPNAME, $indexType)]; - $this->cellphone = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : CustomerTableMap::translateFieldName('Email', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CustomerTableMap::translateFieldName('Email', TableMap::TYPE_PHPNAME, $indexType)]; $this->email = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : CustomerTableMap::translateFieldName('Password', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CustomerTableMap::translateFieldName('Password', TableMap::TYPE_PHPNAME, $indexType)]; $this->password = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : CustomerTableMap::translateFieldName('Algo', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CustomerTableMap::translateFieldName('Algo', TableMap::TYPE_PHPNAME, $indexType)]; $this->algo = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : CustomerTableMap::translateFieldName('Salt', TableMap::TYPE_PHPNAME, $indexType)]; - $this->salt = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 18 + $startcol : CustomerTableMap::translateFieldName('Reseller', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CustomerTableMap::translateFieldName('Reseller', TableMap::TYPE_PHPNAME, $indexType)]; $this->reseller = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 19 + $startcol : CustomerTableMap::translateFieldName('Lang', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CustomerTableMap::translateFieldName('Lang', TableMap::TYPE_PHPNAME, $indexType)]; $this->lang = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 20 + $startcol : CustomerTableMap::translateFieldName('Sponsor', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CustomerTableMap::translateFieldName('Sponsor', TableMap::TYPE_PHPNAME, $indexType)]; $this->sponsor = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 21 + $startcol : CustomerTableMap::translateFieldName('Discount', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CustomerTableMap::translateFieldName('Discount', TableMap::TYPE_PHPNAME, $indexType)]; $this->discount = (null !== $col) ? (double) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 22 + $startcol : CustomerTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CustomerTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 23 + $startcol : CustomerTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CustomerTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -1408,7 +864,7 @@ abstract class Customer implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 24; // 24 = CustomerTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 11; // 11 = CustomerTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating \Thelia\Model\Customer object", 0, $e); @@ -1430,9 +886,6 @@ abstract class Customer implements ActiveRecordInterface */ public function ensureConsistency() { - if ($this->aCustomerTitle !== null && $this->customer_title_id !== $this->aCustomerTitle->getId()) { - $this->aCustomerTitle = null; - } } // ensureConsistency /** @@ -1472,7 +925,6 @@ abstract class Customer implements ActiveRecordInterface if ($deep) { // also de-associate any related objects? - $this->aCustomerTitle = null; $this->collAddresses = null; $this->collOrders = null; @@ -1599,18 +1051,6 @@ abstract class Customer implements ActiveRecordInterface if (!$this->alreadyInSave) { $this->alreadyInSave = true; - // We call the save method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aCustomerTitle !== null) { - if ($this->aCustomerTitle->isModified() || $this->aCustomerTitle->isNew()) { - $affectedRows += $this->aCustomerTitle->save($con); - } - $this->setCustomerTitle($this->aCustomerTitle); - } - if ($this->isNew() || $this->isModified()) { // persist changes if ($this->isNew()) { @@ -1688,42 +1128,6 @@ abstract class Customer implements ActiveRecordInterface if ($this->isColumnModified(CustomerTableMap::REF)) { $modifiedColumns[':p' . $index++] = 'REF'; } - if ($this->isColumnModified(CustomerTableMap::CUSTOMER_TITLE_ID)) { - $modifiedColumns[':p' . $index++] = 'CUSTOMER_TITLE_ID'; - } - if ($this->isColumnModified(CustomerTableMap::COMPANY)) { - $modifiedColumns[':p' . $index++] = 'COMPANY'; - } - if ($this->isColumnModified(CustomerTableMap::FIRSTNAME)) { - $modifiedColumns[':p' . $index++] = 'FIRSTNAME'; - } - if ($this->isColumnModified(CustomerTableMap::LASTNAME)) { - $modifiedColumns[':p' . $index++] = 'LASTNAME'; - } - if ($this->isColumnModified(CustomerTableMap::ADDRESS1)) { - $modifiedColumns[':p' . $index++] = 'ADDRESS1'; - } - if ($this->isColumnModified(CustomerTableMap::ADDRESS2)) { - $modifiedColumns[':p' . $index++] = 'ADDRESS2'; - } - if ($this->isColumnModified(CustomerTableMap::ADDRESS3)) { - $modifiedColumns[':p' . $index++] = 'ADDRESS3'; - } - if ($this->isColumnModified(CustomerTableMap::ZIPCODE)) { - $modifiedColumns[':p' . $index++] = 'ZIPCODE'; - } - if ($this->isColumnModified(CustomerTableMap::CITY)) { - $modifiedColumns[':p' . $index++] = 'CITY'; - } - if ($this->isColumnModified(CustomerTableMap::COUNTRY_ID)) { - $modifiedColumns[':p' . $index++] = 'COUNTRY_ID'; - } - if ($this->isColumnModified(CustomerTableMap::PHONE)) { - $modifiedColumns[':p' . $index++] = 'PHONE'; - } - if ($this->isColumnModified(CustomerTableMap::CELLPHONE)) { - $modifiedColumns[':p' . $index++] = 'CELLPHONE'; - } if ($this->isColumnModified(CustomerTableMap::EMAIL)) { $modifiedColumns[':p' . $index++] = 'EMAIL'; } @@ -1733,9 +1137,6 @@ abstract class Customer implements ActiveRecordInterface if ($this->isColumnModified(CustomerTableMap::ALGO)) { $modifiedColumns[':p' . $index++] = 'ALGO'; } - if ($this->isColumnModified(CustomerTableMap::SALT)) { - $modifiedColumns[':p' . $index++] = 'SALT'; - } if ($this->isColumnModified(CustomerTableMap::RESELLER)) { $modifiedColumns[':p' . $index++] = 'RESELLER'; } @@ -1771,42 +1172,6 @@ abstract class Customer implements ActiveRecordInterface case 'REF': $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); break; - case 'CUSTOMER_TITLE_ID': - $stmt->bindValue($identifier, $this->customer_title_id, PDO::PARAM_INT); - break; - case 'COMPANY': - $stmt->bindValue($identifier, $this->company, PDO::PARAM_STR); - break; - case 'FIRSTNAME': - $stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR); - break; - case 'LASTNAME': - $stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR); - break; - case 'ADDRESS1': - $stmt->bindValue($identifier, $this->address1, PDO::PARAM_STR); - break; - case 'ADDRESS2': - $stmt->bindValue($identifier, $this->address2, PDO::PARAM_STR); - break; - case 'ADDRESS3': - $stmt->bindValue($identifier, $this->address3, PDO::PARAM_STR); - break; - case 'ZIPCODE': - $stmt->bindValue($identifier, $this->zipcode, PDO::PARAM_STR); - break; - case 'CITY': - $stmt->bindValue($identifier, $this->city, PDO::PARAM_STR); - break; - case 'COUNTRY_ID': - $stmt->bindValue($identifier, $this->country_id, PDO::PARAM_INT); - break; - case 'PHONE': - $stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR); - break; - case 'CELLPHONE': - $stmt->bindValue($identifier, $this->cellphone, PDO::PARAM_STR); - break; case 'EMAIL': $stmt->bindValue($identifier, $this->email, PDO::PARAM_STR); break; @@ -1816,9 +1181,6 @@ abstract class Customer implements ActiveRecordInterface case 'ALGO': $stmt->bindValue($identifier, $this->algo, PDO::PARAM_STR); break; - case 'SALT': - $stmt->bindValue($identifier, $this->salt, PDO::PARAM_STR); - break; case 'RESELLER': $stmt->bindValue($identifier, $this->reseller, PDO::PARAM_INT); break; @@ -1906,69 +1268,30 @@ abstract class Customer implements ActiveRecordInterface return $this->getRef(); break; case 2: - return $this->getCustomerTitleId(); - break; - case 3: - return $this->getCompany(); - break; - case 4: - return $this->getFirstname(); - break; - case 5: - return $this->getLastname(); - break; - case 6: - return $this->getAddress1(); - break; - case 7: - return $this->getAddress2(); - break; - case 8: - return $this->getAddress3(); - break; - case 9: - return $this->getZipcode(); - break; - case 10: - return $this->getCity(); - break; - case 11: - return $this->getCountryId(); - break; - case 12: - return $this->getPhone(); - break; - case 13: - return $this->getCellphone(); - break; - case 14: return $this->getEmail(); break; - case 15: + case 3: return $this->getPassword(); break; - case 16: + case 4: return $this->getAlgo(); break; - case 17: - return $this->getSalt(); - break; - case 18: + case 5: return $this->getReseller(); break; - case 19: + case 6: return $this->getLang(); break; - case 20: + case 7: return $this->getSponsor(); break; - case 21: + case 8: return $this->getDiscount(); break; - case 22: + case 9: return $this->getCreatedAt(); break; - case 23: + case 10: return $this->getUpdatedAt(); break; default: @@ -2002,28 +1325,15 @@ abstract class Customer implements ActiveRecordInterface $result = array( $keys[0] => $this->getId(), $keys[1] => $this->getRef(), - $keys[2] => $this->getCustomerTitleId(), - $keys[3] => $this->getCompany(), - $keys[4] => $this->getFirstname(), - $keys[5] => $this->getLastname(), - $keys[6] => $this->getAddress1(), - $keys[7] => $this->getAddress2(), - $keys[8] => $this->getAddress3(), - $keys[9] => $this->getZipcode(), - $keys[10] => $this->getCity(), - $keys[11] => $this->getCountryId(), - $keys[12] => $this->getPhone(), - $keys[13] => $this->getCellphone(), - $keys[14] => $this->getEmail(), - $keys[15] => $this->getPassword(), - $keys[16] => $this->getAlgo(), - $keys[17] => $this->getSalt(), - $keys[18] => $this->getReseller(), - $keys[19] => $this->getLang(), - $keys[20] => $this->getSponsor(), - $keys[21] => $this->getDiscount(), - $keys[22] => $this->getCreatedAt(), - $keys[23] => $this->getUpdatedAt(), + $keys[2] => $this->getEmail(), + $keys[3] => $this->getPassword(), + $keys[4] => $this->getAlgo(), + $keys[5] => $this->getReseller(), + $keys[6] => $this->getLang(), + $keys[7] => $this->getSponsor(), + $keys[8] => $this->getDiscount(), + $keys[9] => $this->getCreatedAt(), + $keys[10] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach($virtualColumns as $key => $virtualColumn) @@ -2032,9 +1342,6 @@ abstract class Customer implements ActiveRecordInterface } if ($includeForeignObjects) { - if (null !== $this->aCustomerTitle) { - $result['CustomerTitle'] = $this->aCustomerTitle->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); - } if (null !== $this->collAddresses) { $result['Addresses'] = $this->collAddresses->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } @@ -2082,69 +1389,30 @@ abstract class Customer implements ActiveRecordInterface $this->setRef($value); break; case 2: - $this->setCustomerTitleId($value); - break; - case 3: - $this->setCompany($value); - break; - case 4: - $this->setFirstname($value); - break; - case 5: - $this->setLastname($value); - break; - case 6: - $this->setAddress1($value); - break; - case 7: - $this->setAddress2($value); - break; - case 8: - $this->setAddress3($value); - break; - case 9: - $this->setZipcode($value); - break; - case 10: - $this->setCity($value); - break; - case 11: - $this->setCountryId($value); - break; - case 12: - $this->setPhone($value); - break; - case 13: - $this->setCellphone($value); - break; - case 14: $this->setEmail($value); break; - case 15: + case 3: $this->setPassword($value); break; - case 16: + case 4: $this->setAlgo($value); break; - case 17: - $this->setSalt($value); - break; - case 18: + case 5: $this->setReseller($value); break; - case 19: + case 6: $this->setLang($value); break; - case 20: + case 7: $this->setSponsor($value); break; - case 21: + case 8: $this->setDiscount($value); break; - case 22: + case 9: $this->setCreatedAt($value); break; - case 23: + case 10: $this->setUpdatedAt($value); break; } // switch() @@ -2173,28 +1441,15 @@ abstract class Customer implements ActiveRecordInterface if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setRef($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setCustomerTitleId($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setCompany($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setFirstname($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setLastname($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setAddress1($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setAddress2($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setAddress3($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setZipcode($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setCity($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setCountryId($arr[$keys[11]]); - if (array_key_exists($keys[12], $arr)) $this->setPhone($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setCellphone($arr[$keys[13]]); - if (array_key_exists($keys[14], $arr)) $this->setEmail($arr[$keys[14]]); - if (array_key_exists($keys[15], $arr)) $this->setPassword($arr[$keys[15]]); - if (array_key_exists($keys[16], $arr)) $this->setAlgo($arr[$keys[16]]); - if (array_key_exists($keys[17], $arr)) $this->setSalt($arr[$keys[17]]); - if (array_key_exists($keys[18], $arr)) $this->setReseller($arr[$keys[18]]); - if (array_key_exists($keys[19], $arr)) $this->setLang($arr[$keys[19]]); - if (array_key_exists($keys[20], $arr)) $this->setSponsor($arr[$keys[20]]); - if (array_key_exists($keys[21], $arr)) $this->setDiscount($arr[$keys[21]]); - if (array_key_exists($keys[22], $arr)) $this->setCreatedAt($arr[$keys[22]]); - if (array_key_exists($keys[23], $arr)) $this->setUpdatedAt($arr[$keys[23]]); + if (array_key_exists($keys[2], $arr)) $this->setEmail($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setPassword($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setAlgo($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setReseller($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setLang($arr[$keys[6]]); + if (array_key_exists($keys[7], $arr)) $this->setSponsor($arr[$keys[7]]); + if (array_key_exists($keys[8], $arr)) $this->setDiscount($arr[$keys[8]]); + if (array_key_exists($keys[9], $arr)) $this->setCreatedAt($arr[$keys[9]]); + if (array_key_exists($keys[10], $arr)) $this->setUpdatedAt($arr[$keys[10]]); } /** @@ -2208,22 +1463,9 @@ abstract class Customer implements ActiveRecordInterface if ($this->isColumnModified(CustomerTableMap::ID)) $criteria->add(CustomerTableMap::ID, $this->id); if ($this->isColumnModified(CustomerTableMap::REF)) $criteria->add(CustomerTableMap::REF, $this->ref); - if ($this->isColumnModified(CustomerTableMap::CUSTOMER_TITLE_ID)) $criteria->add(CustomerTableMap::CUSTOMER_TITLE_ID, $this->customer_title_id); - if ($this->isColumnModified(CustomerTableMap::COMPANY)) $criteria->add(CustomerTableMap::COMPANY, $this->company); - if ($this->isColumnModified(CustomerTableMap::FIRSTNAME)) $criteria->add(CustomerTableMap::FIRSTNAME, $this->firstname); - if ($this->isColumnModified(CustomerTableMap::LASTNAME)) $criteria->add(CustomerTableMap::LASTNAME, $this->lastname); - if ($this->isColumnModified(CustomerTableMap::ADDRESS1)) $criteria->add(CustomerTableMap::ADDRESS1, $this->address1); - if ($this->isColumnModified(CustomerTableMap::ADDRESS2)) $criteria->add(CustomerTableMap::ADDRESS2, $this->address2); - if ($this->isColumnModified(CustomerTableMap::ADDRESS3)) $criteria->add(CustomerTableMap::ADDRESS3, $this->address3); - if ($this->isColumnModified(CustomerTableMap::ZIPCODE)) $criteria->add(CustomerTableMap::ZIPCODE, $this->zipcode); - if ($this->isColumnModified(CustomerTableMap::CITY)) $criteria->add(CustomerTableMap::CITY, $this->city); - if ($this->isColumnModified(CustomerTableMap::COUNTRY_ID)) $criteria->add(CustomerTableMap::COUNTRY_ID, $this->country_id); - if ($this->isColumnModified(CustomerTableMap::PHONE)) $criteria->add(CustomerTableMap::PHONE, $this->phone); - if ($this->isColumnModified(CustomerTableMap::CELLPHONE)) $criteria->add(CustomerTableMap::CELLPHONE, $this->cellphone); if ($this->isColumnModified(CustomerTableMap::EMAIL)) $criteria->add(CustomerTableMap::EMAIL, $this->email); if ($this->isColumnModified(CustomerTableMap::PASSWORD)) $criteria->add(CustomerTableMap::PASSWORD, $this->password); if ($this->isColumnModified(CustomerTableMap::ALGO)) $criteria->add(CustomerTableMap::ALGO, $this->algo); - if ($this->isColumnModified(CustomerTableMap::SALT)) $criteria->add(CustomerTableMap::SALT, $this->salt); if ($this->isColumnModified(CustomerTableMap::RESELLER)) $criteria->add(CustomerTableMap::RESELLER, $this->reseller); if ($this->isColumnModified(CustomerTableMap::LANG)) $criteria->add(CustomerTableMap::LANG, $this->lang); if ($this->isColumnModified(CustomerTableMap::SPONSOR)) $criteria->add(CustomerTableMap::SPONSOR, $this->sponsor); @@ -2294,22 +1536,9 @@ abstract class Customer implements ActiveRecordInterface public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setRef($this->getRef()); - $copyObj->setCustomerTitleId($this->getCustomerTitleId()); - $copyObj->setCompany($this->getCompany()); - $copyObj->setFirstname($this->getFirstname()); - $copyObj->setLastname($this->getLastname()); - $copyObj->setAddress1($this->getAddress1()); - $copyObj->setAddress2($this->getAddress2()); - $copyObj->setAddress3($this->getAddress3()); - $copyObj->setZipcode($this->getZipcode()); - $copyObj->setCity($this->getCity()); - $copyObj->setCountryId($this->getCountryId()); - $copyObj->setPhone($this->getPhone()); - $copyObj->setCellphone($this->getCellphone()); $copyObj->setEmail($this->getEmail()); $copyObj->setPassword($this->getPassword()); $copyObj->setAlgo($this->getAlgo()); - $copyObj->setSalt($this->getSalt()); $copyObj->setReseller($this->getReseller()); $copyObj->setLang($this->getLang()); $copyObj->setSponsor($this->getSponsor()); @@ -2364,57 +1593,6 @@ abstract class Customer implements ActiveRecordInterface return $copyObj; } - /** - * Declares an association between this object and a ChildCustomerTitle object. - * - * @param ChildCustomerTitle $v - * @return \Thelia\Model\Customer The current object (for fluent API support) - * @throws PropelException - */ - public function setCustomerTitle(ChildCustomerTitle $v = null) - { - if ($v === null) { - $this->setCustomerTitleId(NULL); - } else { - $this->setCustomerTitleId($v->getId()); - } - - $this->aCustomerTitle = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the ChildCustomerTitle object, it will not be re-added. - if ($v !== null) { - $v->addCustomer($this); - } - - - return $this; - } - - - /** - * Get the associated ChildCustomerTitle object - * - * @param ConnectionInterface $con Optional Connection object. - * @return ChildCustomerTitle The associated ChildCustomerTitle object. - * @throws PropelException - */ - public function getCustomerTitle(ConnectionInterface $con = null) - { - if ($this->aCustomerTitle === null && ($this->customer_title_id !== null)) { - $this->aCustomerTitle = ChildCustomerTitleQuery::create()->findPk($this->customer_title_id, $con); - /* The following can be used additionally to - guarantee the related object contains a reference - to this object. This level of coupling may, however, be - undesirable since it could result in an only partially populated collection - in the referenced object. - $this->aCustomerTitle->addCustomers($this); - */ - } - - return $this->aCustomerTitle; - } - /** * Initializes a collection based on the name of a relation. @@ -3002,22 +2180,9 @@ abstract class Customer implements ActiveRecordInterface { $this->id = null; $this->ref = null; - $this->customer_title_id = null; - $this->company = null; - $this->firstname = null; - $this->lastname = null; - $this->address1 = null; - $this->address2 = null; - $this->address3 = null; - $this->zipcode = null; - $this->city = null; - $this->country_id = null; - $this->phone = null; - $this->cellphone = null; $this->email = null; $this->password = null; $this->algo = null; - $this->salt = null; $this->reseller = null; $this->lang = null; $this->sponsor = null; @@ -3063,7 +2228,6 @@ abstract class Customer implements ActiveRecordInterface $this->collOrders->clearIterator(); } $this->collOrders = null; - $this->aCustomerTitle = null; } /** diff --git a/core/lib/Thelia/Model/Base/CustomerQuery.php b/core/lib/Thelia/Model/Base/CustomerQuery.php index eb6371592..5bc89fa3b 100755 --- a/core/lib/Thelia/Model/Base/CustomerQuery.php +++ b/core/lib/Thelia/Model/Base/CustomerQuery.php @@ -23,22 +23,9 @@ use Thelia\Model\Map\CustomerTableMap; * * @method ChildCustomerQuery orderById($order = Criteria::ASC) Order by the id column * @method ChildCustomerQuery orderByRef($order = Criteria::ASC) Order by the ref column - * @method ChildCustomerQuery 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 orderByPassword($order = Criteria::ASC) Order by the password 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 orderByLang($order = Criteria::ASC) Order by the lang 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 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 groupByPassword() Group by the password 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 groupByLang() Group by the lang 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 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 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 @@ -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 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 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 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 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 @@ -117,22 +74,9 @@ use Thelia\Model\Map\CustomerTableMap; * * @method array findById(int $id) Return ChildCustomer objects filtered by the id column * @method array findByRef(string $ref) Return ChildCustomer objects filtered by the ref column - * @method array 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 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 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 findByLang(string $lang) Return ChildCustomer objects filtered by the lang 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) { - $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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -386,380 +330,6 @@ abstract class CustomerQuery extends ModelCriteria return $this->addUsingAlias(CustomerTableMap::REF, $ref, $comparison); } - /** - * Filter the query on the customer_title_id column - * - * Example usage: - * - * $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 - * - * - * @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: - * - * $query->filterByCompany('fooValue'); // WHERE company = 'fooValue' - * $query->filterByCompany('%fooValue%'); // WHERE company LIKE '%fooValue%' - * - * - * @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: - * - * $query->filterByFirstname('fooValue'); // WHERE firstname = 'fooValue' - * $query->filterByFirstname('%fooValue%'); // WHERE firstname LIKE '%fooValue%' - * - * - * @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: - * - * $query->filterByLastname('fooValue'); // WHERE lastname = 'fooValue' - * $query->filterByLastname('%fooValue%'); // WHERE lastname LIKE '%fooValue%' - * - * - * @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: - * - * $query->filterByAddress1('fooValue'); // WHERE address1 = 'fooValue' - * $query->filterByAddress1('%fooValue%'); // WHERE address1 LIKE '%fooValue%' - * - * - * @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: - * - * $query->filterByAddress2('fooValue'); // WHERE address2 = 'fooValue' - * $query->filterByAddress2('%fooValue%'); // WHERE address2 LIKE '%fooValue%' - * - * - * @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: - * - * $query->filterByAddress3('fooValue'); // WHERE address3 = 'fooValue' - * $query->filterByAddress3('%fooValue%'); // WHERE address3 LIKE '%fooValue%' - * - * - * @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: - * - * $query->filterByZipcode('fooValue'); // WHERE zipcode = 'fooValue' - * $query->filterByZipcode('%fooValue%'); // WHERE zipcode LIKE '%fooValue%' - * - * - * @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: - * - * $query->filterByCity('fooValue'); // WHERE city = 'fooValue' - * $query->filterByCity('%fooValue%'); // WHERE city LIKE '%fooValue%' - * - * - * @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: - * - * $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 - * - * - * @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: - * - * $query->filterByPhone('fooValue'); // WHERE phone = 'fooValue' - * $query->filterByPhone('%fooValue%'); // WHERE phone LIKE '%fooValue%' - * - * - * @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: - * - * $query->filterByCellphone('fooValue'); // WHERE cellphone = 'fooValue' - * $query->filterByCellphone('%fooValue%'); // WHERE cellphone LIKE '%fooValue%' - * - * - * @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 * @@ -847,35 +417,6 @@ abstract class CustomerQuery extends ModelCriteria return $this->addUsingAlias(CustomerTableMap::ALGO, $algo, $comparison); } - /** - * Filter the query on the salt column - * - * Example usage: - * - * $query->filterBySalt('fooValue'); // WHERE salt = 'fooValue' - * $query->filterBySalt('%fooValue%'); // WHERE salt LIKE '%fooValue%' - * - * - * @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 * @@ -1102,81 +643,6 @@ abstract class CustomerQuery extends ModelCriteria 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 * diff --git a/core/lib/Thelia/Model/Base/CustomerTitle.php b/core/lib/Thelia/Model/Base/CustomerTitle.php index d126839d0..459940747 100755 --- a/core/lib/Thelia/Model/Base/CustomerTitle.php +++ b/core/lib/Thelia/Model/Base/CustomerTitle.php @@ -19,8 +19,6 @@ use Propel\Runtime\Parser\AbstractParser; use Propel\Runtime\Util\PropelDateTime; use Thelia\Model\Address as ChildAddress; 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\CustomerTitleI18n as ChildCustomerTitleI18n; use Thelia\Model\CustomerTitleI18nQuery as ChildCustomerTitleI18nQuery; @@ -92,12 +90,6 @@ abstract class CustomerTitle implements ActiveRecordInterface */ 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. */ @@ -132,12 +124,6 @@ abstract class CustomerTitle implements ActiveRecordInterface */ protected $currentTranslations; - /** - * An array of objects scheduled for deletion. - * @var ObjectCollection - */ - protected $customersScheduledForDeletion = null; - /** * An array of objects scheduled for deletion. * @var ObjectCollection @@ -725,8 +711,6 @@ abstract class CustomerTitle implements ActiveRecordInterface if ($deep) { // also de-associate any related objects? - $this->collCustomers = null; - $this->collAddresses = null; $this->collCustomerTitleI18ns = null; @@ -864,24 +848,6 @@ abstract class CustomerTitle implements ActiveRecordInterface $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->isEmpty()) { foreach ($this->addressesScheduledForDeletion as $address) { @@ -1103,9 +1069,6 @@ abstract class CustomerTitle implements ActiveRecordInterface } if ($includeForeignObjects) { - if (null !== $this->collCustomers) { - $result['Customers'] = $this->collCustomers->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); - } if (null !== $this->collAddresses) { $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. $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) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addAddress($relObj->copy($deepCopy)); @@ -1338,9 +1295,6 @@ abstract class CustomerTitle implements ActiveRecordInterface */ public function initRelation($relationName) { - if ('Customer' == $relationName) { - return $this->initCustomers(); - } if ('Address' == $relationName) { 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 * @@ -2065,11 +1801,6 @@ abstract class CustomerTitle implements ActiveRecordInterface public function clearAllReferences($deep = false) { if ($deep) { - if ($this->collCustomers) { - foreach ($this->collCustomers as $o) { - $o->clearAllReferences($deep); - } - } if ($this->collAddresses) { foreach ($this->collAddresses as $o) { $o->clearAllReferences($deep); @@ -2086,10 +1817,6 @@ abstract class CustomerTitle implements ActiveRecordInterface $this->currentLocale = 'en_US'; $this->currentTranslations = null; - if ($this->collCustomers instanceof Collection) { - $this->collCustomers->clearIterator(); - } - $this->collCustomers = null; if ($this->collAddresses instanceof Collection) { $this->collAddresses->clearIterator(); } diff --git a/core/lib/Thelia/Model/Base/CustomerTitleQuery.php b/core/lib/Thelia/Model/Base/CustomerTitleQuery.php index 940db1425..95b2a8326 100755 --- a/core/lib/Thelia/Model/Base/CustomerTitleQuery.php +++ b/core/lib/Thelia/Model/Base/CustomerTitleQuery.php @@ -38,10 +38,6 @@ use Thelia\Model\Map\CustomerTitleTableMap; * @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 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 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 @@ -438,79 +434,6 @@ abstract class CustomerTitleQuery extends ModelCriteria 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 * diff --git a/core/lib/Thelia/Model/Map/AddressTableMap.php b/core/lib/Thelia/Model/Map/AddressTableMap.php index 8a6126964..5a360f08e 100755 --- a/core/lib/Thelia/Model/Map/AddressTableMap.php +++ b/core/lib/Thelia/Model/Map/AddressTableMap.php @@ -57,7 +57,7 @@ class AddressTableMap extends TableMap /** * The total number of columns */ - const NUM_COLUMNS = 16; + const NUM_COLUMNS = 18; /** * 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) */ - const NUM_HYDRATE_COLUMNS = 16; + const NUM_HYDRATE_COLUMNS = 18; /** * the column name for the ID field @@ -139,6 +139,16 @@ class AddressTableMap extends TableMap */ 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 */ @@ -161,12 +171,12 @@ class AddressTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ 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_STUDLYPHPNAME => array('id', 'title', 'customerId', 'customerTitleId', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'countryId', 'phone', '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_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_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_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ) + 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', '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::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', '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', '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, 16, 17, ) ); /** @@ -176,12 +186,12 @@ class AddressTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ 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_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_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_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_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_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 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, '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::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, '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, '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, 16, 17, ) ); /** @@ -214,6 +224,8 @@ class AddressTableMap extends TableMap $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('DEFAULT', 'Default', 'TINYINT', false, null, 0); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); } // initialize() @@ -392,6 +404,8 @@ class AddressTableMap extends TableMap $criteria->addSelectColumn(AddressTableMap::CITY); $criteria->addSelectColumn(AddressTableMap::COUNTRY_ID); $criteria->addSelectColumn(AddressTableMap::PHONE); + $criteria->addSelectColumn(AddressTableMap::CELLPHONE); + $criteria->addSelectColumn(AddressTableMap::DEFAULT); $criteria->addSelectColumn(AddressTableMap::CREATED_AT); $criteria->addSelectColumn(AddressTableMap::UPDATED_AT); } else { @@ -409,6 +423,8 @@ class AddressTableMap extends TableMap $criteria->addSelectColumn($alias . '.CITY'); $criteria->addSelectColumn($alias . '.COUNTRY_ID'); $criteria->addSelectColumn($alias . '.PHONE'); + $criteria->addSelectColumn($alias . '.CELLPHONE'); + $criteria->addSelectColumn($alias . '.DEFAULT'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); } diff --git a/core/lib/Thelia/Model/Map/CustomerTableMap.php b/core/lib/Thelia/Model/Map/CustomerTableMap.php index 030d233d9..011ecc549 100755 --- a/core/lib/Thelia/Model/Map/CustomerTableMap.php +++ b/core/lib/Thelia/Model/Map/CustomerTableMap.php @@ -57,7 +57,7 @@ class CustomerTableMap extends TableMap /** * The total number of columns */ - const NUM_COLUMNS = 24; + const NUM_COLUMNS = 11; /** * The number of lazy-loaded columns @@ -67,7 +67,7 @@ class CustomerTableMap extends TableMap /** * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 24; + const NUM_HYDRATE_COLUMNS = 11; /** * the column name for the ID field @@ -79,66 +79,6 @@ class CustomerTableMap extends TableMap */ 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 */ @@ -154,11 +94,6 @@ class CustomerTableMap extends TableMap */ const ALGO = 'customer.ALGO'; - /** - * the column name for the SALT field - */ - const SALT = 'customer.SALT'; - /** * the column name for the RESELLER field */ @@ -201,12 +136,12 @@ class CustomerTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ 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_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_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_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_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_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_PHPNAME => array('Id', 'Ref', 'Email', 'Password', 'Algo', 'Reseller', 'Lang', 'Sponsor', 'Discount', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'email', 'password', 'algo', 'reseller', 'lang', 'sponsor', 'discount', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(CustomerTableMap::ID, CustomerTableMap::REF, CustomerTableMap::EMAIL, CustomerTableMap::PASSWORD, CustomerTableMap::ALGO, CustomerTableMap::RESELLER, CustomerTableMap::LANG, CustomerTableMap::SPONSOR, CustomerTableMap::DISCOUNT, CustomerTableMap::CREATED_AT, CustomerTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'REF', 'EMAIL', 'PASSWORD', 'ALGO', 'RESELLER', 'LANG', 'SPONSOR', 'DISCOUNT', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'ref', 'email', 'password', 'algo', 'reseller', 'lang', 'sponsor', 'discount', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) ); /** @@ -216,12 +151,12 @@ class CustomerTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, '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, '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_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_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_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_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_PHPNAME => array('Id' => 0, 'Ref' => 1, 'Email' => 2, 'Password' => 3, 'Algo' => 4, 'Reseller' => 5, 'Lang' => 6, 'Sponsor' => 7, 'Discount' => 8, 'CreatedAt' => 9, 'UpdatedAt' => 10, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'email' => 2, 'password' => 3, 'algo' => 4, 'reseller' => 5, 'lang' => 6, 'sponsor' => 7, 'discount' => 8, 'createdAt' => 9, 'updatedAt' => 10, ), + self::TYPE_COLNAME => array(CustomerTableMap::ID => 0, CustomerTableMap::REF => 1, CustomerTableMap::EMAIL => 2, CustomerTableMap::PASSWORD => 3, CustomerTableMap::ALGO => 4, CustomerTableMap::RESELLER => 5, CustomerTableMap::LANG => 6, CustomerTableMap::SPONSOR => 7, CustomerTableMap::DISCOUNT => 8, CustomerTableMap::CREATED_AT => 9, CustomerTableMap::UPDATED_AT => 10, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'EMAIL' => 2, 'PASSWORD' => 3, 'ALGO' => 4, 'RESELLER' => 5, 'LANG' => 6, 'SPONSOR' => 7, 'DISCOUNT' => 8, 'CREATED_AT' => 9, 'UPDATED_AT' => 10, ), + self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'email' => 2, 'password' => 3, 'algo' => 4, 'reseller' => 5, 'lang' => 6, 'sponsor' => 7, 'discount' => 8, 'created_at' => 9, 'updated_at' => 10, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) ); /** @@ -242,22 +177,9 @@ class CustomerTableMap extends TableMap // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, 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('PASSWORD', 'Password', 'VARCHAR', false, 255, 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('LANG', 'Lang', 'VARCHAR', false, 10, null); $this->addColumn('SPONSOR', 'Sponsor', 'VARCHAR', false, 50, null); @@ -271,7 +193,6 @@ class CustomerTableMap extends TableMap */ 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('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'RESTRICT', 'Orders'); } // buildRelations() @@ -439,22 +360,9 @@ class CustomerTableMap extends TableMap if (null === $alias) { $criteria->addSelectColumn(CustomerTableMap::ID); $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::PASSWORD); $criteria->addSelectColumn(CustomerTableMap::ALGO); - $criteria->addSelectColumn(CustomerTableMap::SALT); $criteria->addSelectColumn(CustomerTableMap::RESELLER); $criteria->addSelectColumn(CustomerTableMap::LANG); $criteria->addSelectColumn(CustomerTableMap::SPONSOR); @@ -464,22 +372,9 @@ class CustomerTableMap extends TableMap } else { $criteria->addSelectColumn($alias . '.ID'); $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 . '.PASSWORD'); $criteria->addSelectColumn($alias . '.ALGO'); - $criteria->addSelectColumn($alias . '.SALT'); $criteria->addSelectColumn($alias . '.RESELLER'); $criteria->addSelectColumn($alias . '.LANG'); $criteria->addSelectColumn($alias . '.SPONSOR'); diff --git a/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php b/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php index 8e91631cf..341f2a420 100755 --- a/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php +++ b/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php @@ -166,7 +166,6 @@ class CustomerTitleTableMap extends TableMap */ 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('CustomerTitleI18n', '\\Thelia\\Model\\CustomerTitleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CustomerTitleI18ns'); } // buildRelations() @@ -191,7 +190,6 @@ class CustomerTitleTableMap extends TableMap { // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CustomerTableMap::clearInstancePool(); CustomerTitleI18nTableMap::clearInstancePool(); } diff --git a/install/thelia.sql b/install/thelia.sql index 94d933587..d3e6e4f7e 100755 --- a/install/thelia.sql +++ b/install/thelia.sql @@ -453,22 +453,9 @@ CREATE TABLE `customer` ( `id` INTEGER NOT NULL AUTO_INCREMENT, `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), `password` VARCHAR(255), `algo` VARCHAR(128), - `salt` VARCHAR(128), `reseller` TINYINT, `lang` VARCHAR(10), `sponsor` VARCHAR(50), @@ -476,13 +463,7 @@ CREATE TABLE `customer` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`), - 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 + UNIQUE INDEX `ref_UNIQUE` (`ref`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- @@ -507,6 +488,8 @@ CREATE TABLE `address` `city` VARCHAR(255) NOT NULL, `country_id` INTEGER NOT NULL, `phone` VARCHAR(20), + `cellphone` VARCHAR(20), + `default` TINYINT DEFAULT 0, `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`), @@ -1040,11 +1023,11 @@ DROP TABLE IF EXISTS `admin_group`; CREATE TABLE `admin_group` ( `id` INTEGER NOT NULL AUTO_INCREMENT, - `group_id` INTEGER, - `admin_id` INTEGER, + `group_id` INTEGER NOT NULL, + `admin_id` INTEGER NOT NULL, `created_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_admin_id` (`admin_id`), CONSTRAINT `fk_admin_group_group_id` @@ -1074,8 +1057,8 @@ CREATE TABLE `group_resource` `write` TINYINT DEFAULT 0, `created_at` DATETIME, `updated_at` DATETIME, - PRIMARY KEY (`id`), - INDEX `id_idx` (`group_id`), + PRIMARY KEY (`id`,`group_id`,`resource_id`), + INDEX `id_group_resource_group_id` (`group_id`), INDEX `idx_group_resource_resource_id` (`resource_id`), CONSTRAINT `fk_group_resource_group_id` FOREIGN KEY (`group_id`) diff --git a/local/config/schema.xml b/local/config/schema.xml index cae47a184..7afc015d7 100755 --- a/local/config/schema.xml +++ b/local/config/schema.xml @@ -329,35 +329,16 @@ - - - - - - - - - - - - - - - - - - -
@@ -375,6 +356,8 @@ + +