diff --git a/.gitignore b/.gitignore
index cb281fd6..22ea1195 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
/.well-known/
/local/session/
/stats/
+/local/media/images/
diff --git a/local/modules/SoColissimo/AdminIncludes/order-edit.html b/local/modules/SoColissimo/AdminIncludes/order-edit.html
new file mode 100644
index 00000000..2c453104
--- /dev/null
+++ b/local/modules/SoColissimo/AdminIncludes/order-edit.html
@@ -0,0 +1,31 @@
+{loop name="check.module.socolissimo.order.edit" type="order" id=$ID status="2,3"}
+{loop name="check.module.socolissimoid" type="socolissimoid"}
+ {if $MODULE_ID == $DELIVERY_MODULE}
+
+
Livraison chez vous ou à une adresse personnelle de votre choix avec tentative de remise en mains propres ou en boîte aux lettres.
En cas d\'absence, remise en bureau de poste.
', + 'Friday' => 'Jeudi', + 'Monday' => 'Lundi', + 'My home' => 'Mon domicile', + 'Near you' => 'A proximité de chez vous', + 'No relay points were selected' => 'Aucun point relais n\'a été sélectionné', + 'Pickup shop' => 'En relais Pickup', + 'Please enter a city and a zipcode' => 'Merci de renseigner le code postal et la ville', + 'Post office' => 'En bureau de poste', + 'Saturday' => 'Samedi', + 'Search' => 'Rechercher', + 'Search Colissimo relay in a city' => 'Rechercher un point de retrait Colissimo dans une ville', + 'Sunday' => 'Dimanche', + 'Thursday' => 'Vendredi', + 'Tuesday' => 'Mardi', + 'Wednesday' => 'Mercredi', + 'address' => 'adresse', + 'city' => 'ville', + 'home delivery' => 'Livraison à domicile', + 'include in results' => 'inclure dans la recherche', + 'zipcode' => 'code postal', +); diff --git a/local/modules/SoColissimo/I18n/pdf/default/en_US.php b/local/modules/SoColissimo/I18n/pdf/default/en_US.php new file mode 100644 index 00000000..75d92322 --- /dev/null +++ b/local/modules/SoColissimo/I18n/pdf/default/en_US.php @@ -0,0 +1,8 @@ + 'Delivered at a relay.', + 'Delivered at home.' => 'Delivered at home.', + 'Relay address:' => 'Relay address:', + 'no address' => 'no address', +); diff --git a/local/modules/SoColissimo/I18n/pdf/default/fr_FR.php b/local/modules/SoColissimo/I18n/pdf/default/fr_FR.php new file mode 100644 index 00000000..4e71ca3e --- /dev/null +++ b/local/modules/SoColissimo/I18n/pdf/default/fr_FR.php @@ -0,0 +1,8 @@ + 'Livré en point relais.', + 'Delivered at home.' => 'Livré à domicile.', + 'Relay address:' => 'Adresse du point relais :', + 'no address' => 'Aucune adresse', +); diff --git a/local/modules/SoColissimo/LICENSE.txt b/local/modules/SoColissimo/LICENSE.txt new file mode 100644 index 00000000..65c5ca88 --- /dev/null +++ b/local/modules/SoColissimo/LICENSE.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc.AddressSocolissimo instance. If
+ * obj is an instance of AddressSocolissimo, delegates to
+ * equals(AddressSocolissimo). Otherwise, returns false.
+ *
+ * @param mixed $obj The object to compare to.
+ * @return boolean Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return mixed
+ *
+ * @throws PropelException
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return AddressSocolissimo The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return AddressSocolissimo The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+
+ return $this;
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [title_id] column value.
+ *
+ * @return int
+ */
+ public function getTitleId()
+ {
+
+ return $this->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 [code] column value.
+ *
+ * @return string
+ */
+ public function getCode()
+ {
+
+ return $this->code;
+ }
+
+ /**
+ * Get the [type] column value.
+ *
+ * @return string
+ */
+ public function getType()
+ {
+
+ return $this->type;
+ }
+
+ /**
+ * Get the [cellphone] column value.
+ *
+ * @return string
+ */
+ public function getCellphone()
+ {
+
+ return $this->cellphone;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[AddressSocolissimoTableMap::ID] = true;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [title_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo The current object (for fluent API support)
+ */
+ public function setTitleId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->title_id !== $v) {
+ $this->title_id = $v;
+ $this->modifiedColumns[AddressSocolissimoTableMap::TITLE_ID] = true;
+ }
+
+ if ($this->aCustomerTitle !== null && $this->aCustomerTitle->getId() !== $v) {
+ $this->aCustomerTitle = null;
+ }
+
+
+ return $this;
+ } // setTitleId()
+
+ /**
+ * Set the value of [company] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::COMPANY] = true;
+ }
+
+
+ return $this;
+ } // setCompany()
+
+ /**
+ * Set the value of [firstname] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::FIRSTNAME] = true;
+ }
+
+
+ return $this;
+ } // setFirstname()
+
+ /**
+ * Set the value of [lastname] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::LASTNAME] = true;
+ }
+
+
+ return $this;
+ } // setLastname()
+
+ /**
+ * Set the value of [address1] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::ADDRESS1] = true;
+ }
+
+
+ return $this;
+ } // setAddress1()
+
+ /**
+ * Set the value of [address2] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::ADDRESS2] = true;
+ }
+
+
+ return $this;
+ } // setAddress2()
+
+ /**
+ * Set the value of [address3] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::ADDRESS3] = true;
+ }
+
+
+ return $this;
+ } // setAddress3()
+
+ /**
+ * Set the value of [zipcode] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::ZIPCODE] = true;
+ }
+
+
+ return $this;
+ } // setZipcode()
+
+ /**
+ * Set the value of [city] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::CITY] = true;
+ }
+
+
+ return $this;
+ } // setCity()
+
+ /**
+ * Set the value of [country_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::COUNTRY_ID] = true;
+ }
+
+ if ($this->aCountry !== null && $this->aCountry->getId() !== $v) {
+ $this->aCountry = null;
+ }
+
+
+ return $this;
+ } // setCountryId()
+
+ /**
+ * Set the value of [code] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo The current object (for fluent API support)
+ */
+ public function setCode($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->code !== $v) {
+ $this->code = $v;
+ $this->modifiedColumns[AddressSocolissimoTableMap::CODE] = true;
+ }
+
+
+ return $this;
+ } // setCode()
+
+ /**
+ * Set the value of [type] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo The current object (for fluent API support)
+ */
+ public function setType($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->type !== $v) {
+ $this->type = $v;
+ $this->modifiedColumns[AddressSocolissimoTableMap::TYPE] = true;
+ }
+
+
+ return $this;
+ } // setType()
+
+ /**
+ * Set the value of [cellphone] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\AddressSocolissimo 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[AddressSocolissimoTableMap::CELLPHONE] = true;
+ }
+
+
+ return $this;
+ } // setCellphone()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : AddressSocolissimoTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AddressSocolissimoTableMap::translateFieldName('TitleId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->title_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AddressSocolissimoTableMap::translateFieldName('Company', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->company = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AddressSocolissimoTableMap::translateFieldName('Firstname', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->firstname = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AddressSocolissimoTableMap::translateFieldName('Lastname', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->lastname = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : AddressSocolissimoTableMap::translateFieldName('Address1', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->address1 = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : AddressSocolissimoTableMap::translateFieldName('Address2', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->address2 = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : AddressSocolissimoTableMap::translateFieldName('Address3', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->address3 = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : AddressSocolissimoTableMap::translateFieldName('Zipcode', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->zipcode = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : AddressSocolissimoTableMap::translateFieldName('City', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->city = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : AddressSocolissimoTableMap::translateFieldName('CountryId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->country_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : AddressSocolissimoTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->code = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : AddressSocolissimoTableMap::translateFieldName('Type', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->type = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : AddressSocolissimoTableMap::translateFieldName('Cellphone', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->cellphone = (null !== $col) ? (string) $col : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 14; // 14 = AddressSocolissimoTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \SoColissimo\Model\AddressSocolissimo object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ if ($this->aCustomerTitle !== null && $this->title_id !== $this->aCustomerTitle->getId()) {
+ $this->aCustomerTitle = null;
+ }
+ if ($this->aCountry !== null && $this->country_id !== $this->aCountry->getId()) {
+ $this->aCountry = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(AddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildAddressSocolissimoQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->aCustomerTitle = null;
+ $this->aCountry = null;
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see AddressSocolissimo::setDeleted()
+ * @see AddressSocolissimo::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(AddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildAddressSocolissimoQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(AddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ AddressSocolissimoTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ 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->aCountry !== null) {
+ if ($this->aCountry->isModified() || $this->aCountry->isNew()) {
+ $affectedRows += $this->aCountry->save($con);
+ }
+ $this->setCountry($this->aCountry);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::TITLE_ID)) {
+ $modifiedColumns[':p' . $index++] = 'TITLE_ID';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::COMPANY)) {
+ $modifiedColumns[':p' . $index++] = 'COMPANY';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::FIRSTNAME)) {
+ $modifiedColumns[':p' . $index++] = 'FIRSTNAME';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::LASTNAME)) {
+ $modifiedColumns[':p' . $index++] = 'LASTNAME';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ADDRESS1)) {
+ $modifiedColumns[':p' . $index++] = 'ADDRESS1';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ADDRESS2)) {
+ $modifiedColumns[':p' . $index++] = 'ADDRESS2';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ADDRESS3)) {
+ $modifiedColumns[':p' . $index++] = 'ADDRESS3';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ZIPCODE)) {
+ $modifiedColumns[':p' . $index++] = 'ZIPCODE';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::CITY)) {
+ $modifiedColumns[':p' . $index++] = 'CITY';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::COUNTRY_ID)) {
+ $modifiedColumns[':p' . $index++] = 'COUNTRY_ID';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::CODE)) {
+ $modifiedColumns[':p' . $index++] = 'CODE';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::TYPE)) {
+ $modifiedColumns[':p' . $index++] = 'TYPE';
+ }
+ if ($this->isColumnModified(AddressSocolissimoTableMap::CELLPHONE)) {
+ $modifiedColumns[':p' . $index++] = 'CELLPHONE';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO address_socolissimo (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'TITLE_ID':
+ $stmt->bindValue($identifier, $this->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 'CODE':
+ $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR);
+ break;
+ case 'TYPE':
+ $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR);
+ break;
+ case 'CELLPHONE':
+ $stmt->bindValue($identifier, $this->cellphone, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = AddressSocolissimoTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getTitleId();
+ break;
+ case 2:
+ return $this->getCompany();
+ break;
+ case 3:
+ return $this->getFirstname();
+ break;
+ case 4:
+ return $this->getLastname();
+ break;
+ case 5:
+ return $this->getAddress1();
+ break;
+ case 6:
+ return $this->getAddress2();
+ break;
+ case 7:
+ return $this->getAddress3();
+ break;
+ case 8:
+ return $this->getZipcode();
+ break;
+ case 9:
+ return $this->getCity();
+ break;
+ case 10:
+ return $this->getCountryId();
+ break;
+ case 11:
+ return $this->getCode();
+ break;
+ case 12:
+ return $this->getType();
+ break;
+ case 13:
+ return $this->getCellphone();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['AddressSocolissimo'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['AddressSocolissimo'][$this->getPrimaryKey()] = true;
+ $keys = AddressSocolissimoTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getTitleId(),
+ $keys[2] => $this->getCompany(),
+ $keys[3] => $this->getFirstname(),
+ $keys[4] => $this->getLastname(),
+ $keys[5] => $this->getAddress1(),
+ $keys[6] => $this->getAddress2(),
+ $keys[7] => $this->getAddress3(),
+ $keys[8] => $this->getZipcode(),
+ $keys[9] => $this->getCity(),
+ $keys[10] => $this->getCountryId(),
+ $keys[11] => $this->getCode(),
+ $keys[12] => $this->getType(),
+ $keys[13] => $this->getCellphone(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach ($virtualColumns as $key => $virtualColumn) {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aCustomerTitle) {
+ $result['CustomerTitle'] = $this->aCustomerTitle->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ if (null !== $this->aCountry) {
+ $result['Country'] = $this->aCountry->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = AddressSocolissimoTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setTitleId($value);
+ break;
+ case 2:
+ $this->setCompany($value);
+ break;
+ case 3:
+ $this->setFirstname($value);
+ break;
+ case 4:
+ $this->setLastname($value);
+ break;
+ case 5:
+ $this->setAddress1($value);
+ break;
+ case 6:
+ $this->setAddress2($value);
+ break;
+ case 7:
+ $this->setAddress3($value);
+ break;
+ case 8:
+ $this->setZipcode($value);
+ break;
+ case 9:
+ $this->setCity($value);
+ break;
+ case 10:
+ $this->setCountryId($value);
+ break;
+ case 11:
+ $this->setCode($value);
+ break;
+ case 12:
+ $this->setType($value);
+ break;
+ case 13:
+ $this->setCellphone($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = AddressSocolissimoTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setTitleId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setCompany($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setFirstname($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setLastname($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setAddress1($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setAddress2($arr[$keys[6]]);
+ if (array_key_exists($keys[7], $arr)) $this->setAddress3($arr[$keys[7]]);
+ if (array_key_exists($keys[8], $arr)) $this->setZipcode($arr[$keys[8]]);
+ if (array_key_exists($keys[9], $arr)) $this->setCity($arr[$keys[9]]);
+ if (array_key_exists($keys[10], $arr)) $this->setCountryId($arr[$keys[10]]);
+ if (array_key_exists($keys[11], $arr)) $this->setCode($arr[$keys[11]]);
+ if (array_key_exists($keys[12], $arr)) $this->setType($arr[$keys[12]]);
+ if (array_key_exists($keys[13], $arr)) $this->setCellphone($arr[$keys[13]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AddressSocolissimoTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ID)) $criteria->add(AddressSocolissimoTableMap::ID, $this->id);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::TITLE_ID)) $criteria->add(AddressSocolissimoTableMap::TITLE_ID, $this->title_id);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::COMPANY)) $criteria->add(AddressSocolissimoTableMap::COMPANY, $this->company);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::FIRSTNAME)) $criteria->add(AddressSocolissimoTableMap::FIRSTNAME, $this->firstname);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::LASTNAME)) $criteria->add(AddressSocolissimoTableMap::LASTNAME, $this->lastname);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ADDRESS1)) $criteria->add(AddressSocolissimoTableMap::ADDRESS1, $this->address1);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ADDRESS2)) $criteria->add(AddressSocolissimoTableMap::ADDRESS2, $this->address2);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ADDRESS3)) $criteria->add(AddressSocolissimoTableMap::ADDRESS3, $this->address3);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::ZIPCODE)) $criteria->add(AddressSocolissimoTableMap::ZIPCODE, $this->zipcode);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::CITY)) $criteria->add(AddressSocolissimoTableMap::CITY, $this->city);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::COUNTRY_ID)) $criteria->add(AddressSocolissimoTableMap::COUNTRY_ID, $this->country_id);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::CODE)) $criteria->add(AddressSocolissimoTableMap::CODE, $this->code);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::TYPE)) $criteria->add(AddressSocolissimoTableMap::TYPE, $this->type);
+ if ($this->isColumnModified(AddressSocolissimoTableMap::CELLPHONE)) $criteria->add(AddressSocolissimoTableMap::CELLPHONE, $this->cellphone);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AddressSocolissimoTableMap::DATABASE_NAME);
+ $criteria->add(AddressSocolissimoTableMap::ID, $this->id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+ /**
+ * Generic method to set the primary key (id column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return null === $this->getId();
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \SoColissimo\Model\AddressSocolissimo (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setId($this->getId());
+ $copyObj->setTitleId($this->getTitleId());
+ $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->setCode($this->getCode());
+ $copyObj->setType($this->getType());
+ $copyObj->setCellphone($this->getCellphone());
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \SoColissimo\Model\AddressSocolissimo Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Declares an association between this object and a ChildCustomerTitle object.
+ *
+ * @param ChildCustomerTitle $v
+ * @return \SoColissimo\Model\AddressSocolissimo The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setCustomerTitle(ChildCustomerTitle $v = null)
+ {
+ if ($v === null) {
+ $this->setTitleId(NULL);
+ } else {
+ $this->setTitleId($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->addAddressSocolissimo($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->title_id !== null)) {
+ $this->aCustomerTitle = CustomerTitleQuery::create()->findPk($this->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->addAddressSocolissimos($this);
+ */
+ }
+
+ return $this->aCustomerTitle;
+ }
+
+ /**
+ * Declares an association between this object and a ChildCountry object.
+ *
+ * @param ChildCountry $v
+ * @return \SoColissimo\Model\AddressSocolissimo The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setCountry(ChildCountry $v = null)
+ {
+ if ($v === null) {
+ $this->setCountryId(NULL);
+ } else {
+ $this->setCountryId($v->getId());
+ }
+
+ $this->aCountry = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildCountry object, it will not be re-added.
+ if ($v !== null) {
+ $v->addAddressSocolissimo($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildCountry object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildCountry The associated ChildCountry object.
+ * @throws PropelException
+ */
+ public function getCountry(ConnectionInterface $con = null)
+ {
+ if ($this->aCountry === null && ($this->country_id !== null)) {
+ $this->aCountry = CountryQuery::create()->findPk($this->country_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->aCountry->addAddressSocolissimos($this);
+ */
+ }
+
+ return $this->aCountry;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->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->code = null;
+ $this->type = null;
+ $this->cellphone = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ } // if ($deep)
+
+ $this->aCustomerTitle = null;
+ $this->aCountry = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(AddressSocolissimoTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/local/modules/SoColissimo/Model/Base/AddressSocolissimoQuery.php b/local/modules/SoColissimo/Model/Base/AddressSocolissimoQuery.php
new file mode 100644
index 00000000..0444e0b7
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/AddressSocolissimoQuery.php
@@ -0,0 +1,964 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildAddressSocolissimo|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = AddressSocolissimoTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(AddressSocolissimoTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildAddressSocolissimo A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, CODE, TYPE, CELLPHONE FROM address_socolissimo WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildAddressSocolissimo();
+ $obj->hydrate($row);
+ AddressSocolissimoTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildAddressSocolissimo|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(AddressSocolissimoTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(AddressSocolissimoTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @param mixed $id 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 ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(AddressSocolissimoTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(AddressSocolissimoTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(AddressSocolissimoTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the title_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByTitleId(1234); // WHERE title_id = 1234
+ * $query->filterByTitleId(array(12, 34)); // WHERE title_id IN (12, 34)
+ * $query->filterByTitleId(array('min' => 12)); // WHERE title_id > 12
+ *
+ *
+ * @see filterByCustomerTitle()
+ *
+ * @param mixed $titleId 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 ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByTitleId($titleId = null, $comparison = null)
+ {
+ if (is_array($titleId)) {
+ $useMinMax = false;
+ if (isset($titleId['min'])) {
+ $this->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $titleId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($titleId['max'])) {
+ $this->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $titleId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $titleId, $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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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
+ *
+ *
+ * @see filterByCountry()
+ *
+ * @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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::COUNTRY_ID, $countryId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($countryId['max'])) {
+ $this->addUsingAlias(AddressSocolissimoTableMap::COUNTRY_ID, $countryId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(AddressSocolissimoTableMap::COUNTRY_ID, $countryId, $comparison);
+ }
+
+ /**
+ * Filter the query on the code column
+ *
+ * Example usage:
+ *
+ * $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
+ * $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
+ *
+ *
+ * @param string $code The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByCode($code = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($code)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $code)) {
+ $code = str_replace('*', '%', $code);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(AddressSocolissimoTableMap::CODE, $code, $comparison);
+ }
+
+ /**
+ * Filter the query on the type column
+ *
+ * Example usage:
+ *
+ * $query->filterByType('fooValue'); // WHERE type = 'fooValue'
+ * $query->filterByType('%fooValue%'); // WHERE type LIKE '%fooValue%'
+ *
+ *
+ * @param string $type 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 ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByType($type = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($type)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $type)) {
+ $type = str_replace('*', '%', $type);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(AddressSocolissimoTableMap::TYPE, $type, $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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::CELLPHONE, $cellphone, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\Thelia\Model\CustomerTitle object
+ *
+ * @param \SoColissimo\Model\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 ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByCustomerTitle($customerTitle, $comparison = null)
+ {
+ if ($customerTitle instanceof \SoColissimo\Model\Thelia\Model\CustomerTitle) {
+ return $this
+ ->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $customerTitle->getId(), $comparison);
+ } elseif ($customerTitle instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $customerTitle->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByCustomerTitle() only accepts arguments of type \SoColissimo\Model\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 ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function joinCustomerTitle($relationAlias = null, $joinType = Criteria::INNER_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 \SoColissimo\Model\Thelia\Model\CustomerTitleQuery A secondary query class using the current class as primary query
+ */
+ public function useCustomerTitleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinCustomerTitle($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'CustomerTitle', '\SoColissimo\Model\Thelia\Model\CustomerTitleQuery');
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\Thelia\Model\Country object
+ *
+ * @param \SoColissimo\Model\Thelia\Model\Country|ObjectCollection $country The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByCountry($country, $comparison = null)
+ {
+ if ($country instanceof \SoColissimo\Model\Thelia\Model\Country) {
+ return $this
+ ->addUsingAlias(AddressSocolissimoTableMap::COUNTRY_ID, $country->getId(), $comparison);
+ } elseif ($country instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(AddressSocolissimoTableMap::COUNTRY_ID, $country->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByCountry() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Country or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Country relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function joinCountry($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Country');
+
+ // 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, 'Country');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Country relation Country 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 \SoColissimo\Model\Thelia\Model\CountryQuery A secondary query class using the current class as primary query
+ */
+ public function useCountryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinCountry($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Country', '\SoColissimo\Model\Thelia\Model\CountryQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildAddressSocolissimo $addressSocolissimo Object to remove from the list of results
+ *
+ * @return ChildAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function prune($addressSocolissimo = null)
+ {
+ if ($addressSocolissimo) {
+ $this->addUsingAlias(AddressSocolissimoTableMap::ID, $addressSocolissimo->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the address_socolissimo table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(AddressSocolissimoTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ AddressSocolissimoTableMap::clearInstancePool();
+ AddressSocolissimoTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildAddressSocolissimo or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildAddressSocolissimo object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(AddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(AddressSocolissimoTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ AddressSocolissimoTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ AddressSocolissimoTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // AddressSocolissimoQuery
diff --git a/local/modules/SoColissimo/Model/Base/OrderAddressSocolissimo.php b/local/modules/SoColissimo/Model/Base/OrderAddressSocolissimo.php
new file mode 100644
index 00000000..df06014f
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/OrderAddressSocolissimo.php
@@ -0,0 +1,1236 @@
+modifiedColumns;
+ }
+
+ /**
+ * Has specified column been modified?
+ *
+ * @param string $col column fully qualified name (TableMap::TYPE_COLNAME), e.g. Book::AUTHOR_ID
+ * @return boolean True if $col has been modified.
+ */
+ public function isColumnModified($col)
+ {
+ return $this->modifiedColumns && isset($this->modifiedColumns[$col]);
+ }
+
+ /**
+ * Get the columns that have been modified in this object.
+ * @return array A unique list of the modified column names for this object.
+ */
+ public function getModifiedColumns()
+ {
+ return $this->modifiedColumns ? array_keys($this->modifiedColumns) : [];
+ }
+
+ /**
+ * Returns whether the object has ever been saved. This will
+ * be false, if the object was retrieved from storage or was created
+ * and then saved.
+ *
+ * @return boolean true, if the object has never been persisted.
+ */
+ public function isNew()
+ {
+ return $this->new;
+ }
+
+ /**
+ * Setter for the isNew attribute. This method will be called
+ * by Propel-generated children and objects.
+ *
+ * @param boolean $b the state of the object.
+ */
+ public function setNew($b)
+ {
+ $this->new = (Boolean) $b;
+ }
+
+ /**
+ * Whether this object has been deleted.
+ * @return boolean The deleted state of this object.
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Specify whether this object has been deleted.
+ * @param boolean $b The deleted state of this object.
+ * @return void
+ */
+ public function setDeleted($b)
+ {
+ $this->deleted = (Boolean) $b;
+ }
+
+ /**
+ * Sets the modified state for the object to be false.
+ * @param string $col If supplied, only the specified column is reset.
+ * @return void
+ */
+ public function resetModified($col = null)
+ {
+ if (null !== $col) {
+ if (isset($this->modifiedColumns[$col])) {
+ unset($this->modifiedColumns[$col]);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another OrderAddressSocolissimo instance. If
+ * obj is an instance of OrderAddressSocolissimo, delegates to
+ * equals(OrderAddressSocolissimo). Otherwise, returns false.
+ *
+ * @param mixed $obj The object to compare to.
+ * @return boolean Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return mixed
+ *
+ * @throws PropelException
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return OrderAddressSocolissimo The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return OrderAddressSocolissimo The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+
+ return $this;
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [code] column value.
+ *
+ * @return string
+ */
+ public function getCode()
+ {
+
+ return $this->code;
+ }
+
+ /**
+ * Get the [type] column value.
+ *
+ * @return string
+ */
+ public function getType()
+ {
+
+ return $this->type;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\OrderAddressSocolissimo The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[OrderAddressSocolissimoTableMap::ID] = true;
+ }
+
+ if ($this->aOrderAddress !== null && $this->aOrderAddress->getId() !== $v) {
+ $this->aOrderAddress = null;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [code] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\OrderAddressSocolissimo The current object (for fluent API support)
+ */
+ public function setCode($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->code !== $v) {
+ $this->code = $v;
+ $this->modifiedColumns[OrderAddressSocolissimoTableMap::CODE] = true;
+ }
+
+
+ return $this;
+ } // setCode()
+
+ /**
+ * Set the value of [type] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\OrderAddressSocolissimo The current object (for fluent API support)
+ */
+ public function setType($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->type !== $v) {
+ $this->type = $v;
+ $this->modifiedColumns[OrderAddressSocolissimoTableMap::TYPE] = true;
+ }
+
+
+ return $this;
+ } // setType()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : OrderAddressSocolissimoTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : OrderAddressSocolissimoTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->code = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : OrderAddressSocolissimoTableMap::translateFieldName('Type', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->type = (null !== $col) ? (string) $col : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 3; // 3 = OrderAddressSocolissimoTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \SoColissimo\Model\OrderAddressSocolissimo object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ if ($this->aOrderAddress !== null && $this->id !== $this->aOrderAddress->getId()) {
+ $this->aOrderAddress = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildOrderAddressSocolissimoQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->aOrderAddress = null;
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see OrderAddressSocolissimo::setDeleted()
+ * @see OrderAddressSocolissimo::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildOrderAddressSocolissimoQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ OrderAddressSocolissimoTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ 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->aOrderAddress !== null) {
+ if ($this->aOrderAddress->isModified() || $this->aOrderAddress->isNew()) {
+ $affectedRows += $this->aOrderAddress->save($con);
+ }
+ $this->setOrderAddress($this->aOrderAddress);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(OrderAddressSocolissimoTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(OrderAddressSocolissimoTableMap::CODE)) {
+ $modifiedColumns[':p' . $index++] = 'CODE';
+ }
+ if ($this->isColumnModified(OrderAddressSocolissimoTableMap::TYPE)) {
+ $modifiedColumns[':p' . $index++] = 'TYPE';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO order_address_socolissimo (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'CODE':
+ $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR);
+ break;
+ case 'TYPE':
+ $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = OrderAddressSocolissimoTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getCode();
+ break;
+ case 2:
+ return $this->getType();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['OrderAddressSocolissimo'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['OrderAddressSocolissimo'][$this->getPrimaryKey()] = true;
+ $keys = OrderAddressSocolissimoTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getCode(),
+ $keys[2] => $this->getType(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach ($virtualColumns as $key => $virtualColumn) {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aOrderAddress) {
+ $result['OrderAddress'] = $this->aOrderAddress->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = OrderAddressSocolissimoTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setCode($value);
+ break;
+ case 2:
+ $this->setType($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = OrderAddressSocolissimoTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setCode($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setType($arr[$keys[2]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(OrderAddressSocolissimoTableMap::ID)) $criteria->add(OrderAddressSocolissimoTableMap::ID, $this->id);
+ if ($this->isColumnModified(OrderAddressSocolissimoTableMap::CODE)) $criteria->add(OrderAddressSocolissimoTableMap::CODE, $this->code);
+ if ($this->isColumnModified(OrderAddressSocolissimoTableMap::TYPE)) $criteria->add(OrderAddressSocolissimoTableMap::TYPE, $this->type);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ $criteria->add(OrderAddressSocolissimoTableMap::ID, $this->id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+ /**
+ * Generic method to set the primary key (id column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return null === $this->getId();
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \SoColissimo\Model\OrderAddressSocolissimo (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setId($this->getId());
+ $copyObj->setCode($this->getCode());
+ $copyObj->setType($this->getType());
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \SoColissimo\Model\OrderAddressSocolissimo Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Declares an association between this object and a ChildOrderAddress object.
+ *
+ * @param ChildOrderAddress $v
+ * @return \SoColissimo\Model\OrderAddressSocolissimo The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setOrderAddress(ChildOrderAddress $v = null)
+ {
+ if ($v === null) {
+ $this->setId(NULL);
+ } else {
+ $this->setId($v->getId());
+ }
+
+ $this->aOrderAddress = $v;
+
+ // Add binding for other direction of this 1:1 relationship.
+ if ($v !== null) {
+ $v->setOrderAddressSocolissimo($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildOrderAddress object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildOrderAddress The associated ChildOrderAddress object.
+ * @throws PropelException
+ */
+ public function getOrderAddress(ConnectionInterface $con = null)
+ {
+ if ($this->aOrderAddress === null && ($this->id !== null)) {
+ $this->aOrderAddress = OrderAddressQuery::create()->findPk($this->id, $con);
+ // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.
+ $this->aOrderAddress->setOrderAddressSocolissimo($this);
+ }
+
+ return $this->aOrderAddress;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->code = null;
+ $this->type = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ } // if ($deep)
+
+ $this->aOrderAddress = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(OrderAddressSocolissimoTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/local/modules/SoColissimo/Model/Base/OrderAddressSocolissimoQuery.php b/local/modules/SoColissimo/Model/Base/OrderAddressSocolissimoQuery.php
new file mode 100644
index 00000000..2d343b52
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/OrderAddressSocolissimoQuery.php
@@ -0,0 +1,495 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildOrderAddressSocolissimo|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = OrderAddressSocolissimoTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildOrderAddressSocolissimo A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, CODE, TYPE FROM order_address_socolissimo WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildOrderAddressSocolissimo();
+ $obj->hydrate($row);
+ OrderAddressSocolissimoTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildOrderAddressSocolissimo|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @see filterByOrderAddress()
+ *
+ * @param mixed $id 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 ChildOrderAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the code column
+ *
+ * Example usage:
+ *
+ * $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
+ * $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
+ *
+ *
+ * @param string $code The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByCode($code = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($code)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $code)) {
+ $code = str_replace('*', '%', $code);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderAddressSocolissimoTableMap::CODE, $code, $comparison);
+ }
+
+ /**
+ * Filter the query on the type column
+ *
+ * Example usage:
+ *
+ * $query->filterByType('fooValue'); // WHERE type = 'fooValue'
+ * $query->filterByType('%fooValue%'); // WHERE type LIKE '%fooValue%'
+ *
+ *
+ * @param string $type 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 ChildOrderAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByType($type = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($type)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $type)) {
+ $type = str_replace('*', '%', $type);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderAddressSocolissimoTableMap::TYPE, $type, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\Thelia\Model\OrderAddress object
+ *
+ * @param \SoColissimo\Model\Thelia\Model\OrderAddress|ObjectCollection $orderAddress The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function filterByOrderAddress($orderAddress, $comparison = null)
+ {
+ if ($orderAddress instanceof \SoColissimo\Model\Thelia\Model\OrderAddress) {
+ return $this
+ ->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $orderAddress->getId(), $comparison);
+ } elseif ($orderAddress instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByOrderAddress() only accepts arguments of type \SoColissimo\Model\Thelia\Model\OrderAddress or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the OrderAddress relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function joinOrderAddress($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('OrderAddress');
+
+ // 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, 'OrderAddress');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the OrderAddress relation OrderAddress 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 \SoColissimo\Model\Thelia\Model\OrderAddressQuery A secondary query class using the current class as primary query
+ */
+ public function useOrderAddressQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinOrderAddress($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'OrderAddress', '\SoColissimo\Model\Thelia\Model\OrderAddressQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildOrderAddressSocolissimo $orderAddressSocolissimo Object to remove from the list of results
+ *
+ * @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
+ */
+ public function prune($orderAddressSocolissimo = null)
+ {
+ if ($orderAddressSocolissimo) {
+ $this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $orderAddressSocolissimo->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the order_address_socolissimo table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ OrderAddressSocolissimoTableMap::clearInstancePool();
+ OrderAddressSocolissimoTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildOrderAddressSocolissimo or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildOrderAddressSocolissimo object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ OrderAddressSocolissimoTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ OrderAddressSocolissimoTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // OrderAddressSocolissimoQuery
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshipping.php b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshipping.php
new file mode 100644
index 00000000..0427b73e
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshipping.php
@@ -0,0 +1,1407 @@
+cart_amount = '0.000000';
+ }
+
+ /**
+ * Initializes internal state of SoColissimo\Model\Base\SocolissimoAreaFreeshipping object.
+ * @see applyDefaults()
+ */
+ public function __construct()
+ {
+ $this->applyDefaultValues();
+ }
+
+ /**
+ * Returns whether the object has been modified.
+ *
+ * @return boolean True if the object has been modified.
+ */
+ public function isModified()
+ {
+ return !!$this->modifiedColumns;
+ }
+
+ /**
+ * Has specified column been modified?
+ *
+ * @param string $col column fully qualified name (TableMap::TYPE_COLNAME), e.g. Book::AUTHOR_ID
+ * @return boolean True if $col has been modified.
+ */
+ public function isColumnModified($col)
+ {
+ return $this->modifiedColumns && isset($this->modifiedColumns[$col]);
+ }
+
+ /**
+ * Get the columns that have been modified in this object.
+ * @return array A unique list of the modified column names for this object.
+ */
+ public function getModifiedColumns()
+ {
+ return $this->modifiedColumns ? array_keys($this->modifiedColumns) : [];
+ }
+
+ /**
+ * Returns whether the object has ever been saved. This will
+ * be false, if the object was retrieved from storage or was created
+ * and then saved.
+ *
+ * @return boolean true, if the object has never been persisted.
+ */
+ public function isNew()
+ {
+ return $this->new;
+ }
+
+ /**
+ * Setter for the isNew attribute. This method will be called
+ * by Propel-generated children and objects.
+ *
+ * @param boolean $b the state of the object.
+ */
+ public function setNew($b)
+ {
+ $this->new = (Boolean) $b;
+ }
+
+ /**
+ * Whether this object has been deleted.
+ * @return boolean The deleted state of this object.
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Specify whether this object has been deleted.
+ * @param boolean $b The deleted state of this object.
+ * @return void
+ */
+ public function setDeleted($b)
+ {
+ $this->deleted = (Boolean) $b;
+ }
+
+ /**
+ * Sets the modified state for the object to be false.
+ * @param string $col If supplied, only the specified column is reset.
+ * @return void
+ */
+ public function resetModified($col = null)
+ {
+ if (null !== $col) {
+ if (isset($this->modifiedColumns[$col])) {
+ unset($this->modifiedColumns[$col]);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another SocolissimoAreaFreeshipping instance. If
+ * obj is an instance of SocolissimoAreaFreeshipping, delegates to
+ * equals(SocolissimoAreaFreeshipping). Otherwise, returns false.
+ *
+ * @param mixed $obj The object to compare to.
+ * @return boolean Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return mixed
+ *
+ * @throws PropelException
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return SocolissimoAreaFreeshipping The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return SocolissimoAreaFreeshipping The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+
+ return $this;
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [area_id] column value.
+ *
+ * @return int
+ */
+ public function getAreaId()
+ {
+
+ return $this->area_id;
+ }
+
+ /**
+ * Get the [delivery_mode_id] column value.
+ *
+ * @return int
+ */
+ public function getDeliveryModeId()
+ {
+
+ return $this->delivery_mode_id;
+ }
+
+ /**
+ * Get the [cart_amount] column value.
+ *
+ * @return string
+ */
+ public function getCartAmount()
+ {
+
+ return $this->cart_amount;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshipping The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingTableMap::ID] = true;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [area_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshipping The current object (for fluent API support)
+ */
+ public function setAreaId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->area_id !== $v) {
+ $this->area_id = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingTableMap::AREA_ID] = true;
+ }
+
+ if ($this->aArea !== null && $this->aArea->getId() !== $v) {
+ $this->aArea = null;
+ }
+
+
+ return $this;
+ } // setAreaId()
+
+ /**
+ * Set the value of [delivery_mode_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshipping The current object (for fluent API support)
+ */
+ public function setDeliveryModeId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->delivery_mode_id !== $v) {
+ $this->delivery_mode_id = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID] = true;
+ }
+
+ if ($this->aSocolissimoDeliveryMode !== null && $this->aSocolissimoDeliveryMode->getId() !== $v) {
+ $this->aSocolissimoDeliveryMode = null;
+ }
+
+
+ return $this;
+ } // setDeliveryModeId()
+
+ /**
+ * Set the value of [cart_amount] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshipping The current object (for fluent API support)
+ */
+ public function setCartAmount($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->cart_amount !== $v) {
+ $this->cart_amount = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingTableMap::CART_AMOUNT] = true;
+ }
+
+
+ return $this;
+ } // setCartAmount()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ if ($this->cart_amount !== '0.000000') {
+ return false;
+ }
+
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : SocolissimoAreaFreeshippingTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : SocolissimoAreaFreeshippingTableMap::translateFieldName('AreaId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->area_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : SocolissimoAreaFreeshippingTableMap::translateFieldName('DeliveryModeId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->delivery_mode_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : SocolissimoAreaFreeshippingTableMap::translateFieldName('CartAmount', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->cart_amount = (null !== $col) ? (string) $col : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 4; // 4 = SocolissimoAreaFreeshippingTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \SoColissimo\Model\SocolissimoAreaFreeshipping object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ if ($this->aArea !== null && $this->area_id !== $this->aArea->getId()) {
+ $this->aArea = null;
+ }
+ if ($this->aSocolissimoDeliveryMode !== null && $this->delivery_mode_id !== $this->aSocolissimoDeliveryMode->getId()) {
+ $this->aSocolissimoDeliveryMode = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildSocolissimoAreaFreeshippingQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->aArea = null;
+ $this->aSocolissimoDeliveryMode = null;
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see SocolissimoAreaFreeshipping::setDeleted()
+ * @see SocolissimoAreaFreeshipping::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildSocolissimoAreaFreeshippingQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ SocolissimoAreaFreeshippingTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ 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->aArea !== null) {
+ if ($this->aArea->isModified() || $this->aArea->isNew()) {
+ $affectedRows += $this->aArea->save($con);
+ }
+ $this->setArea($this->aArea);
+ }
+
+ if ($this->aSocolissimoDeliveryMode !== null) {
+ if ($this->aSocolissimoDeliveryMode->isModified() || $this->aSocolissimoDeliveryMode->isNew()) {
+ $affectedRows += $this->aSocolissimoDeliveryMode->save($con);
+ }
+ $this->setSocolissimoDeliveryMode($this->aSocolissimoDeliveryMode);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+ $this->modifiedColumns[SocolissimoAreaFreeshippingTableMap::ID] = true;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . SocolissimoAreaFreeshippingTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingTableMap::AREA_ID)) {
+ $modifiedColumns[':p' . $index++] = 'AREA_ID';
+ }
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID)) {
+ $modifiedColumns[':p' . $index++] = 'DELIVERY_MODE_ID';
+ }
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT)) {
+ $modifiedColumns[':p' . $index++] = 'CART_AMOUNT';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO socolissimo_area_freeshipping (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'AREA_ID':
+ $stmt->bindValue($identifier, $this->area_id, PDO::PARAM_INT);
+ break;
+ case 'DELIVERY_MODE_ID':
+ $stmt->bindValue($identifier, $this->delivery_mode_id, PDO::PARAM_INT);
+ break;
+ case 'CART_AMOUNT':
+ $stmt->bindValue($identifier, $this->cart_amount, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ try {
+ $pk = $con->lastInsertId();
+ } catch (Exception $e) {
+ throw new PropelException('Unable to get autoincrement id.', 0, $e);
+ }
+ $this->setId($pk);
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoAreaFreeshippingTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getAreaId();
+ break;
+ case 2:
+ return $this->getDeliveryModeId();
+ break;
+ case 3:
+ return $this->getCartAmount();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['SocolissimoAreaFreeshipping'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['SocolissimoAreaFreeshipping'][$this->getPrimaryKey()] = true;
+ $keys = SocolissimoAreaFreeshippingTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getAreaId(),
+ $keys[2] => $this->getDeliveryModeId(),
+ $keys[3] => $this->getCartAmount(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach ($virtualColumns as $key => $virtualColumn) {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aArea) {
+ $result['Area'] = $this->aArea->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ if (null !== $this->aSocolissimoDeliveryMode) {
+ $result['SocolissimoDeliveryMode'] = $this->aSocolissimoDeliveryMode->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoAreaFreeshippingTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setAreaId($value);
+ break;
+ case 2:
+ $this->setDeliveryModeId($value);
+ break;
+ case 3:
+ $this->setCartAmount($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = SocolissimoAreaFreeshippingTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setAreaId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setDeliveryModeId($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setCartAmount($arr[$keys[3]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingTableMap::ID)) $criteria->add(SocolissimoAreaFreeshippingTableMap::ID, $this->id);
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingTableMap::AREA_ID)) $criteria->add(SocolissimoAreaFreeshippingTableMap::AREA_ID, $this->area_id);
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID)) $criteria->add(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $this->delivery_mode_id);
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT)) $criteria->add(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT, $this->cart_amount);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoAreaFreeshippingTableMap::ID, $this->id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+ /**
+ * Generic method to set the primary key (id column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return null === $this->getId();
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \SoColissimo\Model\SocolissimoAreaFreeshipping (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setAreaId($this->getAreaId());
+ $copyObj->setDeliveryModeId($this->getDeliveryModeId());
+ $copyObj->setCartAmount($this->getCartAmount());
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshipping Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Declares an association between this object and a ChildArea object.
+ *
+ * @param ChildArea $v
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshipping The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setArea(ChildArea $v = null)
+ {
+ if ($v === null) {
+ $this->setAreaId(NULL);
+ } else {
+ $this->setAreaId($v->getId());
+ }
+
+ $this->aArea = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildArea object, it will not be re-added.
+ if ($v !== null) {
+ $v->addSocolissimoAreaFreeshipping($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildArea object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildArea The associated ChildArea object.
+ * @throws PropelException
+ */
+ public function getArea(ConnectionInterface $con = null)
+ {
+ if ($this->aArea === null && ($this->area_id !== null)) {
+ $this->aArea = AreaQuery::create()->findPk($this->area_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->aArea->addSocolissimoAreaFreeshippings($this);
+ */
+ }
+
+ return $this->aArea;
+ }
+
+ /**
+ * Declares an association between this object and a ChildSocolissimoDeliveryMode object.
+ *
+ * @param ChildSocolissimoDeliveryMode $v
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshipping The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setSocolissimoDeliveryMode(ChildSocolissimoDeliveryMode $v = null)
+ {
+ if ($v === null) {
+ $this->setDeliveryModeId(NULL);
+ } else {
+ $this->setDeliveryModeId($v->getId());
+ }
+
+ $this->aSocolissimoDeliveryMode = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildSocolissimoDeliveryMode object, it will not be re-added.
+ if ($v !== null) {
+ $v->addSocolissimoAreaFreeshipping($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildSocolissimoDeliveryMode object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildSocolissimoDeliveryMode The associated ChildSocolissimoDeliveryMode object.
+ * @throws PropelException
+ */
+ public function getSocolissimoDeliveryMode(ConnectionInterface $con = null)
+ {
+ if ($this->aSocolissimoDeliveryMode === null && ($this->delivery_mode_id !== null)) {
+ $this->aSocolissimoDeliveryMode = ChildSocolissimoDeliveryModeQuery::create()->findPk($this->delivery_mode_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->aSocolissimoDeliveryMode->addSocolissimoAreaFreeshippings($this);
+ */
+ }
+
+ return $this->aSocolissimoDeliveryMode;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->area_id = null;
+ $this->delivery_mode_id = null;
+ $this->cart_amount = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->applyDefaultValues();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ } // if ($deep)
+
+ $this->aArea = null;
+ $this->aSocolissimoDeliveryMode = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(SocolissimoAreaFreeshippingTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingDom.php b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingDom.php
new file mode 100644
index 00000000..b7aa5dbc
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingDom.php
@@ -0,0 +1,1407 @@
+cart_amount = '0.000000';
+ }
+
+ /**
+ * Initializes internal state of SoColissimo\Model\Base\SocolissimoAreaFreeshippingDom object.
+ * @see applyDefaults()
+ */
+ public function __construct()
+ {
+ $this->applyDefaultValues();
+ }
+
+ /**
+ * Returns whether the object has been modified.
+ *
+ * @return boolean True if the object has been modified.
+ */
+ public function isModified()
+ {
+ return !!$this->modifiedColumns;
+ }
+
+ /**
+ * Has specified column been modified?
+ *
+ * @param string $col column fully qualified name (TableMap::TYPE_COLNAME), e.g. Book::AUTHOR_ID
+ * @return boolean True if $col has been modified.
+ */
+ public function isColumnModified($col)
+ {
+ return $this->modifiedColumns && isset($this->modifiedColumns[$col]);
+ }
+
+ /**
+ * Get the columns that have been modified in this object.
+ * @return array A unique list of the modified column names for this object.
+ */
+ public function getModifiedColumns()
+ {
+ return $this->modifiedColumns ? array_keys($this->modifiedColumns) : [];
+ }
+
+ /**
+ * Returns whether the object has ever been saved. This will
+ * be false, if the object was retrieved from storage or was created
+ * and then saved.
+ *
+ * @return boolean true, if the object has never been persisted.
+ */
+ public function isNew()
+ {
+ return $this->new;
+ }
+
+ /**
+ * Setter for the isNew attribute. This method will be called
+ * by Propel-generated children and objects.
+ *
+ * @param boolean $b the state of the object.
+ */
+ public function setNew($b)
+ {
+ $this->new = (Boolean) $b;
+ }
+
+ /**
+ * Whether this object has been deleted.
+ * @return boolean The deleted state of this object.
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Specify whether this object has been deleted.
+ * @param boolean $b The deleted state of this object.
+ * @return void
+ */
+ public function setDeleted($b)
+ {
+ $this->deleted = (Boolean) $b;
+ }
+
+ /**
+ * Sets the modified state for the object to be false.
+ * @param string $col If supplied, only the specified column is reset.
+ * @return void
+ */
+ public function resetModified($col = null)
+ {
+ if (null !== $col) {
+ if (isset($this->modifiedColumns[$col])) {
+ unset($this->modifiedColumns[$col]);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another SocolissimoAreaFreeshippingDom instance. If
+ * obj is an instance of SocolissimoAreaFreeshippingDom, delegates to
+ * equals(SocolissimoAreaFreeshippingDom). Otherwise, returns false.
+ *
+ * @param mixed $obj The object to compare to.
+ * @return boolean Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return mixed
+ *
+ * @throws PropelException
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return SocolissimoAreaFreeshippingDom The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return SocolissimoAreaFreeshippingDom The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+
+ return $this;
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [area_id] column value.
+ *
+ * @return int
+ */
+ public function getAreaId()
+ {
+
+ return $this->area_id;
+ }
+
+ /**
+ * Get the [delivery_mode_id] column value.
+ *
+ * @return int
+ */
+ public function getDeliveryModeId()
+ {
+
+ return $this->delivery_mode_id;
+ }
+
+ /**
+ * Get the [cart_amount] column value.
+ *
+ * @return string
+ */
+ public function getCartAmount()
+ {
+
+ return $this->cart_amount;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingDom The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingDomTableMap::ID] = true;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [area_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingDom The current object (for fluent API support)
+ */
+ public function setAreaId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->area_id !== $v) {
+ $this->area_id = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingDomTableMap::AREA_ID] = true;
+ }
+
+ if ($this->aArea !== null && $this->aArea->getId() !== $v) {
+ $this->aArea = null;
+ }
+
+
+ return $this;
+ } // setAreaId()
+
+ /**
+ * Set the value of [delivery_mode_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingDom The current object (for fluent API support)
+ */
+ public function setDeliveryModeId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->delivery_mode_id !== $v) {
+ $this->delivery_mode_id = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID] = true;
+ }
+
+ if ($this->aSocolissimoDeliveryMode !== null && $this->aSocolissimoDeliveryMode->getId() !== $v) {
+ $this->aSocolissimoDeliveryMode = null;
+ }
+
+
+ return $this;
+ } // setDeliveryModeId()
+
+ /**
+ * Set the value of [cart_amount] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingDom The current object (for fluent API support)
+ */
+ public function setCartAmount($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->cart_amount !== $v) {
+ $this->cart_amount = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT] = true;
+ }
+
+
+ return $this;
+ } // setCartAmount()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ if ($this->cart_amount !== '0.000000') {
+ return false;
+ }
+
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : SocolissimoAreaFreeshippingDomTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : SocolissimoAreaFreeshippingDomTableMap::translateFieldName('AreaId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->area_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : SocolissimoAreaFreeshippingDomTableMap::translateFieldName('DeliveryModeId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->delivery_mode_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : SocolissimoAreaFreeshippingDomTableMap::translateFieldName('CartAmount', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->cart_amount = (null !== $col) ? (string) $col : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 4; // 4 = SocolissimoAreaFreeshippingDomTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \SoColissimo\Model\SocolissimoAreaFreeshippingDom object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ if ($this->aArea !== null && $this->area_id !== $this->aArea->getId()) {
+ $this->aArea = null;
+ }
+ if ($this->aSocolissimoDeliveryMode !== null && $this->delivery_mode_id !== $this->aSocolissimoDeliveryMode->getId()) {
+ $this->aSocolissimoDeliveryMode = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildSocolissimoAreaFreeshippingDomQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->aArea = null;
+ $this->aSocolissimoDeliveryMode = null;
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see SocolissimoAreaFreeshippingDom::setDeleted()
+ * @see SocolissimoAreaFreeshippingDom::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildSocolissimoAreaFreeshippingDomQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ SocolissimoAreaFreeshippingDomTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ 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->aArea !== null) {
+ if ($this->aArea->isModified() || $this->aArea->isNew()) {
+ $affectedRows += $this->aArea->save($con);
+ }
+ $this->setArea($this->aArea);
+ }
+
+ if ($this->aSocolissimoDeliveryMode !== null) {
+ if ($this->aSocolissimoDeliveryMode->isModified() || $this->aSocolissimoDeliveryMode->isNew()) {
+ $affectedRows += $this->aSocolissimoDeliveryMode->save($con);
+ }
+ $this->setSocolissimoDeliveryMode($this->aSocolissimoDeliveryMode);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+ $this->modifiedColumns[SocolissimoAreaFreeshippingDomTableMap::ID] = true;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . SocolissimoAreaFreeshippingDomTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingDomTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingDomTableMap::AREA_ID)) {
+ $modifiedColumns[':p' . $index++] = 'AREA_ID';
+ }
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID)) {
+ $modifiedColumns[':p' . $index++] = 'DELIVERY_MODE_ID';
+ }
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT)) {
+ $modifiedColumns[':p' . $index++] = 'CART_AMOUNT';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO socolissimo_area_freeshipping_dom (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'AREA_ID':
+ $stmt->bindValue($identifier, $this->area_id, PDO::PARAM_INT);
+ break;
+ case 'DELIVERY_MODE_ID':
+ $stmt->bindValue($identifier, $this->delivery_mode_id, PDO::PARAM_INT);
+ break;
+ case 'CART_AMOUNT':
+ $stmt->bindValue($identifier, $this->cart_amount, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ try {
+ $pk = $con->lastInsertId();
+ } catch (Exception $e) {
+ throw new PropelException('Unable to get autoincrement id.', 0, $e);
+ }
+ $this->setId($pk);
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoAreaFreeshippingDomTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getAreaId();
+ break;
+ case 2:
+ return $this->getDeliveryModeId();
+ break;
+ case 3:
+ return $this->getCartAmount();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['SocolissimoAreaFreeshippingDom'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['SocolissimoAreaFreeshippingDom'][$this->getPrimaryKey()] = true;
+ $keys = SocolissimoAreaFreeshippingDomTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getAreaId(),
+ $keys[2] => $this->getDeliveryModeId(),
+ $keys[3] => $this->getCartAmount(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach ($virtualColumns as $key => $virtualColumn) {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aArea) {
+ $result['Area'] = $this->aArea->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ if (null !== $this->aSocolissimoDeliveryMode) {
+ $result['SocolissimoDeliveryMode'] = $this->aSocolissimoDeliveryMode->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoAreaFreeshippingDomTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setAreaId($value);
+ break;
+ case 2:
+ $this->setDeliveryModeId($value);
+ break;
+ case 3:
+ $this->setCartAmount($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = SocolissimoAreaFreeshippingDomTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setAreaId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setDeliveryModeId($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setCartAmount($arr[$keys[3]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingDomTableMap::ID)) $criteria->add(SocolissimoAreaFreeshippingDomTableMap::ID, $this->id);
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingDomTableMap::AREA_ID)) $criteria->add(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $this->area_id);
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID)) $criteria->add(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $this->delivery_mode_id);
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT)) $criteria->add(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT, $this->cart_amount);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoAreaFreeshippingDomTableMap::ID, $this->id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+ /**
+ * Generic method to set the primary key (id column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return null === $this->getId();
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \SoColissimo\Model\SocolissimoAreaFreeshippingDom (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setAreaId($this->getAreaId());
+ $copyObj->setDeliveryModeId($this->getDeliveryModeId());
+ $copyObj->setCartAmount($this->getCartAmount());
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingDom Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Declares an association between this object and a ChildArea object.
+ *
+ * @param ChildArea $v
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingDom The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setArea(ChildArea $v = null)
+ {
+ if ($v === null) {
+ $this->setAreaId(NULL);
+ } else {
+ $this->setAreaId($v->getId());
+ }
+
+ $this->aArea = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildArea object, it will not be re-added.
+ if ($v !== null) {
+ $v->addSocolissimoAreaFreeshippingDom($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildArea object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildArea The associated ChildArea object.
+ * @throws PropelException
+ */
+ public function getArea(ConnectionInterface $con = null)
+ {
+ if ($this->aArea === null && ($this->area_id !== null)) {
+ $this->aArea = AreaQuery::create()->findPk($this->area_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->aArea->addSocolissimoAreaFreeshippingDoms($this);
+ */
+ }
+
+ return $this->aArea;
+ }
+
+ /**
+ * Declares an association between this object and a ChildSocolissimoDeliveryMode object.
+ *
+ * @param ChildSocolissimoDeliveryMode $v
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingDom The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setSocolissimoDeliveryMode(ChildSocolissimoDeliveryMode $v = null)
+ {
+ if ($v === null) {
+ $this->setDeliveryModeId(NULL);
+ } else {
+ $this->setDeliveryModeId($v->getId());
+ }
+
+ $this->aSocolissimoDeliveryMode = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildSocolissimoDeliveryMode object, it will not be re-added.
+ if ($v !== null) {
+ $v->addSocolissimoAreaFreeshippingDom($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildSocolissimoDeliveryMode object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildSocolissimoDeliveryMode The associated ChildSocolissimoDeliveryMode object.
+ * @throws PropelException
+ */
+ public function getSocolissimoDeliveryMode(ConnectionInterface $con = null)
+ {
+ if ($this->aSocolissimoDeliveryMode === null && ($this->delivery_mode_id !== null)) {
+ $this->aSocolissimoDeliveryMode = ChildSocolissimoDeliveryModeQuery::create()->findPk($this->delivery_mode_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->aSocolissimoDeliveryMode->addSocolissimoAreaFreeshippingDoms($this);
+ */
+ }
+
+ return $this->aSocolissimoDeliveryMode;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->area_id = null;
+ $this->delivery_mode_id = null;
+ $this->cart_amount = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->applyDefaultValues();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ } // if ($deep)
+
+ $this->aArea = null;
+ $this->aSocolissimoDeliveryMode = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(SocolissimoAreaFreeshippingDomTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingDomQuery.php b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingDomQuery.php
new file mode 100644
index 00000000..3d09af2a
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingDomQuery.php
@@ -0,0 +1,645 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildSocolissimoAreaFreeshippingDom|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = SocolissimoAreaFreeshippingDomTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoAreaFreeshippingDom A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, AREA_ID, DELIVERY_MODE_ID, CART_AMOUNT FROM socolissimo_area_freeshipping_dom WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildSocolissimoAreaFreeshippingDom();
+ $obj->hydrate($row);
+ SocolissimoAreaFreeshippingDomTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoAreaFreeshippingDom|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @param mixed $id 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 ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the area_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByAreaId(1234); // WHERE area_id = 1234
+ * $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
+ * $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
+ *
+ *
+ * @see filterByArea()
+ *
+ * @param mixed $areaId 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 ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function filterByAreaId($areaId = null, $comparison = null)
+ {
+ if (is_array($areaId)) {
+ $useMinMax = false;
+ if (isset($areaId['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($areaId['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $areaId, $comparison);
+ }
+
+ /**
+ * Filter the query on the delivery_mode_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByDeliveryModeId(1234); // WHERE delivery_mode_id = 1234
+ * $query->filterByDeliveryModeId(array(12, 34)); // WHERE delivery_mode_id IN (12, 34)
+ * $query->filterByDeliveryModeId(array('min' => 12)); // WHERE delivery_mode_id > 12
+ *
+ *
+ * @see filterBySocolissimoDeliveryMode()
+ *
+ * @param mixed $deliveryModeId 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 ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function filterByDeliveryModeId($deliveryModeId = null, $comparison = null)
+ {
+ if (is_array($deliveryModeId)) {
+ $useMinMax = false;
+ if (isset($deliveryModeId['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($deliveryModeId['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $deliveryModeId, $comparison);
+ }
+
+ /**
+ * Filter the query on the cart_amount column
+ *
+ * Example usage:
+ *
+ * $query->filterByCartAmount(1234); // WHERE cart_amount = 1234
+ * $query->filterByCartAmount(array(12, 34)); // WHERE cart_amount IN (12, 34)
+ * $query->filterByCartAmount(array('min' => 12)); // WHERE cart_amount > 12
+ *
+ *
+ * @param mixed $cartAmount 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 ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function filterByCartAmount($cartAmount = null, $comparison = null)
+ {
+ if (is_array($cartAmount)) {
+ $useMinMax = false;
+ if (isset($cartAmount['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT, $cartAmount['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($cartAmount['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT, $cartAmount['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT, $cartAmount, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\Thelia\Model\Area object
+ *
+ * @param \SoColissimo\Model\Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function filterByArea($area, $comparison = null)
+ {
+ if ($area instanceof \SoColissimo\Model\Thelia\Model\Area) {
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $area->getId(), $comparison);
+ } elseif ($area instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByArea() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Area or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Area relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function joinArea($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Area');
+
+ // 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, 'Area');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Area relation Area 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 \SoColissimo\Model\Thelia\Model\AreaQuery A secondary query class using the current class as primary query
+ */
+ public function useAreaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinArea($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Area', '\SoColissimo\Model\Thelia\Model\AreaQuery');
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\SocolissimoDeliveryMode object
+ *
+ * @param \SoColissimo\Model\SocolissimoDeliveryMode|ObjectCollection $socolissimoDeliveryMode The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function filterBySocolissimoDeliveryMode($socolissimoDeliveryMode, $comparison = null)
+ {
+ if ($socolissimoDeliveryMode instanceof \SoColissimo\Model\SocolissimoDeliveryMode) {
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->getId(), $comparison);
+ } elseif ($socolissimoDeliveryMode instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterBySocolissimoDeliveryMode() only accepts arguments of type \SoColissimo\Model\SocolissimoDeliveryMode or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the SocolissimoDeliveryMode relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function joinSocolissimoDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('SocolissimoDeliveryMode');
+
+ // 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, 'SocolissimoDeliveryMode');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the SocolissimoDeliveryMode relation SocolissimoDeliveryMode 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 \SoColissimo\Model\SocolissimoDeliveryModeQuery A secondary query class using the current class as primary query
+ */
+ public function useSocolissimoDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinSocolissimoDeliveryMode($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'SocolissimoDeliveryMode', '\SoColissimo\Model\SocolissimoDeliveryModeQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildSocolissimoAreaFreeshippingDom $socolissimoAreaFreeshippingDom Object to remove from the list of results
+ *
+ * @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
+ */
+ public function prune($socolissimoAreaFreeshippingDom = null)
+ {
+ if ($socolissimoAreaFreeshippingDom) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::ID, $socolissimoAreaFreeshippingDom->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_area_freeshipping_dom table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ SocolissimoAreaFreeshippingDomTableMap::clearInstancePool();
+ SocolissimoAreaFreeshippingDomTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildSocolissimoAreaFreeshippingDom or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildSocolissimoAreaFreeshippingDom object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ SocolissimoAreaFreeshippingDomTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ SocolissimoAreaFreeshippingDomTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // SocolissimoAreaFreeshippingDomQuery
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingPr.php b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingPr.php
new file mode 100644
index 00000000..cc53f87e
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingPr.php
@@ -0,0 +1,1407 @@
+cart_amount = '0.000000';
+ }
+
+ /**
+ * Initializes internal state of SoColissimo\Model\Base\SocolissimoAreaFreeshippingPr object.
+ * @see applyDefaults()
+ */
+ public function __construct()
+ {
+ $this->applyDefaultValues();
+ }
+
+ /**
+ * Returns whether the object has been modified.
+ *
+ * @return boolean True if the object has been modified.
+ */
+ public function isModified()
+ {
+ return !!$this->modifiedColumns;
+ }
+
+ /**
+ * Has specified column been modified?
+ *
+ * @param string $col column fully qualified name (TableMap::TYPE_COLNAME), e.g. Book::AUTHOR_ID
+ * @return boolean True if $col has been modified.
+ */
+ public function isColumnModified($col)
+ {
+ return $this->modifiedColumns && isset($this->modifiedColumns[$col]);
+ }
+
+ /**
+ * Get the columns that have been modified in this object.
+ * @return array A unique list of the modified column names for this object.
+ */
+ public function getModifiedColumns()
+ {
+ return $this->modifiedColumns ? array_keys($this->modifiedColumns) : [];
+ }
+
+ /**
+ * Returns whether the object has ever been saved. This will
+ * be false, if the object was retrieved from storage or was created
+ * and then saved.
+ *
+ * @return boolean true, if the object has never been persisted.
+ */
+ public function isNew()
+ {
+ return $this->new;
+ }
+
+ /**
+ * Setter for the isNew attribute. This method will be called
+ * by Propel-generated children and objects.
+ *
+ * @param boolean $b the state of the object.
+ */
+ public function setNew($b)
+ {
+ $this->new = (Boolean) $b;
+ }
+
+ /**
+ * Whether this object has been deleted.
+ * @return boolean The deleted state of this object.
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Specify whether this object has been deleted.
+ * @param boolean $b The deleted state of this object.
+ * @return void
+ */
+ public function setDeleted($b)
+ {
+ $this->deleted = (Boolean) $b;
+ }
+
+ /**
+ * Sets the modified state for the object to be false.
+ * @param string $col If supplied, only the specified column is reset.
+ * @return void
+ */
+ public function resetModified($col = null)
+ {
+ if (null !== $col) {
+ if (isset($this->modifiedColumns[$col])) {
+ unset($this->modifiedColumns[$col]);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another SocolissimoAreaFreeshippingPr instance. If
+ * obj is an instance of SocolissimoAreaFreeshippingPr, delegates to
+ * equals(SocolissimoAreaFreeshippingPr). Otherwise, returns false.
+ *
+ * @param mixed $obj The object to compare to.
+ * @return boolean Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return mixed
+ *
+ * @throws PropelException
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return SocolissimoAreaFreeshippingPr The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return SocolissimoAreaFreeshippingPr The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+
+ return $this;
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [area_id] column value.
+ *
+ * @return int
+ */
+ public function getAreaId()
+ {
+
+ return $this->area_id;
+ }
+
+ /**
+ * Get the [delivery_mode_id] column value.
+ *
+ * @return int
+ */
+ public function getDeliveryModeId()
+ {
+
+ return $this->delivery_mode_id;
+ }
+
+ /**
+ * Get the [cart_amount] column value.
+ *
+ * @return string
+ */
+ public function getCartAmount()
+ {
+
+ return $this->cart_amount;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingPr The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingPrTableMap::ID] = true;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [area_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingPr The current object (for fluent API support)
+ */
+ public function setAreaId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->area_id !== $v) {
+ $this->area_id = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingPrTableMap::AREA_ID] = true;
+ }
+
+ if ($this->aArea !== null && $this->aArea->getId() !== $v) {
+ $this->aArea = null;
+ }
+
+
+ return $this;
+ } // setAreaId()
+
+ /**
+ * Set the value of [delivery_mode_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingPr The current object (for fluent API support)
+ */
+ public function setDeliveryModeId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->delivery_mode_id !== $v) {
+ $this->delivery_mode_id = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID] = true;
+ }
+
+ if ($this->aSocolissimoDeliveryMode !== null && $this->aSocolissimoDeliveryMode->getId() !== $v) {
+ $this->aSocolissimoDeliveryMode = null;
+ }
+
+
+ return $this;
+ } // setDeliveryModeId()
+
+ /**
+ * Set the value of [cart_amount] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingPr The current object (for fluent API support)
+ */
+ public function setCartAmount($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->cart_amount !== $v) {
+ $this->cart_amount = $v;
+ $this->modifiedColumns[SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT] = true;
+ }
+
+
+ return $this;
+ } // setCartAmount()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ if ($this->cart_amount !== '0.000000') {
+ return false;
+ }
+
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : SocolissimoAreaFreeshippingPrTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : SocolissimoAreaFreeshippingPrTableMap::translateFieldName('AreaId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->area_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : SocolissimoAreaFreeshippingPrTableMap::translateFieldName('DeliveryModeId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->delivery_mode_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : SocolissimoAreaFreeshippingPrTableMap::translateFieldName('CartAmount', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->cart_amount = (null !== $col) ? (string) $col : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 4; // 4 = SocolissimoAreaFreeshippingPrTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \SoColissimo\Model\SocolissimoAreaFreeshippingPr object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ if ($this->aArea !== null && $this->area_id !== $this->aArea->getId()) {
+ $this->aArea = null;
+ }
+ if ($this->aSocolissimoDeliveryMode !== null && $this->delivery_mode_id !== $this->aSocolissimoDeliveryMode->getId()) {
+ $this->aSocolissimoDeliveryMode = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildSocolissimoAreaFreeshippingPrQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->aArea = null;
+ $this->aSocolissimoDeliveryMode = null;
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see SocolissimoAreaFreeshippingPr::setDeleted()
+ * @see SocolissimoAreaFreeshippingPr::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildSocolissimoAreaFreeshippingPrQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ SocolissimoAreaFreeshippingPrTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ 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->aArea !== null) {
+ if ($this->aArea->isModified() || $this->aArea->isNew()) {
+ $affectedRows += $this->aArea->save($con);
+ }
+ $this->setArea($this->aArea);
+ }
+
+ if ($this->aSocolissimoDeliveryMode !== null) {
+ if ($this->aSocolissimoDeliveryMode->isModified() || $this->aSocolissimoDeliveryMode->isNew()) {
+ $affectedRows += $this->aSocolissimoDeliveryMode->save($con);
+ }
+ $this->setSocolissimoDeliveryMode($this->aSocolissimoDeliveryMode);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+ $this->modifiedColumns[SocolissimoAreaFreeshippingPrTableMap::ID] = true;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . SocolissimoAreaFreeshippingPrTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingPrTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingPrTableMap::AREA_ID)) {
+ $modifiedColumns[':p' . $index++] = 'AREA_ID';
+ }
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID)) {
+ $modifiedColumns[':p' . $index++] = 'DELIVERY_MODE_ID';
+ }
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT)) {
+ $modifiedColumns[':p' . $index++] = 'CART_AMOUNT';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO socolissimo_area_freeshipping_pr (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'AREA_ID':
+ $stmt->bindValue($identifier, $this->area_id, PDO::PARAM_INT);
+ break;
+ case 'DELIVERY_MODE_ID':
+ $stmt->bindValue($identifier, $this->delivery_mode_id, PDO::PARAM_INT);
+ break;
+ case 'CART_AMOUNT':
+ $stmt->bindValue($identifier, $this->cart_amount, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ try {
+ $pk = $con->lastInsertId();
+ } catch (Exception $e) {
+ throw new PropelException('Unable to get autoincrement id.', 0, $e);
+ }
+ $this->setId($pk);
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoAreaFreeshippingPrTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getAreaId();
+ break;
+ case 2:
+ return $this->getDeliveryModeId();
+ break;
+ case 3:
+ return $this->getCartAmount();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['SocolissimoAreaFreeshippingPr'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['SocolissimoAreaFreeshippingPr'][$this->getPrimaryKey()] = true;
+ $keys = SocolissimoAreaFreeshippingPrTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getAreaId(),
+ $keys[2] => $this->getDeliveryModeId(),
+ $keys[3] => $this->getCartAmount(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach ($virtualColumns as $key => $virtualColumn) {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aArea) {
+ $result['Area'] = $this->aArea->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ if (null !== $this->aSocolissimoDeliveryMode) {
+ $result['SocolissimoDeliveryMode'] = $this->aSocolissimoDeliveryMode->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoAreaFreeshippingPrTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setAreaId($value);
+ break;
+ case 2:
+ $this->setDeliveryModeId($value);
+ break;
+ case 3:
+ $this->setCartAmount($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = SocolissimoAreaFreeshippingPrTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setAreaId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setDeliveryModeId($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setCartAmount($arr[$keys[3]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingPrTableMap::ID)) $criteria->add(SocolissimoAreaFreeshippingPrTableMap::ID, $this->id);
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingPrTableMap::AREA_ID)) $criteria->add(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $this->area_id);
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID)) $criteria->add(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $this->delivery_mode_id);
+ if ($this->isColumnModified(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT)) $criteria->add(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT, $this->cart_amount);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoAreaFreeshippingPrTableMap::ID, $this->id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+ /**
+ * Generic method to set the primary key (id column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return null === $this->getId();
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \SoColissimo\Model\SocolissimoAreaFreeshippingPr (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setAreaId($this->getAreaId());
+ $copyObj->setDeliveryModeId($this->getDeliveryModeId());
+ $copyObj->setCartAmount($this->getCartAmount());
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingPr Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Declares an association between this object and a ChildArea object.
+ *
+ * @param ChildArea $v
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingPr The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setArea(ChildArea $v = null)
+ {
+ if ($v === null) {
+ $this->setAreaId(NULL);
+ } else {
+ $this->setAreaId($v->getId());
+ }
+
+ $this->aArea = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildArea object, it will not be re-added.
+ if ($v !== null) {
+ $v->addSocolissimoAreaFreeshippingPr($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildArea object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildArea The associated ChildArea object.
+ * @throws PropelException
+ */
+ public function getArea(ConnectionInterface $con = null)
+ {
+ if ($this->aArea === null && ($this->area_id !== null)) {
+ $this->aArea = AreaQuery::create()->findPk($this->area_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->aArea->addSocolissimoAreaFreeshippingPrs($this);
+ */
+ }
+
+ return $this->aArea;
+ }
+
+ /**
+ * Declares an association between this object and a ChildSocolissimoDeliveryMode object.
+ *
+ * @param ChildSocolissimoDeliveryMode $v
+ * @return \SoColissimo\Model\SocolissimoAreaFreeshippingPr The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setSocolissimoDeliveryMode(ChildSocolissimoDeliveryMode $v = null)
+ {
+ if ($v === null) {
+ $this->setDeliveryModeId(NULL);
+ } else {
+ $this->setDeliveryModeId($v->getId());
+ }
+
+ $this->aSocolissimoDeliveryMode = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildSocolissimoDeliveryMode object, it will not be re-added.
+ if ($v !== null) {
+ $v->addSocolissimoAreaFreeshippingPr($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildSocolissimoDeliveryMode object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildSocolissimoDeliveryMode The associated ChildSocolissimoDeliveryMode object.
+ * @throws PropelException
+ */
+ public function getSocolissimoDeliveryMode(ConnectionInterface $con = null)
+ {
+ if ($this->aSocolissimoDeliveryMode === null && ($this->delivery_mode_id !== null)) {
+ $this->aSocolissimoDeliveryMode = ChildSocolissimoDeliveryModeQuery::create()->findPk($this->delivery_mode_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->aSocolissimoDeliveryMode->addSocolissimoAreaFreeshippingPrs($this);
+ */
+ }
+
+ return $this->aSocolissimoDeliveryMode;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->area_id = null;
+ $this->delivery_mode_id = null;
+ $this->cart_amount = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->applyDefaultValues();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ } // if ($deep)
+
+ $this->aArea = null;
+ $this->aSocolissimoDeliveryMode = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(SocolissimoAreaFreeshippingPrTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingPrQuery.php b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingPrQuery.php
new file mode 100644
index 00000000..e79c596f
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingPrQuery.php
@@ -0,0 +1,645 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildSocolissimoAreaFreeshippingPr|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = SocolissimoAreaFreeshippingPrTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoAreaFreeshippingPr A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, AREA_ID, DELIVERY_MODE_ID, CART_AMOUNT FROM socolissimo_area_freeshipping_pr WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildSocolissimoAreaFreeshippingPr();
+ $obj->hydrate($row);
+ SocolissimoAreaFreeshippingPrTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoAreaFreeshippingPr|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @param mixed $id 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 ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the area_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByAreaId(1234); // WHERE area_id = 1234
+ * $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
+ * $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
+ *
+ *
+ * @see filterByArea()
+ *
+ * @param mixed $areaId 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 ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function filterByAreaId($areaId = null, $comparison = null)
+ {
+ if (is_array($areaId)) {
+ $useMinMax = false;
+ if (isset($areaId['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($areaId['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $areaId, $comparison);
+ }
+
+ /**
+ * Filter the query on the delivery_mode_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByDeliveryModeId(1234); // WHERE delivery_mode_id = 1234
+ * $query->filterByDeliveryModeId(array(12, 34)); // WHERE delivery_mode_id IN (12, 34)
+ * $query->filterByDeliveryModeId(array('min' => 12)); // WHERE delivery_mode_id > 12
+ *
+ *
+ * @see filterBySocolissimoDeliveryMode()
+ *
+ * @param mixed $deliveryModeId 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 ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function filterByDeliveryModeId($deliveryModeId = null, $comparison = null)
+ {
+ if (is_array($deliveryModeId)) {
+ $useMinMax = false;
+ if (isset($deliveryModeId['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($deliveryModeId['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $deliveryModeId, $comparison);
+ }
+
+ /**
+ * Filter the query on the cart_amount column
+ *
+ * Example usage:
+ *
+ * $query->filterByCartAmount(1234); // WHERE cart_amount = 1234
+ * $query->filterByCartAmount(array(12, 34)); // WHERE cart_amount IN (12, 34)
+ * $query->filterByCartAmount(array('min' => 12)); // WHERE cart_amount > 12
+ *
+ *
+ * @param mixed $cartAmount 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 ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function filterByCartAmount($cartAmount = null, $comparison = null)
+ {
+ if (is_array($cartAmount)) {
+ $useMinMax = false;
+ if (isset($cartAmount['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT, $cartAmount['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($cartAmount['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT, $cartAmount['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT, $cartAmount, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\Thelia\Model\Area object
+ *
+ * @param \SoColissimo\Model\Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function filterByArea($area, $comparison = null)
+ {
+ if ($area instanceof \SoColissimo\Model\Thelia\Model\Area) {
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $area->getId(), $comparison);
+ } elseif ($area instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByArea() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Area or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Area relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function joinArea($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Area');
+
+ // 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, 'Area');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Area relation Area 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 \SoColissimo\Model\Thelia\Model\AreaQuery A secondary query class using the current class as primary query
+ */
+ public function useAreaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinArea($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Area', '\SoColissimo\Model\Thelia\Model\AreaQuery');
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\SocolissimoDeliveryMode object
+ *
+ * @param \SoColissimo\Model\SocolissimoDeliveryMode|ObjectCollection $socolissimoDeliveryMode The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function filterBySocolissimoDeliveryMode($socolissimoDeliveryMode, $comparison = null)
+ {
+ if ($socolissimoDeliveryMode instanceof \SoColissimo\Model\SocolissimoDeliveryMode) {
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->getId(), $comparison);
+ } elseif ($socolissimoDeliveryMode instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterBySocolissimoDeliveryMode() only accepts arguments of type \SoColissimo\Model\SocolissimoDeliveryMode or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the SocolissimoDeliveryMode relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function joinSocolissimoDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('SocolissimoDeliveryMode');
+
+ // 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, 'SocolissimoDeliveryMode');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the SocolissimoDeliveryMode relation SocolissimoDeliveryMode 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 \SoColissimo\Model\SocolissimoDeliveryModeQuery A secondary query class using the current class as primary query
+ */
+ public function useSocolissimoDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinSocolissimoDeliveryMode($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'SocolissimoDeliveryMode', '\SoColissimo\Model\SocolissimoDeliveryModeQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildSocolissimoAreaFreeshippingPr $socolissimoAreaFreeshippingPr Object to remove from the list of results
+ *
+ * @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
+ */
+ public function prune($socolissimoAreaFreeshippingPr = null)
+ {
+ if ($socolissimoAreaFreeshippingPr) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::ID, $socolissimoAreaFreeshippingPr->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_area_freeshipping_pr table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ SocolissimoAreaFreeshippingPrTableMap::clearInstancePool();
+ SocolissimoAreaFreeshippingPrTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildSocolissimoAreaFreeshippingPr or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildSocolissimoAreaFreeshippingPr object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ SocolissimoAreaFreeshippingPrTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ SocolissimoAreaFreeshippingPrTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // SocolissimoAreaFreeshippingPrQuery
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingQuery.php b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingQuery.php
new file mode 100644
index 00000000..89e5ff69
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoAreaFreeshippingQuery.php
@@ -0,0 +1,645 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildSocolissimoAreaFreeshipping|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = SocolissimoAreaFreeshippingTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoAreaFreeshipping A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, AREA_ID, DELIVERY_MODE_ID, CART_AMOUNT FROM socolissimo_area_freeshipping WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildSocolissimoAreaFreeshipping();
+ $obj->hydrate($row);
+ SocolissimoAreaFreeshippingTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoAreaFreeshipping|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @param mixed $id 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 ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the area_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByAreaId(1234); // WHERE area_id = 1234
+ * $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
+ * $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
+ *
+ *
+ * @see filterByArea()
+ *
+ * @param mixed $areaId 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 ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByAreaId($areaId = null, $comparison = null)
+ {
+ if (is_array($areaId)) {
+ $useMinMax = false;
+ if (isset($areaId['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($areaId['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $areaId, $comparison);
+ }
+
+ /**
+ * Filter the query on the delivery_mode_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByDeliveryModeId(1234); // WHERE delivery_mode_id = 1234
+ * $query->filterByDeliveryModeId(array(12, 34)); // WHERE delivery_mode_id IN (12, 34)
+ * $query->filterByDeliveryModeId(array('min' => 12)); // WHERE delivery_mode_id > 12
+ *
+ *
+ * @see filterBySocolissimoDeliveryMode()
+ *
+ * @param mixed $deliveryModeId 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 ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByDeliveryModeId($deliveryModeId = null, $comparison = null)
+ {
+ if (is_array($deliveryModeId)) {
+ $useMinMax = false;
+ if (isset($deliveryModeId['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($deliveryModeId['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $deliveryModeId, $comparison);
+ }
+
+ /**
+ * Filter the query on the cart_amount column
+ *
+ * Example usage:
+ *
+ * $query->filterByCartAmount(1234); // WHERE cart_amount = 1234
+ * $query->filterByCartAmount(array(12, 34)); // WHERE cart_amount IN (12, 34)
+ * $query->filterByCartAmount(array('min' => 12)); // WHERE cart_amount > 12
+ *
+ *
+ * @param mixed $cartAmount 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 ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByCartAmount($cartAmount = null, $comparison = null)
+ {
+ if (is_array($cartAmount)) {
+ $useMinMax = false;
+ if (isset($cartAmount['min'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT, $cartAmount['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($cartAmount['max'])) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT, $cartAmount['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT, $cartAmount, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\Thelia\Model\Area object
+ *
+ * @param \SoColissimo\Model\Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByArea($area, $comparison = null)
+ {
+ if ($area instanceof \SoColissimo\Model\Thelia\Model\Area) {
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $area->getId(), $comparison);
+ } elseif ($area instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByArea() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Area or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Area relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function joinArea($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Area');
+
+ // 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, 'Area');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Area relation Area 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 \SoColissimo\Model\Thelia\Model\AreaQuery A secondary query class using the current class as primary query
+ */
+ public function useAreaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinArea($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Area', '\SoColissimo\Model\Thelia\Model\AreaQuery');
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\SocolissimoDeliveryMode object
+ *
+ * @param \SoColissimo\Model\SocolissimoDeliveryMode|ObjectCollection $socolissimoDeliveryMode The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterBySocolissimoDeliveryMode($socolissimoDeliveryMode, $comparison = null)
+ {
+ if ($socolissimoDeliveryMode instanceof \SoColissimo\Model\SocolissimoDeliveryMode) {
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->getId(), $comparison);
+ } elseif ($socolissimoDeliveryMode instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterBySocolissimoDeliveryMode() only accepts arguments of type \SoColissimo\Model\SocolissimoDeliveryMode or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the SocolissimoDeliveryMode relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function joinSocolissimoDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('SocolissimoDeliveryMode');
+
+ // 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, 'SocolissimoDeliveryMode');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the SocolissimoDeliveryMode relation SocolissimoDeliveryMode 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 \SoColissimo\Model\SocolissimoDeliveryModeQuery A secondary query class using the current class as primary query
+ */
+ public function useSocolissimoDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinSocolissimoDeliveryMode($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'SocolissimoDeliveryMode', '\SoColissimo\Model\SocolissimoDeliveryModeQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildSocolissimoAreaFreeshipping $socolissimoAreaFreeshipping Object to remove from the list of results
+ *
+ * @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
+ */
+ public function prune($socolissimoAreaFreeshipping = null)
+ {
+ if ($socolissimoAreaFreeshipping) {
+ $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::ID, $socolissimoAreaFreeshipping->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_area_freeshipping table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ SocolissimoAreaFreeshippingTableMap::clearInstancePool();
+ SocolissimoAreaFreeshippingTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildSocolissimoAreaFreeshipping or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildSocolissimoAreaFreeshipping object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ SocolissimoAreaFreeshippingTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ SocolissimoAreaFreeshippingTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // SocolissimoAreaFreeshippingQuery
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoDeliveryMode.php b/local/modules/SoColissimo/Model/Base/SocolissimoDeliveryMode.php
new file mode 100644
index 00000000..78d3a8bc
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoDeliveryMode.php
@@ -0,0 +1,2200 @@
+modifiedColumns;
+ }
+
+ /**
+ * Has specified column been modified?
+ *
+ * @param string $col column fully qualified name (TableMap::TYPE_COLNAME), e.g. Book::AUTHOR_ID
+ * @return boolean True if $col has been modified.
+ */
+ public function isColumnModified($col)
+ {
+ return $this->modifiedColumns && isset($this->modifiedColumns[$col]);
+ }
+
+ /**
+ * Get the columns that have been modified in this object.
+ * @return array A unique list of the modified column names for this object.
+ */
+ public function getModifiedColumns()
+ {
+ return $this->modifiedColumns ? array_keys($this->modifiedColumns) : [];
+ }
+
+ /**
+ * Returns whether the object has ever been saved. This will
+ * be false, if the object was retrieved from storage or was created
+ * and then saved.
+ *
+ * @return boolean true, if the object has never been persisted.
+ */
+ public function isNew()
+ {
+ return $this->new;
+ }
+
+ /**
+ * Setter for the isNew attribute. This method will be called
+ * by Propel-generated children and objects.
+ *
+ * @param boolean $b the state of the object.
+ */
+ public function setNew($b)
+ {
+ $this->new = (Boolean) $b;
+ }
+
+ /**
+ * Whether this object has been deleted.
+ * @return boolean The deleted state of this object.
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Specify whether this object has been deleted.
+ * @param boolean $b The deleted state of this object.
+ * @return void
+ */
+ public function setDeleted($b)
+ {
+ $this->deleted = (Boolean) $b;
+ }
+
+ /**
+ * Sets the modified state for the object to be false.
+ * @param string $col If supplied, only the specified column is reset.
+ * @return void
+ */
+ public function resetModified($col = null)
+ {
+ if (null !== $col) {
+ if (isset($this->modifiedColumns[$col])) {
+ unset($this->modifiedColumns[$col]);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another SocolissimoDeliveryMode instance. If
+ * obj is an instance of SocolissimoDeliveryMode, delegates to
+ * equals(SocolissimoDeliveryMode). Otherwise, returns false.
+ *
+ * @param mixed $obj The object to compare to.
+ * @return boolean Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return mixed
+ *
+ * @throws PropelException
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return SocolissimoDeliveryMode The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return SocolissimoDeliveryMode The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+
+ return $this;
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [title] column value.
+ *
+ * @return string
+ */
+ public function getTitle()
+ {
+
+ return $this->title;
+ }
+
+ /**
+ * Get the [code] column value.
+ *
+ * @return string
+ */
+ public function getCode()
+ {
+
+ return $this->code;
+ }
+
+ /**
+ * Get the [freeshipping_active] column value.
+ *
+ * @return boolean
+ */
+ public function getFreeshippingActive()
+ {
+
+ return $this->freeshipping_active;
+ }
+
+ /**
+ * Get the [freeshipping_from] column value.
+ *
+ * @return double
+ */
+ public function getFreeshippingFrom()
+ {
+
+ return $this->freeshipping_from;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[SocolissimoDeliveryModeTableMap::ID] = true;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [title] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\SocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function setTitle($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->title !== $v) {
+ $this->title = $v;
+ $this->modifiedColumns[SocolissimoDeliveryModeTableMap::TITLE] = true;
+ }
+
+
+ return $this;
+ } // setTitle()
+
+ /**
+ * Set the value of [code] column.
+ *
+ * @param string $v new value
+ * @return \SoColissimo\Model\SocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function setCode($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->code !== $v) {
+ $this->code = $v;
+ $this->modifiedColumns[SocolissimoDeliveryModeTableMap::CODE] = true;
+ }
+
+
+ return $this;
+ } // setCode()
+
+ /**
+ * Sets the value of the [freeshipping_active] column.
+ * Non-boolean arguments are converted using the following rules:
+ * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
+ * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
+ * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
+ *
+ * @param boolean|integer|string $v The new value
+ * @return \SoColissimo\Model\SocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function setFreeshippingActive($v)
+ {
+ if ($v !== null) {
+ if (is_string($v)) {
+ $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
+ } else {
+ $v = (boolean) $v;
+ }
+ }
+
+ if ($this->freeshipping_active !== $v) {
+ $this->freeshipping_active = $v;
+ $this->modifiedColumns[SocolissimoDeliveryModeTableMap::FREESHIPPING_ACTIVE] = true;
+ }
+
+
+ return $this;
+ } // setFreeshippingActive()
+
+ /**
+ * Set the value of [freeshipping_from] column.
+ *
+ * @param double $v new value
+ * @return \SoColissimo\Model\SocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function setFreeshippingFrom($v)
+ {
+ if ($v !== null) {
+ $v = (double) $v;
+ }
+
+ if ($this->freeshipping_from !== $v) {
+ $this->freeshipping_from = $v;
+ $this->modifiedColumns[SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM] = true;
+ }
+
+
+ return $this;
+ } // setFreeshippingFrom()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : SocolissimoDeliveryModeTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : SocolissimoDeliveryModeTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->title = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : SocolissimoDeliveryModeTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->code = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : SocolissimoDeliveryModeTableMap::translateFieldName('FreeshippingActive', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->freeshipping_active = (null !== $col) ? (boolean) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : SocolissimoDeliveryModeTableMap::translateFieldName('FreeshippingFrom', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->freeshipping_from = (null !== $col) ? (double) $col : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 5; // 5 = SocolissimoDeliveryModeTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \SoColissimo\Model\SocolissimoDeliveryMode object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildSocolissimoDeliveryModeQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->collSocolissimoPrices = null;
+
+ $this->collSocolissimoAreaFreeshippingDoms = null;
+
+ $this->collSocolissimoAreaFreeshippingPrs = null;
+
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see SocolissimoDeliveryMode::setDeleted()
+ * @see SocolissimoDeliveryMode::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildSocolissimoDeliveryModeQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ SocolissimoDeliveryModeTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ if ($this->socolissimoPricesScheduledForDeletion !== null) {
+ if (!$this->socolissimoPricesScheduledForDeletion->isEmpty()) {
+ \SoColissimo\Model\SocolissimoPriceQuery::create()
+ ->filterByPrimaryKeys($this->socolissimoPricesScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->socolissimoPricesScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collSocolissimoPrices !== null) {
+ foreach ($this->collSocolissimoPrices as $referrerFK) {
+ if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
+ if ($this->socolissimoAreaFreeshippingDomsScheduledForDeletion !== null) {
+ if (!$this->socolissimoAreaFreeshippingDomsScheduledForDeletion->isEmpty()) {
+ \SoColissimo\Model\SocolissimoAreaFreeshippingDomQuery::create()
+ ->filterByPrimaryKeys($this->socolissimoAreaFreeshippingDomsScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->socolissimoAreaFreeshippingDomsScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collSocolissimoAreaFreeshippingDoms !== null) {
+ foreach ($this->collSocolissimoAreaFreeshippingDoms as $referrerFK) {
+ if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
+ if ($this->socolissimoAreaFreeshippingPrsScheduledForDeletion !== null) {
+ if (!$this->socolissimoAreaFreeshippingPrsScheduledForDeletion->isEmpty()) {
+ \SoColissimo\Model\SocolissimoAreaFreeshippingPrQuery::create()
+ ->filterByPrimaryKeys($this->socolissimoAreaFreeshippingPrsScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->socolissimoAreaFreeshippingPrsScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collSocolissimoAreaFreeshippingPrs !== null) {
+ foreach ($this->collSocolissimoAreaFreeshippingPrs as $referrerFK) {
+ if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+ $this->modifiedColumns[SocolissimoDeliveryModeTableMap::ID] = true;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . SocolissimoDeliveryModeTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::TITLE)) {
+ $modifiedColumns[':p' . $index++] = 'TITLE';
+ }
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::CODE)) {
+ $modifiedColumns[':p' . $index++] = 'CODE';
+ }
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::FREESHIPPING_ACTIVE)) {
+ $modifiedColumns[':p' . $index++] = 'FREESHIPPING_ACTIVE';
+ }
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM)) {
+ $modifiedColumns[':p' . $index++] = 'FREESHIPPING_FROM';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO socolissimo_delivery_mode (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'TITLE':
+ $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
+ break;
+ case 'CODE':
+ $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR);
+ break;
+ case 'FREESHIPPING_ACTIVE':
+ $stmt->bindValue($identifier, (int) $this->freeshipping_active, PDO::PARAM_INT);
+ break;
+ case 'FREESHIPPING_FROM':
+ $stmt->bindValue($identifier, $this->freeshipping_from, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ try {
+ $pk = $con->lastInsertId();
+ } catch (Exception $e) {
+ throw new PropelException('Unable to get autoincrement id.', 0, $e);
+ }
+ $this->setId($pk);
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoDeliveryModeTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getTitle();
+ break;
+ case 2:
+ return $this->getCode();
+ break;
+ case 3:
+ return $this->getFreeshippingActive();
+ break;
+ case 4:
+ return $this->getFreeshippingFrom();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['SocolissimoDeliveryMode'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['SocolissimoDeliveryMode'][$this->getPrimaryKey()] = true;
+ $keys = SocolissimoDeliveryModeTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getTitle(),
+ $keys[2] => $this->getCode(),
+ $keys[3] => $this->getFreeshippingActive(),
+ $keys[4] => $this->getFreeshippingFrom(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach ($virtualColumns as $key => $virtualColumn) {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->collSocolissimoPrices) {
+ $result['SocolissimoPrices'] = $this->collSocolissimoPrices->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ }
+ if (null !== $this->collSocolissimoAreaFreeshippingDoms) {
+ $result['SocolissimoAreaFreeshippingDoms'] = $this->collSocolissimoAreaFreeshippingDoms->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ }
+ if (null !== $this->collSocolissimoAreaFreeshippingPrs) {
+ $result['SocolissimoAreaFreeshippingPrs'] = $this->collSocolissimoAreaFreeshippingPrs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoDeliveryModeTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setTitle($value);
+ break;
+ case 2:
+ $this->setCode($value);
+ break;
+ case 3:
+ $this->setFreeshippingActive($value);
+ break;
+ case 4:
+ $this->setFreeshippingFrom($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = SocolissimoDeliveryModeTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setTitle($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setCode($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setFreeshippingActive($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setFreeshippingFrom($arr[$keys[4]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::ID)) $criteria->add(SocolissimoDeliveryModeTableMap::ID, $this->id);
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::TITLE)) $criteria->add(SocolissimoDeliveryModeTableMap::TITLE, $this->title);
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::CODE)) $criteria->add(SocolissimoDeliveryModeTableMap::CODE, $this->code);
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::FREESHIPPING_ACTIVE)) $criteria->add(SocolissimoDeliveryModeTableMap::FREESHIPPING_ACTIVE, $this->freeshipping_active);
+ if ($this->isColumnModified(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM)) $criteria->add(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM, $this->freeshipping_from);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoDeliveryModeTableMap::ID, $this->id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+ /**
+ * Generic method to set the primary key (id column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return null === $this->getId();
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \SoColissimo\Model\SocolissimoDeliveryMode (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setTitle($this->getTitle());
+ $copyObj->setCode($this->getCode());
+ $copyObj->setFreeshippingActive($this->getFreeshippingActive());
+ $copyObj->setFreeshippingFrom($this->getFreeshippingFrom());
+
+ if ($deepCopy) {
+ // important: temporarily setNew(false) because this affects the behavior of
+ // the getter/setter methods for fkey referrer objects.
+ $copyObj->setNew(false);
+
+ foreach ($this->getSocolissimoPrices() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addSocolissimoPrice($relObj->copy($deepCopy));
+ }
+ }
+
+ foreach ($this->getSocolissimoAreaFreeshippingDoms() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addSocolissimoAreaFreeshippingDom($relObj->copy($deepCopy));
+ }
+ }
+
+ foreach ($this->getSocolissimoAreaFreeshippingPrs() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addSocolissimoAreaFreeshippingPr($relObj->copy($deepCopy));
+ }
+ }
+
+ } // if ($deepCopy)
+
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \SoColissimo\Model\SocolissimoDeliveryMode Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+
+ /**
+ * Initializes a collection based on the name of a relation.
+ * Avoids crafting an 'init[$relationName]s' method name
+ * that wouldn't work when StandardEnglishPluralizer is used.
+ *
+ * @param string $relationName The name of the relation to initialize
+ * @return void
+ */
+ public function initRelation($relationName)
+ {
+ if ('SocolissimoPrice' == $relationName) {
+ return $this->initSocolissimoPrices();
+ }
+ if ('SocolissimoAreaFreeshippingDom' == $relationName) {
+ return $this->initSocolissimoAreaFreeshippingDoms();
+ }
+ if ('SocolissimoAreaFreeshippingPr' == $relationName) {
+ return $this->initSocolissimoAreaFreeshippingPrs();
+ }
+ }
+
+ /**
+ * Clears out the collSocolissimoPrices 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 addSocolissimoPrices()
+ */
+ public function clearSocolissimoPrices()
+ {
+ $this->collSocolissimoPrices = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collSocolissimoPrices collection loaded partially.
+ */
+ public function resetPartialSocolissimoPrices($v = true)
+ {
+ $this->collSocolissimoPricesPartial = $v;
+ }
+
+ /**
+ * Initializes the collSocolissimoPrices collection.
+ *
+ * By default this just sets the collSocolissimoPrices collection to an empty array (like clearcollSocolissimoPrices());
+ * 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 initSocolissimoPrices($overrideExisting = true)
+ {
+ if (null !== $this->collSocolissimoPrices && !$overrideExisting) {
+ return;
+ }
+ $this->collSocolissimoPrices = new ObjectCollection();
+ $this->collSocolissimoPrices->setModel('\SoColissimo\Model\SocolissimoPrice');
+ }
+
+ /**
+ * Gets an array of ChildSocolissimoPrice 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 ChildSocolissimoDeliveryMode 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|ChildSocolissimoPrice[] List of ChildSocolissimoPrice objects
+ * @throws PropelException
+ */
+ public function getSocolissimoPrices($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collSocolissimoPricesPartial && !$this->isNew();
+ if (null === $this->collSocolissimoPrices || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collSocolissimoPrices) {
+ // return empty collection
+ $this->initSocolissimoPrices();
+ } else {
+ $collSocolissimoPrices = ChildSocolissimoPriceQuery::create(null, $criteria)
+ ->filterBySocolissimoDeliveryMode($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collSocolissimoPricesPartial && count($collSocolissimoPrices)) {
+ $this->initSocolissimoPrices(false);
+
+ foreach ($collSocolissimoPrices as $obj) {
+ if (false == $this->collSocolissimoPrices->contains($obj)) {
+ $this->collSocolissimoPrices->append($obj);
+ }
+ }
+
+ $this->collSocolissimoPricesPartial = true;
+ }
+
+ reset($collSocolissimoPrices);
+
+ return $collSocolissimoPrices;
+ }
+
+ if ($partial && $this->collSocolissimoPrices) {
+ foreach ($this->collSocolissimoPrices as $obj) {
+ if ($obj->isNew()) {
+ $collSocolissimoPrices[] = $obj;
+ }
+ }
+ }
+
+ $this->collSocolissimoPrices = $collSocolissimoPrices;
+ $this->collSocolissimoPricesPartial = false;
+ }
+ }
+
+ return $this->collSocolissimoPrices;
+ }
+
+ /**
+ * Sets a collection of SocolissimoPrice 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 $socolissimoPrices A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildSocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function setSocolissimoPrices(Collection $socolissimoPrices, ConnectionInterface $con = null)
+ {
+ $socolissimoPricesToDelete = $this->getSocolissimoPrices(new Criteria(), $con)->diff($socolissimoPrices);
+
+
+ $this->socolissimoPricesScheduledForDeletion = $socolissimoPricesToDelete;
+
+ foreach ($socolissimoPricesToDelete as $socolissimoPriceRemoved) {
+ $socolissimoPriceRemoved->setSocolissimoDeliveryMode(null);
+ }
+
+ $this->collSocolissimoPrices = null;
+ foreach ($socolissimoPrices as $socolissimoPrice) {
+ $this->addSocolissimoPrice($socolissimoPrice);
+ }
+
+ $this->collSocolissimoPrices = $socolissimoPrices;
+ $this->collSocolissimoPricesPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related SocolissimoPrice objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related SocolissimoPrice objects.
+ * @throws PropelException
+ */
+ public function countSocolissimoPrices(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collSocolissimoPricesPartial && !$this->isNew();
+ if (null === $this->collSocolissimoPrices || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collSocolissimoPrices) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getSocolissimoPrices());
+ }
+
+ $query = ChildSocolissimoPriceQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterBySocolissimoDeliveryMode($this)
+ ->count($con);
+ }
+
+ return count($this->collSocolissimoPrices);
+ }
+
+ /**
+ * Method called to associate a ChildSocolissimoPrice object to this object
+ * through the ChildSocolissimoPrice foreign key attribute.
+ *
+ * @param ChildSocolissimoPrice $l ChildSocolissimoPrice
+ * @return \SoColissimo\Model\SocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function addSocolissimoPrice(ChildSocolissimoPrice $l)
+ {
+ if ($this->collSocolissimoPrices === null) {
+ $this->initSocolissimoPrices();
+ $this->collSocolissimoPricesPartial = true;
+ }
+
+ if (!in_array($l, $this->collSocolissimoPrices->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddSocolissimoPrice($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param SocolissimoPrice $socolissimoPrice The socolissimoPrice object to add.
+ */
+ protected function doAddSocolissimoPrice($socolissimoPrice)
+ {
+ $this->collSocolissimoPrices[]= $socolissimoPrice;
+ $socolissimoPrice->setSocolissimoDeliveryMode($this);
+ }
+
+ /**
+ * @param SocolissimoPrice $socolissimoPrice The socolissimoPrice object to remove.
+ * @return ChildSocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function removeSocolissimoPrice($socolissimoPrice)
+ {
+ if ($this->getSocolissimoPrices()->contains($socolissimoPrice)) {
+ $this->collSocolissimoPrices->remove($this->collSocolissimoPrices->search($socolissimoPrice));
+ if (null === $this->socolissimoPricesScheduledForDeletion) {
+ $this->socolissimoPricesScheduledForDeletion = clone $this->collSocolissimoPrices;
+ $this->socolissimoPricesScheduledForDeletion->clear();
+ }
+ $this->socolissimoPricesScheduledForDeletion[]= clone $socolissimoPrice;
+ $socolissimoPrice->setSocolissimoDeliveryMode(null);
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * If this collection has already been initialized with
+ * an identical criteria, it returns the collection.
+ * Otherwise if this SocolissimoDeliveryMode is new, it will return
+ * an empty collection; or if this SocolissimoDeliveryMode has previously
+ * been saved, it will retrieve related SocolissimoPrices from storage.
+ *
+ * This method is protected by default in order to keep the public
+ * api reasonable. You can provide public methods for those you
+ * actually need in SocolissimoDeliveryMode.
+ *
+ * @param Criteria $criteria optional Criteria object to narrow the query
+ * @param ConnectionInterface $con optional connection object
+ * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
+ * @return Collection|ChildSocolissimoPrice[] List of ChildSocolissimoPrice objects
+ */
+ public function getSocolissimoPricesJoinArea($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ {
+ $query = ChildSocolissimoPriceQuery::create(null, $criteria);
+ $query->joinWith('Area', $joinBehavior);
+
+ return $this->getSocolissimoPrices($query, $con);
+ }
+
+ /**
+ * Clears out the collSocolissimoAreaFreeshippingDoms 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 addSocolissimoAreaFreeshippingDoms()
+ */
+ public function clearSocolissimoAreaFreeshippingDoms()
+ {
+ $this->collSocolissimoAreaFreeshippingDoms = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collSocolissimoAreaFreeshippingDoms collection loaded partially.
+ */
+ public function resetPartialSocolissimoAreaFreeshippingDoms($v = true)
+ {
+ $this->collSocolissimoAreaFreeshippingDomsPartial = $v;
+ }
+
+ /**
+ * Initializes the collSocolissimoAreaFreeshippingDoms collection.
+ *
+ * By default this just sets the collSocolissimoAreaFreeshippingDoms collection to an empty array (like clearcollSocolissimoAreaFreeshippingDoms());
+ * 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 initSocolissimoAreaFreeshippingDoms($overrideExisting = true)
+ {
+ if (null !== $this->collSocolissimoAreaFreeshippingDoms && !$overrideExisting) {
+ return;
+ }
+ $this->collSocolissimoAreaFreeshippingDoms = new ObjectCollection();
+ $this->collSocolissimoAreaFreeshippingDoms->setModel('\SoColissimo\Model\SocolissimoAreaFreeshippingDom');
+ }
+
+ /**
+ * Gets an array of ChildSocolissimoAreaFreeshippingDom 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 ChildSocolissimoDeliveryMode 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|ChildSocolissimoAreaFreeshippingDom[] List of ChildSocolissimoAreaFreeshippingDom objects
+ * @throws PropelException
+ */
+ public function getSocolissimoAreaFreeshippingDoms($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collSocolissimoAreaFreeshippingDomsPartial && !$this->isNew();
+ if (null === $this->collSocolissimoAreaFreeshippingDoms || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collSocolissimoAreaFreeshippingDoms) {
+ // return empty collection
+ $this->initSocolissimoAreaFreeshippingDoms();
+ } else {
+ $collSocolissimoAreaFreeshippingDoms = ChildSocolissimoAreaFreeshippingDomQuery::create(null, $criteria)
+ ->filterBySocolissimoDeliveryMode($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collSocolissimoAreaFreeshippingDomsPartial && count($collSocolissimoAreaFreeshippingDoms)) {
+ $this->initSocolissimoAreaFreeshippingDoms(false);
+
+ foreach ($collSocolissimoAreaFreeshippingDoms as $obj) {
+ if (false == $this->collSocolissimoAreaFreeshippingDoms->contains($obj)) {
+ $this->collSocolissimoAreaFreeshippingDoms->append($obj);
+ }
+ }
+
+ $this->collSocolissimoAreaFreeshippingDomsPartial = true;
+ }
+
+ reset($collSocolissimoAreaFreeshippingDoms);
+
+ return $collSocolissimoAreaFreeshippingDoms;
+ }
+
+ if ($partial && $this->collSocolissimoAreaFreeshippingDoms) {
+ foreach ($this->collSocolissimoAreaFreeshippingDoms as $obj) {
+ if ($obj->isNew()) {
+ $collSocolissimoAreaFreeshippingDoms[] = $obj;
+ }
+ }
+ }
+
+ $this->collSocolissimoAreaFreeshippingDoms = $collSocolissimoAreaFreeshippingDoms;
+ $this->collSocolissimoAreaFreeshippingDomsPartial = false;
+ }
+ }
+
+ return $this->collSocolissimoAreaFreeshippingDoms;
+ }
+
+ /**
+ * Sets a collection of SocolissimoAreaFreeshippingDom 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 $socolissimoAreaFreeshippingDoms A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildSocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function setSocolissimoAreaFreeshippingDoms(Collection $socolissimoAreaFreeshippingDoms, ConnectionInterface $con = null)
+ {
+ $socolissimoAreaFreeshippingDomsToDelete = $this->getSocolissimoAreaFreeshippingDoms(new Criteria(), $con)->diff($socolissimoAreaFreeshippingDoms);
+
+
+ $this->socolissimoAreaFreeshippingDomsScheduledForDeletion = $socolissimoAreaFreeshippingDomsToDelete;
+
+ foreach ($socolissimoAreaFreeshippingDomsToDelete as $socolissimoAreaFreeshippingDomRemoved) {
+ $socolissimoAreaFreeshippingDomRemoved->setSocolissimoDeliveryMode(null);
+ }
+
+ $this->collSocolissimoAreaFreeshippingDoms = null;
+ foreach ($socolissimoAreaFreeshippingDoms as $socolissimoAreaFreeshippingDom) {
+ $this->addSocolissimoAreaFreeshippingDom($socolissimoAreaFreeshippingDom);
+ }
+
+ $this->collSocolissimoAreaFreeshippingDoms = $socolissimoAreaFreeshippingDoms;
+ $this->collSocolissimoAreaFreeshippingDomsPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related SocolissimoAreaFreeshippingDom objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related SocolissimoAreaFreeshippingDom objects.
+ * @throws PropelException
+ */
+ public function countSocolissimoAreaFreeshippingDoms(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collSocolissimoAreaFreeshippingDomsPartial && !$this->isNew();
+ if (null === $this->collSocolissimoAreaFreeshippingDoms || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collSocolissimoAreaFreeshippingDoms) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getSocolissimoAreaFreeshippingDoms());
+ }
+
+ $query = ChildSocolissimoAreaFreeshippingDomQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterBySocolissimoDeliveryMode($this)
+ ->count($con);
+ }
+
+ return count($this->collSocolissimoAreaFreeshippingDoms);
+ }
+
+ /**
+ * Method called to associate a ChildSocolissimoAreaFreeshippingDom object to this object
+ * through the ChildSocolissimoAreaFreeshippingDom foreign key attribute.
+ *
+ * @param ChildSocolissimoAreaFreeshippingDom $l ChildSocolissimoAreaFreeshippingDom
+ * @return \SoColissimo\Model\SocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function addSocolissimoAreaFreeshippingDom(ChildSocolissimoAreaFreeshippingDom $l)
+ {
+ if ($this->collSocolissimoAreaFreeshippingDoms === null) {
+ $this->initSocolissimoAreaFreeshippingDoms();
+ $this->collSocolissimoAreaFreeshippingDomsPartial = true;
+ }
+
+ if (!in_array($l, $this->collSocolissimoAreaFreeshippingDoms->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddSocolissimoAreaFreeshippingDom($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param SocolissimoAreaFreeshippingDom $socolissimoAreaFreeshippingDom The socolissimoAreaFreeshippingDom object to add.
+ */
+ protected function doAddSocolissimoAreaFreeshippingDom($socolissimoAreaFreeshippingDom)
+ {
+ $this->collSocolissimoAreaFreeshippingDoms[]= $socolissimoAreaFreeshippingDom;
+ $socolissimoAreaFreeshippingDom->setSocolissimoDeliveryMode($this);
+ }
+
+ /**
+ * @param SocolissimoAreaFreeshippingDom $socolissimoAreaFreeshippingDom The socolissimoAreaFreeshippingDom object to remove.
+ * @return ChildSocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function removeSocolissimoAreaFreeshippingDom($socolissimoAreaFreeshippingDom)
+ {
+ if ($this->getSocolissimoAreaFreeshippingDoms()->contains($socolissimoAreaFreeshippingDom)) {
+ $this->collSocolissimoAreaFreeshippingDoms->remove($this->collSocolissimoAreaFreeshippingDoms->search($socolissimoAreaFreeshippingDom));
+ if (null === $this->socolissimoAreaFreeshippingDomsScheduledForDeletion) {
+ $this->socolissimoAreaFreeshippingDomsScheduledForDeletion = clone $this->collSocolissimoAreaFreeshippingDoms;
+ $this->socolissimoAreaFreeshippingDomsScheduledForDeletion->clear();
+ }
+ $this->socolissimoAreaFreeshippingDomsScheduledForDeletion[]= clone $socolissimoAreaFreeshippingDom;
+ $socolissimoAreaFreeshippingDom->setSocolissimoDeliveryMode(null);
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * If this collection has already been initialized with
+ * an identical criteria, it returns the collection.
+ * Otherwise if this SocolissimoDeliveryMode is new, it will return
+ * an empty collection; or if this SocolissimoDeliveryMode has previously
+ * been saved, it will retrieve related SocolissimoAreaFreeshippingDoms from storage.
+ *
+ * This method is protected by default in order to keep the public
+ * api reasonable. You can provide public methods for those you
+ * actually need in SocolissimoDeliveryMode.
+ *
+ * @param Criteria $criteria optional Criteria object to narrow the query
+ * @param ConnectionInterface $con optional connection object
+ * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
+ * @return Collection|ChildSocolissimoAreaFreeshippingDom[] List of ChildSocolissimoAreaFreeshippingDom objects
+ */
+ public function getSocolissimoAreaFreeshippingDomsJoinArea($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ {
+ $query = ChildSocolissimoAreaFreeshippingDomQuery::create(null, $criteria);
+ $query->joinWith('Area', $joinBehavior);
+
+ return $this->getSocolissimoAreaFreeshippingDoms($query, $con);
+ }
+
+ /**
+ * Clears out the collSocolissimoAreaFreeshippingPrs 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 addSocolissimoAreaFreeshippingPrs()
+ */
+ public function clearSocolissimoAreaFreeshippingPrs()
+ {
+ $this->collSocolissimoAreaFreeshippingPrs = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collSocolissimoAreaFreeshippingPrs collection loaded partially.
+ */
+ public function resetPartialSocolissimoAreaFreeshippingPrs($v = true)
+ {
+ $this->collSocolissimoAreaFreeshippingPrsPartial = $v;
+ }
+
+ /**
+ * Initializes the collSocolissimoAreaFreeshippingPrs collection.
+ *
+ * By default this just sets the collSocolissimoAreaFreeshippingPrs collection to an empty array (like clearcollSocolissimoAreaFreeshippingPrs());
+ * 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 initSocolissimoAreaFreeshippingPrs($overrideExisting = true)
+ {
+ if (null !== $this->collSocolissimoAreaFreeshippingPrs && !$overrideExisting) {
+ return;
+ }
+ $this->collSocolissimoAreaFreeshippingPrs = new ObjectCollection();
+ $this->collSocolissimoAreaFreeshippingPrs->setModel('\SoColissimo\Model\SocolissimoAreaFreeshippingPr');
+ }
+
+ /**
+ * Gets an array of ChildSocolissimoAreaFreeshippingPr 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 ChildSocolissimoDeliveryMode 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|ChildSocolissimoAreaFreeshippingPr[] List of ChildSocolissimoAreaFreeshippingPr objects
+ * @throws PropelException
+ */
+ public function getSocolissimoAreaFreeshippingPrs($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collSocolissimoAreaFreeshippingPrsPartial && !$this->isNew();
+ if (null === $this->collSocolissimoAreaFreeshippingPrs || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collSocolissimoAreaFreeshippingPrs) {
+ // return empty collection
+ $this->initSocolissimoAreaFreeshippingPrs();
+ } else {
+ $collSocolissimoAreaFreeshippingPrs = ChildSocolissimoAreaFreeshippingPrQuery::create(null, $criteria)
+ ->filterBySocolissimoDeliveryMode($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collSocolissimoAreaFreeshippingPrsPartial && count($collSocolissimoAreaFreeshippingPrs)) {
+ $this->initSocolissimoAreaFreeshippingPrs(false);
+
+ foreach ($collSocolissimoAreaFreeshippingPrs as $obj) {
+ if (false == $this->collSocolissimoAreaFreeshippingPrs->contains($obj)) {
+ $this->collSocolissimoAreaFreeshippingPrs->append($obj);
+ }
+ }
+
+ $this->collSocolissimoAreaFreeshippingPrsPartial = true;
+ }
+
+ reset($collSocolissimoAreaFreeshippingPrs);
+
+ return $collSocolissimoAreaFreeshippingPrs;
+ }
+
+ if ($partial && $this->collSocolissimoAreaFreeshippingPrs) {
+ foreach ($this->collSocolissimoAreaFreeshippingPrs as $obj) {
+ if ($obj->isNew()) {
+ $collSocolissimoAreaFreeshippingPrs[] = $obj;
+ }
+ }
+ }
+
+ $this->collSocolissimoAreaFreeshippingPrs = $collSocolissimoAreaFreeshippingPrs;
+ $this->collSocolissimoAreaFreeshippingPrsPartial = false;
+ }
+ }
+
+ return $this->collSocolissimoAreaFreeshippingPrs;
+ }
+
+ /**
+ * Sets a collection of SocolissimoAreaFreeshippingPr 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 $socolissimoAreaFreeshippingPrs A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildSocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function setSocolissimoAreaFreeshippingPrs(Collection $socolissimoAreaFreeshippingPrs, ConnectionInterface $con = null)
+ {
+ $socolissimoAreaFreeshippingPrsToDelete = $this->getSocolissimoAreaFreeshippingPrs(new Criteria(), $con)->diff($socolissimoAreaFreeshippingPrs);
+
+
+ $this->socolissimoAreaFreeshippingPrsScheduledForDeletion = $socolissimoAreaFreeshippingPrsToDelete;
+
+ foreach ($socolissimoAreaFreeshippingPrsToDelete as $socolissimoAreaFreeshippingPrRemoved) {
+ $socolissimoAreaFreeshippingPrRemoved->setSocolissimoDeliveryMode(null);
+ }
+
+ $this->collSocolissimoAreaFreeshippingPrs = null;
+ foreach ($socolissimoAreaFreeshippingPrs as $socolissimoAreaFreeshippingPr) {
+ $this->addSocolissimoAreaFreeshippingPr($socolissimoAreaFreeshippingPr);
+ }
+
+ $this->collSocolissimoAreaFreeshippingPrs = $socolissimoAreaFreeshippingPrs;
+ $this->collSocolissimoAreaFreeshippingPrsPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related SocolissimoAreaFreeshippingPr objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related SocolissimoAreaFreeshippingPr objects.
+ * @throws PropelException
+ */
+ public function countSocolissimoAreaFreeshippingPrs(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collSocolissimoAreaFreeshippingPrsPartial && !$this->isNew();
+ if (null === $this->collSocolissimoAreaFreeshippingPrs || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collSocolissimoAreaFreeshippingPrs) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getSocolissimoAreaFreeshippingPrs());
+ }
+
+ $query = ChildSocolissimoAreaFreeshippingPrQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterBySocolissimoDeliveryMode($this)
+ ->count($con);
+ }
+
+ return count($this->collSocolissimoAreaFreeshippingPrs);
+ }
+
+ /**
+ * Method called to associate a ChildSocolissimoAreaFreeshippingPr object to this object
+ * through the ChildSocolissimoAreaFreeshippingPr foreign key attribute.
+ *
+ * @param ChildSocolissimoAreaFreeshippingPr $l ChildSocolissimoAreaFreeshippingPr
+ * @return \SoColissimo\Model\SocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function addSocolissimoAreaFreeshippingPr(ChildSocolissimoAreaFreeshippingPr $l)
+ {
+ if ($this->collSocolissimoAreaFreeshippingPrs === null) {
+ $this->initSocolissimoAreaFreeshippingPrs();
+ $this->collSocolissimoAreaFreeshippingPrsPartial = true;
+ }
+
+ if (!in_array($l, $this->collSocolissimoAreaFreeshippingPrs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddSocolissimoAreaFreeshippingPr($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param SocolissimoAreaFreeshippingPr $socolissimoAreaFreeshippingPr The socolissimoAreaFreeshippingPr object to add.
+ */
+ protected function doAddSocolissimoAreaFreeshippingPr($socolissimoAreaFreeshippingPr)
+ {
+ $this->collSocolissimoAreaFreeshippingPrs[]= $socolissimoAreaFreeshippingPr;
+ $socolissimoAreaFreeshippingPr->setSocolissimoDeliveryMode($this);
+ }
+
+ /**
+ * @param SocolissimoAreaFreeshippingPr $socolissimoAreaFreeshippingPr The socolissimoAreaFreeshippingPr object to remove.
+ * @return ChildSocolissimoDeliveryMode The current object (for fluent API support)
+ */
+ public function removeSocolissimoAreaFreeshippingPr($socolissimoAreaFreeshippingPr)
+ {
+ if ($this->getSocolissimoAreaFreeshippingPrs()->contains($socolissimoAreaFreeshippingPr)) {
+ $this->collSocolissimoAreaFreeshippingPrs->remove($this->collSocolissimoAreaFreeshippingPrs->search($socolissimoAreaFreeshippingPr));
+ if (null === $this->socolissimoAreaFreeshippingPrsScheduledForDeletion) {
+ $this->socolissimoAreaFreeshippingPrsScheduledForDeletion = clone $this->collSocolissimoAreaFreeshippingPrs;
+ $this->socolissimoAreaFreeshippingPrsScheduledForDeletion->clear();
+ }
+ $this->socolissimoAreaFreeshippingPrsScheduledForDeletion[]= clone $socolissimoAreaFreeshippingPr;
+ $socolissimoAreaFreeshippingPr->setSocolissimoDeliveryMode(null);
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * If this collection has already been initialized with
+ * an identical criteria, it returns the collection.
+ * Otherwise if this SocolissimoDeliveryMode is new, it will return
+ * an empty collection; or if this SocolissimoDeliveryMode has previously
+ * been saved, it will retrieve related SocolissimoAreaFreeshippingPrs from storage.
+ *
+ * This method is protected by default in order to keep the public
+ * api reasonable. You can provide public methods for those you
+ * actually need in SocolissimoDeliveryMode.
+ *
+ * @param Criteria $criteria optional Criteria object to narrow the query
+ * @param ConnectionInterface $con optional connection object
+ * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
+ * @return Collection|ChildSocolissimoAreaFreeshippingPr[] List of ChildSocolissimoAreaFreeshippingPr objects
+ */
+ public function getSocolissimoAreaFreeshippingPrsJoinArea($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
+ {
+ $query = ChildSocolissimoAreaFreeshippingPrQuery::create(null, $criteria);
+ $query->joinWith('Area', $joinBehavior);
+
+ return $this->getSocolissimoAreaFreeshippingPrs($query, $con);
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->title = null;
+ $this->code = null;
+ $this->freeshipping_active = null;
+ $this->freeshipping_from = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ if ($this->collSocolissimoPrices) {
+ foreach ($this->collSocolissimoPrices as $o) {
+ $o->clearAllReferences($deep);
+ }
+ }
+ if ($this->collSocolissimoAreaFreeshippingDoms) {
+ foreach ($this->collSocolissimoAreaFreeshippingDoms as $o) {
+ $o->clearAllReferences($deep);
+ }
+ }
+ if ($this->collSocolissimoAreaFreeshippingPrs) {
+ foreach ($this->collSocolissimoAreaFreeshippingPrs as $o) {
+ $o->clearAllReferences($deep);
+ }
+ }
+ } // if ($deep)
+
+ $this->collSocolissimoPrices = null;
+ $this->collSocolissimoAreaFreeshippingDoms = null;
+ $this->collSocolissimoAreaFreeshippingPrs = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(SocolissimoDeliveryModeTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoDeliveryModeQuery.php b/local/modules/SoColissimo/Model/Base/SocolissimoDeliveryModeQuery.php
new file mode 100644
index 00000000..c76e4357
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoDeliveryModeQuery.php
@@ -0,0 +1,720 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildSocolissimoDeliveryMode|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = SocolissimoDeliveryModeTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoDeliveryMode A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, TITLE, CODE, FREESHIPPING_ACTIVE, FREESHIPPING_FROM FROM socolissimo_delivery_mode WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildSocolissimoDeliveryMode();
+ $obj->hydrate($row);
+ SocolissimoDeliveryModeTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoDeliveryMode|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @param mixed $id 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 ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the title column
+ *
+ * Example usage:
+ *
+ * $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
+ * $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
+ *
+ *
+ * @param string $title The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterByTitle($title = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($title)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $title)) {
+ $title = str_replace('*', '%', $title);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::TITLE, $title, $comparison);
+ }
+
+ /**
+ * Filter the query on the code column
+ *
+ * Example usage:
+ *
+ * $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
+ * $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
+ *
+ *
+ * @param string $code The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterByCode($code = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($code)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $code)) {
+ $code = str_replace('*', '%', $code);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::CODE, $code, $comparison);
+ }
+
+ /**
+ * Filter the query on the freeshipping_active column
+ *
+ * Example usage:
+ *
+ * $query->filterByFreeshippingActive(true); // WHERE freeshipping_active = true
+ * $query->filterByFreeshippingActive('yes'); // WHERE freeshipping_active = true
+ *
+ *
+ * @param boolean|string $freeshippingActive The value to use as filter.
+ * Non-boolean arguments are converted using the following rules:
+ * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
+ * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
+ * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterByFreeshippingActive($freeshippingActive = null, $comparison = null)
+ {
+ if (is_string($freeshippingActive)) {
+ $freeshipping_active = in_array(strtolower($freeshippingActive), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
+ }
+
+ return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::FREESHIPPING_ACTIVE, $freeshippingActive, $comparison);
+ }
+
+ /**
+ * Filter the query on the freeshipping_from column
+ *
+ * Example usage:
+ *
+ * $query->filterByFreeshippingFrom(1234); // WHERE freeshipping_from = 1234
+ * $query->filterByFreeshippingFrom(array(12, 34)); // WHERE freeshipping_from IN (12, 34)
+ * $query->filterByFreeshippingFrom(array('min' => 12)); // WHERE freeshipping_from > 12
+ *
+ *
+ * @param mixed $freeshippingFrom 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 ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterByFreeshippingFrom($freeshippingFrom = null, $comparison = null)
+ {
+ if (is_array($freeshippingFrom)) {
+ $useMinMax = false;
+ if (isset($freeshippingFrom['min'])) {
+ $this->addUsingAlias(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM, $freeshippingFrom['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($freeshippingFrom['max'])) {
+ $this->addUsingAlias(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM, $freeshippingFrom['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM, $freeshippingFrom, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\SocolissimoPrice object
+ *
+ * @param \SoColissimo\Model\SocolissimoPrice|ObjectCollection $socolissimoPrice the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterBySocolissimoPrice($socolissimoPrice, $comparison = null)
+ {
+ if ($socolissimoPrice instanceof \SoColissimo\Model\SocolissimoPrice) {
+ return $this
+ ->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoPrice->getDeliveryModeId(), $comparison);
+ } elseif ($socolissimoPrice instanceof ObjectCollection) {
+ return $this
+ ->useSocolissimoPriceQuery()
+ ->filterByPrimaryKeys($socolissimoPrice->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterBySocolissimoPrice() only accepts arguments of type \SoColissimo\Model\SocolissimoPrice or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the SocolissimoPrice relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function joinSocolissimoPrice($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('SocolissimoPrice');
+
+ // 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, 'SocolissimoPrice');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the SocolissimoPrice relation SocolissimoPrice 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 \SoColissimo\Model\SocolissimoPriceQuery A secondary query class using the current class as primary query
+ */
+ public function useSocolissimoPriceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinSocolissimoPrice($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'SocolissimoPrice', '\SoColissimo\Model\SocolissimoPriceQuery');
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\SocolissimoAreaFreeshippingDom object
+ *
+ * @param \SoColissimo\Model\SocolissimoAreaFreeshippingDom|ObjectCollection $socolissimoAreaFreeshippingDom the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterBySocolissimoAreaFreeshippingDom($socolissimoAreaFreeshippingDom, $comparison = null)
+ {
+ if ($socolissimoAreaFreeshippingDom instanceof \SoColissimo\Model\SocolissimoAreaFreeshippingDom) {
+ return $this
+ ->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoAreaFreeshippingDom->getDeliveryModeId(), $comparison);
+ } elseif ($socolissimoAreaFreeshippingDom instanceof ObjectCollection) {
+ return $this
+ ->useSocolissimoAreaFreeshippingDomQuery()
+ ->filterByPrimaryKeys($socolissimoAreaFreeshippingDom->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterBySocolissimoAreaFreeshippingDom() only accepts arguments of type \SoColissimo\Model\SocolissimoAreaFreeshippingDom or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the SocolissimoAreaFreeshippingDom relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function joinSocolissimoAreaFreeshippingDom($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('SocolissimoAreaFreeshippingDom');
+
+ // 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, 'SocolissimoAreaFreeshippingDom');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the SocolissimoAreaFreeshippingDom relation SocolissimoAreaFreeshippingDom 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 \SoColissimo\Model\SocolissimoAreaFreeshippingDomQuery A secondary query class using the current class as primary query
+ */
+ public function useSocolissimoAreaFreeshippingDomQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinSocolissimoAreaFreeshippingDom($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'SocolissimoAreaFreeshippingDom', '\SoColissimo\Model\SocolissimoAreaFreeshippingDomQuery');
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\SocolissimoAreaFreeshippingPr object
+ *
+ * @param \SoColissimo\Model\SocolissimoAreaFreeshippingPr|ObjectCollection $socolissimoAreaFreeshippingPr the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function filterBySocolissimoAreaFreeshippingPr($socolissimoAreaFreeshippingPr, $comparison = null)
+ {
+ if ($socolissimoAreaFreeshippingPr instanceof \SoColissimo\Model\SocolissimoAreaFreeshippingPr) {
+ return $this
+ ->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoAreaFreeshippingPr->getDeliveryModeId(), $comparison);
+ } elseif ($socolissimoAreaFreeshippingPr instanceof ObjectCollection) {
+ return $this
+ ->useSocolissimoAreaFreeshippingPrQuery()
+ ->filterByPrimaryKeys($socolissimoAreaFreeshippingPr->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterBySocolissimoAreaFreeshippingPr() only accepts arguments of type \SoColissimo\Model\SocolissimoAreaFreeshippingPr or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the SocolissimoAreaFreeshippingPr relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function joinSocolissimoAreaFreeshippingPr($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('SocolissimoAreaFreeshippingPr');
+
+ // 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, 'SocolissimoAreaFreeshippingPr');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the SocolissimoAreaFreeshippingPr relation SocolissimoAreaFreeshippingPr 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 \SoColissimo\Model\SocolissimoAreaFreeshippingPrQuery A secondary query class using the current class as primary query
+ */
+ public function useSocolissimoAreaFreeshippingPrQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinSocolissimoAreaFreeshippingPr($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'SocolissimoAreaFreeshippingPr', '\SoColissimo\Model\SocolissimoAreaFreeshippingPrQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildSocolissimoDeliveryMode $socolissimoDeliveryMode Object to remove from the list of results
+ *
+ * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
+ */
+ public function prune($socolissimoDeliveryMode = null)
+ {
+ if ($socolissimoDeliveryMode) {
+ $this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoDeliveryMode->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_delivery_mode table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ SocolissimoDeliveryModeTableMap::clearInstancePool();
+ SocolissimoDeliveryModeTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildSocolissimoDeliveryMode or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildSocolissimoDeliveryMode object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ SocolissimoDeliveryModeTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ SocolissimoDeliveryModeTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // SocolissimoDeliveryModeQuery
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoFreeshipping.php b/local/modules/SoColissimo/Model/Base/SocolissimoFreeshipping.php
new file mode 100644
index 00000000..0b1a4642
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoFreeshipping.php
@@ -0,0 +1,1286 @@
+modifiedColumns;
+ }
+
+ /**
+ * Has specified column been modified?
+ *
+ * @param string $col column fully qualified name (TableMap::TYPE_COLNAME), e.g. Book::AUTHOR_ID
+ * @return boolean True if $col has been modified.
+ */
+ public function isColumnModified($col)
+ {
+ return $this->modifiedColumns && isset($this->modifiedColumns[$col]);
+ }
+
+ /**
+ * Get the columns that have been modified in this object.
+ * @return array A unique list of the modified column names for this object.
+ */
+ public function getModifiedColumns()
+ {
+ return $this->modifiedColumns ? array_keys($this->modifiedColumns) : [];
+ }
+
+ /**
+ * Returns whether the object has ever been saved. This will
+ * be false, if the object was retrieved from storage or was created
+ * and then saved.
+ *
+ * @return boolean true, if the object has never been persisted.
+ */
+ public function isNew()
+ {
+ return $this->new;
+ }
+
+ /**
+ * Setter for the isNew attribute. This method will be called
+ * by Propel-generated children and objects.
+ *
+ * @param boolean $b the state of the object.
+ */
+ public function setNew($b)
+ {
+ $this->new = (Boolean) $b;
+ }
+
+ /**
+ * Whether this object has been deleted.
+ * @return boolean The deleted state of this object.
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Specify whether this object has been deleted.
+ * @param boolean $b The deleted state of this object.
+ * @return void
+ */
+ public function setDeleted($b)
+ {
+ $this->deleted = (Boolean) $b;
+ }
+
+ /**
+ * Sets the modified state for the object to be false.
+ * @param string $col If supplied, only the specified column is reset.
+ * @return void
+ */
+ public function resetModified($col = null)
+ {
+ if (null !== $col) {
+ if (isset($this->modifiedColumns[$col])) {
+ unset($this->modifiedColumns[$col]);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another SocolissimoFreeshipping instance. If
+ * obj is an instance of SocolissimoFreeshipping, delegates to
+ * equals(SocolissimoFreeshipping). Otherwise, returns false.
+ *
+ * @param mixed $obj The object to compare to.
+ * @return boolean Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return mixed
+ *
+ * @throws PropelException
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return SocolissimoFreeshipping The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return SocolissimoFreeshipping The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+
+ return $this;
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [active] column value.
+ *
+ * @return boolean
+ */
+ public function getActive()
+ {
+
+ return $this->active;
+ }
+
+ /**
+ * Get the [optionally formatted] temporal [created_at] column value.
+ *
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the raw \DateTime object will be returned.
+ *
+ * @return mixed Formatted date/time value as string or \DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
+ *
+ * @throws PropelException - if unable to parse/validate the date/time value.
+ */
+ public function getCreatedAt($format = NULL)
+ {
+ if ($format === null) {
+ return $this->created_at;
+ } else {
+ return $this->created_at instanceof \DateTime ? $this->created_at->format($format) : null;
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] temporal [updated_at] column value.
+ *
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the raw \DateTime object will be returned.
+ *
+ * @return mixed Formatted date/time value as string or \DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
+ *
+ * @throws PropelException - if unable to parse/validate the date/time value.
+ */
+ public function getUpdatedAt($format = NULL)
+ {
+ if ($format === null) {
+ return $this->updated_at;
+ } else {
+ return $this->updated_at instanceof \DateTime ? $this->updated_at->format($format) : null;
+ }
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoFreeshipping The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[SocolissimoFreeshippingTableMap::ID] = true;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Sets the value of the [active] column.
+ * Non-boolean arguments are converted using the following rules:
+ * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
+ * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
+ * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
+ *
+ * @param boolean|integer|string $v The new value
+ * @return \SoColissimo\Model\SocolissimoFreeshipping The current object (for fluent API support)
+ */
+ public function setActive($v)
+ {
+ if ($v !== null) {
+ if (is_string($v)) {
+ $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
+ } else {
+ $v = (boolean) $v;
+ }
+ }
+
+ if ($this->active !== $v) {
+ $this->active = $v;
+ $this->modifiedColumns[SocolissimoFreeshippingTableMap::ACTIVE] = true;
+ }
+
+
+ return $this;
+ } // setActive()
+
+ /**
+ * Sets the value of [created_at] column to a normalized version of the date/time value specified.
+ *
+ * @param mixed $v string, integer (timestamp), or \DateTime value.
+ * Empty strings are treated as NULL.
+ * @return \SoColissimo\Model\SocolissimoFreeshipping The current object (for fluent API support)
+ */
+ public function setCreatedAt($v)
+ {
+ $dt = PropelDateTime::newInstance($v, null, '\DateTime');
+ if ($this->created_at !== null || $dt !== null) {
+ if ($dt !== $this->created_at) {
+ $this->created_at = $dt;
+ $this->modifiedColumns[SocolissimoFreeshippingTableMap::CREATED_AT] = true;
+ }
+ } // if either are not null
+
+
+ return $this;
+ } // setCreatedAt()
+
+ /**
+ * Sets the value of [updated_at] column to a normalized version of the date/time value specified.
+ *
+ * @param mixed $v string, integer (timestamp), or \DateTime value.
+ * Empty strings are treated as NULL.
+ * @return \SoColissimo\Model\SocolissimoFreeshipping The current object (for fluent API support)
+ */
+ public function setUpdatedAt($v)
+ {
+ $dt = PropelDateTime::newInstance($v, null, '\DateTime');
+ if ($this->updated_at !== null || $dt !== null) {
+ if ($dt !== $this->updated_at) {
+ $this->updated_at = $dt;
+ $this->modifiedColumns[SocolissimoFreeshippingTableMap::UPDATED_AT] = true;
+ }
+ } // if either are not null
+
+
+ return $this;
+ } // setUpdatedAt()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : SocolissimoFreeshippingTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : SocolissimoFreeshippingTableMap::translateFieldName('Active', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->active = (null !== $col) ? (boolean) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : SocolissimoFreeshippingTableMap::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 ? 3 + $startcol : SocolissimoFreeshippingTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ if ($col === '0000-00-00 00:00:00') {
+ $col = null;
+ }
+ $this->updated_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 4; // 4 = SocolissimoFreeshippingTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \SoColissimo\Model\SocolissimoFreeshipping object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildSocolissimoFreeshippingQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see SocolissimoFreeshipping::setDeleted()
+ * @see SocolissimoFreeshipping::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildSocolissimoFreeshippingQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ // timestampable behavior
+ if (!$this->isColumnModified(SocolissimoFreeshippingTableMap::CREATED_AT)) {
+ $this->setCreatedAt(time());
+ }
+ if (!$this->isColumnModified(SocolissimoFreeshippingTableMap::UPDATED_AT)) {
+ $this->setUpdatedAt(time());
+ }
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ // timestampable behavior
+ if ($this->isModified() && !$this->isColumnModified(SocolissimoFreeshippingTableMap::UPDATED_AT)) {
+ $this->setUpdatedAt(time());
+ }
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ SocolissimoFreeshippingTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+ $this->modifiedColumns[SocolissimoFreeshippingTableMap::ID] = true;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . SocolissimoFreeshippingTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(SocolissimoFreeshippingTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(SocolissimoFreeshippingTableMap::ACTIVE)) {
+ $modifiedColumns[':p' . $index++] = 'ACTIVE';
+ }
+ if ($this->isColumnModified(SocolissimoFreeshippingTableMap::CREATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'CREATED_AT';
+ }
+ if ($this->isColumnModified(SocolissimoFreeshippingTableMap::UPDATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'UPDATED_AT';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO socolissimo_freeshipping (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'ACTIVE':
+ $stmt->bindValue($identifier, (int) $this->active, 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;
+ case 'UPDATED_AT':
+ $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ try {
+ $pk = $con->lastInsertId();
+ } catch (Exception $e) {
+ throw new PropelException('Unable to get autoincrement id.', 0, $e);
+ }
+ $this->setId($pk);
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoFreeshippingTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getActive();
+ break;
+ case 2:
+ return $this->getCreatedAt();
+ break;
+ case 3:
+ return $this->getUpdatedAt();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array())
+ {
+ if (isset($alreadyDumpedObjects['SocolissimoFreeshipping'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['SocolissimoFreeshipping'][$this->getPrimaryKey()] = true;
+ $keys = SocolissimoFreeshippingTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getActive(),
+ $keys[2] => $this->getCreatedAt(),
+ $keys[3] => $this->getUpdatedAt(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach ($virtualColumns as $key => $virtualColumn) {
+ $result[$key] = $virtualColumn;
+ }
+
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoFreeshippingTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setActive($value);
+ break;
+ case 2:
+ $this->setCreatedAt($value);
+ break;
+ case 3:
+ $this->setUpdatedAt($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = SocolissimoFreeshippingTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setActive($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setCreatedAt($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(SocolissimoFreeshippingTableMap::ID)) $criteria->add(SocolissimoFreeshippingTableMap::ID, $this->id);
+ if ($this->isColumnModified(SocolissimoFreeshippingTableMap::ACTIVE)) $criteria->add(SocolissimoFreeshippingTableMap::ACTIVE, $this->active);
+ if ($this->isColumnModified(SocolissimoFreeshippingTableMap::CREATED_AT)) $criteria->add(SocolissimoFreeshippingTableMap::CREATED_AT, $this->created_at);
+ if ($this->isColumnModified(SocolissimoFreeshippingTableMap::UPDATED_AT)) $criteria->add(SocolissimoFreeshippingTableMap::UPDATED_AT, $this->updated_at);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoFreeshippingTableMap::ID, $this->id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+ /**
+ * Generic method to set the primary key (id column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return null === $this->getId();
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \SoColissimo\Model\SocolissimoFreeshipping (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setActive($this->getActive());
+ $copyObj->setCreatedAt($this->getCreatedAt());
+ $copyObj->setUpdatedAt($this->getUpdatedAt());
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \SoColissimo\Model\SocolissimoFreeshipping Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->active = null;
+ $this->created_at = null;
+ $this->updated_at = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ } // if ($deep)
+
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(SocolissimoFreeshippingTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ // timestampable behavior
+
+ /**
+ * Mark the current object so that the update date doesn't get updated during next save
+ *
+ * @return ChildSocolissimoFreeshipping The current object (for fluent API support)
+ */
+ public function keepUpdateDateUnchanged()
+ {
+ $this->modifiedColumns[SocolissimoFreeshippingTableMap::UPDATED_AT] = true;
+
+ return $this;
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoFreeshippingQuery.php b/local/modules/SoColissimo/Model/Base/SocolissimoFreeshippingQuery.php
new file mode 100644
index 00000000..c9ac0f8d
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoFreeshippingQuery.php
@@ -0,0 +1,535 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildSocolissimoFreeshipping|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = SocolissimoFreeshippingTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoFreeshipping A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, ACTIVE, CREATED_AT, UPDATED_AT FROM socolissimo_freeshipping WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildSocolissimoFreeshipping();
+ $obj->hydrate($row);
+ SocolissimoFreeshippingTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoFreeshipping|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(SocolissimoFreeshippingTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(SocolissimoFreeshippingTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @param mixed $id 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 ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(SocolissimoFreeshippingTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(SocolissimoFreeshippingTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoFreeshippingTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the active column
+ *
+ * Example usage:
+ *
+ * $query->filterByActive(true); // WHERE active = true
+ * $query->filterByActive('yes'); // WHERE active = true
+ *
+ *
+ * @param boolean|string $active The value to use as filter.
+ * Non-boolean arguments are converted using the following rules:
+ * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
+ * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
+ * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByActive($active = null, $comparison = null)
+ {
+ if (is_string($active)) {
+ $active = in_array(strtolower($active), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
+ }
+
+ return $this->addUsingAlias(SocolissimoFreeshippingTableMap::ACTIVE, $active, $comparison);
+ }
+
+ /**
+ * Filter the query on the created_at column
+ *
+ * Example usage:
+ *
+ * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
+ * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
+ * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
+ *
+ *
+ * @param mixed $createdAt The value to use as filter.
+ * Values can be integers (unix timestamps), DateTime objects, or strings.
+ * Empty strings are treated as NULL.
+ * 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 ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByCreatedAt($createdAt = null, $comparison = null)
+ {
+ if (is_array($createdAt)) {
+ $useMinMax = false;
+ if (isset($createdAt['min'])) {
+ $this->addUsingAlias(SocolissimoFreeshippingTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($createdAt['max'])) {
+ $this->addUsingAlias(SocolissimoFreeshippingTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoFreeshippingTableMap::CREATED_AT, $createdAt, $comparison);
+ }
+
+ /**
+ * Filter the query on the updated_at column
+ *
+ * Example usage:
+ *
+ * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
+ * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
+ * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
+ *
+ *
+ * @param mixed $updatedAt The value to use as filter.
+ * Values can be integers (unix timestamps), DateTime objects, or strings.
+ * Empty strings are treated as NULL.
+ * 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 ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function filterByUpdatedAt($updatedAt = null, $comparison = null)
+ {
+ if (is_array($updatedAt)) {
+ $useMinMax = false;
+ if (isset($updatedAt['min'])) {
+ $this->addUsingAlias(SocolissimoFreeshippingTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($updatedAt['max'])) {
+ $this->addUsingAlias(SocolissimoFreeshippingTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoFreeshippingTableMap::UPDATED_AT, $updatedAt, $comparison);
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildSocolissimoFreeshipping $socolissimoFreeshipping Object to remove from the list of results
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function prune($socolissimoFreeshipping = null)
+ {
+ if ($socolissimoFreeshipping) {
+ $this->addUsingAlias(SocolissimoFreeshippingTableMap::ID, $socolissimoFreeshipping->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_freeshipping table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ SocolissimoFreeshippingTableMap::clearInstancePool();
+ SocolissimoFreeshippingTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildSocolissimoFreeshipping or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildSocolissimoFreeshipping object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ SocolissimoFreeshippingTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ SocolissimoFreeshippingTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ // timestampable behavior
+
+ /**
+ * Filter by the latest updated
+ *
+ * @param int $nbDays Maximum age of the latest update in days
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function recentlyUpdated($nbDays = 7)
+ {
+ return $this->addUsingAlias(SocolissimoFreeshippingTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Filter by the latest created
+ *
+ * @param int $nbDays Maximum age of in days
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function recentlyCreated($nbDays = 7)
+ {
+ return $this->addUsingAlias(SocolissimoFreeshippingTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Order by update date desc
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function lastUpdatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(SocolissimoFreeshippingTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by update date asc
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function firstUpdatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(SocolissimoFreeshippingTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by create date desc
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function lastCreatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(SocolissimoFreeshippingTableMap::CREATED_AT);
+ }
+
+ /**
+ * Order by create date asc
+ *
+ * @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
+ */
+ public function firstCreatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(SocolissimoFreeshippingTableMap::CREATED_AT);
+ }
+
+} // SocolissimoFreeshippingQuery
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoPrice.php b/local/modules/SoColissimo/Model/Base/SocolissimoPrice.php
new file mode 100644
index 00000000..3cd70a37
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoPrice.php
@@ -0,0 +1,1562 @@
+modifiedColumns;
+ }
+
+ /**
+ * Has specified column been modified?
+ *
+ * @param string $col column fully qualified name (TableMap::TYPE_COLNAME), e.g. Book::AUTHOR_ID
+ * @return boolean True if $col has been modified.
+ */
+ public function isColumnModified($col)
+ {
+ return $this->modifiedColumns && isset($this->modifiedColumns[$col]);
+ }
+
+ /**
+ * Get the columns that have been modified in this object.
+ * @return array A unique list of the modified column names for this object.
+ */
+ public function getModifiedColumns()
+ {
+ return $this->modifiedColumns ? array_keys($this->modifiedColumns) : [];
+ }
+
+ /**
+ * Returns whether the object has ever been saved. This will
+ * be false, if the object was retrieved from storage or was created
+ * and then saved.
+ *
+ * @return boolean true, if the object has never been persisted.
+ */
+ public function isNew()
+ {
+ return $this->new;
+ }
+
+ /**
+ * Setter for the isNew attribute. This method will be called
+ * by Propel-generated children and objects.
+ *
+ * @param boolean $b the state of the object.
+ */
+ public function setNew($b)
+ {
+ $this->new = (Boolean) $b;
+ }
+
+ /**
+ * Whether this object has been deleted.
+ * @return boolean The deleted state of this object.
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Specify whether this object has been deleted.
+ * @param boolean $b The deleted state of this object.
+ * @return void
+ */
+ public function setDeleted($b)
+ {
+ $this->deleted = (Boolean) $b;
+ }
+
+ /**
+ * Sets the modified state for the object to be false.
+ * @param string $col If supplied, only the specified column is reset.
+ * @return void
+ */
+ public function resetModified($col = null)
+ {
+ if (null !== $col) {
+ if (isset($this->modifiedColumns[$col])) {
+ unset($this->modifiedColumns[$col]);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another SocolissimoPrice instance. If
+ * obj is an instance of SocolissimoPrice, delegates to
+ * equals(SocolissimoPrice). Otherwise, returns false.
+ *
+ * @param mixed $obj The object to compare to.
+ * @return boolean Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @return mixed
+ *
+ * @throws PropelException
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return SocolissimoPrice The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return SocolissimoPrice The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+
+ return $this;
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [area_id] column value.
+ *
+ * @return int
+ */
+ public function getAreaId()
+ {
+
+ return $this->area_id;
+ }
+
+ /**
+ * Get the [delivery_mode_id] column value.
+ *
+ * @return int
+ */
+ public function getDeliveryModeId()
+ {
+
+ return $this->delivery_mode_id;
+ }
+
+ /**
+ * Get the [weight_max] column value.
+ *
+ * @return double
+ */
+ public function getWeightMax()
+ {
+
+ return $this->weight_max;
+ }
+
+ /**
+ * Get the [price_max] column value.
+ *
+ * @return double
+ */
+ public function getPriceMax()
+ {
+
+ return $this->price_max;
+ }
+
+ /**
+ * Get the [franco_min_price] column value.
+ *
+ * @return double
+ */
+ public function getFrancoMinPrice()
+ {
+
+ return $this->franco_min_price;
+ }
+
+ /**
+ * Get the [price] column value.
+ *
+ * @return double
+ */
+ public function getPrice()
+ {
+
+ return $this->price;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[SocolissimoPriceTableMap::ID] = true;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [area_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support)
+ */
+ public function setAreaId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->area_id !== $v) {
+ $this->area_id = $v;
+ $this->modifiedColumns[SocolissimoPriceTableMap::AREA_ID] = true;
+ }
+
+ if ($this->aArea !== null && $this->aArea->getId() !== $v) {
+ $this->aArea = null;
+ }
+
+
+ return $this;
+ } // setAreaId()
+
+ /**
+ * Set the value of [delivery_mode_id] column.
+ *
+ * @param int $v new value
+ * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support)
+ */
+ public function setDeliveryModeId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->delivery_mode_id !== $v) {
+ $this->delivery_mode_id = $v;
+ $this->modifiedColumns[SocolissimoPriceTableMap::DELIVERY_MODE_ID] = true;
+ }
+
+ if ($this->aSocolissimoDeliveryMode !== null && $this->aSocolissimoDeliveryMode->getId() !== $v) {
+ $this->aSocolissimoDeliveryMode = null;
+ }
+
+
+ return $this;
+ } // setDeliveryModeId()
+
+ /**
+ * Set the value of [weight_max] column.
+ *
+ * @param double $v new value
+ * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support)
+ */
+ public function setWeightMax($v)
+ {
+ if ($v !== null) {
+ $v = (double) $v;
+ }
+
+ if ($this->weight_max !== $v) {
+ $this->weight_max = $v;
+ $this->modifiedColumns[SocolissimoPriceTableMap::WEIGHT_MAX] = true;
+ }
+
+
+ return $this;
+ } // setWeightMax()
+
+ /**
+ * Set the value of [price_max] column.
+ *
+ * @param double $v new value
+ * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support)
+ */
+ public function setPriceMax($v)
+ {
+ if ($v !== null) {
+ $v = (double) $v;
+ }
+
+ if ($this->price_max !== $v) {
+ $this->price_max = $v;
+ $this->modifiedColumns[SocolissimoPriceTableMap::PRICE_MAX] = true;
+ }
+
+
+ return $this;
+ } // setPriceMax()
+
+ /**
+ * Set the value of [franco_min_price] column.
+ *
+ * @param double $v new value
+ * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support)
+ */
+ public function setFrancoMinPrice($v)
+ {
+ if ($v !== null) {
+ $v = (double) $v;
+ }
+
+ if ($this->franco_min_price !== $v) {
+ $this->franco_min_price = $v;
+ $this->modifiedColumns[SocolissimoPriceTableMap::FRANCO_MIN_PRICE] = true;
+ }
+
+
+ return $this;
+ } // setFrancoMinPrice()
+
+ /**
+ * Set the value of [price] column.
+ *
+ * @param double $v new value
+ * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support)
+ */
+ public function setPrice($v)
+ {
+ if ($v !== null) {
+ $v = (double) $v;
+ }
+
+ if ($this->price !== $v) {
+ $this->price = $v;
+ $this->modifiedColumns[SocolissimoPriceTableMap::PRICE] = true;
+ }
+
+
+ return $this;
+ } // setPrice()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : SocolissimoPriceTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : SocolissimoPriceTableMap::translateFieldName('AreaId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->area_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : SocolissimoPriceTableMap::translateFieldName('DeliveryModeId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->delivery_mode_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : SocolissimoPriceTableMap::translateFieldName('WeightMax', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->weight_max = (null !== $col) ? (double) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : SocolissimoPriceTableMap::translateFieldName('PriceMax', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->price_max = (null !== $col) ? (double) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : SocolissimoPriceTableMap::translateFieldName('FrancoMinPrice', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->franco_min_price = (null !== $col) ? (double) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : SocolissimoPriceTableMap::translateFieldName('Price', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->price = (null !== $col) ? (double) $col : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 7; // 7 = SocolissimoPriceTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \SoColissimo\Model\SocolissimoPrice object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ if ($this->aArea !== null && $this->area_id !== $this->aArea->getId()) {
+ $this->aArea = null;
+ }
+ if ($this->aSocolissimoDeliveryMode !== null && $this->delivery_mode_id !== $this->aSocolissimoDeliveryMode->getId()) {
+ $this->aSocolissimoDeliveryMode = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoPriceTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildSocolissimoPriceQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->aArea = null;
+ $this->aSocolissimoDeliveryMode = null;
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see SocolissimoPrice::setDeleted()
+ * @see SocolissimoPrice::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoPriceTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildSocolissimoPriceQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoPriceTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ SocolissimoPriceTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ 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->aArea !== null) {
+ if ($this->aArea->isModified() || $this->aArea->isNew()) {
+ $affectedRows += $this->aArea->save($con);
+ }
+ $this->setArea($this->aArea);
+ }
+
+ if ($this->aSocolissimoDeliveryMode !== null) {
+ if ($this->aSocolissimoDeliveryMode->isModified() || $this->aSocolissimoDeliveryMode->isNew()) {
+ $affectedRows += $this->aSocolissimoDeliveryMode->save($con);
+ }
+ $this->setSocolissimoDeliveryMode($this->aSocolissimoDeliveryMode);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+ $this->modifiedColumns[SocolissimoPriceTableMap::ID] = true;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . SocolissimoPriceTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(SocolissimoPriceTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(SocolissimoPriceTableMap::AREA_ID)) {
+ $modifiedColumns[':p' . $index++] = 'AREA_ID';
+ }
+ if ($this->isColumnModified(SocolissimoPriceTableMap::DELIVERY_MODE_ID)) {
+ $modifiedColumns[':p' . $index++] = 'DELIVERY_MODE_ID';
+ }
+ if ($this->isColumnModified(SocolissimoPriceTableMap::WEIGHT_MAX)) {
+ $modifiedColumns[':p' . $index++] = 'WEIGHT_MAX';
+ }
+ if ($this->isColumnModified(SocolissimoPriceTableMap::PRICE_MAX)) {
+ $modifiedColumns[':p' . $index++] = 'PRICE_MAX';
+ }
+ if ($this->isColumnModified(SocolissimoPriceTableMap::FRANCO_MIN_PRICE)) {
+ $modifiedColumns[':p' . $index++] = 'FRANCO_MIN_PRICE';
+ }
+ if ($this->isColumnModified(SocolissimoPriceTableMap::PRICE)) {
+ $modifiedColumns[':p' . $index++] = 'PRICE';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO socolissimo_price (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'AREA_ID':
+ $stmt->bindValue($identifier, $this->area_id, PDO::PARAM_INT);
+ break;
+ case 'DELIVERY_MODE_ID':
+ $stmt->bindValue($identifier, $this->delivery_mode_id, PDO::PARAM_INT);
+ break;
+ case 'WEIGHT_MAX':
+ $stmt->bindValue($identifier, $this->weight_max, PDO::PARAM_STR);
+ break;
+ case 'PRICE_MAX':
+ $stmt->bindValue($identifier, $this->price_max, PDO::PARAM_STR);
+ break;
+ case 'FRANCO_MIN_PRICE':
+ $stmt->bindValue($identifier, $this->franco_min_price, PDO::PARAM_STR);
+ break;
+ case 'PRICE':
+ $stmt->bindValue($identifier, $this->price, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ try {
+ $pk = $con->lastInsertId();
+ } catch (Exception $e) {
+ throw new PropelException('Unable to get autoincrement id.', 0, $e);
+ }
+ $this->setId($pk);
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoPriceTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getAreaId();
+ break;
+ case 2:
+ return $this->getDeliveryModeId();
+ break;
+ case 3:
+ return $this->getWeightMax();
+ break;
+ case 4:
+ return $this->getPriceMax();
+ break;
+ case 5:
+ return $this->getFrancoMinPrice();
+ break;
+ case 6:
+ return $this->getPrice();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['SocolissimoPrice'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['SocolissimoPrice'][$this->getPrimaryKey()] = true;
+ $keys = SocolissimoPriceTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getAreaId(),
+ $keys[2] => $this->getDeliveryModeId(),
+ $keys[3] => $this->getWeightMax(),
+ $keys[4] => $this->getPriceMax(),
+ $keys[5] => $this->getFrancoMinPrice(),
+ $keys[6] => $this->getPrice(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach ($virtualColumns as $key => $virtualColumn) {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aArea) {
+ $result['Area'] = $this->aArea->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ if (null !== $this->aSocolissimoDeliveryMode) {
+ $result['SocolissimoDeliveryMode'] = $this->aSocolissimoDeliveryMode->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = SocolissimoPriceTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setAreaId($value);
+ break;
+ case 2:
+ $this->setDeliveryModeId($value);
+ break;
+ case 3:
+ $this->setWeightMax($value);
+ break;
+ case 4:
+ $this->setPriceMax($value);
+ break;
+ case 5:
+ $this->setFrancoMinPrice($value);
+ break;
+ case 6:
+ $this->setPrice($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = SocolissimoPriceTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setAreaId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setDeliveryModeId($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setWeightMax($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setPriceMax($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setFrancoMinPrice($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setPrice($arr[$keys[6]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SocolissimoPriceTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(SocolissimoPriceTableMap::ID)) $criteria->add(SocolissimoPriceTableMap::ID, $this->id);
+ if ($this->isColumnModified(SocolissimoPriceTableMap::AREA_ID)) $criteria->add(SocolissimoPriceTableMap::AREA_ID, $this->area_id);
+ if ($this->isColumnModified(SocolissimoPriceTableMap::DELIVERY_MODE_ID)) $criteria->add(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $this->delivery_mode_id);
+ if ($this->isColumnModified(SocolissimoPriceTableMap::WEIGHT_MAX)) $criteria->add(SocolissimoPriceTableMap::WEIGHT_MAX, $this->weight_max);
+ if ($this->isColumnModified(SocolissimoPriceTableMap::PRICE_MAX)) $criteria->add(SocolissimoPriceTableMap::PRICE_MAX, $this->price_max);
+ if ($this->isColumnModified(SocolissimoPriceTableMap::FRANCO_MIN_PRICE)) $criteria->add(SocolissimoPriceTableMap::FRANCO_MIN_PRICE, $this->franco_min_price);
+ if ($this->isColumnModified(SocolissimoPriceTableMap::PRICE)) $criteria->add(SocolissimoPriceTableMap::PRICE, $this->price);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SocolissimoPriceTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoPriceTableMap::ID, $this->id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+ /**
+ * Generic method to set the primary key (id column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return null === $this->getId();
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \SoColissimo\Model\SocolissimoPrice (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setAreaId($this->getAreaId());
+ $copyObj->setDeliveryModeId($this->getDeliveryModeId());
+ $copyObj->setWeightMax($this->getWeightMax());
+ $copyObj->setPriceMax($this->getPriceMax());
+ $copyObj->setFrancoMinPrice($this->getFrancoMinPrice());
+ $copyObj->setPrice($this->getPrice());
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \SoColissimo\Model\SocolissimoPrice Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Declares an association between this object and a ChildArea object.
+ *
+ * @param ChildArea $v
+ * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setArea(ChildArea $v = null)
+ {
+ if ($v === null) {
+ $this->setAreaId(NULL);
+ } else {
+ $this->setAreaId($v->getId());
+ }
+
+ $this->aArea = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildArea object, it will not be re-added.
+ if ($v !== null) {
+ $v->addSocolissimoPrice($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildArea object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildArea The associated ChildArea object.
+ * @throws PropelException
+ */
+ public function getArea(ConnectionInterface $con = null)
+ {
+ if ($this->aArea === null && ($this->area_id !== null)) {
+ $this->aArea = AreaQuery::create()->findPk($this->area_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->aArea->addSocolissimoPrices($this);
+ */
+ }
+
+ return $this->aArea;
+ }
+
+ /**
+ * Declares an association between this object and a ChildSocolissimoDeliveryMode object.
+ *
+ * @param ChildSocolissimoDeliveryMode $v
+ * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setSocolissimoDeliveryMode(ChildSocolissimoDeliveryMode $v = null)
+ {
+ if ($v === null) {
+ $this->setDeliveryModeId(NULL);
+ } else {
+ $this->setDeliveryModeId($v->getId());
+ }
+
+ $this->aSocolissimoDeliveryMode = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildSocolissimoDeliveryMode object, it will not be re-added.
+ if ($v !== null) {
+ $v->addSocolissimoPrice($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildSocolissimoDeliveryMode object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildSocolissimoDeliveryMode The associated ChildSocolissimoDeliveryMode object.
+ * @throws PropelException
+ */
+ public function getSocolissimoDeliveryMode(ConnectionInterface $con = null)
+ {
+ if ($this->aSocolissimoDeliveryMode === null && ($this->delivery_mode_id !== null)) {
+ $this->aSocolissimoDeliveryMode = ChildSocolissimoDeliveryModeQuery::create()->findPk($this->delivery_mode_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->aSocolissimoDeliveryMode->addSocolissimoPrices($this);
+ */
+ }
+
+ return $this->aSocolissimoDeliveryMode;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->area_id = null;
+ $this->delivery_mode_id = null;
+ $this->weight_max = null;
+ $this->price_max = null;
+ $this->franco_min_price = null;
+ $this->price = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ } // if ($deep)
+
+ $this->aArea = null;
+ $this->aSocolissimoDeliveryMode = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(SocolissimoPriceTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/local/modules/SoColissimo/Model/Base/SocolissimoPriceQuery.php b/local/modules/SoColissimo/Model/Base/SocolissimoPriceQuery.php
new file mode 100644
index 00000000..f3167d82
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Base/SocolissimoPriceQuery.php
@@ -0,0 +1,780 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildSocolissimoPrice|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = SocolissimoPriceTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(SocolissimoPriceTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoPrice A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, AREA_ID, DELIVERY_MODE_ID, WEIGHT_MAX, PRICE_MAX, FRANCO_MIN_PRICE, PRICE FROM socolissimo_price WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildSocolissimoPrice();
+ $obj->hydrate($row);
+ SocolissimoPriceTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildSocolissimoPrice|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(SocolissimoPriceTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(SocolissimoPriceTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @param mixed $id 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 ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoPriceTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the area_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByAreaId(1234); // WHERE area_id = 1234
+ * $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
+ * $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
+ *
+ *
+ * @see filterByArea()
+ *
+ * @param mixed $areaId 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 ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterByAreaId($areaId = null, $comparison = null)
+ {
+ if (is_array($areaId)) {
+ $useMinMax = false;
+ if (isset($areaId['min'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($areaId['max'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $areaId, $comparison);
+ }
+
+ /**
+ * Filter the query on the delivery_mode_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByDeliveryModeId(1234); // WHERE delivery_mode_id = 1234
+ * $query->filterByDeliveryModeId(array(12, 34)); // WHERE delivery_mode_id IN (12, 34)
+ * $query->filterByDeliveryModeId(array('min' => 12)); // WHERE delivery_mode_id > 12
+ *
+ *
+ * @see filterBySocolissimoDeliveryMode()
+ *
+ * @param mixed $deliveryModeId 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 ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterByDeliveryModeId($deliveryModeId = null, $comparison = null)
+ {
+ if (is_array($deliveryModeId)) {
+ $useMinMax = false;
+ if (isset($deliveryModeId['min'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($deliveryModeId['max'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $deliveryModeId, $comparison);
+ }
+
+ /**
+ * Filter the query on the weight_max column
+ *
+ * Example usage:
+ *
+ * $query->filterByWeightMax(1234); // WHERE weight_max = 1234
+ * $query->filterByWeightMax(array(12, 34)); // WHERE weight_max IN (12, 34)
+ * $query->filterByWeightMax(array('min' => 12)); // WHERE weight_max > 12
+ *
+ *
+ * @param mixed $weightMax 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 ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterByWeightMax($weightMax = null, $comparison = null)
+ {
+ if (is_array($weightMax)) {
+ $useMinMax = false;
+ if (isset($weightMax['min'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::WEIGHT_MAX, $weightMax['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($weightMax['max'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::WEIGHT_MAX, $weightMax['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoPriceTableMap::WEIGHT_MAX, $weightMax, $comparison);
+ }
+
+ /**
+ * Filter the query on the price_max column
+ *
+ * Example usage:
+ *
+ * $query->filterByPriceMax(1234); // WHERE price_max = 1234
+ * $query->filterByPriceMax(array(12, 34)); // WHERE price_max IN (12, 34)
+ * $query->filterByPriceMax(array('min' => 12)); // WHERE price_max > 12
+ *
+ *
+ * @param mixed $priceMax 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 ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterByPriceMax($priceMax = null, $comparison = null)
+ {
+ if (is_array($priceMax)) {
+ $useMinMax = false;
+ if (isset($priceMax['min'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::PRICE_MAX, $priceMax['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($priceMax['max'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::PRICE_MAX, $priceMax['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoPriceTableMap::PRICE_MAX, $priceMax, $comparison);
+ }
+
+ /**
+ * Filter the query on the franco_min_price column
+ *
+ * Example usage:
+ *
+ * $query->filterByFrancoMinPrice(1234); // WHERE franco_min_price = 1234
+ * $query->filterByFrancoMinPrice(array(12, 34)); // WHERE franco_min_price IN (12, 34)
+ * $query->filterByFrancoMinPrice(array('min' => 12)); // WHERE franco_min_price > 12
+ *
+ *
+ * @param mixed $francoMinPrice 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 ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterByFrancoMinPrice($francoMinPrice = null, $comparison = null)
+ {
+ if (is_array($francoMinPrice)) {
+ $useMinMax = false;
+ if (isset($francoMinPrice['min'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::FRANCO_MIN_PRICE, $francoMinPrice['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($francoMinPrice['max'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::FRANCO_MIN_PRICE, $francoMinPrice['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoPriceTableMap::FRANCO_MIN_PRICE, $francoMinPrice, $comparison);
+ }
+
+ /**
+ * Filter the query on the price column
+ *
+ * Example usage:
+ *
+ * $query->filterByPrice(1234); // WHERE price = 1234
+ * $query->filterByPrice(array(12, 34)); // WHERE price IN (12, 34)
+ * $query->filterByPrice(array('min' => 12)); // WHERE price > 12
+ *
+ *
+ * @param mixed $price 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 ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterByPrice($price = null, $comparison = null)
+ {
+ if (is_array($price)) {
+ $useMinMax = false;
+ if (isset($price['min'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::PRICE, $price['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($price['max'])) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::PRICE, $price['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(SocolissimoPriceTableMap::PRICE, $price, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\Thelia\Model\Area object
+ *
+ * @param \SoColissimo\Model\Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterByArea($area, $comparison = null)
+ {
+ if ($area instanceof \SoColissimo\Model\Thelia\Model\Area) {
+ return $this
+ ->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $area->getId(), $comparison);
+ } elseif ($area instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByArea() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Area or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Area relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function joinArea($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Area');
+
+ // 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, 'Area');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Area relation Area 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 \SoColissimo\Model\Thelia\Model\AreaQuery A secondary query class using the current class as primary query
+ */
+ public function useAreaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinArea($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Area', '\SoColissimo\Model\Thelia\Model\AreaQuery');
+ }
+
+ /**
+ * Filter the query by a related \SoColissimo\Model\SocolissimoDeliveryMode object
+ *
+ * @param \SoColissimo\Model\SocolissimoDeliveryMode|ObjectCollection $socolissimoDeliveryMode The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function filterBySocolissimoDeliveryMode($socolissimoDeliveryMode, $comparison = null)
+ {
+ if ($socolissimoDeliveryMode instanceof \SoColissimo\Model\SocolissimoDeliveryMode) {
+ return $this
+ ->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->getId(), $comparison);
+ } elseif ($socolissimoDeliveryMode instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterBySocolissimoDeliveryMode() only accepts arguments of type \SoColissimo\Model\SocolissimoDeliveryMode or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the SocolissimoDeliveryMode relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function joinSocolissimoDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('SocolissimoDeliveryMode');
+
+ // 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, 'SocolissimoDeliveryMode');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the SocolissimoDeliveryMode relation SocolissimoDeliveryMode 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 \SoColissimo\Model\SocolissimoDeliveryModeQuery A secondary query class using the current class as primary query
+ */
+ public function useSocolissimoDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinSocolissimoDeliveryMode($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'SocolissimoDeliveryMode', '\SoColissimo\Model\SocolissimoDeliveryModeQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildSocolissimoPrice $socolissimoPrice Object to remove from the list of results
+ *
+ * @return ChildSocolissimoPriceQuery The current query, for fluid interface
+ */
+ public function prune($socolissimoPrice = null)
+ {
+ if ($socolissimoPrice) {
+ $this->addUsingAlias(SocolissimoPriceTableMap::ID, $socolissimoPrice->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_price table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoPriceTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ SocolissimoPriceTableMap::clearInstancePool();
+ SocolissimoPriceTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildSocolissimoPrice or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildSocolissimoPrice object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoPriceTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(SocolissimoPriceTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ SocolissimoPriceTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ SocolissimoPriceTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // SocolissimoPriceQuery
diff --git a/local/modules/SoColissimo/Model/Map/AddressSocolissimoTableMap.php b/local/modules/SoColissimo/Model/Map/AddressSocolissimoTableMap.php
new file mode 100644
index 00000000..811eab03
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Map/AddressSocolissimoTableMap.php
@@ -0,0 +1,504 @@
+ array('Id', 'TitleId', 'Company', 'Firstname', 'Lastname', 'Address1', 'Address2', 'Address3', 'Zipcode', 'City', 'CountryId', 'Code', 'Type', 'Cellphone', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'titleId', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'countryId', 'code', 'type', 'cellphone', ),
+ self::TYPE_COLNAME => array(AddressSocolissimoTableMap::ID, AddressSocolissimoTableMap::TITLE_ID, AddressSocolissimoTableMap::COMPANY, AddressSocolissimoTableMap::FIRSTNAME, AddressSocolissimoTableMap::LASTNAME, AddressSocolissimoTableMap::ADDRESS1, AddressSocolissimoTableMap::ADDRESS2, AddressSocolissimoTableMap::ADDRESS3, AddressSocolissimoTableMap::ZIPCODE, AddressSocolissimoTableMap::CITY, AddressSocolissimoTableMap::COUNTRY_ID, AddressSocolissimoTableMap::CODE, AddressSocolissimoTableMap::TYPE, AddressSocolissimoTableMap::CELLPHONE, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'TITLE_ID', 'COMPANY', 'FIRSTNAME', 'LASTNAME', 'ADDRESS1', 'ADDRESS2', 'ADDRESS3', 'ZIPCODE', 'CITY', 'COUNTRY_ID', 'CODE', 'TYPE', 'CELLPHONE', ),
+ self::TYPE_FIELDNAME => array('id', 'title_id', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'country_id', 'code', 'type', 'cellphone', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'TitleId' => 1, 'Company' => 2, 'Firstname' => 3, 'Lastname' => 4, 'Address1' => 5, 'Address2' => 6, 'Address3' => 7, 'Zipcode' => 8, 'City' => 9, 'CountryId' => 10, 'Code' => 11, 'Type' => 12, 'Cellphone' => 13, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'titleId' => 1, 'company' => 2, 'firstname' => 3, 'lastname' => 4, 'address1' => 5, 'address2' => 6, 'address3' => 7, 'zipcode' => 8, 'city' => 9, 'countryId' => 10, 'code' => 11, 'type' => 12, 'cellphone' => 13, ),
+ self::TYPE_COLNAME => array(AddressSocolissimoTableMap::ID => 0, AddressSocolissimoTableMap::TITLE_ID => 1, AddressSocolissimoTableMap::COMPANY => 2, AddressSocolissimoTableMap::FIRSTNAME => 3, AddressSocolissimoTableMap::LASTNAME => 4, AddressSocolissimoTableMap::ADDRESS1 => 5, AddressSocolissimoTableMap::ADDRESS2 => 6, AddressSocolissimoTableMap::ADDRESS3 => 7, AddressSocolissimoTableMap::ZIPCODE => 8, AddressSocolissimoTableMap::CITY => 9, AddressSocolissimoTableMap::COUNTRY_ID => 10, AddressSocolissimoTableMap::CODE => 11, AddressSocolissimoTableMap::TYPE => 12, AddressSocolissimoTableMap::CELLPHONE => 13, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'TITLE_ID' => 1, 'COMPANY' => 2, 'FIRSTNAME' => 3, 'LASTNAME' => 4, 'ADDRESS1' => 5, 'ADDRESS2' => 6, 'ADDRESS3' => 7, 'ZIPCODE' => 8, 'CITY' => 9, 'COUNTRY_ID' => 10, 'CODE' => 11, 'TYPE' => 12, 'CELLPHONE' => 13, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'title_id' => 1, 'company' => 2, 'firstname' => 3, 'lastname' => 4, 'address1' => 5, 'address2' => 6, 'address3' => 7, 'zipcode' => 8, 'city' => 9, 'country_id' => 10, 'code' => 11, 'type' => 12, 'cellphone' => 13, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('address_socolissimo');
+ $this->setPhpName('AddressSocolissimo');
+ $this->setClassName('\\SoColissimo\\Model\\AddressSocolissimo');
+ $this->setPackage('SoColissimo.Model');
+ $this->setUseIdGenerator(false);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addForeignKey('TITLE_ID', 'TitleId', 'INTEGER', 'customer_title', 'ID', true, 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', true, 255, null);
+ $this->addColumn('ADDRESS3', 'Address3', 'VARCHAR', true, 255, null);
+ $this->addColumn('ZIPCODE', 'Zipcode', 'VARCHAR', true, 10, null);
+ $this->addColumn('CITY', 'City', 'VARCHAR', true, 255, null);
+ $this->addForeignKey('COUNTRY_ID', 'CountryId', 'INTEGER', 'country', 'ID', true, null, null);
+ $this->addColumn('CODE', 'Code', 'VARCHAR', true, 10, null);
+ $this->addColumn('TYPE', 'Type', 'VARCHAR', true, 10, null);
+ $this->addColumn('CELLPHONE', 'Cellphone', 'VARCHAR', false, 20, null);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('CustomerTitle', '\\SoColissimo\\Model\\Thelia\\Model\\CustomerTitle', RelationMap::MANY_TO_ONE, array('title_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ $this->addRelation('Country', '\\SoColissimo\\Model\\Thelia\\Model\\Country', RelationMap::MANY_TO_ONE, array('country_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ } // buildRelations()
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return (int) $row[
+ $indexType == TableMap::TYPE_NUM
+ ? 0 + $offset
+ : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
+ ];
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? AddressSocolissimoTableMap::CLASS_DEFAULT : AddressSocolissimoTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (AddressSocolissimo object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = AddressSocolissimoTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = AddressSocolissimoTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + AddressSocolissimoTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = AddressSocolissimoTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ AddressSocolissimoTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = AddressSocolissimoTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = AddressSocolissimoTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ AddressSocolissimoTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::ID);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::TITLE_ID);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::COMPANY);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::FIRSTNAME);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::LASTNAME);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::ADDRESS1);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::ADDRESS2);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::ADDRESS3);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::ZIPCODE);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::CITY);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::COUNTRY_ID);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::CODE);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::TYPE);
+ $criteria->addSelectColumn(AddressSocolissimoTableMap::CELLPHONE);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.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 . '.CODE');
+ $criteria->addSelectColumn($alias . '.TYPE');
+ $criteria->addSelectColumn($alias . '.CELLPHONE');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(AddressSocolissimoTableMap::DATABASE_NAME)->getTable(AddressSocolissimoTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(AddressSocolissimoTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(AddressSocolissimoTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new AddressSocolissimoTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a AddressSocolissimo or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AddressSocolissimo object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(AddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \SoColissimo\Model\AddressSocolissimo) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(AddressSocolissimoTableMap::DATABASE_NAME);
+ $criteria->add(AddressSocolissimoTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = AddressSocolissimoQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { AddressSocolissimoTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { AddressSocolissimoTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the address_socolissimo table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return AddressSocolissimoQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a AddressSocolissimo or Criteria object.
+ *
+ * @param mixed $criteria Criteria or AddressSocolissimo object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(AddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from AddressSocolissimo object
+ }
+
+
+ // Set the correct dbName
+ $query = AddressSocolissimoQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // AddressSocolissimoTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+AddressSocolissimoTableMap::buildTableMap();
diff --git a/local/modules/SoColissimo/Model/Map/OrderAddressSocolissimoTableMap.php b/local/modules/SoColissimo/Model/Map/OrderAddressSocolissimoTableMap.php
new file mode 100644
index 00000000..3c140463
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Map/OrderAddressSocolissimoTableMap.php
@@ -0,0 +1,415 @@
+ array('Id', 'Code', 'Type', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'code', 'type', ),
+ self::TYPE_COLNAME => array(OrderAddressSocolissimoTableMap::ID, OrderAddressSocolissimoTableMap::CODE, OrderAddressSocolissimoTableMap::TYPE, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'CODE', 'TYPE', ),
+ self::TYPE_FIELDNAME => array('id', 'code', 'type', ),
+ self::TYPE_NUM => array(0, 1, 2, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'Code' => 1, 'Type' => 2, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'code' => 1, 'type' => 2, ),
+ self::TYPE_COLNAME => array(OrderAddressSocolissimoTableMap::ID => 0, OrderAddressSocolissimoTableMap::CODE => 1, OrderAddressSocolissimoTableMap::TYPE => 2, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'CODE' => 1, 'TYPE' => 2, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'code' => 1, 'type' => 2, ),
+ self::TYPE_NUM => array(0, 1, 2, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('order_address_socolissimo');
+ $this->setPhpName('OrderAddressSocolissimo');
+ $this->setClassName('\\SoColissimo\\Model\\OrderAddressSocolissimo');
+ $this->setPackage('SoColissimo.Model');
+ $this->setUseIdGenerator(false);
+ // columns
+ $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'order_address', 'ID', true, null, null);
+ $this->addColumn('CODE', 'Code', 'VARCHAR', true, 10, null);
+ $this->addColumn('TYPE', 'Type', 'VARCHAR', true, 10, null);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('OrderAddress', '\\SoColissimo\\Model\\Thelia\\Model\\OrderAddress', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', 'CASCADE');
+ } // buildRelations()
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return (int) $row[
+ $indexType == TableMap::TYPE_NUM
+ ? 0 + $offset
+ : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
+ ];
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? OrderAddressSocolissimoTableMap::CLASS_DEFAULT : OrderAddressSocolissimoTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (OrderAddressSocolissimo object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = OrderAddressSocolissimoTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = OrderAddressSocolissimoTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + OrderAddressSocolissimoTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = OrderAddressSocolissimoTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ OrderAddressSocolissimoTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = OrderAddressSocolissimoTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = OrderAddressSocolissimoTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ OrderAddressSocolissimoTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(OrderAddressSocolissimoTableMap::ID);
+ $criteria->addSelectColumn(OrderAddressSocolissimoTableMap::CODE);
+ $criteria->addSelectColumn(OrderAddressSocolissimoTableMap::TYPE);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.CODE');
+ $criteria->addSelectColumn($alias . '.TYPE');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(OrderAddressSocolissimoTableMap::DATABASE_NAME)->getTable(OrderAddressSocolissimoTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(OrderAddressSocolissimoTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new OrderAddressSocolissimoTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a OrderAddressSocolissimo or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or OrderAddressSocolissimo object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \SoColissimo\Model\OrderAddressSocolissimo) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ $criteria->add(OrderAddressSocolissimoTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = OrderAddressSocolissimoQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { OrderAddressSocolissimoTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { OrderAddressSocolissimoTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the order_address_socolissimo table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return OrderAddressSocolissimoQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a OrderAddressSocolissimo or Criteria object.
+ *
+ * @param mixed $criteria Criteria or OrderAddressSocolissimo object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderAddressSocolissimoTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from OrderAddressSocolissimo object
+ }
+
+
+ // Set the correct dbName
+ $query = OrderAddressSocolissimoQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // OrderAddressSocolissimoTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+OrderAddressSocolissimoTableMap::buildTableMap();
diff --git a/local/modules/SoColissimo/Model/Map/SocolissimoAreaFreeshippingDomTableMap.php b/local/modules/SoColissimo/Model/Map/SocolissimoAreaFreeshippingDomTableMap.php
new file mode 100644
index 00000000..bb1a7e4f
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Map/SocolissimoAreaFreeshippingDomTableMap.php
@@ -0,0 +1,428 @@
+ array('Id', 'AreaId', 'DeliveryModeId', 'CartAmount', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'areaId', 'deliveryModeId', 'cartAmount', ),
+ self::TYPE_COLNAME => array(SocolissimoAreaFreeshippingDomTableMap::ID, SocolissimoAreaFreeshippingDomTableMap::AREA_ID, SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'AREA_ID', 'DELIVERY_MODE_ID', 'CART_AMOUNT', ),
+ self::TYPE_FIELDNAME => array('id', 'area_id', 'delivery_mode_id', 'cart_amount', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'AreaId' => 1, 'DeliveryModeId' => 2, 'CartAmount' => 3, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'areaId' => 1, 'deliveryModeId' => 2, 'cartAmount' => 3, ),
+ self::TYPE_COLNAME => array(SocolissimoAreaFreeshippingDomTableMap::ID => 0, SocolissimoAreaFreeshippingDomTableMap::AREA_ID => 1, SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID => 2, SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT => 3, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'AREA_ID' => 1, 'DELIVERY_MODE_ID' => 2, 'CART_AMOUNT' => 3, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'area_id' => 1, 'delivery_mode_id' => 2, 'cart_amount' => 3, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('socolissimo_area_freeshipping_dom');
+ $this->setPhpName('SocolissimoAreaFreeshippingDom');
+ $this->setClassName('\\SoColissimo\\Model\\SocolissimoAreaFreeshippingDom');
+ $this->setPackage('SoColissimo.Model');
+ $this->setUseIdGenerator(true);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addForeignKey('AREA_ID', 'AreaId', 'INTEGER', 'area', 'ID', true, null, null);
+ $this->addForeignKey('DELIVERY_MODE_ID', 'DeliveryModeId', 'INTEGER', 'socolissimo_delivery_mode', 'ID', true, null, null);
+ $this->addColumn('CART_AMOUNT', 'CartAmount', 'DECIMAL', false, 16, 0);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('Area', '\\SoColissimo\\Model\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ $this->addRelation('SocolissimoDeliveryMode', '\\SoColissimo\\Model\\SocolissimoDeliveryMode', RelationMap::MANY_TO_ONE, array('delivery_mode_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ } // buildRelations()
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return (int) $row[
+ $indexType == TableMap::TYPE_NUM
+ ? 0 + $offset
+ : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
+ ];
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? SocolissimoAreaFreeshippingDomTableMap::CLASS_DEFAULT : SocolissimoAreaFreeshippingDomTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (SocolissimoAreaFreeshippingDom object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = SocolissimoAreaFreeshippingDomTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = SocolissimoAreaFreeshippingDomTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + SocolissimoAreaFreeshippingDomTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = SocolissimoAreaFreeshippingDomTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ SocolissimoAreaFreeshippingDomTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = SocolissimoAreaFreeshippingDomTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = SocolissimoAreaFreeshippingDomTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ SocolissimoAreaFreeshippingDomTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingDomTableMap::ID);
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingDomTableMap::AREA_ID);
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID);
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.AREA_ID');
+ $criteria->addSelectColumn($alias . '.DELIVERY_MODE_ID');
+ $criteria->addSelectColumn($alias . '.CART_AMOUNT');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME)->getTable(SocolissimoAreaFreeshippingDomTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(SocolissimoAreaFreeshippingDomTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new SocolissimoAreaFreeshippingDomTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a SocolissimoAreaFreeshippingDom or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or SocolissimoAreaFreeshippingDom object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \SoColissimo\Model\SocolissimoAreaFreeshippingDom) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoAreaFreeshippingDomTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = SocolissimoAreaFreeshippingDomQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { SocolissimoAreaFreeshippingDomTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { SocolissimoAreaFreeshippingDomTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_area_freeshipping_dom table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return SocolissimoAreaFreeshippingDomQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a SocolissimoAreaFreeshippingDom or Criteria object.
+ *
+ * @param mixed $criteria Criteria or SocolissimoAreaFreeshippingDom object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from SocolissimoAreaFreeshippingDom object
+ }
+
+ if ($criteria->containsKey(SocolissimoAreaFreeshippingDomTableMap::ID) && $criteria->keyContainsValue(SocolissimoAreaFreeshippingDomTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.SocolissimoAreaFreeshippingDomTableMap::ID.')');
+ }
+
+
+ // Set the correct dbName
+ $query = SocolissimoAreaFreeshippingDomQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // SocolissimoAreaFreeshippingDomTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+SocolissimoAreaFreeshippingDomTableMap::buildTableMap();
diff --git a/local/modules/SoColissimo/Model/Map/SocolissimoAreaFreeshippingPrTableMap.php b/local/modules/SoColissimo/Model/Map/SocolissimoAreaFreeshippingPrTableMap.php
new file mode 100644
index 00000000..be57ad81
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Map/SocolissimoAreaFreeshippingPrTableMap.php
@@ -0,0 +1,428 @@
+ array('Id', 'AreaId', 'DeliveryModeId', 'CartAmount', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'areaId', 'deliveryModeId', 'cartAmount', ),
+ self::TYPE_COLNAME => array(SocolissimoAreaFreeshippingPrTableMap::ID, SocolissimoAreaFreeshippingPrTableMap::AREA_ID, SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'AREA_ID', 'DELIVERY_MODE_ID', 'CART_AMOUNT', ),
+ self::TYPE_FIELDNAME => array('id', 'area_id', 'delivery_mode_id', 'cart_amount', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'AreaId' => 1, 'DeliveryModeId' => 2, 'CartAmount' => 3, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'areaId' => 1, 'deliveryModeId' => 2, 'cartAmount' => 3, ),
+ self::TYPE_COLNAME => array(SocolissimoAreaFreeshippingPrTableMap::ID => 0, SocolissimoAreaFreeshippingPrTableMap::AREA_ID => 1, SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID => 2, SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT => 3, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'AREA_ID' => 1, 'DELIVERY_MODE_ID' => 2, 'CART_AMOUNT' => 3, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'area_id' => 1, 'delivery_mode_id' => 2, 'cart_amount' => 3, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('socolissimo_area_freeshipping_pr');
+ $this->setPhpName('SocolissimoAreaFreeshippingPr');
+ $this->setClassName('\\SoColissimo\\Model\\SocolissimoAreaFreeshippingPr');
+ $this->setPackage('SoColissimo.Model');
+ $this->setUseIdGenerator(true);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addForeignKey('AREA_ID', 'AreaId', 'INTEGER', 'area', 'ID', true, null, null);
+ $this->addForeignKey('DELIVERY_MODE_ID', 'DeliveryModeId', 'INTEGER', 'socolissimo_delivery_mode', 'ID', true, null, null);
+ $this->addColumn('CART_AMOUNT', 'CartAmount', 'DECIMAL', false, 16, 0);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('Area', '\\SoColissimo\\Model\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ $this->addRelation('SocolissimoDeliveryMode', '\\SoColissimo\\Model\\SocolissimoDeliveryMode', RelationMap::MANY_TO_ONE, array('delivery_mode_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ } // buildRelations()
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return (int) $row[
+ $indexType == TableMap::TYPE_NUM
+ ? 0 + $offset
+ : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
+ ];
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? SocolissimoAreaFreeshippingPrTableMap::CLASS_DEFAULT : SocolissimoAreaFreeshippingPrTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (SocolissimoAreaFreeshippingPr object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = SocolissimoAreaFreeshippingPrTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = SocolissimoAreaFreeshippingPrTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + SocolissimoAreaFreeshippingPrTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = SocolissimoAreaFreeshippingPrTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ SocolissimoAreaFreeshippingPrTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = SocolissimoAreaFreeshippingPrTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = SocolissimoAreaFreeshippingPrTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ SocolissimoAreaFreeshippingPrTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingPrTableMap::ID);
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingPrTableMap::AREA_ID);
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID);
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.AREA_ID');
+ $criteria->addSelectColumn($alias . '.DELIVERY_MODE_ID');
+ $criteria->addSelectColumn($alias . '.CART_AMOUNT');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME)->getTable(SocolissimoAreaFreeshippingPrTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(SocolissimoAreaFreeshippingPrTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new SocolissimoAreaFreeshippingPrTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a SocolissimoAreaFreeshippingPr or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or SocolissimoAreaFreeshippingPr object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \SoColissimo\Model\SocolissimoAreaFreeshippingPr) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoAreaFreeshippingPrTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = SocolissimoAreaFreeshippingPrQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { SocolissimoAreaFreeshippingPrTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { SocolissimoAreaFreeshippingPrTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_area_freeshipping_pr table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return SocolissimoAreaFreeshippingPrQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a SocolissimoAreaFreeshippingPr or Criteria object.
+ *
+ * @param mixed $criteria Criteria or SocolissimoAreaFreeshippingPr object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from SocolissimoAreaFreeshippingPr object
+ }
+
+ if ($criteria->containsKey(SocolissimoAreaFreeshippingPrTableMap::ID) && $criteria->keyContainsValue(SocolissimoAreaFreeshippingPrTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.SocolissimoAreaFreeshippingPrTableMap::ID.')');
+ }
+
+
+ // Set the correct dbName
+ $query = SocolissimoAreaFreeshippingPrQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // SocolissimoAreaFreeshippingPrTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+SocolissimoAreaFreeshippingPrTableMap::buildTableMap();
diff --git a/local/modules/SoColissimo/Model/Map/SocolissimoAreaFreeshippingTableMap.php b/local/modules/SoColissimo/Model/Map/SocolissimoAreaFreeshippingTableMap.php
new file mode 100644
index 00000000..90df0bab
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Map/SocolissimoAreaFreeshippingTableMap.php
@@ -0,0 +1,428 @@
+ array('Id', 'AreaId', 'DeliveryModeId', 'CartAmount', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'areaId', 'deliveryModeId', 'cartAmount', ),
+ self::TYPE_COLNAME => array(SocolissimoAreaFreeshippingTableMap::ID, SocolissimoAreaFreeshippingTableMap::AREA_ID, SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, SocolissimoAreaFreeshippingTableMap::CART_AMOUNT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'AREA_ID', 'DELIVERY_MODE_ID', 'CART_AMOUNT', ),
+ self::TYPE_FIELDNAME => array('id', 'area_id', 'delivery_mode_id', 'cart_amount', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'AreaId' => 1, 'DeliveryModeId' => 2, 'CartAmount' => 3, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'areaId' => 1, 'deliveryModeId' => 2, 'cartAmount' => 3, ),
+ self::TYPE_COLNAME => array(SocolissimoAreaFreeshippingTableMap::ID => 0, SocolissimoAreaFreeshippingTableMap::AREA_ID => 1, SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID => 2, SocolissimoAreaFreeshippingTableMap::CART_AMOUNT => 3, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'AREA_ID' => 1, 'DELIVERY_MODE_ID' => 2, 'CART_AMOUNT' => 3, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'area_id' => 1, 'delivery_mode_id' => 2, 'cart_amount' => 3, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('socolissimo_area_freeshipping');
+ $this->setPhpName('SocolissimoAreaFreeshipping');
+ $this->setClassName('\\SoColissimo\\Model\\SocolissimoAreaFreeshipping');
+ $this->setPackage('SoColissimo.Model');
+ $this->setUseIdGenerator(true);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addForeignKey('AREA_ID', 'AreaId', 'INTEGER', 'area', 'ID', true, null, null);
+ $this->addForeignKey('DELIVERY_MODE_ID', 'DeliveryModeId', 'INTEGER', 'socolissimo_delivery_mode', 'ID', true, null, null);
+ $this->addColumn('CART_AMOUNT', 'CartAmount', 'DECIMAL', true, 16, 0);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('Area', '\\SoColissimo\\Model\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ $this->addRelation('SocolissimoDeliveryMode', '\\SoColissimo\\Model\\SocolissimoDeliveryMode', RelationMap::MANY_TO_ONE, array('delivery_mode_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ } // buildRelations()
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return (int) $row[
+ $indexType == TableMap::TYPE_NUM
+ ? 0 + $offset
+ : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
+ ];
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? SocolissimoAreaFreeshippingTableMap::CLASS_DEFAULT : SocolissimoAreaFreeshippingTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (SocolissimoAreaFreeshipping object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = SocolissimoAreaFreeshippingTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = SocolissimoAreaFreeshippingTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + SocolissimoAreaFreeshippingTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = SocolissimoAreaFreeshippingTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ SocolissimoAreaFreeshippingTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = SocolissimoAreaFreeshippingTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = SocolissimoAreaFreeshippingTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ SocolissimoAreaFreeshippingTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingTableMap::ID);
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingTableMap::AREA_ID);
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID);
+ $criteria->addSelectColumn(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.AREA_ID');
+ $criteria->addSelectColumn($alias . '.DELIVERY_MODE_ID');
+ $criteria->addSelectColumn($alias . '.CART_AMOUNT');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME)->getTable(SocolissimoAreaFreeshippingTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(SocolissimoAreaFreeshippingTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new SocolissimoAreaFreeshippingTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a SocolissimoAreaFreeshipping or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or SocolissimoAreaFreeshipping object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \SoColissimo\Model\SocolissimoAreaFreeshipping) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoAreaFreeshippingTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = SocolissimoAreaFreeshippingQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { SocolissimoAreaFreeshippingTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { SocolissimoAreaFreeshippingTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_area_freeshipping table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return SocolissimoAreaFreeshippingQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a SocolissimoAreaFreeshipping or Criteria object.
+ *
+ * @param mixed $criteria Criteria or SocolissimoAreaFreeshipping object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from SocolissimoAreaFreeshipping object
+ }
+
+ if ($criteria->containsKey(SocolissimoAreaFreeshippingTableMap::ID) && $criteria->keyContainsValue(SocolissimoAreaFreeshippingTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.SocolissimoAreaFreeshippingTableMap::ID.')');
+ }
+
+
+ // Set the correct dbName
+ $query = SocolissimoAreaFreeshippingQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // SocolissimoAreaFreeshippingTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+SocolissimoAreaFreeshippingTableMap::buildTableMap();
diff --git a/local/modules/SoColissimo/Model/Map/SocolissimoDeliveryModeTableMap.php b/local/modules/SoColissimo/Model/Map/SocolissimoDeliveryModeTableMap.php
new file mode 100644
index 00000000..8ae89e80
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Map/SocolissimoDeliveryModeTableMap.php
@@ -0,0 +1,437 @@
+ array('Id', 'Title', 'Code', 'FreeshippingActive', 'FreeshippingFrom', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'title', 'code', 'freeshippingActive', 'freeshippingFrom', ),
+ self::TYPE_COLNAME => array(SocolissimoDeliveryModeTableMap::ID, SocolissimoDeliveryModeTableMap::TITLE, SocolissimoDeliveryModeTableMap::CODE, SocolissimoDeliveryModeTableMap::FREESHIPPING_ACTIVE, SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'TITLE', 'CODE', 'FREESHIPPING_ACTIVE', 'FREESHIPPING_FROM', ),
+ self::TYPE_FIELDNAME => array('id', 'title', 'code', 'freeshipping_active', 'freeshipping_from', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'Title' => 1, 'Code' => 2, 'FreeshippingActive' => 3, 'FreeshippingFrom' => 4, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'title' => 1, 'code' => 2, 'freeshippingActive' => 3, 'freeshippingFrom' => 4, ),
+ self::TYPE_COLNAME => array(SocolissimoDeliveryModeTableMap::ID => 0, SocolissimoDeliveryModeTableMap::TITLE => 1, SocolissimoDeliveryModeTableMap::CODE => 2, SocolissimoDeliveryModeTableMap::FREESHIPPING_ACTIVE => 3, SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM => 4, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'TITLE' => 1, 'CODE' => 2, 'FREESHIPPING_ACTIVE' => 3, 'FREESHIPPING_FROM' => 4, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'title' => 1, 'code' => 2, 'freeshipping_active' => 3, 'freeshipping_from' => 4, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('socolissimo_delivery_mode');
+ $this->setPhpName('SocolissimoDeliveryMode');
+ $this->setClassName('\\SoColissimo\\Model\\SocolissimoDeliveryMode');
+ $this->setPackage('SoColissimo.Model');
+ $this->setUseIdGenerator(true);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
+ $this->addColumn('CODE', 'Code', 'VARCHAR', true, 55, null);
+ $this->addColumn('FREESHIPPING_ACTIVE', 'FreeshippingActive', 'BOOLEAN', false, 1, null);
+ $this->addColumn('FREESHIPPING_FROM', 'FreeshippingFrom', 'FLOAT', false, null, null);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('SocolissimoPrice', '\\SoColissimo\\Model\\SocolissimoPrice', RelationMap::ONE_TO_MANY, array('id' => 'delivery_mode_id', ), 'RESTRICT', 'RESTRICT', 'SocolissimoPrices');
+ $this->addRelation('SocolissimoAreaFreeshippingDom', '\\SoColissimo\\Model\\SocolissimoAreaFreeshippingDom', RelationMap::ONE_TO_MANY, array('id' => 'delivery_mode_id', ), 'RESTRICT', 'RESTRICT', 'SocolissimoAreaFreeshippingDoms');
+ $this->addRelation('SocolissimoAreaFreeshippingPr', '\\SoColissimo\\Model\\SocolissimoAreaFreeshippingPr', RelationMap::ONE_TO_MANY, array('id' => 'delivery_mode_id', ), 'RESTRICT', 'RESTRICT', 'SocolissimoAreaFreeshippingPrs');
+ } // buildRelations()
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return (int) $row[
+ $indexType == TableMap::TYPE_NUM
+ ? 0 + $offset
+ : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
+ ];
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? SocolissimoDeliveryModeTableMap::CLASS_DEFAULT : SocolissimoDeliveryModeTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (SocolissimoDeliveryMode object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = SocolissimoDeliveryModeTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = SocolissimoDeliveryModeTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + SocolissimoDeliveryModeTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = SocolissimoDeliveryModeTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ SocolissimoDeliveryModeTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = SocolissimoDeliveryModeTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = SocolissimoDeliveryModeTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ SocolissimoDeliveryModeTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(SocolissimoDeliveryModeTableMap::ID);
+ $criteria->addSelectColumn(SocolissimoDeliveryModeTableMap::TITLE);
+ $criteria->addSelectColumn(SocolissimoDeliveryModeTableMap::CODE);
+ $criteria->addSelectColumn(SocolissimoDeliveryModeTableMap::FREESHIPPING_ACTIVE);
+ $criteria->addSelectColumn(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.TITLE');
+ $criteria->addSelectColumn($alias . '.CODE');
+ $criteria->addSelectColumn($alias . '.FREESHIPPING_ACTIVE');
+ $criteria->addSelectColumn($alias . '.FREESHIPPING_FROM');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(SocolissimoDeliveryModeTableMap::DATABASE_NAME)->getTable(SocolissimoDeliveryModeTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(SocolissimoDeliveryModeTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new SocolissimoDeliveryModeTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a SocolissimoDeliveryMode or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or SocolissimoDeliveryMode object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \SoColissimo\Model\SocolissimoDeliveryMode) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoDeliveryModeTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = SocolissimoDeliveryModeQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { SocolissimoDeliveryModeTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { SocolissimoDeliveryModeTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_delivery_mode table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return SocolissimoDeliveryModeQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a SocolissimoDeliveryMode or Criteria object.
+ *
+ * @param mixed $criteria Criteria or SocolissimoDeliveryMode object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from SocolissimoDeliveryMode object
+ }
+
+ if ($criteria->containsKey(SocolissimoDeliveryModeTableMap::ID) && $criteria->keyContainsValue(SocolissimoDeliveryModeTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.SocolissimoDeliveryModeTableMap::ID.')');
+ }
+
+
+ // Set the correct dbName
+ $query = SocolissimoDeliveryModeQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // SocolissimoDeliveryModeTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+SocolissimoDeliveryModeTableMap::buildTableMap();
diff --git a/local/modules/SoColissimo/Model/Map/SocolissimoFreeshippingTableMap.php b/local/modules/SoColissimo/Model/Map/SocolissimoFreeshippingTableMap.php
new file mode 100644
index 00000000..9ad970ea
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Map/SocolissimoFreeshippingTableMap.php
@@ -0,0 +1,439 @@
+ array('Id', 'Active', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'active', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(SocolissimoFreeshippingTableMap::ID, SocolissimoFreeshippingTableMap::ACTIVE, SocolissimoFreeshippingTableMap::CREATED_AT, SocolissimoFreeshippingTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'ACTIVE', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'active', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'Active' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'active' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
+ self::TYPE_COLNAME => array(SocolissimoFreeshippingTableMap::ID => 0, SocolissimoFreeshippingTableMap::ACTIVE => 1, SocolissimoFreeshippingTableMap::CREATED_AT => 2, SocolissimoFreeshippingTableMap::UPDATED_AT => 3, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'ACTIVE' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'active' => 1, 'created_at' => 2, 'updated_at' => 3, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('socolissimo_freeshipping');
+ $this->setPhpName('SocolissimoFreeshipping');
+ $this->setClassName('\\SoColissimo\\Model\\SocolissimoFreeshipping');
+ $this->setPackage('SoColissimo.Model');
+ $this->setUseIdGenerator(true);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addColumn('ACTIVE', 'Active', 'BOOLEAN', true, 1, null);
+ $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
+ $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ } // buildRelations()
+
+ /**
+ *
+ * Gets the list of behaviors registered for this table
+ *
+ * @return array Associative array (name => parameters) of behaviors
+ */
+ public function getBehaviors()
+ {
+ return array(
+ 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
+ );
+ } // getBehaviors()
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return (int) $row[
+ $indexType == TableMap::TYPE_NUM
+ ? 0 + $offset
+ : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
+ ];
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? SocolissimoFreeshippingTableMap::CLASS_DEFAULT : SocolissimoFreeshippingTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (SocolissimoFreeshipping object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = SocolissimoFreeshippingTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = SocolissimoFreeshippingTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + SocolissimoFreeshippingTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = SocolissimoFreeshippingTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ SocolissimoFreeshippingTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = SocolissimoFreeshippingTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = SocolissimoFreeshippingTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ SocolissimoFreeshippingTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(SocolissimoFreeshippingTableMap::ID);
+ $criteria->addSelectColumn(SocolissimoFreeshippingTableMap::ACTIVE);
+ $criteria->addSelectColumn(SocolissimoFreeshippingTableMap::CREATED_AT);
+ $criteria->addSelectColumn(SocolissimoFreeshippingTableMap::UPDATED_AT);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.ACTIVE');
+ $criteria->addSelectColumn($alias . '.CREATED_AT');
+ $criteria->addSelectColumn($alias . '.UPDATED_AT');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(SocolissimoFreeshippingTableMap::DATABASE_NAME)->getTable(SocolissimoFreeshippingTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(SocolissimoFreeshippingTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new SocolissimoFreeshippingTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a SocolissimoFreeshipping or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or SocolissimoFreeshipping object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \SoColissimo\Model\SocolissimoFreeshipping) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoFreeshippingTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = SocolissimoFreeshippingQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { SocolissimoFreeshippingTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { SocolissimoFreeshippingTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_freeshipping table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return SocolissimoFreeshippingQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a SocolissimoFreeshipping or Criteria object.
+ *
+ * @param mixed $criteria Criteria or SocolissimoFreeshipping object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoFreeshippingTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from SocolissimoFreeshipping object
+ }
+
+ if ($criteria->containsKey(SocolissimoFreeshippingTableMap::ID) && $criteria->keyContainsValue(SocolissimoFreeshippingTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.SocolissimoFreeshippingTableMap::ID.')');
+ }
+
+
+ // Set the correct dbName
+ $query = SocolissimoFreeshippingQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // SocolissimoFreeshippingTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+SocolissimoFreeshippingTableMap::buildTableMap();
diff --git a/local/modules/SoColissimo/Model/Map/SocolissimoPriceTableMap.php b/local/modules/SoColissimo/Model/Map/SocolissimoPriceTableMap.php
new file mode 100644
index 00000000..afb0b32b
--- /dev/null
+++ b/local/modules/SoColissimo/Model/Map/SocolissimoPriceTableMap.php
@@ -0,0 +1,452 @@
+ array('Id', 'AreaId', 'DeliveryModeId', 'WeightMax', 'PriceMax', 'FrancoMinPrice', 'Price', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'areaId', 'deliveryModeId', 'weightMax', 'priceMax', 'francoMinPrice', 'price', ),
+ self::TYPE_COLNAME => array(SocolissimoPriceTableMap::ID, SocolissimoPriceTableMap::AREA_ID, SocolissimoPriceTableMap::DELIVERY_MODE_ID, SocolissimoPriceTableMap::WEIGHT_MAX, SocolissimoPriceTableMap::PRICE_MAX, SocolissimoPriceTableMap::FRANCO_MIN_PRICE, SocolissimoPriceTableMap::PRICE, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'AREA_ID', 'DELIVERY_MODE_ID', 'WEIGHT_MAX', 'PRICE_MAX', 'FRANCO_MIN_PRICE', 'PRICE', ),
+ self::TYPE_FIELDNAME => array('id', 'area_id', 'delivery_mode_id', 'weight_max', 'price_max', 'franco_min_price', 'price', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'AreaId' => 1, 'DeliveryModeId' => 2, 'WeightMax' => 3, 'PriceMax' => 4, 'FrancoMinPrice' => 5, 'Price' => 6, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'areaId' => 1, 'deliveryModeId' => 2, 'weightMax' => 3, 'priceMax' => 4, 'francoMinPrice' => 5, 'price' => 6, ),
+ self::TYPE_COLNAME => array(SocolissimoPriceTableMap::ID => 0, SocolissimoPriceTableMap::AREA_ID => 1, SocolissimoPriceTableMap::DELIVERY_MODE_ID => 2, SocolissimoPriceTableMap::WEIGHT_MAX => 3, SocolissimoPriceTableMap::PRICE_MAX => 4, SocolissimoPriceTableMap::FRANCO_MIN_PRICE => 5, SocolissimoPriceTableMap::PRICE => 6, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'AREA_ID' => 1, 'DELIVERY_MODE_ID' => 2, 'WEIGHT_MAX' => 3, 'PRICE_MAX' => 4, 'FRANCO_MIN_PRICE' => 5, 'PRICE' => 6, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'area_id' => 1, 'delivery_mode_id' => 2, 'weight_max' => 3, 'price_max' => 4, 'franco_min_price' => 5, 'price' => 6, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('socolissimo_price');
+ $this->setPhpName('SocolissimoPrice');
+ $this->setClassName('\\SoColissimo\\Model\\SocolissimoPrice');
+ $this->setPackage('SoColissimo.Model');
+ $this->setUseIdGenerator(true);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addForeignKey('AREA_ID', 'AreaId', 'INTEGER', 'area', 'ID', true, null, null);
+ $this->addForeignKey('DELIVERY_MODE_ID', 'DeliveryModeId', 'INTEGER', 'socolissimo_delivery_mode', 'ID', true, null, null);
+ $this->addColumn('WEIGHT_MAX', 'WeightMax', 'FLOAT', false, null, null);
+ $this->addColumn('PRICE_MAX', 'PriceMax', 'FLOAT', false, null, null);
+ $this->addColumn('FRANCO_MIN_PRICE', 'FrancoMinPrice', 'FLOAT', false, null, null);
+ $this->addColumn('PRICE', 'Price', 'FLOAT', true, null, null);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('Area', '\\SoColissimo\\Model\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ $this->addRelation('SocolissimoDeliveryMode', '\\SoColissimo\\Model\\SocolissimoDeliveryMode', RelationMap::MANY_TO_ONE, array('delivery_mode_id' => 'id', ), 'RESTRICT', 'RESTRICT');
+ } // buildRelations()
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return (int) $row[
+ $indexType == TableMap::TYPE_NUM
+ ? 0 + $offset
+ : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
+ ];
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? SocolissimoPriceTableMap::CLASS_DEFAULT : SocolissimoPriceTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (SocolissimoPrice object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = SocolissimoPriceTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = SocolissimoPriceTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + SocolissimoPriceTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = SocolissimoPriceTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ SocolissimoPriceTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = SocolissimoPriceTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = SocolissimoPriceTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ SocolissimoPriceTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(SocolissimoPriceTableMap::ID);
+ $criteria->addSelectColumn(SocolissimoPriceTableMap::AREA_ID);
+ $criteria->addSelectColumn(SocolissimoPriceTableMap::DELIVERY_MODE_ID);
+ $criteria->addSelectColumn(SocolissimoPriceTableMap::WEIGHT_MAX);
+ $criteria->addSelectColumn(SocolissimoPriceTableMap::PRICE_MAX);
+ $criteria->addSelectColumn(SocolissimoPriceTableMap::FRANCO_MIN_PRICE);
+ $criteria->addSelectColumn(SocolissimoPriceTableMap::PRICE);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.AREA_ID');
+ $criteria->addSelectColumn($alias . '.DELIVERY_MODE_ID');
+ $criteria->addSelectColumn($alias . '.WEIGHT_MAX');
+ $criteria->addSelectColumn($alias . '.PRICE_MAX');
+ $criteria->addSelectColumn($alias . '.FRANCO_MIN_PRICE');
+ $criteria->addSelectColumn($alias . '.PRICE');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(SocolissimoPriceTableMap::DATABASE_NAME)->getTable(SocolissimoPriceTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(SocolissimoPriceTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(SocolissimoPriceTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new SocolissimoPriceTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a SocolissimoPrice or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or SocolissimoPrice object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoPriceTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \SoColissimo\Model\SocolissimoPrice) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(SocolissimoPriceTableMap::DATABASE_NAME);
+ $criteria->add(SocolissimoPriceTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = SocolissimoPriceQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { SocolissimoPriceTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { SocolissimoPriceTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the socolissimo_price table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return SocolissimoPriceQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a SocolissimoPrice or Criteria object.
+ *
+ * @param mixed $criteria Criteria or SocolissimoPrice object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(SocolissimoPriceTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from SocolissimoPrice object
+ }
+
+ if ($criteria->containsKey(SocolissimoPriceTableMap::ID) && $criteria->keyContainsValue(SocolissimoPriceTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.SocolissimoPriceTableMap::ID.')');
+ }
+
+
+ // Set the correct dbName
+ $query = SocolissimoPriceQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // SocolissimoPriceTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+SocolissimoPriceTableMap::buildTableMap();
diff --git a/local/modules/SoColissimo/Model/OrderAddressSocolissimo.php b/local/modules/SoColissimo/Model/OrderAddressSocolissimo.php
new file mode 100644
index 00000000..aa06d110
--- /dev/null
+++ b/local/modules/SoColissimo/Model/OrderAddressSocolissimo.php
@@ -0,0 +1,10 @@
+orderById('desc')->findOne()->getActive();
+ }
+} // SocolissimoFreeshippingQuery
diff --git a/local/modules/SoColissimo/Model/SocolissimoPrice.php b/local/modules/SoColissimo/Model/SocolissimoPrice.php
new file mode 100644
index 00000000..166e282f
--- /dev/null
+++ b/local/modules/SoColissimo/Model/SocolissimoPrice.php
@@ -0,0 +1,10 @@
+
+
+Summary
+=======
+
+### fr_FR
+1. Installation
+2. Utilisation
+3. Boucles
+4. Intégration
+
+### en_US
+1. Install notes
+2. How to use
+3. Loops
+4. Integration
+
+
+fr_FR
+=====
+
+Installation
+------------
+Pour installer le module So Colissimo, téléchargez l'archive et extrayez la dans le dossier dossierDeThelia/local/modules
+
+Utilisation
+-----------
+Tout d'abord, allez dans votre back-office, onglet Modules, et activez le module So Colissimo.
+Allez ensuite sur la page de configuration de ce dernier, onglet "Configurer So Colissimo", et entrez vos identifiants
+pour le service So Colissimo.
+Pour importer les fichiers générés via l'export avec Expeditor INET, vous avez besoin de THELIA_INET.FMT présent dans l'archive du module.
+
+Boucles
+-------
+1. socolissimo.check.rights
+ - Arguments:
+ Aucun
+ - Sorties:
+ 1. $ERRMES: message d'erreur
+ 2. $ERRFILE: fichier où le problème a été detecté
+ - Utilisation:
+ ```{loop name="yourloopname" type="socolissimo.check.rights"}{/loop}```
+
+2. socolissimo
+ - Arguments:
+ 1. area | obligatoire | id de l'area dont on veut savoir les prix
+ - Sorties:
+ 1. $MAX_WEIGHT: poids maximal pour le prix
+ 2. $PRICE: prix
+ - Utilisation:
+ ```{loop name="yourloopname" type="socolissimo"}{/loop}```
+
+3. socolissimoid
+ - Arguments:
+ Aucun
+ - Sorties:
+ 1. $MODULE_ID: id du module So Colissimo
+ - Utilisation:
+ ```{loop name="yourloopname" type="socolissimoid"}{/loop}```
+
+4. socolissimo.around
+ - Arguments:
+ 1. zipcode | optionnel | code postal de la ville recherchée
+ 2. city | optionnel | nom de la ville recherchée
+ 3. address | optionnel | id de l'addresse a utiliser pour la recherche.
+ address et zipcode + city ne peuvent pas être présents en même temps.
+ - Sorties:
+ 1. $LONGITUDE: longitude du point relais
+ 2. $LATITUDE : latitude du point relais
+ 3. $CODE : code spécifique So Colissimo du point relais
+ 4. $ADDRESS : adresse du point relais
+ 5. $ZIPCODE : code postal du point relais
+ 6. $CITY : ville du point relais
+ 7. $DISTANCE : distance entre le point relais et l'adresse du client/l'adresse recherchée
+ - Utilisation:
+ ```{loop name="yourloopname" type="socolissimo.around"}{/loop}```
+
+5. address.socolissimo
+ - Arguments:
+ Les mêmes que la boucle address
+ - Sorties:
+ Les mêmes que la boucle address, mais avec l'adresse du point relais.
+ - Utilisation:
+ ```{loop name="yourloopname" type="address.socolissimo"}{/loop}```
+
+6. order.notsent.socolissimo
+ - Arguments:
+ Aucun
+ - Sorties:
+ Les même sorties que la boucle order, mais avec uniquement les commandes So Colissimo non envoyées.
+ - Utilisation:
+ ```{loop name="yourloopname" type="order.notsent.socolissimo"}{/loop}```
+
+7. socolissimo.order_address
+ - Argument :
+ 1. id | obligatoire | ID de la OrderAddressSoColissimo que l'on veut retrouver grâce à la boucle.
+ - Sorties :
+ 1. $ID : ID de la OrderAddressSoColissimo.
+ 2. $CODE : code de la OrderAddressSoColissimo.
+ 3. $TYPE : type de la OrderAddressSoColissimo.
+ - Utilisation:
+ ```{loop name="yourloopname" type="socolissimo.order_address"}{/loop}```
+
+Intégration
+-----------
+Un exemple d'intégration avec une google map vous est proposé avec le thème par default de Thelia.
+Pour l'installer, veuillez copier les fichiers contenus dans dossierDeSoColissimo/templates/frontOffice/default,
+dossierDeSoColissimo/templates/frontOffice/default/assets et dossierDeSoColissimo/templates/frontOffice/default/ajax respectivement dans le dossier
+dossierDeThelia/templates/frontOffice/default, dossierDeThelia/templates/frontOffice/default/assets et dossierDeSoColissimo/templates/frontOffice/default/ajax
+
+en_US
+=====
+Install notes
+-----------
+To install So Colissimo module, download the archive and extract it in pathToThelia/local/modules
+
+How to use
+-----------
+First, go to your back office, tab Modules, and activate the module So Colissimo.
+Then go to So Colissimo configure page, tab "Configure So Colissimo" and enter your So Colissimo id and password.
+To import exported files in Expeditor INET, you need the file THELIA_INET.FMT, that is in the archive.
+
+Loops
+-----
+1. socolissimo.check.rights
+ - Arguments:
+ None
+ - Output:
+ 1. $ERRMES: error message
+ 2. $ERRFILE: file where the error has been detected
+ - Usage:
+ ```{loop name="yourloopname" type="socolissimo.check.rights"}{/loop}```
+
+2. socolissimo
+ - Arguments:
+ 1. area | mandatory | id de l'area dont on veut savoir les prix
+ - Output:
+ 1. $MAX_WEIGHT: max weight for the price
+ 2. $PRICE: price
+ - Usage:
+ ```{loop name="yourloopname" type="socolissimo"}{/loop}```
+
+3. socolissimoid
+ - Arguments:
+ None
+ - Output:
+ 1. $MODULE_ID: id of the module So Colissimo
+ - Usage:
+ ```{loop name="yourloopname" type="socolissimoid"}{/loop}```
+
+4. socolissimo.around
+ - Arguments:
+ 1. zipcode | optionnel | zipcode of the searched city
+ 2. city | optionnel | name of the searched city
+ 3. address | optionnel | id of the address to use for the search.
+ address and zipcode + city cannot be used at the same time.
+ - Output:
+ 1. $LONGITUDE: longitude of the pickup & go store
+ 2. $LATITUDE : latitude of the pickup & go store
+ 3. $CODE : ID of the pickup & go store
+ 4. $ADDRESS : address of the pickup & go store
+ 5. $ZIPCODE : zipcode of the pickup & go store
+ 6. $CITY : city of the pickup & go store
+ 7. $DISTANCE : distance between the store and the customer's address/searched address
+ - Usage:
+ ```{loop name="yourloopname" type="socolissimo.around"}{/loop}```
+
+5. address.socolissimo
+ - Arguments:
+ The same as the loop address
+ - Output:
+ The same as the loop address, but with pickup & go store's address
+ - Usage:
+ ```{loop name="yourloopname" type="address.socolissimo"}{/loop}```
+
+6. order.notsent.socolissimo
+ - Arguments:
+ None
+ - Output:
+ The same as the loop order, but with not sent So Colissimo orders.
+ - Usage:
+ ```{loop name="yourloopname" type="order.notsent.socolissimo"}{/loop}```
+
+7. socolissimo.order_address
+ - Arguments:
+ 1. id | obligatoire | ID of the OrderAddressSoColissimo that should be retrieved by the loop.
+ - Outputs:
+ 1. $ID : OrderAddressSoColissimo ID.
+ 2. $CODE : OrderAddressSoColissimo code.
+ 3. $TYPE : OrderAddressSoColissimo type.
+ - Usage:
+ ```{loop name="yourloopname" type="socolissimo.order_address"}{/loop}```
+
+
+Integration
+-----------
+A integration example is available for the default theme of Thelia.
+To install it, copy the files of pathToSoColissimo/templates/frontOffice/default and
+pathToSoColissimo/templates/frontOffice/default/ajax respectively in pathToThelia/templates/frontOffice/default
+and pathToThelia/templates/frontOffice/default/ajax
diff --git a/local/modules/SoColissimo/Smarty/Plugins/SocolissimoDeliveryPrice.php b/local/modules/SoColissimo/Smarty/Plugins/SocolissimoDeliveryPrice.php
new file mode 100644
index 00000000..c200989a
--- /dev/null
+++ b/local/modules/SoColissimo/Smarty/Plugins/SocolissimoDeliveryPrice.php
@@ -0,0 +1,59 @@
+request = $request;
+ $this->dispatcher = $dispatcher;
+ }
+
+ public function getPluginDescriptors()
+ {
+ return array(
+ new SmartyPluginDescriptor("function", "socolissimoDeliveryPrice", $this, "socolissimoDeliveryPrice")
+ );
+ }
+
+ public function socolissimoDeliveryPrice($params, $smarty)
+ {
+ $deliveryMode = $params["delivery-mode"];
+
+ $country = Country::getShopLocation();
+ if (isset($params["country"])) {
+ $country = CountryQuery::create()->findOneById($params["country"]);
+ }
+
+ $cartWeight = $this->request->getSession()->getSessionCart($this->dispatcher)->getWeight();
+ $cartAmount = $this->request->getSession()->getSessionCart($this->dispatcher)->getTaxedAmount($country);
+
+ try {
+ $price = SoColissimo::getPostageAmount(
+ $country->getAreaId(),
+ $cartWeight,
+ $cartAmount,
+ $deliveryMode
+ );
+ } catch (DeliveryException $ex) {
+ $smarty->assign('isValidMode', false);
+ }
+
+ $smarty->assign('deliveryModePrice', $price);
+ }
+}
\ No newline at end of file
diff --git a/local/modules/SoColissimo/SoColissimo.php b/local/modules/SoColissimo/SoColissimo.php
new file mode 100644
index 00000000..7a0e0f5f
--- /dev/null
+++ b/local/modules/SoColissimo/SoColissimo.php
@@ -0,0 +1,447 @@
+. */
+/* */
+/*************************************************************************************/
+
+namespace SoColissimo;
+
+use PDO;
+use Propel\Runtime\ActiveQuery\Criteria;
+use Propel\Runtime\Exception\PropelException;
+use Propel\Runtime\Propel;
+use SoColissimo\Model\SocolissimoAreaFreeshippingDomQuery;
+use SoColissimo\Model\SocolissimoAreaFreeshippingPrQuery;
+use SoColissimo\Model\SocolissimoDeliveryMode;
+use SoColissimo\Model\SocolissimoDeliveryModeQuery;
+use SoColissimo\Model\SocolissimoPrice;
+use SoColissimo\Model\SocolissimoPriceQuery;
+use Symfony\Component\Config\Definition\Exception\Exception;
+use Symfony\Component\Finder\Finder;
+use Thelia\Model\AreaQuery;
+use Thelia\Model\ConfigQuery;
+use Thelia\Model\Country;
+use Thelia\Model\ModuleImageQuery;
+use Thelia\Model\ModuleQuery;
+use Propel\Runtime\Connection\ConnectionInterface;
+use Thelia\Install\Database;
+use Thelia\Module\AbstractDeliveryModule;
+use Thelia\Module\Exception\DeliveryException;
+
+class SoColissimo extends AbstractDeliveryModule
+{
+ protected $request;
+ protected $dispatcher;
+
+ private static $prices = null;
+
+ const DOMAIN = 'socolissimo';
+
+ const JSON_PRICE_RESOURCE = "/Config/prices.json";
+ const JSON_CONFIG_PATH = "/Config/config.json";
+
+ /**
+ * These constants refer to the imported CSV file.
+ * IMPORT_NB_COLS: file's number of columns (begin at 1)
+ * IMPORT_DELIVERY_REF_COL: file's column where delivery reference is set (begin at 0)
+ * IMPORT_ORDER_REF_COL: file's column where order reference is set (begin at 0)
+ */
+ const IMPORT_NB_COLS = 2;
+ const IMPORT_DELIVERY_REF_COL = 0;
+ const IMPORT_ORDER_REF_COL = 1;
+
+ /**
+ * This method is called by the Delivery loop, to check if the current module has to be displayed to the customer.
+ * Override it to implements your delivery rules/
+ *
+ * If you return true, the delivery method will de displayed to the customer
+ * If you return false, the delivery method will not be displayed
+ *
+ * @param Country $country the country to deliver to.
+ *
+ * @return boolean
+ */
+ public function isValidDelivery(Country $country)
+ {
+ $cartWeight = $this->getRequest()->getSession()->getSessionCart($this->getDispatcher())->getWeight();
+
+ $areaId = $country->getAreaId();
+
+ $prices = SocolissimoPriceQuery::create()
+ ->filterByAreaId($areaId)
+ ->findOne();
+
+ $freeShipping = SocolissimoDeliveryModeQuery::create()
+ ->findOneByFreeshippingActive(1);
+
+ /* check if Colissimo delivers the asked area*/
+ if (null !== $prices || null !== $freeShipping) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @param $areaId
+ * @param $weight
+ * @param $cartAmount
+ * @param $deliverModeCode
+ *
+ * @return mixed
+ * @throws DeliveryException
+ */
+ public static function getPostageAmount($areaId, $weight, $cartAmount = 0, $deliverModeCode = null)
+ {
+ if (null === $deliverModeCode) {
+ $deliveryMode = SocolissimoDeliveryModeQuery::create()->find()->getFirst();
+ } else {
+ $deliveryMode = SocolissimoDeliveryModeQuery::create()->findOneByCode($deliverModeCode);
+ }
+
+ $freeshipping = $deliveryMode->getFreeshippingActive();
+ $freeshippingFrom = $deliveryMode->getFreeshippingFrom();
+ $deliveryModeQuery = $deliveryMode->getCode();
+
+
+ $postage = 0;
+
+ if (!$freeshipping) {
+ $areaPrices = SocolissimoPriceQuery::create()
+ ->filterByDeliveryModeId($deliveryMode->getId())
+ ->filterByAreaId($areaId)
+ ->filterByWeightMax($weight, Criteria::GREATER_EQUAL)
+ ->_or()
+ ->filterByWeightMax(null)
+ ->filterByPriceMax($cartAmount, Criteria::GREATER_EQUAL)
+ ->_or()
+ ->filterByPriceMax(null)
+ ->orderByWeightMax()
+ ->orderByPriceMax();
+
+ $firstPrice = $areaPrices->find()
+ ->getFirst();
+
+ if (null === $firstPrice) {
+ throw new DeliveryException("Colissimo delivery unavailable for your cart weight or delivery country");
+ }
+
+ //If a min price for freeshipping is define and the amount of cart reach this montant return 0
+ if (null !== $freeshippingFrom && $freeshippingFrom <= $cartAmount) {
+ $postage = 0;
+ return $postage;
+ }
+
+ if ($deliveryModeQuery === 'dom') {
+ $cartAmountDom = SocolissimoAreaFreeshippingDomQuery::create()
+ ->filterByAreaId($areaId)
+ ->findOne();
+ if ($cartAmountDom) {
+ $cartAmountDom = $cartAmountDom->getCartAmount();
+ }
+ if (null !== $cartAmountDom && $cartAmountDom <= $cartAmount) {
+ $postage = 0;
+ return $postage;
+ }
+ } elseif ($deliveryModeQuery === 'pr') {
+ $cartAmountPr = SocolissimoAreaFreeshippingPrQuery::create()
+ ->filterByAreaId($areaId)
+ ->findOne();
+ if ($cartAmountPr) {
+ $cartAmountPr = $cartAmountPr->getCartAmount();
+ }
+ if (null !== $cartAmountPr && $cartAmountPr <= $cartAmount) {
+ $postage = 0;
+ return $postage;
+ }
+ }
+ $postage = $firstPrice->getPrice();
+ }
+ return $postage;
+ }
+
+ /**
+ *
+ * calculate and return delivery price
+ *
+ * @param Country $country
+ * @return mixed
+ * @throws DeliveryException
+ */
+ public function getPostage(Country $country)
+ {
+ $request = $this->getRequest();
+
+ $cartWeight = $request->getSession()->getSessionCart($this->getDispatcher())->getWeight();
+ $cartAmount = $request->getSession()->getSessionCart($this->getDispatcher())->getTaxedAmount($country);
+
+ $dom = $request->get('socolissimo-home');
+ $pr_code = $request->get('socolissimo_code');
+
+ $deliveryModeCode = null;
+ if ($dom) {
+ $deliveryModeCode = "dom";
+ } elseif (!empty($pr_code)) {
+ $deliveryModeCode = "pr";
+ }
+
+ if (null == $deliveryModeCode) {
+ $session = $request->getSession();
+ $dom = $session->get('SoColissimoDomicile');
+ $pr_code = $session->get('SoColissimoDeliveryId');
+
+ if ($dom) {
+ $deliveryModeCode = "dom";
+ } elseif (!empty($pr_code)) {
+ $deliveryModeCode = "pr";
+ }
+ }
+
+ $areaIdArray = $this->getAllAreasForCountry($country);
+ if (empty($areaIdArray)) {
+ throw new DeliveryException("Your delivery country is not covered by Colissimo.");
+ }
+ $postage = null;
+
+ if (null === $postage = self::getMinPostage($areaIdArray, $cartWeight, $cartAmount, $deliveryModeCode)) {
+ $postage = self::getMinPostage($areaIdArray, $cartWeight, $cartAmount, 'dom');
+ if (null === $postage) {
+ throw new DeliveryException("Colissimo delivery unavailable for your cart weight or delivery country");
+ }
+ }
+ return $postage;
+ }
+
+
+ private function getMinPostage($areaIdArray, $cartWeight, $cartAmount, $deliveryModeCode)
+ {
+ $minPostage = null;
+
+ foreach ($areaIdArray as $areaId) {
+ try {
+ $postage = self::getPostageAmount($areaId, $cartWeight, $cartAmount, $deliveryModeCode);
+ if ($minPostage === null || $postage < $minPostage) {
+ $minPostage = $postage;
+ if ($minPostage == 0) {
+ break;
+ }
+ }
+ } catch (\Exception $ex) {
+ }
+ }
+
+ return $minPostage;
+ }
+
+ /**
+ * Returns ids of area containing this country and covers by this module
+ * @param Country $country
+ * @return array Area ids
+ */
+ private function getAllAreasForCountry(Country $country)
+ {
+ $areaArray = [];
+
+ $sql = "SELECT ca.area_id as area_id FROM country_area ca
+ INNER JOIN area_delivery_module adm ON (ca.area_id = adm.area_id AND adm.delivery_module_id = :p0)
+ WHERE ca.country_id = :p1";
+
+ $con = Propel::getConnection();
+
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $this->getModuleModel()->getId(), PDO::PARAM_INT);
+ $stmt->bindValue(':p1', $country->getId(), PDO::PARAM_INT);
+ $stmt->execute();
+
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ $areaArray[] = $row['area_id'];
+ }
+
+ return $areaArray;
+ }
+
+
+
+
+
+ public function getCode()
+ {
+ return 'SoColissimo';
+ }
+
+ public static function getPrices(SocolissimoDeliveryMode $deliveryMode)
+ {
+ self::$prices = null;
+
+ $fileName = sprintf('%s%s', __DIR__, "/Config/prices_".$deliveryMode->getCode().".json");
+
+ // If delivery mode file doesn't exist take global price
+ if (!file_exists($fileName)) {
+ $fileName = sprintf('%s%s', __DIR__, self::JSON_PRICE_RESOURCE);
+ // If global price doesn't exist throw exception
+ if (!file_exists($fileName)) {
+ throw new Exception("Prices configuration not found.");
+ }
+ }
+
+ if (null === self::$prices) {
+ self::$prices = json_decode(file_get_contents($fileName), true);
+ }
+ return self::$prices;
+ }
+
+ public static function importJsonPrice(SocolissimoDeliveryMode $deliveryMode, ConnectionInterface $con)
+ {
+ $areaPrices = self::getPrices($deliveryMode);
+
+ $priceExist = SocolissimoPriceQuery::create()
+ ->filterByDeliveryModeId($deliveryMode->getId())
+ ->findOne();
+
+ //If at least one price exist doesn't import the xml (or it will erase the user price)
+ if (null !== $priceExist) {
+ return;
+ }
+
+ $con->beginTransaction();
+ try {
+ foreach ($areaPrices as $areaId => $area) {
+ // Check if the area exists
+ if (null !== AreaQuery::create()->findPk($areaId)) {
+ foreach ($area['slices'] as $weight => $price) {
+ $slice = (new SocolissimoPrice())
+ ->setAreaId($areaId)
+ ->setWeightMax($weight)
+ ->setPrice($price)
+ ->setDeliveryModeId($deliveryMode->getId());
+ $slice->save();
+ }
+ $con->commit();
+ }
+ }
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ public function postActivation(ConnectionInterface $con = null)
+ {
+ try {
+ // Security to not erase user config on reactivation
+ SocolissimoDeliveryModeQuery::create()->findOne();
+ SocolissimoAreaFreeshippingDomQuery::create()->findOne();
+ SocolissimoAreaFreeshippingPrQuery::create()->findOne();
+ } catch (\Exception $e) {
+ $database = new Database($con->getWrappedConnection());
+ $database->insertSql(null, [__DIR__ . '/Config/thelia.sql', __DIR__ . '/Config/insert.sql']);
+ }
+
+ try {
+ $deliveryModes = SocolissimoDeliveryModeQuery::create()
+ ->find();
+
+ foreach ($deliveryModes as $deliveryMode) {
+ self::importJsonPrice($deliveryMode, $con);
+ }
+ } catch (\Exception $e) {
+ throw $e;
+ }
+
+
+ ConfigQuery::write(
+ 'socolissimo_login',
+ ConfigQuery::read('socolissimo_login', null),
+ 1,
+ 1
+ );
+
+ ConfigQuery::write(
+ 'socolissimo_pwd',
+ ConfigQuery::read('socolissimo_pwd', null),
+ 1,
+ 1
+ );
+
+ ConfigQuery::write(
+ 'socolissimo_pwd',
+ ConfigQuery::read('socolissimo_pwd', null),
+ 1,
+ 1
+ );
+
+ ConfigQuery::write(
+ 'socolissimo_google_map_key',
+ ConfigQuery::read('socolissimo_google_map_key', null),
+ 1,
+ 1
+ );
+
+ ConfigQuery::write(
+ 'socolissimo_url_prod',
+ ConfigQuery::read('socolissimo_url_prod', 'https://ws.colissimo.fr/pointretrait-ws-cxf/PointRetraitServiceWS/2.0?wsdl'),
+ 1,
+ 1
+ );
+
+ ConfigQuery::write(
+ 'socolissimo_url_test',
+ ConfigQuery::read('socolissimo_url_test', 'https://pfi.telintrans.fr/pointretrait-ws-cxf/PointRetraitServiceWS/2.0?wsdl'),
+ 1,
+ 1
+ );
+
+ /* insert the images from image folder if first module activation */
+ $module = $this->getModuleModel();
+ if (ModuleImageQuery::create()->filterByModule($module)->count() == 0) {
+ $this->deployImageFolder($module, sprintf('%s/images', __DIR__), $con);
+ }
+ }
+
+ public static function getModCode()
+ {
+ return ModuleQuery::create()->findOneByCode("SoColissimo")->getId();
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function update($currentVersion, $newVersion, ConnectionInterface $con = null)
+ {
+ $finder = (new Finder)
+ ->files()
+ ->name('#.*?\.sql#')
+ ->sortByName()
+ ->in(__DIR__ . DS . 'Config' . DS . 'update' . DS . 'sql');
+
+ $database = new Database($con);
+
+ /** @var \Symfony\Component\Finder\SplFileInfo $updateSQLFile */
+ foreach ($finder as $updateSQLFile) {
+ if (version_compare($currentVersion, str_replace('.sql', '', $updateSQLFile->getFilename()), '<')) {
+ $database->insertSql(
+ null,
+ [
+ $updateSQLFile->getPathname()
+ ]
+ );
+ }
+ }
+ }
+}
diff --git a/local/modules/SoColissimo/THELIA_INET.FMT b/local/modules/SoColissimo/THELIA_INET.FMT
new file mode 100644
index 00000000..9697ab83
--- /dev/null
+++ b/local/modules/SoColissimo/THELIA_INET.FMT
@@ -0,0 +1,25 @@
+[GENERAL]
+DELIMITE=O
+SEPARATEUR=59
+DELIMITEUR=34
+FINDELIGNE=CRLF
+Unité poids=KG
+[CHAMPS]
+Prenom=1
+NomDestinataire=2
+RaisonSociale=3
+Adresse1=4
+Adresse2=5
+Adresse3=6
+CodePostal=7
+Commune=8
+CodePays=9
+Telephone=10
+Portable=11
+CodeProduit=12
+Civilite=13
+CodePointRetrait=14
+Mail=15
+Poids=16
+NomCommercialChargeur=17
+typeDePoint=18
\ No newline at end of file
diff --git a/local/modules/SoColissimo/Tests/WebService/BaseSoColissimoWebServiceTest.php b/local/modules/SoColissimo/Tests/WebService/BaseSoColissimoWebServiceTest.php
new file mode 100644
index 00000000..56170994
--- /dev/null
+++ b/local/modules/SoColissimo/Tests/WebService/BaseSoColissimoWebServiceTest.php
@@ -0,0 +1,172 @@
+. */
+/* */
+/*************************************************************************************/
+
+namespace SoColissimo\Tests\WebService;
+
+/**
+ * Class BaseSoColissimoWebServiceTest
+ * @package SoColissimo\Tests\WebService
+ * @author Thelia {$ERRMES} {$ERRFILE} | {intl l="Please change the access rights" d='socolissimo.bo.default'}.
+| + + | ++ + | +||
|---|---|---|---|
| {intl l="Weight up to ... kg" d='socolissimo.bo.default'} | +{intl l="Untaxed Price up to ... %symbol" symbol=$currencySymbol d='socolissimo.bo.default'} | +{intl l="Price (%symbol)" symbol=$currencySymbol d='socolissimo.bo.default'} | +{intl l="Actions" d='socolissimo.bo.default'} | +
| + + | ++ + | ++ + | ++ + | +
| + + | ++ + | ++ + | ++ + + + | +
{intl l='Delivered at home.' d='socolissimo.pdf.default'}
+ {else} +
+ {intl l='Delivered at a relay.' d='socolissimo.pdf.default'}
+ {intl l='Relay address:' d='socolissimo.pdf.default'}
+ {loop name='order_address' type='order_address' id=$delivery_address_id}
+
{$COMPANY}+ {/loop} + {elseloop rel='order_address'} {intl l='no address' d='socolissimo.pdf.default'}{/elseloop} + + {/if} +{/loop}
+ {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
+ {$ZIPCODE} {$CITY}
+ {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop} +