{$TITLE}
+ {if $hasDescription} +{$DESCRIPTION}
+diff --git a/Readme.md b/Readme.md
index ac0862dae..ed4edf9ef 100755
--- a/Readme.md
+++ b/Readme.md
@@ -35,10 +35,10 @@ Installation
------------
``` bash
-$ git clone --recursive https://github.com/thelia/thelia.git
+$ git clone https://github.com/thelia/thelia.git
$ cd thelia
$ curl -sS https://getcomposer.org/installer | php
-$ php composer.phar install --optimize-autoloader
+$ php composer.phar install --prefer-dist --optimize-autoloader
```
Finish the installation using cli tools :
diff --git a/core/lib/Thelia/Action/Category.php b/core/lib/Thelia/Action/Category.php
index 64254d734..25a94711f 100755
--- a/core/lib/Thelia/Action/Category.php
+++ b/core/lib/Thelia/Action/Category.php
@@ -160,6 +160,7 @@ class Category extends BaseAction implements EventSubscriberInterface
$content = new CategoryAssociatedContent();
$content
+ ->setDispatcher($this->getDispatcher())
->setCategory($event->getCategory())
->setContentId($event->getContentId())
->save()
@@ -174,7 +175,11 @@ class Category extends BaseAction implements EventSubscriberInterface
->filterByCategory($event->getCategory())->findOne()
;
- if ($content !== null) $content->delete();
+ if ($content !== null) {
+ $content
+ ->setDispatcher($this->getDispatcher())
+ ->delete();
+ }
}
diff --git a/core/lib/Thelia/Action/Folder.php b/core/lib/Thelia/Action/Folder.php
new file mode 100644
index 000000000..b830947cc
--- /dev/null
+++ b/core/lib/Thelia/Action/Folder.php
@@ -0,0 +1,155 @@
+. */
+/* */
+/*************************************************************************************/
+
+namespace Thelia\Action;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Thelia\Core\Event\FolderCreateEvent;
+use Thelia\Core\Event\FolderDeleteEvent;
+use Thelia\Core\Event\FolderToggleVisibilityEvent;
+use Thelia\Core\Event\FolderUpdateEvent;
+use Thelia\Core\Event\TheliaEvents;
+use Thelia\Core\Event\UpdatePositionEvent;
+use Thelia\Model\FolderQuery;
+use Thelia\Model\Folder as FolderModel;
+
+
+/**
+ * Class Folder
+ * @package Thelia\Action
+ * @author Manuel Raynaud {$DESCRIPTION}
";
+ //echo "source = ".$this->getSourceId()."source_id=$source_id, id=$id
";
if (is_null($source_id) && is_null($id)) {
throw new \InvalidArgumentException("If 'source' argument is specified, 'id' or 'source_id' argument should be specified");
@@ -214,6 +215,7 @@ class Image extends BaseI18nLoop
*/
public function exec(&$pagination)
{
+
// Select the proper query to use, and get the object type
$object_type = $object_id = null;
@@ -262,13 +264,14 @@ class Image extends BaseI18nLoop
}
- //echo "sql=".$search->toString();
+ // echo "sql=".$search->toString();
$results = $this->search($search, $pagination);
$loopResult = new LoopResult($results);
foreach ($results as $result) {
+
// Create image processing event
$event = new ImageEvent($this->request);
@@ -315,7 +318,8 @@ class Image extends BaseI18nLoop
;
$loopResult->addRow($loopResultRow);
- } catch (\Exception $ex) {
+ }
+ catch (\Exception $ex) {
// Ignore the result and log an error
Tlog::getInstance()->addError("Failed to process image in image loop: ", $this->args);
}
diff --git a/core/lib/Thelia/Core/Template/Loop/Module.php b/core/lib/Thelia/Core/Template/Loop/Module.php
new file mode 100755
index 000000000..1c4f91b4d
--- /dev/null
+++ b/core/lib/Thelia/Core/Template/Loop/Module.php
@@ -0,0 +1,137 @@
+. */
+/* */
+/*************************************************************************************/
+
+namespace Thelia\Core\Template\Loop;
+
+use Propel\Runtime\ActiveQuery\Criteria;
+use Thelia\Core\Template\Element\BaseI18nLoop;
+use Thelia\Core\Template\Element\LoopResult;
+use Thelia\Core\Template\Element\LoopResultRow;
+
+use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
+use Thelia\Core\Template\Loop\Argument\Argument;
+
+use Thelia\Model\ModuleQuery;
+
+use Thelia\Module\BaseModule;
+use Thelia\Type;
+
+/**
+ *
+ * Module loop
+ *
+ *
+ * Class Module
+ * @package Thelia\Core\Template\Loop
+ * @author Etienne Roudeix ModuleImage instance. If
+ * obj is an instance of ModuleImage, delegates to
+ * equals(ModuleImage). Otherwise, returns false.
+ *
+ * @param obj The object to compare to.
+ * @return 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
+ *
+ * @param string $name The virtual column name
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @return mixed
+ */
+ 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 ModuleImage 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 ModuleImage The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+ }
+
+ /**
+ * 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 [module_id] column value.
+ *
+ * @return int
+ */
+ public function getModuleId()
+ {
+
+ return $this->module_id;
+ }
+
+ /**
+ * Get the [file] column value.
+ *
+ * @return string
+ */
+ public function getFile()
+ {
+
+ return $this->file;
+ }
+
+ /**
+ * Get the [position] column value.
+ *
+ * @return int
+ */
+ public function getPosition()
+ {
+
+ return $this->position;
+ }
+
+ /**
+ * 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 !== null ? $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 !== null ? $this->updated_at->format($format) : null;
+ }
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\ModuleImage 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[] = ModuleImageTableMap::ID;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [module_id] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function setModuleId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->module_id !== $v) {
+ $this->module_id = $v;
+ $this->modifiedColumns[] = ModuleImageTableMap::MODULE_ID;
+ }
+
+ if ($this->aModule !== null && $this->aModule->getId() !== $v) {
+ $this->aModule = null;
+ }
+
+
+ return $this;
+ } // setModuleId()
+
+ /**
+ * Set the value of [file] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function setFile($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->file !== $v) {
+ $this->file = $v;
+ $this->modifiedColumns[] = ModuleImageTableMap::FILE;
+ }
+
+
+ return $this;
+ } // setFile()
+
+ /**
+ * Set the value of [position] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function setPosition($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->position !== $v) {
+ $this->position = $v;
+ $this->modifiedColumns[] = ModuleImageTableMap::POSITION;
+ }
+
+
+ return $this;
+ } // setPosition()
+
+ /**
+ * 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 \Thelia\Model\ModuleImage 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[] = ModuleImageTableMap::CREATED_AT;
+ }
+ } // 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 \Thelia\Model\ModuleImage 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[] = ModuleImageTableMap::UPDATED_AT;
+ }
+ } // 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 : ModuleImageTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ModuleImageTableMap::translateFieldName('ModuleId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->module_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ModuleImageTableMap::translateFieldName('File', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->file = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ModuleImageTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->position = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ModuleImageTableMap::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 ? 5 + $startcol : ModuleImageTableMap::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 + 6; // 6 = ModuleImageTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \Thelia\Model\ModuleImage 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->aModule !== null && $this->module_id !== $this->aModule->getId()) {
+ $this->aModule = 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(ModuleImageTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildModuleImageQuery::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->aModule = null;
+ $this->collModuleImageI18ns = null;
+
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see ModuleImage::setDeleted()
+ * @see ModuleImage::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(ModuleImageTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildModuleImageQuery::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(ModuleImageTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ // timestampable behavior
+ if (!$this->isColumnModified(ModuleImageTableMap::CREATED_AT)) {
+ $this->setCreatedAt(time());
+ }
+ if (!$this->isColumnModified(ModuleImageTableMap::UPDATED_AT)) {
+ $this->setUpdatedAt(time());
+ }
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ // timestampable behavior
+ if ($this->isModified() && !$this->isColumnModified(ModuleImageTableMap::UPDATED_AT)) {
+ $this->setUpdatedAt(time());
+ }
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ ModuleImageTableMap::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->aModule !== null) {
+ if ($this->aModule->isModified() || $this->aModule->isNew()) {
+ $affectedRows += $this->aModule->save($con);
+ }
+ $this->setModule($this->aModule);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ if ($this->moduleImageI18nsScheduledForDeletion !== null) {
+ if (!$this->moduleImageI18nsScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\ModuleImageI18nQuery::create()
+ ->filterByPrimaryKeys($this->moduleImageI18nsScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->moduleImageI18nsScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collModuleImageI18ns !== null) {
+ foreach ($this->collModuleImageI18ns 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[] = ModuleImageTableMap::ID;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . ModuleImageTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(ModuleImageTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::MODULE_ID)) {
+ $modifiedColumns[':p' . $index++] = 'MODULE_ID';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::FILE)) {
+ $modifiedColumns[':p' . $index++] = 'FILE';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::POSITION)) {
+ $modifiedColumns[':p' . $index++] = 'POSITION';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::CREATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'CREATED_AT';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::UPDATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'UPDATED_AT';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO module_image (%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 'MODULE_ID':
+ $stmt->bindValue($identifier, $this->module_id, PDO::PARAM_INT);
+ break;
+ case 'FILE':
+ $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR);
+ break;
+ case 'POSITION':
+ $stmt->bindValue($identifier, $this->position, 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 = ModuleImageTableMap::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->getModuleId();
+ break;
+ case 2:
+ return $this->getFile();
+ break;
+ case 3:
+ return $this->getPosition();
+ break;
+ case 4:
+ return $this->getCreatedAt();
+ break;
+ case 5:
+ 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
+ * @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['ModuleImage'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['ModuleImage'][$this->getPrimaryKey()] = true;
+ $keys = ModuleImageTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getModuleId(),
+ $keys[2] => $this->getFile(),
+ $keys[3] => $this->getPosition(),
+ $keys[4] => $this->getCreatedAt(),
+ $keys[5] => $this->getUpdatedAt(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach($virtualColumns as $key => $virtualColumn)
+ {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aModule) {
+ $result['Module'] = $this->aModule->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ if (null !== $this->collModuleImageI18ns) {
+ $result['ModuleImageI18ns'] = $this->collModuleImageI18ns->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 = ModuleImageTableMap::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->setModuleId($value);
+ break;
+ case 2:
+ $this->setFile($value);
+ break;
+ case 3:
+ $this->setPosition($value);
+ break;
+ case 4:
+ $this->setCreatedAt($value);
+ break;
+ case 5:
+ $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 = ModuleImageTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setModuleId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setFile($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setPosition($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setUpdatedAt($arr[$keys[5]]);
+ }
+
+ /**
+ * 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(ModuleImageTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(ModuleImageTableMap::ID)) $criteria->add(ModuleImageTableMap::ID, $this->id);
+ if ($this->isColumnModified(ModuleImageTableMap::MODULE_ID)) $criteria->add(ModuleImageTableMap::MODULE_ID, $this->module_id);
+ if ($this->isColumnModified(ModuleImageTableMap::FILE)) $criteria->add(ModuleImageTableMap::FILE, $this->file);
+ if ($this->isColumnModified(ModuleImageTableMap::POSITION)) $criteria->add(ModuleImageTableMap::POSITION, $this->position);
+ if ($this->isColumnModified(ModuleImageTableMap::CREATED_AT)) $criteria->add(ModuleImageTableMap::CREATED_AT, $this->created_at);
+ if ($this->isColumnModified(ModuleImageTableMap::UPDATED_AT)) $criteria->add(ModuleImageTableMap::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(ModuleImageTableMap::DATABASE_NAME);
+ $criteria->add(ModuleImageTableMap::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 \Thelia\Model\ModuleImage (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->setModuleId($this->getModuleId());
+ $copyObj->setFile($this->getFile());
+ $copyObj->setPosition($this->getPosition());
+ $copyObj->setCreatedAt($this->getCreatedAt());
+ $copyObj->setUpdatedAt($this->getUpdatedAt());
+
+ 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->getModuleImageI18ns() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addModuleImageI18n($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 \Thelia\Model\ModuleImage 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 ChildModule object.
+ *
+ * @param ChildModule $v
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setModule(ChildModule $v = null)
+ {
+ if ($v === null) {
+ $this->setModuleId(NULL);
+ } else {
+ $this->setModuleId($v->getId());
+ }
+
+ $this->aModule = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildModule object, it will not be re-added.
+ if ($v !== null) {
+ $v->addModuleImage($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildModule object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildModule The associated ChildModule object.
+ * @throws PropelException
+ */
+ public function getModule(ConnectionInterface $con = null)
+ {
+ if ($this->aModule === null && ($this->module_id !== null)) {
+ $this->aModule = ChildModuleQuery::create()->findPk($this->module_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->aModule->addModuleImages($this);
+ */
+ }
+
+ return $this->aModule;
+ }
+
+
+ /**
+ * 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 ('ModuleImageI18n' == $relationName) {
+ return $this->initModuleImageI18ns();
+ }
+ }
+
+ /**
+ * Clears out the collModuleImageI18ns 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 addModuleImageI18ns()
+ */
+ public function clearModuleImageI18ns()
+ {
+ $this->collModuleImageI18ns = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collModuleImageI18ns collection loaded partially.
+ */
+ public function resetPartialModuleImageI18ns($v = true)
+ {
+ $this->collModuleImageI18nsPartial = $v;
+ }
+
+ /**
+ * Initializes the collModuleImageI18ns collection.
+ *
+ * By default this just sets the collModuleImageI18ns collection to an empty array (like clearcollModuleImageI18ns());
+ * 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 initModuleImageI18ns($overrideExisting = true)
+ {
+ if (null !== $this->collModuleImageI18ns && !$overrideExisting) {
+ return;
+ }
+ $this->collModuleImageI18ns = new ObjectCollection();
+ $this->collModuleImageI18ns->setModel('\Thelia\Model\ModuleImageI18n');
+ }
+
+ /**
+ * Gets an array of ChildModuleImageI18n 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 ChildModuleImage 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|ChildModuleImageI18n[] List of ChildModuleImageI18n objects
+ * @throws PropelException
+ */
+ public function getModuleImageI18ns($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collModuleImageI18nsPartial && !$this->isNew();
+ if (null === $this->collModuleImageI18ns || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collModuleImageI18ns) {
+ // return empty collection
+ $this->initModuleImageI18ns();
+ } else {
+ $collModuleImageI18ns = ChildModuleImageI18nQuery::create(null, $criteria)
+ ->filterByModuleImage($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collModuleImageI18nsPartial && count($collModuleImageI18ns)) {
+ $this->initModuleImageI18ns(false);
+
+ foreach ($collModuleImageI18ns as $obj) {
+ if (false == $this->collModuleImageI18ns->contains($obj)) {
+ $this->collModuleImageI18ns->append($obj);
+ }
+ }
+
+ $this->collModuleImageI18nsPartial = true;
+ }
+
+ $collModuleImageI18ns->getInternalIterator()->rewind();
+
+ return $collModuleImageI18ns;
+ }
+
+ if ($partial && $this->collModuleImageI18ns) {
+ foreach ($this->collModuleImageI18ns as $obj) {
+ if ($obj->isNew()) {
+ $collModuleImageI18ns[] = $obj;
+ }
+ }
+ }
+
+ $this->collModuleImageI18ns = $collModuleImageI18ns;
+ $this->collModuleImageI18nsPartial = false;
+ }
+ }
+
+ return $this->collModuleImageI18ns;
+ }
+
+ /**
+ * Sets a collection of ModuleImageI18n 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 $moduleImageI18ns A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function setModuleImageI18ns(Collection $moduleImageI18ns, ConnectionInterface $con = null)
+ {
+ $moduleImageI18nsToDelete = $this->getModuleImageI18ns(new Criteria(), $con)->diff($moduleImageI18ns);
+
+
+ //since at least one column in the foreign key is at the same time a PK
+ //we can not just set a PK to NULL in the lines below. We have to store
+ //a backup of all values, so we are able to manipulate these items based on the onDelete value later.
+ $this->moduleImageI18nsScheduledForDeletion = clone $moduleImageI18nsToDelete;
+
+ foreach ($moduleImageI18nsToDelete as $moduleImageI18nRemoved) {
+ $moduleImageI18nRemoved->setModuleImage(null);
+ }
+
+ $this->collModuleImageI18ns = null;
+ foreach ($moduleImageI18ns as $moduleImageI18n) {
+ $this->addModuleImageI18n($moduleImageI18n);
+ }
+
+ $this->collModuleImageI18ns = $moduleImageI18ns;
+ $this->collModuleImageI18nsPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related ModuleImageI18n objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related ModuleImageI18n objects.
+ * @throws PropelException
+ */
+ public function countModuleImageI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collModuleImageI18nsPartial && !$this->isNew();
+ if (null === $this->collModuleImageI18ns || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collModuleImageI18ns) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getModuleImageI18ns());
+ }
+
+ $query = ChildModuleImageI18nQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterByModuleImage($this)
+ ->count($con);
+ }
+
+ return count($this->collModuleImageI18ns);
+ }
+
+ /**
+ * Method called to associate a ChildModuleImageI18n object to this object
+ * through the ChildModuleImageI18n foreign key attribute.
+ *
+ * @param ChildModuleImageI18n $l ChildModuleImageI18n
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function addModuleImageI18n(ChildModuleImageI18n $l)
+ {
+ if ($l && $locale = $l->getLocale()) {
+ $this->setLocale($locale);
+ $this->currentTranslations[$locale] = $l;
+ }
+ if ($this->collModuleImageI18ns === null) {
+ $this->initModuleImageI18ns();
+ $this->collModuleImageI18nsPartial = true;
+ }
+
+ if (!in_array($l, $this->collModuleImageI18ns->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddModuleImageI18n($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param ModuleImageI18n $moduleImageI18n The moduleImageI18n object to add.
+ */
+ protected function doAddModuleImageI18n($moduleImageI18n)
+ {
+ $this->collModuleImageI18ns[]= $moduleImageI18n;
+ $moduleImageI18n->setModuleImage($this);
+ }
+
+ /**
+ * @param ModuleImageI18n $moduleImageI18n The moduleImageI18n object to remove.
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function removeModuleImageI18n($moduleImageI18n)
+ {
+ if ($this->getModuleImageI18ns()->contains($moduleImageI18n)) {
+ $this->collModuleImageI18ns->remove($this->collModuleImageI18ns->search($moduleImageI18n));
+ if (null === $this->moduleImageI18nsScheduledForDeletion) {
+ $this->moduleImageI18nsScheduledForDeletion = clone $this->collModuleImageI18ns;
+ $this->moduleImageI18nsScheduledForDeletion->clear();
+ }
+ $this->moduleImageI18nsScheduledForDeletion[]= clone $moduleImageI18n;
+ $moduleImageI18n->setModuleImage(null);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->module_id = null;
+ $this->file = null;
+ $this->position = 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 ($this->collModuleImageI18ns) {
+ foreach ($this->collModuleImageI18ns as $o) {
+ $o->clearAllReferences($deep);
+ }
+ }
+ } // if ($deep)
+
+ // i18n behavior
+ $this->currentLocale = 'en_US';
+ $this->currentTranslations = null;
+
+ if ($this->collModuleImageI18ns instanceof Collection) {
+ $this->collModuleImageI18ns->clearIterator();
+ }
+ $this->collModuleImageI18ns = null;
+ $this->aModule = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(ModuleImageTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ // timestampable behavior
+
+ /**
+ * Mark the current object so that the update date doesn't get updated during next save
+ *
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function keepUpdateDateUnchanged()
+ {
+ $this->modifiedColumns[] = ModuleImageTableMap::UPDATED_AT;
+
+ return $this;
+ }
+
+ // i18n behavior
+
+ /**
+ * Sets the locale for translations
+ *
+ * @param string $locale Locale to use for the translation, e.g. 'fr_FR'
+ *
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function setLocale($locale = 'en_US')
+ {
+ $this->currentLocale = $locale;
+
+ return $this;
+ }
+
+ /**
+ * Gets the locale for translations
+ *
+ * @return string $locale Locale to use for the translation, e.g. 'fr_FR'
+ */
+ public function getLocale()
+ {
+ return $this->currentLocale;
+ }
+
+ /**
+ * Returns the current translation for a given locale
+ *
+ * @param string $locale Locale to use for the translation, e.g. 'fr_FR'
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildModuleImageI18n */
+ public function getTranslation($locale = 'en_US', ConnectionInterface $con = null)
+ {
+ if (!isset($this->currentTranslations[$locale])) {
+ if (null !== $this->collModuleImageI18ns) {
+ foreach ($this->collModuleImageI18ns as $translation) {
+ if ($translation->getLocale() == $locale) {
+ $this->currentTranslations[$locale] = $translation;
+
+ return $translation;
+ }
+ }
+ }
+ if ($this->isNew()) {
+ $translation = new ChildModuleImageI18n();
+ $translation->setLocale($locale);
+ } else {
+ $translation = ChildModuleImageI18nQuery::create()
+ ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
+ ->findOneOrCreate($con);
+ $this->currentTranslations[$locale] = $translation;
+ }
+ $this->addModuleImageI18n($translation);
+ }
+
+ return $this->currentTranslations[$locale];
+ }
+
+ /**
+ * Remove the translation for a given locale
+ *
+ * @param string $locale Locale to use for the translation, e.g. 'fr_FR'
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null)
+ {
+ if (!$this->isNew()) {
+ ChildModuleImageI18nQuery::create()
+ ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
+ ->delete($con);
+ }
+ if (isset($this->currentTranslations[$locale])) {
+ unset($this->currentTranslations[$locale]);
+ }
+ foreach ($this->collModuleImageI18ns as $key => $translation) {
+ if ($translation->getLocale() == $locale) {
+ unset($this->collModuleImageI18ns[$key]);
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the current translation
+ *
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildModuleImageI18n */
+ public function getCurrentTranslation(ConnectionInterface $con = null)
+ {
+ return $this->getTranslation($this->getLocale(), $con);
+ }
+
+
+ /**
+ * Get the [title] column value.
+ *
+ * @return string
+ */
+ public function getTitle()
+ {
+ return $this->getCurrentTranslation()->getTitle();
+ }
+
+
+ /**
+ * Set the value of [title] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setTitle($v)
+ { $this->getCurrentTranslation()->setTitle($v);
+
+ return $this;
+ }
+
+
+ /**
+ * Get the [description] column value.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->getCurrentTranslation()->getDescription();
+ }
+
+
+ /**
+ * Set the value of [description] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setDescription($v)
+ { $this->getCurrentTranslation()->setDescription($v);
+
+ return $this;
+ }
+
+
+ /**
+ * Get the [chapo] column value.
+ *
+ * @return string
+ */
+ public function getChapo()
+ {
+ return $this->getCurrentTranslation()->getChapo();
+ }
+
+
+ /**
+ * Set the value of [chapo] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setChapo($v)
+ { $this->getCurrentTranslation()->setChapo($v);
+
+ return $this;
+ }
+
+
+ /**
+ * Get the [postscriptum] column value.
+ *
+ * @return string
+ */
+ public function getPostscriptum()
+ {
+ return $this->getCurrentTranslation()->getPostscriptum();
+ }
+
+
+ /**
+ * Set the value of [postscriptum] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setPostscriptum($v)
+ { $this->getCurrentTranslation()->setPostscriptum($v);
+
+ 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/core/lib/Thelia/Model/Base/AttributeCategory.php b/core/lib/Thelia/Model/Base/ModuleImageI18n.php
similarity index 64%
rename from core/lib/Thelia/Model/Base/AttributeCategory.php
rename to core/lib/Thelia/Model/Base/ModuleImageI18n.php
index da702559a..2425b4e65 100644
--- a/core/lib/Thelia/Model/Base/AttributeCategory.php
+++ b/core/lib/Thelia/Model/Base/ModuleImageI18n.php
@@ -2,7 +2,6 @@
namespace Thelia\Model\Base;
-use \DateTime;
use \Exception;
use \PDO;
use Propel\Runtime\Propel;
@@ -15,21 +14,17 @@ use Propel\Runtime\Exception\BadMethodCallException;
use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
-use Propel\Runtime\Util\PropelDateTime;
-use Thelia\Model\Attribute as ChildAttribute;
-use Thelia\Model\AttributeCategory as ChildAttributeCategory;
-use Thelia\Model\AttributeCategoryQuery as ChildAttributeCategoryQuery;
-use Thelia\Model\AttributeQuery as ChildAttributeQuery;
-use Thelia\Model\Category as ChildCategory;
-use Thelia\Model\CategoryQuery as ChildCategoryQuery;
-use Thelia\Model\Map\AttributeCategoryTableMap;
+use Thelia\Model\ModuleImage as ChildModuleImage;
+use Thelia\Model\ModuleImageI18nQuery as ChildModuleImageI18nQuery;
+use Thelia\Model\ModuleImageQuery as ChildModuleImageQuery;
+use Thelia\Model\Map\ModuleImageI18nTableMap;
-abstract class AttributeCategory implements ActiveRecordInterface
+abstract class ModuleImageI18n implements ActiveRecordInterface
{
/**
* TableMap class name
*/
- const TABLE_MAP = '\\Thelia\\Model\\Map\\AttributeCategoryTableMap';
+ const TABLE_MAP = '\\Thelia\\Model\\Map\\ModuleImageI18nTableMap';
/**
@@ -65,38 +60,40 @@ abstract class AttributeCategory implements ActiveRecordInterface
protected $id;
/**
- * The value for the category_id field.
- * @var int
- */
- protected $category_id;
-
- /**
- * The value for the attribute_id field.
- * @var int
- */
- protected $attribute_id;
-
- /**
- * The value for the created_at field.
+ * The value for the locale field.
+ * Note: this column has a database default value of: 'en_US'
* @var string
*/
- protected $created_at;
+ protected $locale;
/**
- * The value for the updated_at field.
+ * The value for the title field.
* @var string
*/
- protected $updated_at;
+ protected $title;
/**
- * @var Category
+ * The value for the description field.
+ * @var string
*/
- protected $aCategory;
+ protected $description;
/**
- * @var Attribute
+ * The value for the chapo field.
+ * @var string
*/
- protected $aAttribute;
+ protected $chapo;
+
+ /**
+ * The value for the postscriptum field.
+ * @var string
+ */
+ protected $postscriptum;
+
+ /**
+ * @var ModuleImage
+ */
+ protected $aModuleImage;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -107,10 +104,23 @@ abstract class AttributeCategory implements ActiveRecordInterface
protected $alreadyInSave = false;
/**
- * Initializes internal state of Thelia\Model\Base\AttributeCategory object.
+ * Applies default values to this object.
+ * This method should be called from the object's constructor (or
+ * equivalent initialization method).
+ * @see __construct()
+ */
+ public function applyDefaultValues()
+ {
+ $this->locale = 'en_US';
+ }
+
+ /**
+ * Initializes internal state of Thelia\Model\Base\ModuleImageI18n object.
+ * @see applyDefaults()
*/
public function __construct()
{
+ $this->applyDefaultValues();
}
/**
@@ -202,9 +212,9 @@ abstract class AttributeCategory implements ActiveRecordInterface
}
/**
- * Compares this with another AttributeCategory instance. If
- * obj is an instance of AttributeCategory, delegates to
- * equals(AttributeCategory). Otherwise, returns false.
+ * Compares this with another ModuleImageI18n instance. If
+ * obj is an instance of ModuleImageI18n, delegates to
+ * equals(ModuleImageI18n). Otherwise, returns false.
*
* @param obj The object to compare to.
* @return Whether equal to the object specified.
@@ -285,7 +295,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
* @param string $name The virtual column name
* @param mixed $value The value to give to the virtual column
*
- * @return AttributeCategory The current object, for fluid interface
+ * @return ModuleImageI18n The current object, for fluid interface
*/
public function setVirtualColumn($name, $value)
{
@@ -317,7 +327,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
* @param string $data The source data to import from
*
- * @return AttributeCategory The current object, for fluid interface
+ * @return ModuleImageI18n The current object, for fluid interface
*/
public function importFrom($parser, $data)
{
@@ -372,72 +382,65 @@ abstract class AttributeCategory implements ActiveRecordInterface
}
/**
- * Get the [category_id] column value.
+ * Get the [locale] column value.
*
- * @return int
+ * @return string
*/
- public function getCategoryId()
+ public function getLocale()
{
- return $this->category_id;
+ return $this->locale;
}
/**
- * Get the [attribute_id] column value.
+ * Get the [title] column value.
*
- * @return int
+ * @return string
*/
- public function getAttributeId()
+ public function getTitle()
{
- return $this->attribute_id;
+ return $this->title;
}
/**
- * Get the [optionally formatted] temporal [created_at] column value.
+ * Get the [description] 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.
+ * @return string
*/
- public function getCreatedAt($format = NULL)
+ public function getDescription()
{
- if ($format === null) {
- return $this->created_at;
- } else {
- return $this->created_at !== null ? $this->created_at->format($format) : null;
- }
+
+ return $this->description;
}
/**
- * Get the [optionally formatted] temporal [updated_at] column value.
+ * Get the [chapo] 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.
+ * @return string
*/
- public function getUpdatedAt($format = NULL)
+ public function getChapo()
{
- if ($format === null) {
- return $this->updated_at;
- } else {
- return $this->updated_at !== null ? $this->updated_at->format($format) : null;
- }
+
+ return $this->chapo;
+ }
+
+ /**
+ * Get the [postscriptum] column value.
+ *
+ * @return string
+ */
+ public function getPostscriptum()
+ {
+
+ return $this->postscriptum;
}
/**
* Set the value of [id] column.
*
* @param int $v new value
- * @return \Thelia\Model\AttributeCategory The current object (for fluent API support)
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
*/
public function setId($v)
{
@@ -447,7 +450,11 @@ abstract class AttributeCategory implements ActiveRecordInterface
if ($this->id !== $v) {
$this->id = $v;
- $this->modifiedColumns[] = AttributeCategoryTableMap::ID;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::ID;
+ }
+
+ if ($this->aModuleImage !== null && $this->aModuleImage->getId() !== $v) {
+ $this->aModuleImage = null;
}
@@ -455,96 +462,109 @@ abstract class AttributeCategory implements ActiveRecordInterface
} // setId()
/**
- * Set the value of [category_id] column.
+ * Set the value of [locale] column.
*
- * @param int $v new value
- * @return \Thelia\Model\AttributeCategory The current object (for fluent API support)
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
*/
- public function setCategoryId($v)
+ public function setLocale($v)
{
if ($v !== null) {
- $v = (int) $v;
+ $v = (string) $v;
}
- if ($this->category_id !== $v) {
- $this->category_id = $v;
- $this->modifiedColumns[] = AttributeCategoryTableMap::CATEGORY_ID;
- }
-
- if ($this->aCategory !== null && $this->aCategory->getId() !== $v) {
- $this->aCategory = null;
+ if ($this->locale !== $v) {
+ $this->locale = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::LOCALE;
}
return $this;
- } // setCategoryId()
+ } // setLocale()
/**
- * Set the value of [attribute_id] column.
+ * Set the value of [title] column.
*
- * @param int $v new value
- * @return \Thelia\Model\AttributeCategory The current object (for fluent API support)
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
*/
- public function setAttributeId($v)
+ public function setTitle($v)
{
if ($v !== null) {
- $v = (int) $v;
+ $v = (string) $v;
}
- if ($this->attribute_id !== $v) {
- $this->attribute_id = $v;
- $this->modifiedColumns[] = AttributeCategoryTableMap::ATTRIBUTE_ID;
- }
-
- if ($this->aAttribute !== null && $this->aAttribute->getId() !== $v) {
- $this->aAttribute = null;
+ if ($this->title !== $v) {
+ $this->title = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::TITLE;
}
return $this;
- } // setAttributeId()
+ } // setTitle()
/**
- * Sets the value of [created_at] column to a normalized version of the date/time value specified.
+ * Set the value of [description] column.
*
- * @param mixed $v string, integer (timestamp), or \DateTime value.
- * Empty strings are treated as NULL.
- * @return \Thelia\Model\AttributeCategory The current object (for fluent API support)
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
*/
- public function setCreatedAt($v)
+ public function setDescription($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[] = AttributeCategoryTableMap::CREATED_AT;
- }
- } // if either are not null
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->description !== $v) {
+ $this->description = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::DESCRIPTION;
+ }
return $this;
- } // setCreatedAt()
+ } // setDescription()
/**
- * Sets the value of [updated_at] column to a normalized version of the date/time value specified.
+ * Set the value of [chapo] column.
*
- * @param mixed $v string, integer (timestamp), or \DateTime value.
- * Empty strings are treated as NULL.
- * @return \Thelia\Model\AttributeCategory The current object (for fluent API support)
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
*/
- public function setUpdatedAt($v)
+ public function setChapo($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[] = AttributeCategoryTableMap::UPDATED_AT;
- }
- } // if either are not null
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->chapo !== $v) {
+ $this->chapo = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::CHAPO;
+ }
return $this;
- } // setUpdatedAt()
+ } // setChapo()
+
+ /**
+ * Set the value of [postscriptum] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setPostscriptum($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->postscriptum !== $v) {
+ $this->postscriptum = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::POSTSCRIPTUM;
+ }
+
+
+ return $this;
+ } // setPostscriptum()
/**
* Indicates whether the columns in this object are only set to default values.
@@ -556,6 +576,10 @@ abstract class AttributeCategory implements ActiveRecordInterface
*/
public function hasOnlyDefaultValues()
{
+ if ($this->locale !== 'en_US') {
+ return false;
+ }
+
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
@@ -583,26 +607,23 @@ abstract class AttributeCategory implements ActiveRecordInterface
try {
- $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : AttributeCategoryTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ModuleImageI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AttributeCategoryTableMap::translateFieldName('CategoryId', TableMap::TYPE_PHPNAME, $indexType)];
- $this->category_id = (null !== $col) ? (int) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ModuleImageI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->locale = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AttributeCategoryTableMap::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)];
- $this->attribute_id = (null !== $col) ? (int) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ModuleImageI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->title = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AttributeCategoryTableMap::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 : ModuleImageI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->description = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AttributeCategoryTableMap::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;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ModuleImageI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->chapo = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ModuleImageI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->postscriptum = (null !== $col) ? (string) $col : null;
$this->resetModified();
$this->setNew(false);
@@ -611,10 +632,10 @@ abstract class AttributeCategory implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 5; // 5 = AttributeCategoryTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 6; // 6 = ModuleImageI18nTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
- throw new PropelException("Error populating \Thelia\Model\AttributeCategory object", 0, $e);
+ throw new PropelException("Error populating \Thelia\Model\ModuleImageI18n object", 0, $e);
}
}
@@ -633,11 +654,8 @@ abstract class AttributeCategory implements ActiveRecordInterface
*/
public function ensureConsistency()
{
- if ($this->aCategory !== null && $this->category_id !== $this->aCategory->getId()) {
- $this->aCategory = null;
- }
- if ($this->aAttribute !== null && $this->attribute_id !== $this->aAttribute->getId()) {
- $this->aAttribute = null;
+ if ($this->aModuleImage !== null && $this->id !== $this->aModuleImage->getId()) {
+ $this->aModuleImage = null;
}
} // ensureConsistency
@@ -662,13 +680,13 @@ abstract class AttributeCategory implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(AttributeCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getReadConnection(ModuleImageI18nTableMap::DATABASE_NAME);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
- $dataFetcher = ChildAttributeCategoryQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $dataFetcher = ChildModuleImageI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$row = $dataFetcher->fetch();
$dataFetcher->close();
if (!$row) {
@@ -678,8 +696,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
- $this->aCategory = null;
- $this->aAttribute = null;
+ $this->aModuleImage = null;
} // if (deep)
}
@@ -689,8 +706,8 @@ abstract class AttributeCategory implements ActiveRecordInterface
* @param ConnectionInterface $con
* @return void
* @throws PropelException
- * @see AttributeCategory::setDeleted()
- * @see AttributeCategory::isDeleted()
+ * @see ModuleImageI18n::setDeleted()
+ * @see ModuleImageI18n::isDeleted()
*/
public function delete(ConnectionInterface $con = null)
{
@@ -699,12 +716,12 @@ abstract class AttributeCategory implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(AttributeCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
- $deleteQuery = ChildAttributeCategoryQuery::create()
+ $deleteQuery = ChildModuleImageI18nQuery::create()
->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con);
if ($ret) {
@@ -741,7 +758,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(AttributeCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
}
$con->beginTransaction();
@@ -750,19 +767,8 @@ abstract class AttributeCategory implements ActiveRecordInterface
$ret = $this->preSave($con);
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
- // timestampable behavior
- if (!$this->isColumnModified(AttributeCategoryTableMap::CREATED_AT)) {
- $this->setCreatedAt(time());
- }
- if (!$this->isColumnModified(AttributeCategoryTableMap::UPDATED_AT)) {
- $this->setUpdatedAt(time());
- }
} else {
$ret = $ret && $this->preUpdate($con);
- // timestampable behavior
- if ($this->isModified() && !$this->isColumnModified(AttributeCategoryTableMap::UPDATED_AT)) {
- $this->setUpdatedAt(time());
- }
}
if ($ret) {
$affectedRows = $this->doSave($con);
@@ -772,7 +778,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
$this->postUpdate($con);
}
$this->postSave($con);
- AttributeCategoryTableMap::addInstanceToPool($this);
+ ModuleImageI18nTableMap::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
@@ -807,18 +813,11 @@ abstract class AttributeCategory implements ActiveRecordInterface
// method. This object relates to these object(s) by a
// foreign key reference.
- if ($this->aCategory !== null) {
- if ($this->aCategory->isModified() || $this->aCategory->isNew()) {
- $affectedRows += $this->aCategory->save($con);
+ if ($this->aModuleImage !== null) {
+ if ($this->aModuleImage->isModified() || $this->aModuleImage->isNew()) {
+ $affectedRows += $this->aModuleImage->save($con);
}
- $this->setCategory($this->aCategory);
- }
-
- if ($this->aAttribute !== null) {
- if ($this->aAttribute->isModified() || $this->aAttribute->isNew()) {
- $affectedRows += $this->aAttribute->save($con);
- }
- $this->setAttribute($this->aAttribute);
+ $this->setModuleImage($this->aModuleImage);
}
if ($this->isNew() || $this->isModified()) {
@@ -852,30 +851,29 @@ abstract class AttributeCategory implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
- $this->modifiedColumns[] = AttributeCategoryTableMap::ID;
- if (null !== $this->id) {
- throw new PropelException('Cannot insert a value for auto-increment primary key (' . AttributeCategoryTableMap::ID . ')');
- }
// check the columns in natural order for more readable SQL queries
- if ($this->isColumnModified(AttributeCategoryTableMap::ID)) {
+ if ($this->isColumnModified(ModuleImageI18nTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
- if ($this->isColumnModified(AttributeCategoryTableMap::CATEGORY_ID)) {
- $modifiedColumns[':p' . $index++] = 'CATEGORY_ID';
+ if ($this->isColumnModified(ModuleImageI18nTableMap::LOCALE)) {
+ $modifiedColumns[':p' . $index++] = 'LOCALE';
}
- if ($this->isColumnModified(AttributeCategoryTableMap::ATTRIBUTE_ID)) {
- $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_ID';
+ if ($this->isColumnModified(ModuleImageI18nTableMap::TITLE)) {
+ $modifiedColumns[':p' . $index++] = 'TITLE';
}
- if ($this->isColumnModified(AttributeCategoryTableMap::CREATED_AT)) {
- $modifiedColumns[':p' . $index++] = 'CREATED_AT';
+ if ($this->isColumnModified(ModuleImageI18nTableMap::DESCRIPTION)) {
+ $modifiedColumns[':p' . $index++] = 'DESCRIPTION';
}
- if ($this->isColumnModified(AttributeCategoryTableMap::UPDATED_AT)) {
- $modifiedColumns[':p' . $index++] = 'UPDATED_AT';
+ if ($this->isColumnModified(ModuleImageI18nTableMap::CHAPO)) {
+ $modifiedColumns[':p' . $index++] = 'CHAPO';
+ }
+ if ($this->isColumnModified(ModuleImageI18nTableMap::POSTSCRIPTUM)) {
+ $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
}
$sql = sprintf(
- 'INSERT INTO attribute_category (%s) VALUES (%s)',
+ 'INSERT INTO module_image_i18n (%s) VALUES (%s)',
implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns))
);
@@ -887,17 +885,20 @@ abstract class AttributeCategory implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
- case 'CATEGORY_ID':
- $stmt->bindValue($identifier, $this->category_id, PDO::PARAM_INT);
+ case 'LOCALE':
+ $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR);
break;
- case 'ATTRIBUTE_ID':
- $stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT);
+ case 'TITLE':
+ $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
break;
- case 'CREATED_AT':
- $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
+ case 'DESCRIPTION':
+ $stmt->bindValue($identifier, $this->description, 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);
+ case 'CHAPO':
+ $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR);
+ break;
+ case 'POSTSCRIPTUM':
+ $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR);
break;
}
}
@@ -907,13 +908,6 @@ abstract class AttributeCategory implements ActiveRecordInterface
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);
}
@@ -945,7 +939,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
*/
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
{
- $pos = AttributeCategoryTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = ModuleImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
@@ -965,16 +959,19 @@ abstract class AttributeCategory implements ActiveRecordInterface
return $this->getId();
break;
case 1:
- return $this->getCategoryId();
+ return $this->getLocale();
break;
case 2:
- return $this->getAttributeId();
+ return $this->getTitle();
break;
case 3:
- return $this->getCreatedAt();
+ return $this->getDescription();
break;
case 4:
- return $this->getUpdatedAt();
+ return $this->getChapo();
+ break;
+ case 5:
+ return $this->getPostscriptum();
break;
default:
return null;
@@ -999,17 +996,18 @@ abstract class AttributeCategory implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
- if (isset($alreadyDumpedObjects['AttributeCategory'][$this->getPrimaryKey()])) {
+ if (isset($alreadyDumpedObjects['ModuleImageI18n'][serialize($this->getPrimaryKey())])) {
return '*RECURSION*';
}
- $alreadyDumpedObjects['AttributeCategory'][$this->getPrimaryKey()] = true;
- $keys = AttributeCategoryTableMap::getFieldNames($keyType);
+ $alreadyDumpedObjects['ModuleImageI18n'][serialize($this->getPrimaryKey())] = true;
+ $keys = ModuleImageI18nTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
- $keys[1] => $this->getCategoryId(),
- $keys[2] => $this->getAttributeId(),
- $keys[3] => $this->getCreatedAt(),
- $keys[4] => $this->getUpdatedAt(),
+ $keys[1] => $this->getLocale(),
+ $keys[2] => $this->getTitle(),
+ $keys[3] => $this->getDescription(),
+ $keys[4] => $this->getChapo(),
+ $keys[5] => $this->getPostscriptum(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1018,11 +1016,8 @@ abstract class AttributeCategory implements ActiveRecordInterface
}
if ($includeForeignObjects) {
- if (null !== $this->aCategory) {
- $result['Category'] = $this->aCategory->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
- }
- if (null !== $this->aAttribute) {
- $result['Attribute'] = $this->aAttribute->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ if (null !== $this->aModuleImage) {
+ $result['ModuleImage'] = $this->aModuleImage->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
@@ -1042,7 +1037,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
*/
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
{
- $pos = AttributeCategoryTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = ModuleImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -1062,16 +1057,19 @@ abstract class AttributeCategory implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
- $this->setCategoryId($value);
+ $this->setLocale($value);
break;
case 2:
- $this->setAttributeId($value);
+ $this->setTitle($value);
break;
case 3:
- $this->setCreatedAt($value);
+ $this->setDescription($value);
break;
case 4:
- $this->setUpdatedAt($value);
+ $this->setChapo($value);
+ break;
+ case 5:
+ $this->setPostscriptum($value);
break;
} // switch()
}
@@ -1095,13 +1093,14 @@ abstract class AttributeCategory implements ActiveRecordInterface
*/
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
- $keys = AttributeCategoryTableMap::getFieldNames($keyType);
+ $keys = ModuleImageI18nTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setCategoryId($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setAttributeId($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
+ if (array_key_exists($keys[1], $arr)) $this->setLocale($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setTitle($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setDescription($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setChapo($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setPostscriptum($arr[$keys[5]]);
}
/**
@@ -1111,13 +1110,14 @@ abstract class AttributeCategory implements ActiveRecordInterface
*/
public function buildCriteria()
{
- $criteria = new Criteria(AttributeCategoryTableMap::DATABASE_NAME);
+ $criteria = new Criteria(ModuleImageI18nTableMap::DATABASE_NAME);
- if ($this->isColumnModified(AttributeCategoryTableMap::ID)) $criteria->add(AttributeCategoryTableMap::ID, $this->id);
- if ($this->isColumnModified(AttributeCategoryTableMap::CATEGORY_ID)) $criteria->add(AttributeCategoryTableMap::CATEGORY_ID, $this->category_id);
- if ($this->isColumnModified(AttributeCategoryTableMap::ATTRIBUTE_ID)) $criteria->add(AttributeCategoryTableMap::ATTRIBUTE_ID, $this->attribute_id);
- if ($this->isColumnModified(AttributeCategoryTableMap::CREATED_AT)) $criteria->add(AttributeCategoryTableMap::CREATED_AT, $this->created_at);
- if ($this->isColumnModified(AttributeCategoryTableMap::UPDATED_AT)) $criteria->add(AttributeCategoryTableMap::UPDATED_AT, $this->updated_at);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::ID)) $criteria->add(ModuleImageI18nTableMap::ID, $this->id);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::LOCALE)) $criteria->add(ModuleImageI18nTableMap::LOCALE, $this->locale);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::TITLE)) $criteria->add(ModuleImageI18nTableMap::TITLE, $this->title);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::DESCRIPTION)) $criteria->add(ModuleImageI18nTableMap::DESCRIPTION, $this->description);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::CHAPO)) $criteria->add(ModuleImageI18nTableMap::CHAPO, $this->chapo);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::POSTSCRIPTUM)) $criteria->add(ModuleImageI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
return $criteria;
}
@@ -1132,30 +1132,37 @@ abstract class AttributeCategory implements ActiveRecordInterface
*/
public function buildPkeyCriteria()
{
- $criteria = new Criteria(AttributeCategoryTableMap::DATABASE_NAME);
- $criteria->add(AttributeCategoryTableMap::ID, $this->id);
+ $criteria = new Criteria(ModuleImageI18nTableMap::DATABASE_NAME);
+ $criteria->add(ModuleImageI18nTableMap::ID, $this->id);
+ $criteria->add(ModuleImageI18nTableMap::LOCALE, $this->locale);
return $criteria;
}
/**
- * Returns the primary key for this object (row).
- * @return int
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
*/
public function getPrimaryKey()
{
- return $this->getId();
+ $pks = array();
+ $pks[0] = $this->getId();
+ $pks[1] = $this->getLocale();
+
+ return $pks;
}
/**
- * Generic method to set the primary key (id column).
+ * Set the [composite] primary key.
*
- * @param int $key Primary key.
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
* @return void
*/
- public function setPrimaryKey($key)
+ public function setPrimaryKey($keys)
{
- $this->setId($key);
+ $this->setId($keys[0]);
+ $this->setLocale($keys[1]);
}
/**
@@ -1165,7 +1172,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
public function isPrimaryKeyNull()
{
- return null === $this->getId();
+ return (null === $this->getId()) && (null === $this->getLocale());
}
/**
@@ -1174,20 +1181,21 @@ abstract class AttributeCategory implements ActiveRecordInterface
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
- * @param object $copyObj An object of \Thelia\Model\AttributeCategory (or compatible) type.
+ * @param object $copyObj An object of \Thelia\Model\ModuleImageI18n (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->setCategoryId($this->getCategoryId());
- $copyObj->setAttributeId($this->getAttributeId());
- $copyObj->setCreatedAt($this->getCreatedAt());
- $copyObj->setUpdatedAt($this->getUpdatedAt());
+ $copyObj->setId($this->getId());
+ $copyObj->setLocale($this->getLocale());
+ $copyObj->setTitle($this->getTitle());
+ $copyObj->setDescription($this->getDescription());
+ $copyObj->setChapo($this->getChapo());
+ $copyObj->setPostscriptum($this->getPostscriptum());
if ($makeNew) {
$copyObj->setNew(true);
- $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
}
}
@@ -1200,7 +1208,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return \Thelia\Model\AttributeCategory Clone of current object.
+ * @return \Thelia\Model\ModuleImageI18n Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -1214,26 +1222,26 @@ abstract class AttributeCategory implements ActiveRecordInterface
}
/**
- * Declares an association between this object and a ChildCategory object.
+ * Declares an association between this object and a ChildModuleImage object.
*
- * @param ChildCategory $v
- * @return \Thelia\Model\AttributeCategory The current object (for fluent API support)
+ * @param ChildModuleImage $v
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
* @throws PropelException
*/
- public function setCategory(ChildCategory $v = null)
+ public function setModuleImage(ChildModuleImage $v = null)
{
if ($v === null) {
- $this->setCategoryId(NULL);
+ $this->setId(NULL);
} else {
- $this->setCategoryId($v->getId());
+ $this->setId($v->getId());
}
- $this->aCategory = $v;
+ $this->aModuleImage = $v;
// Add binding for other direction of this n:n relationship.
- // If this object has already been added to the ChildCategory object, it will not be re-added.
+ // If this object has already been added to the ChildModuleImage object, it will not be re-added.
if ($v !== null) {
- $v->addAttributeCategory($this);
+ $v->addModuleImageI18n($this);
}
@@ -1242,77 +1250,26 @@ abstract class AttributeCategory implements ActiveRecordInterface
/**
- * Get the associated ChildCategory object
+ * Get the associated ChildModuleImage object
*
* @param ConnectionInterface $con Optional Connection object.
- * @return ChildCategory The associated ChildCategory object.
+ * @return ChildModuleImage The associated ChildModuleImage object.
* @throws PropelException
*/
- public function getCategory(ConnectionInterface $con = null)
+ public function getModuleImage(ConnectionInterface $con = null)
{
- if ($this->aCategory === null && ($this->category_id !== null)) {
- $this->aCategory = ChildCategoryQuery::create()->findPk($this->category_id, $con);
+ if ($this->aModuleImage === null && ($this->id !== null)) {
+ $this->aModuleImage = ChildModuleImageQuery::create()->findPk($this->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->aCategory->addAttributeCategories($this);
+ $this->aModuleImage->addModuleImageI18ns($this);
*/
}
- return $this->aCategory;
- }
-
- /**
- * Declares an association between this object and a ChildAttribute object.
- *
- * @param ChildAttribute $v
- * @return \Thelia\Model\AttributeCategory The current object (for fluent API support)
- * @throws PropelException
- */
- public function setAttribute(ChildAttribute $v = null)
- {
- if ($v === null) {
- $this->setAttributeId(NULL);
- } else {
- $this->setAttributeId($v->getId());
- }
-
- $this->aAttribute = $v;
-
- // Add binding for other direction of this n:n relationship.
- // If this object has already been added to the ChildAttribute object, it will not be re-added.
- if ($v !== null) {
- $v->addAttributeCategory($this);
- }
-
-
- return $this;
- }
-
-
- /**
- * Get the associated ChildAttribute object
- *
- * @param ConnectionInterface $con Optional Connection object.
- * @return ChildAttribute The associated ChildAttribute object.
- * @throws PropelException
- */
- public function getAttribute(ConnectionInterface $con = null)
- {
- if ($this->aAttribute === null && ($this->attribute_id !== null)) {
- $this->aAttribute = ChildAttributeQuery::create()->findPk($this->attribute_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->aAttribute->addAttributeCategories($this);
- */
- }
-
- return $this->aAttribute;
+ return $this->aModuleImage;
}
/**
@@ -1321,12 +1278,14 @@ abstract class AttributeCategory implements ActiveRecordInterface
public function clear()
{
$this->id = null;
- $this->category_id = null;
- $this->attribute_id = null;
- $this->created_at = null;
- $this->updated_at = null;
+ $this->locale = null;
+ $this->title = null;
+ $this->description = null;
+ $this->chapo = null;
+ $this->postscriptum = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
+ $this->applyDefaultValues();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);
@@ -1346,8 +1305,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
if ($deep) {
} // if ($deep)
- $this->aCategory = null;
- $this->aAttribute = null;
+ $this->aModuleImage = null;
}
/**
@@ -1357,21 +1315,7 @@ abstract class AttributeCategory implements ActiveRecordInterface
*/
public function __toString()
{
- return (string) $this->exportTo(AttributeCategoryTableMap::DEFAULT_STRING_FORMAT);
- }
-
- // timestampable behavior
-
- /**
- * Mark the current object so that the update date doesn't get updated during next save
- *
- * @return ChildAttributeCategory The current object (for fluent API support)
- */
- public function keepUpdateDateUnchanged()
- {
- $this->modifiedColumns[] = AttributeCategoryTableMap::UPDATED_AT;
-
- return $this;
+ return (string) $this->exportTo(ModuleImageI18nTableMap::DEFAULT_STRING_FORMAT);
}
/**
diff --git a/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php b/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php
new file mode 100644
index 000000000..e5b6813d6
--- /dev/null
+++ b/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php
@@ -0,0 +1,607 @@
+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(array(12, 34), $con);
+ *
+ *
+ * @param array[$id, $locale] $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildModuleImageI18n|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = ModuleImageI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(ModuleImageI18nTableMap::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 ChildModuleImageI18n A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM module_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
+ $stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
+ $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 ChildModuleImageI18n();
+ $obj->hydrate($row);
+ ModuleImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
+ }
+ $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 ChildModuleImageI18n|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(array(12, 56), array(832, 123), array(123, 456)), $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 ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+ $this->addUsingAlias(ModuleImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
+ $this->addUsingAlias(ModuleImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
+
+ return $this;
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+ if (empty($keys)) {
+ return $this->add(null, '1<>1', Criteria::CUSTOM);
+ }
+ foreach ($keys as $key) {
+ $cton0 = $this->getNewCriterion(ModuleImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
+ $cton1 = $this->getNewCriterion(ModuleImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
+ $cton0->addAnd($cton1);
+ $this->addOr($cton0);
+ }
+
+ return $this;
+ }
+
+ /**
+ * 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 filterByModuleImage()
+ *
+ * @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 ChildModuleImageI18nQuery 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(ModuleImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(ModuleImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the locale column
+ *
+ * Example usage:
+ *
+ * $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
+ * $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
+ *
+ *
+ * @param string $locale 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 ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByLocale($locale = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($locale)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $locale)) {
+ $locale = str_replace('*', '%', $locale);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::LOCALE, $locale, $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 ChildModuleImageI18nQuery 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(ModuleImageI18nTableMap::TITLE, $title, $comparison);
+ }
+
+ /**
+ * Filter the query on the description column
+ *
+ * Example usage:
+ *
+ * $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
+ * $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
+ *
+ *
+ * @param string $description 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 ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByDescription($description = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($description)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $description)) {
+ $description = str_replace('*', '%', $description);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::DESCRIPTION, $description, $comparison);
+ }
+
+ /**
+ * Filter the query on the chapo column
+ *
+ * Example usage:
+ *
+ * $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
+ * $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
+ *
+ *
+ * @param string $chapo 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 ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByChapo($chapo = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($chapo)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $chapo)) {
+ $chapo = str_replace('*', '%', $chapo);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::CHAPO, $chapo, $comparison);
+ }
+
+ /**
+ * Filter the query on the postscriptum column
+ *
+ * Example usage:
+ *
+ * $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
+ * $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
+ *
+ *
+ * @param string $postscriptum 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 ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByPostscriptum($postscriptum = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($postscriptum)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $postscriptum)) {
+ $postscriptum = str_replace('*', '%', $postscriptum);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\ModuleImage object
+ *
+ * @param \Thelia\Model\ModuleImage|ObjectCollection $moduleImage The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByModuleImage($moduleImage, $comparison = null)
+ {
+ if ($moduleImage instanceof \Thelia\Model\ModuleImage) {
+ return $this
+ ->addUsingAlias(ModuleImageI18nTableMap::ID, $moduleImage->getId(), $comparison);
+ } elseif ($moduleImage instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(ModuleImageI18nTableMap::ID, $moduleImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByModuleImage() only accepts arguments of type \Thelia\Model\ModuleImage or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the ModuleImage relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function joinModuleImage($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('ModuleImage');
+
+ // 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, 'ModuleImage');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the ModuleImage relation ModuleImage object
+ *
+ * @see useQuery()
+ *
+ * @param string $relationAlias optional alias for the relation,
+ * to be used as main alias in the secondary query
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return \Thelia\Model\ModuleImageQuery A secondary query class using the current class as primary query
+ */
+ public function useModuleImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ return $this
+ ->joinModuleImage($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ModuleImage', '\Thelia\Model\ModuleImageQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildModuleImageI18n $moduleImageI18n Object to remove from the list of results
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function prune($moduleImageI18n = null)
+ {
+ if ($moduleImageI18n) {
+ $this->addCond('pruneCond0', $this->getAliasedColName(ModuleImageI18nTableMap::ID), $moduleImageI18n->getId(), Criteria::NOT_EQUAL);
+ $this->addCond('pruneCond1', $this->getAliasedColName(ModuleImageI18nTableMap::LOCALE), $moduleImageI18n->getLocale(), Criteria::NOT_EQUAL);
+ $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the module_image_i18n 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(ModuleImageI18nTableMap::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).
+ ModuleImageI18nTableMap::clearInstancePool();
+ ModuleImageI18nTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildModuleImageI18n or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildModuleImageI18n 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(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(ModuleImageI18nTableMap::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();
+
+
+ ModuleImageI18nTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ ModuleImageI18nTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // ModuleImageI18nQuery
diff --git a/core/lib/Thelia/Model/Base/AttributeCategoryQuery.php b/core/lib/Thelia/Model/Base/ModuleImageQuery.php
similarity index 50%
rename from core/lib/Thelia/Model/Base/AttributeCategoryQuery.php
rename to core/lib/Thelia/Model/Base/ModuleImageQuery.php
index d325d2037..966e686ad 100644
--- a/core/lib/Thelia/Model/Base/AttributeCategoryQuery.php
+++ b/core/lib/Thelia/Model/Base/ModuleImageQuery.php
@@ -12,84 +12,89 @@ use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
-use Thelia\Model\AttributeCategory as ChildAttributeCategory;
-use Thelia\Model\AttributeCategoryQuery as ChildAttributeCategoryQuery;
-use Thelia\Model\Map\AttributeCategoryTableMap;
+use Thelia\Model\ModuleImage as ChildModuleImage;
+use Thelia\Model\ModuleImageI18nQuery as ChildModuleImageI18nQuery;
+use Thelia\Model\ModuleImageQuery as ChildModuleImageQuery;
+use Thelia\Model\Map\ModuleImageTableMap;
/**
- * Base class that represents a query for the 'attribute_category' table.
+ * Base class that represents a query for the 'module_image' table.
*
*
*
- * @method ChildAttributeCategoryQuery orderById($order = Criteria::ASC) Order by the id column
- * @method ChildAttributeCategoryQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
- * @method ChildAttributeCategoryQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
- * @method ChildAttributeCategoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
- * @method ChildAttributeCategoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
+ * @method ChildModuleImageQuery orderById($order = Criteria::ASC) Order by the id column
+ * @method ChildModuleImageQuery orderByModuleId($order = Criteria::ASC) Order by the module_id column
+ * @method ChildModuleImageQuery orderByFile($order = Criteria::ASC) Order by the file column
+ * @method ChildModuleImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
+ * @method ChildModuleImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
+ * @method ChildModuleImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
- * @method ChildAttributeCategoryQuery groupById() Group by the id column
- * @method ChildAttributeCategoryQuery groupByCategoryId() Group by the category_id column
- * @method ChildAttributeCategoryQuery groupByAttributeId() Group by the attribute_id column
- * @method ChildAttributeCategoryQuery groupByCreatedAt() Group by the created_at column
- * @method ChildAttributeCategoryQuery groupByUpdatedAt() Group by the updated_at column
+ * @method ChildModuleImageQuery groupById() Group by the id column
+ * @method ChildModuleImageQuery groupByModuleId() Group by the module_id column
+ * @method ChildModuleImageQuery groupByFile() Group by the file column
+ * @method ChildModuleImageQuery groupByPosition() Group by the position column
+ * @method ChildModuleImageQuery groupByCreatedAt() Group by the created_at column
+ * @method ChildModuleImageQuery groupByUpdatedAt() Group by the updated_at column
*
- * @method ChildAttributeCategoryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
- * @method ChildAttributeCategoryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
- * @method ChildAttributeCategoryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
+ * @method ChildModuleImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
+ * @method ChildModuleImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
+ * @method ChildModuleImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
- * @method ChildAttributeCategoryQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
- * @method ChildAttributeCategoryQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
- * @method ChildAttributeCategoryQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
+ * @method ChildModuleImageQuery leftJoinModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the Module relation
+ * @method ChildModuleImageQuery rightJoinModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Module relation
+ * @method ChildModuleImageQuery innerJoinModule($relationAlias = null) Adds a INNER JOIN clause to the query using the Module relation
*
- * @method ChildAttributeCategoryQuery leftJoinAttribute($relationAlias = null) Adds a LEFT JOIN clause to the query using the Attribute relation
- * @method ChildAttributeCategoryQuery rightJoinAttribute($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Attribute relation
- * @method ChildAttributeCategoryQuery innerJoinAttribute($relationAlias = null) Adds a INNER JOIN clause to the query using the Attribute relation
+ * @method ChildModuleImageQuery leftJoinModuleImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleImageI18n relation
+ * @method ChildModuleImageQuery rightJoinModuleImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleImageI18n relation
+ * @method ChildModuleImageQuery innerJoinModuleImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleImageI18n relation
*
- * @method ChildAttributeCategory findOne(ConnectionInterface $con = null) Return the first ChildAttributeCategory matching the query
- * @method ChildAttributeCategory findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAttributeCategory matching the query, or a new ChildAttributeCategory object populated from the query conditions when no match is found
+ * @method ChildModuleImage findOne(ConnectionInterface $con = null) Return the first ChildModuleImage matching the query
+ * @method ChildModuleImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildModuleImage matching the query, or a new ChildModuleImage object populated from the query conditions when no match is found
*
- * @method ChildAttributeCategory findOneById(int $id) Return the first ChildAttributeCategory filtered by the id column
- * @method ChildAttributeCategory findOneByCategoryId(int $category_id) Return the first ChildAttributeCategory filtered by the category_id column
- * @method ChildAttributeCategory findOneByAttributeId(int $attribute_id) Return the first ChildAttributeCategory filtered by the attribute_id column
- * @method ChildAttributeCategory findOneByCreatedAt(string $created_at) Return the first ChildAttributeCategory filtered by the created_at column
- * @method ChildAttributeCategory findOneByUpdatedAt(string $updated_at) Return the first ChildAttributeCategory filtered by the updated_at column
+ * @method ChildModuleImage findOneById(int $id) Return the first ChildModuleImage filtered by the id column
+ * @method ChildModuleImage findOneByModuleId(int $module_id) Return the first ChildModuleImage filtered by the module_id column
+ * @method ChildModuleImage findOneByFile(string $file) Return the first ChildModuleImage filtered by the file column
+ * @method ChildModuleImage findOneByPosition(int $position) Return the first ChildModuleImage filtered by the position column
+ * @method ChildModuleImage findOneByCreatedAt(string $created_at) Return the first ChildModuleImage filtered by the created_at column
+ * @method ChildModuleImage findOneByUpdatedAt(string $updated_at) Return the first ChildModuleImage filtered by the updated_at column
*
- * @method array findById(int $id) Return ChildAttributeCategory objects filtered by the id column
- * @method array findByCategoryId(int $category_id) Return ChildAttributeCategory objects filtered by the category_id column
- * @method array findByAttributeId(int $attribute_id) Return ChildAttributeCategory objects filtered by the attribute_id column
- * @method array findByCreatedAt(string $created_at) Return ChildAttributeCategory objects filtered by the created_at column
- * @method array findByUpdatedAt(string $updated_at) Return ChildAttributeCategory objects filtered by the updated_at column
+ * @method array findById(int $id) Return ChildModuleImage objects filtered by the id column
+ * @method array findByModuleId(int $module_id) Return ChildModuleImage objects filtered by the module_id column
+ * @method array findByFile(string $file) Return ChildModuleImage objects filtered by the file column
+ * @method array findByPosition(int $position) Return ChildModuleImage objects filtered by the position column
+ * @method array findByCreatedAt(string $created_at) Return ChildModuleImage objects filtered by the created_at column
+ * @method array findByUpdatedAt(string $updated_at) Return ChildModuleImage objects filtered by the updated_at column
*
*/
-abstract class AttributeCategoryQuery extends ModelCriteria
+abstract class ModuleImageQuery extends ModelCriteria
{
/**
- * Initializes internal state of \Thelia\Model\Base\AttributeCategoryQuery object.
+ * Initializes internal state of \Thelia\Model\Base\ModuleImageQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
- public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\AttributeCategory', $modelAlias = null)
+ public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ModuleImage', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
- * Returns a new ChildAttributeCategoryQuery object.
+ * Returns a new ChildModuleImageQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
- * @return ChildAttributeCategoryQuery
+ * @return ChildModuleImageQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
- if ($criteria instanceof \Thelia\Model\AttributeCategoryQuery) {
+ if ($criteria instanceof \Thelia\Model\ModuleImageQuery) {
return $criteria;
}
- $query = new \Thelia\Model\AttributeCategoryQuery();
+ $query = new \Thelia\Model\ModuleImageQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
@@ -112,19 +117,19 @@ abstract class AttributeCategoryQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
- * @return ChildAttributeCategory|array|mixed the result, formatted by the current formatter
+ * @return ChildModuleImage|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
- if ((null !== ($obj = AttributeCategoryTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ if ((null !== ($obj = ModuleImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(AttributeCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getReadConnection(ModuleImageTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
@@ -143,11 +148,11 @@ abstract class AttributeCategoryQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
- * @return ChildAttributeCategory A model object, or null if the key is not found
+ * @return ChildModuleImage A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, CATEGORY_ID, ATTRIBUTE_ID, CREATED_AT, UPDATED_AT FROM attribute_category WHERE ID = :p0';
+ $sql = 'SELECT ID, MODULE_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM module_image WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -158,9 +163,9 @@ abstract class AttributeCategoryQuery extends ModelCriteria
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
- $obj = new ChildAttributeCategory();
+ $obj = new ChildModuleImage();
$obj->hydrate($row);
- AttributeCategoryTableMap::addInstanceToPool($obj, (string) $key);
+ ModuleImageTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
@@ -173,7 +178,7 @@ abstract class AttributeCategoryQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
- * @return ChildAttributeCategory|array|mixed the result, formatted by the current formatter
+ * @return ChildModuleImage|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
@@ -215,12 +220,12 @@ abstract class AttributeCategoryQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
- return $this->addUsingAlias(AttributeCategoryTableMap::ID, $key, Criteria::EQUAL);
+ return $this->addUsingAlias(ModuleImageTableMap::ID, $key, Criteria::EQUAL);
}
/**
@@ -228,12 +233,12 @@ abstract class AttributeCategoryQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
- return $this->addUsingAlias(AttributeCategoryTableMap::ID, $keys, Criteria::IN);
+ return $this->addUsingAlias(ModuleImageTableMap::ID, $keys, Criteria::IN);
}
/**
@@ -252,18 +257,18 @@ abstract class AttributeCategoryQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery 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(AttributeCategoryTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(ModuleImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
- $this->addUsingAlias(AttributeCategoryTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(ModuleImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -274,39 +279,39 @@ abstract class AttributeCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(AttributeCategoryTableMap::ID, $id, $comparison);
+ return $this->addUsingAlias(ModuleImageTableMap::ID, $id, $comparison);
}
/**
- * Filter the query on the category_id column
+ * Filter the query on the module_id column
*
* Example usage:
*
- * $query->filterByCategoryId(1234); // WHERE category_id = 1234
- * $query->filterByCategoryId(array(12, 34)); // WHERE category_id IN (12, 34)
- * $query->filterByCategoryId(array('min' => 12)); // WHERE category_id > 12
+ * $query->filterByModuleId(1234); // WHERE module_id = 1234
+ * $query->filterByModuleId(array(12, 34)); // WHERE module_id IN (12, 34)
+ * $query->filterByModuleId(array('min' => 12)); // WHERE module_id > 12
*
*
- * @see filterByCategory()
+ * @see filterByModule()
*
- * @param mixed $categoryId The value to use as filter.
+ * @param mixed $moduleId 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 ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
- public function filterByCategoryId($categoryId = null, $comparison = null)
+ public function filterByModuleId($moduleId = null, $comparison = null)
{
- if (is_array($categoryId)) {
+ if (is_array($moduleId)) {
$useMinMax = false;
- if (isset($categoryId['min'])) {
- $this->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
+ if (isset($moduleId['min'])) {
+ $this->addUsingAlias(ModuleImageTableMap::MODULE_ID, $moduleId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($categoryId['max'])) {
- $this->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
+ if (isset($moduleId['max'])) {
+ $this->addUsingAlias(ModuleImageTableMap::MODULE_ID, $moduleId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -317,39 +322,66 @@ abstract class AttributeCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $categoryId, $comparison);
+ return $this->addUsingAlias(ModuleImageTableMap::MODULE_ID, $moduleId, $comparison);
}
/**
- * Filter the query on the attribute_id column
+ * Filter the query on the file column
*
* Example usage:
*
- * $query->filterByAttributeId(1234); // WHERE attribute_id = 1234
- * $query->filterByAttributeId(array(12, 34)); // WHERE attribute_id IN (12, 34)
- * $query->filterByAttributeId(array('min' => 12)); // WHERE attribute_id > 12
+ * $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
+ * $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
*
*
- * @see filterByAttribute()
+ * @param string $file 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
*
- * @param mixed $attributeId The value to use as filter.
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByFile($file = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($file)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $file)) {
+ $file = str_replace('*', '%', $file);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageTableMap::FILE, $file, $comparison);
+ }
+
+ /**
+ * Filter the query on the position column
+ *
+ * Example usage:
+ *
+ * $query->filterByPosition(1234); // WHERE position = 1234
+ * $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
+ * $query->filterByPosition(array('min' => 12)); // WHERE position > 12
+ *
+ *
+ * @param mixed $position 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 ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
- public function filterByAttributeId($attributeId = null, $comparison = null)
+ public function filterByPosition($position = null, $comparison = null)
{
- if (is_array($attributeId)) {
+ if (is_array($position)) {
$useMinMax = false;
- if (isset($attributeId['min'])) {
- $this->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
+ if (isset($position['min'])) {
+ $this->addUsingAlias(ModuleImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($attributeId['max'])) {
- $this->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
+ if (isset($position['max'])) {
+ $this->addUsingAlias(ModuleImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -360,7 +392,7 @@ abstract class AttributeCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attributeId, $comparison);
+ return $this->addUsingAlias(ModuleImageTableMap::POSITION, $position, $comparison);
}
/**
@@ -381,18 +413,18 @@ abstract class AttributeCategoryQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery 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(AttributeCategoryTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
- $this->addUsingAlias(AttributeCategoryTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -403,7 +435,7 @@ abstract class AttributeCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(AttributeCategoryTableMap::CREATED_AT, $createdAt, $comparison);
+ return $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
@@ -424,18 +456,18 @@ abstract class AttributeCategoryQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery 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(AttributeCategoryTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
- $this->addUsingAlias(AttributeCategoryTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -446,46 +478,46 @@ abstract class AttributeCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(AttributeCategoryTableMap::UPDATED_AT, $updatedAt, $comparison);
+ return $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
- * Filter the query by a related \Thelia\Model\Category object
+ * Filter the query by a related \Thelia\Model\Module object
*
- * @param \Thelia\Model\Category|ObjectCollection $category The related object(s) to use as filter
+ * @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
- public function filterByCategory($category, $comparison = null)
+ public function filterByModule($module, $comparison = null)
{
- if ($category instanceof \Thelia\Model\Category) {
+ if ($module instanceof \Thelia\Model\Module) {
return $this
- ->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $category->getId(), $comparison);
- } elseif ($category instanceof ObjectCollection) {
+ ->addUsingAlias(ModuleImageTableMap::MODULE_ID, $module->getId(), $comparison);
+ } elseif ($module instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(ModuleImageTableMap::MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
- throw new PropelException('filterByCategory() only accepts arguments of type \Thelia\Model\Category or Collection');
+ throw new PropelException('filterByModule() only accepts arguments of type \Thelia\Model\Module or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the Category relation
+ * Adds a JOIN clause to the query using the Module relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
- public function joinCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinModule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Category');
+ $relationMap = $tableMap->getRelation('Module');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -500,14 +532,14 @@ abstract class AttributeCategoryQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'Category');
+ $this->addJoinObject($join, 'Module');
}
return $this;
}
/**
- * Use the Category relation Category object
+ * Use the Module relation Module object
*
* @see useQuery()
*
@@ -515,52 +547,50 @@ abstract class AttributeCategoryQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return \Thelia\Model\CategoryQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\ModuleQuery A secondary query class using the current class as primary query
*/
- public function useCategoryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useModuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinCategory($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Category', '\Thelia\Model\CategoryQuery');
+ ->joinModule($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Module', '\Thelia\Model\ModuleQuery');
}
/**
- * Filter the query by a related \Thelia\Model\Attribute object
+ * Filter the query by a related \Thelia\Model\ModuleImageI18n object
*
- * @param \Thelia\Model\Attribute|ObjectCollection $attribute The related object(s) to use as filter
+ * @param \Thelia\Model\ModuleImageI18n|ObjectCollection $moduleImageI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
- public function filterByAttribute($attribute, $comparison = null)
+ public function filterByModuleImageI18n($moduleImageI18n, $comparison = null)
{
- if ($attribute instanceof \Thelia\Model\Attribute) {
+ if ($moduleImageI18n instanceof \Thelia\Model\ModuleImageI18n) {
return $this
- ->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attribute->getId(), $comparison);
- } elseif ($attribute instanceof ObjectCollection) {
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
-
+ ->addUsingAlias(ModuleImageTableMap::ID, $moduleImageI18n->getId(), $comparison);
+ } elseif ($moduleImageI18n instanceof ObjectCollection) {
return $this
- ->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->useModuleImageI18nQuery()
+ ->filterByPrimaryKeys($moduleImageI18n->getPrimaryKeys())
+ ->endUse();
} else {
- throw new PropelException('filterByAttribute() only accepts arguments of type \Thelia\Model\Attribute or Collection');
+ throw new PropelException('filterByModuleImageI18n() only accepts arguments of type \Thelia\Model\ModuleImageI18n or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the Attribute relation
+ * Adds a JOIN clause to the query using the ModuleImageI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
- public function joinAttribute($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinModuleImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Attribute');
+ $relationMap = $tableMap->getRelation('ModuleImageI18n');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -575,14 +605,14 @@ abstract class AttributeCategoryQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'Attribute');
+ $this->addJoinObject($join, 'ModuleImageI18n');
}
return $this;
}
/**
- * Use the Attribute relation Attribute object
+ * Use the ModuleImageI18n relation ModuleImageI18n object
*
* @see useQuery()
*
@@ -590,33 +620,33 @@ abstract class AttributeCategoryQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return \Thelia\Model\AttributeQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\ModuleImageI18nQuery A secondary query class using the current class as primary query
*/
- public function useAttributeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useModuleImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
- ->joinAttribute($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Attribute', '\Thelia\Model\AttributeQuery');
+ ->joinModuleImageI18n($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ModuleImageI18n', '\Thelia\Model\ModuleImageI18nQuery');
}
/**
* Exclude object from result
*
- * @param ChildAttributeCategory $attributeCategory Object to remove from the list of results
+ * @param ChildModuleImage $moduleImage Object to remove from the list of results
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
- public function prune($attributeCategory = null)
+ public function prune($moduleImage = null)
{
- if ($attributeCategory) {
- $this->addUsingAlias(AttributeCategoryTableMap::ID, $attributeCategory->getId(), Criteria::NOT_EQUAL);
+ if ($moduleImage) {
+ $this->addUsingAlias(ModuleImageTableMap::ID, $moduleImage->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
- * Deletes all rows from the attribute_category table.
+ * Deletes all rows from the module_image table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
@@ -624,7 +654,7 @@ abstract class AttributeCategoryQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(AttributeCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
@@ -635,8 +665,8 @@ abstract class AttributeCategoryQuery extends ModelCriteria
// 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).
- AttributeCategoryTableMap::clearInstancePool();
- AttributeCategoryTableMap::clearRelatedInstancePool();
+ ModuleImageTableMap::clearInstancePool();
+ ModuleImageTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
@@ -648,9 +678,9 @@ abstract class AttributeCategoryQuery extends ModelCriteria
}
/**
- * Performs a DELETE on the database, given a ChildAttributeCategory or Criteria object OR a primary key value.
+ * Performs a DELETE on the database, given a ChildModuleImage or Criteria object OR a primary key value.
*
- * @param mixed $values Criteria or ChildAttributeCategory object or primary key or array of primary keys
+ * @param mixed $values Criteria or ChildModuleImage 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
@@ -661,13 +691,13 @@ abstract class AttributeCategoryQuery extends ModelCriteria
public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(AttributeCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
- $criteria->setDbName(AttributeCategoryTableMap::DATABASE_NAME);
+ $criteria->setDbName(ModuleImageTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
@@ -677,10 +707,10 @@ abstract class AttributeCategoryQuery extends ModelCriteria
$con->beginTransaction();
- AttributeCategoryTableMap::removeInstanceFromPool($criteria);
+ ModuleImageTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
- AttributeCategoryTableMap::clearRelatedInstancePool();
+ ModuleImageTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
@@ -697,11 +727,11 @@ abstract class AttributeCategoryQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of the latest update in days
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
- return $this->addUsingAlias(AttributeCategoryTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ return $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
@@ -709,51 +739,108 @@ abstract class AttributeCategoryQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of in days
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
- return $this->addUsingAlias(AttributeCategoryTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ return $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
- return $this->addDescendingOrderByColumn(AttributeCategoryTableMap::UPDATED_AT);
+ return $this->addDescendingOrderByColumn(ModuleImageTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
- return $this->addAscendingOrderByColumn(AttributeCategoryTableMap::UPDATED_AT);
+ return $this->addAscendingOrderByColumn(ModuleImageTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
- return $this->addDescendingOrderByColumn(AttributeCategoryTableMap::CREATED_AT);
+ return $this->addDescendingOrderByColumn(ModuleImageTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
- * @return ChildAttributeCategoryQuery The current query, for fluid interface
+ * @return ChildModuleImageQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
- return $this->addAscendingOrderByColumn(AttributeCategoryTableMap::CREATED_AT);
+ return $this->addAscendingOrderByColumn(ModuleImageTableMap::CREATED_AT);
}
-} // AttributeCategoryQuery
+ // i18n behavior
+
+ /**
+ * Adds a JOIN clause to the query using the i18n relation
+ *
+ * @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ {
+ $relationName = $relationAlias ? $relationAlias : 'ModuleImageI18n';
+
+ return $this
+ ->joinModuleImageI18n($relationAlias, $joinType)
+ ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
+ }
+
+ /**
+ * Adds a JOIN clause to the query and hydrates the related I18n object.
+ * Shortcut for $c->joinI18n($locale)->with()
+ *
+ * @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
+ {
+ $this
+ ->joinI18n($locale, null, $joinType)
+ ->with('ModuleImageI18n');
+ $this->with['ModuleImageI18n']->setIsWithOneToMany(false);
+
+ return $this;
+ }
+
+ /**
+ * Use the I18n relation query object
+ *
+ * @see useQuery()
+ *
+ * @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
+ *
+ * @return ChildModuleImageI18nQuery A secondary query class using the current class as primary query
+ */
+ public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ {
+ return $this
+ ->joinI18n($locale, $relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ModuleImageI18n', '\Thelia\Model\ModuleImageI18nQuery');
+ }
+
+} // ModuleImageQuery
diff --git a/core/lib/Thelia/Model/Base/ModuleQuery.php b/core/lib/Thelia/Model/Base/ModuleQuery.php
index 0ed6c5293..4031a4f63 100644
--- a/core/lib/Thelia/Model/Base/ModuleQuery.php
+++ b/core/lib/Thelia/Model/Base/ModuleQuery.php
@@ -60,6 +60,10 @@ use Thelia\Model\Map\ModuleTableMap;
* @method ChildModuleQuery rightJoinGroupModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupModule relation
* @method ChildModuleQuery innerJoinGroupModule($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupModule relation
*
+ * @method ChildModuleQuery leftJoinModuleImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleImage relation
+ * @method ChildModuleQuery rightJoinModuleImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleImage relation
+ * @method ChildModuleQuery innerJoinModuleImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleImage relation
+ *
* @method ChildModuleQuery leftJoinModuleI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleI18n relation
* @method ChildModuleQuery rightJoinModuleI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleI18n relation
* @method ChildModuleQuery innerJoinModuleI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleI18n relation
@@ -861,6 +865,79 @@ abstract class ModuleQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'GroupModule', '\Thelia\Model\GroupModuleQuery');
}
+ /**
+ * Filter the query by a related \Thelia\Model\ModuleImage object
+ *
+ * @param \Thelia\Model\ModuleImage|ObjectCollection $moduleImage the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleQuery The current query, for fluid interface
+ */
+ public function filterByModuleImage($moduleImage, $comparison = null)
+ {
+ if ($moduleImage instanceof \Thelia\Model\ModuleImage) {
+ return $this
+ ->addUsingAlias(ModuleTableMap::ID, $moduleImage->getModuleId(), $comparison);
+ } elseif ($moduleImage instanceof ObjectCollection) {
+ return $this
+ ->useModuleImageQuery()
+ ->filterByPrimaryKeys($moduleImage->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByModuleImage() only accepts arguments of type \Thelia\Model\ModuleImage or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the ModuleImage relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildModuleQuery The current query, for fluid interface
+ */
+ public function joinModuleImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('ModuleImage');
+
+ // 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, 'ModuleImage');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the ModuleImage relation ModuleImage object
+ *
+ * @see useQuery()
+ *
+ * @param string $relationAlias optional alias for the relation,
+ * to be used as main alias in the secondary query
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return \Thelia\Model\ModuleImageQuery A secondary query class using the current class as primary query
+ */
+ public function useModuleImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinModuleImage($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ModuleImage', '\Thelia\Model\ModuleImageQuery');
+ }
+
/**
* Filter the query by a related \Thelia\Model\ModuleI18n object
*
diff --git a/core/lib/Thelia/Model/Base/OrderProduct.php b/core/lib/Thelia/Model/Base/OrderProduct.php
index 2bf9c7ace..6ff03d427 100644
--- a/core/lib/Thelia/Model/Base/OrderProduct.php
+++ b/core/lib/Thelia/Model/Base/OrderProduct.php
@@ -18,10 +18,12 @@ use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Order as ChildOrder;
-use Thelia\Model\OrderFeature as ChildOrderFeature;
-use Thelia\Model\OrderFeatureQuery as ChildOrderFeatureQuery;
use Thelia\Model\OrderProduct as ChildOrderProduct;
+use Thelia\Model\OrderProductAttributeCombination as ChildOrderProductAttributeCombination;
+use Thelia\Model\OrderProductAttributeCombinationQuery as ChildOrderProductAttributeCombinationQuery;
use Thelia\Model\OrderProductQuery as ChildOrderProductQuery;
+use Thelia\Model\OrderProductTax as ChildOrderProductTax;
+use Thelia\Model\OrderProductTaxQuery as ChildOrderProductTaxQuery;
use Thelia\Model\OrderQuery as ChildOrderQuery;
use Thelia\Model\Map\OrderProductTableMap;
@@ -77,12 +79,24 @@ abstract class OrderProduct implements ActiveRecordInterface
*/
protected $product_ref;
+ /**
+ * The value for the product_sale_elements_ref field.
+ * @var string
+ */
+ protected $product_sale_elements_ref;
+
/**
* The value for the title field.
* @var string
*/
protected $title;
+ /**
+ * The value for the chapo field.
+ * @var string
+ */
+ protected $chapo;
+
/**
* The value for the description field.
* @var string
@@ -90,10 +104,10 @@ abstract class OrderProduct implements ActiveRecordInterface
protected $description;
/**
- * The value for the chapo field.
+ * The value for the postscriptum field.
* @var string
*/
- protected $chapo;
+ protected $postscriptum;
/**
* The value for the quantity field.
@@ -108,10 +122,40 @@ abstract class OrderProduct implements ActiveRecordInterface
protected $price;
/**
- * The value for the tax field.
- * @var double
+ * The value for the promo_price field.
+ * @var string
*/
- protected $tax;
+ protected $promo_price;
+
+ /**
+ * The value for the was_new field.
+ * @var int
+ */
+ protected $was_new;
+
+ /**
+ * The value for the was_in_promo field.
+ * @var int
+ */
+ protected $was_in_promo;
+
+ /**
+ * The value for the weight field.
+ * @var string
+ */
+ protected $weight;
+
+ /**
+ * The value for the tax_rule_title field.
+ * @var string
+ */
+ protected $tax_rule_title;
+
+ /**
+ * The value for the tax_rule_description field.
+ * @var string
+ */
+ protected $tax_rule_description;
/**
* The value for the parent field.
@@ -137,10 +181,16 @@ abstract class OrderProduct implements ActiveRecordInterface
protected $aOrder;
/**
- * @var ObjectCollection|ChildOrderFeature[] Collection to store aggregation of ChildOrderFeature objects.
+ * @var ObjectCollection|ChildOrderProductAttributeCombination[] Collection to store aggregation of ChildOrderProductAttributeCombination objects.
*/
- protected $collOrderFeatures;
- protected $collOrderFeaturesPartial;
+ protected $collOrderProductAttributeCombinations;
+ protected $collOrderProductAttributeCombinationsPartial;
+
+ /**
+ * @var ObjectCollection|ChildOrderProductTax[] Collection to store aggregation of ChildOrderProductTax objects.
+ */
+ protected $collOrderProductTaxes;
+ protected $collOrderProductTaxesPartial;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -154,7 +204,13 @@ abstract class OrderProduct implements ActiveRecordInterface
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
- protected $orderFeaturesScheduledForDeletion = null;
+ protected $orderProductAttributeCombinationsScheduledForDeletion = null;
+
+ /**
+ * An array of objects scheduled for deletion.
+ * @var ObjectCollection
+ */
+ protected $orderProductTaxesScheduledForDeletion = null;
/**
* Initializes internal state of Thelia\Model\Base\OrderProduct object.
@@ -443,6 +499,17 @@ abstract class OrderProduct implements ActiveRecordInterface
return $this->product_ref;
}
+ /**
+ * Get the [product_sale_elements_ref] column value.
+ *
+ * @return string
+ */
+ public function getProductSaleElementsRef()
+ {
+
+ return $this->product_sale_elements_ref;
+ }
+
/**
* Get the [title] column value.
*
@@ -454,6 +521,17 @@ abstract class OrderProduct implements ActiveRecordInterface
return $this->title;
}
+ /**
+ * Get the [chapo] column value.
+ *
+ * @return string
+ */
+ public function getChapo()
+ {
+
+ return $this->chapo;
+ }
+
/**
* Get the [description] column value.
*
@@ -466,14 +544,14 @@ abstract class OrderProduct implements ActiveRecordInterface
}
/**
- * Get the [chapo] column value.
+ * Get the [postscriptum] column value.
*
* @return string
*/
- public function getChapo()
+ public function getPostscriptum()
{
- return $this->chapo;
+ return $this->postscriptum;
}
/**
@@ -499,19 +577,74 @@ abstract class OrderProduct implements ActiveRecordInterface
}
/**
- * Get the [tax] column value.
+ * Get the [promo_price] column value.
*
- * @return double
+ * @return string
*/
- public function getTax()
+ public function getPromoPrice()
{
- return $this->tax;
+ return $this->promo_price;
+ }
+
+ /**
+ * Get the [was_new] column value.
+ *
+ * @return int
+ */
+ public function getWasNew()
+ {
+
+ return $this->was_new;
+ }
+
+ /**
+ * Get the [was_in_promo] column value.
+ *
+ * @return int
+ */
+ public function getWasInPromo()
+ {
+
+ return $this->was_in_promo;
+ }
+
+ /**
+ * Get the [weight] column value.
+ *
+ * @return string
+ */
+ public function getWeight()
+ {
+
+ return $this->weight;
+ }
+
+ /**
+ * Get the [tax_rule_title] column value.
+ *
+ * @return string
+ */
+ public function getTaxRuleTitle()
+ {
+
+ return $this->tax_rule_title;
+ }
+
+ /**
+ * Get the [tax_rule_description] column value.
+ *
+ * @return string
+ */
+ public function getTaxRuleDescription()
+ {
+
+ return $this->tax_rule_description;
}
/**
* Get the [parent] column value.
- *
+ * not managed yet
* @return int
*/
public function getParent()
@@ -627,6 +760,27 @@ abstract class OrderProduct implements ActiveRecordInterface
return $this;
} // setProductRef()
+ /**
+ * Set the value of [product_sale_elements_ref] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProduct The current object (for fluent API support)
+ */
+ public function setProductSaleElementsRef($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->product_sale_elements_ref !== $v) {
+ $this->product_sale_elements_ref = $v;
+ $this->modifiedColumns[] = OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF;
+ }
+
+
+ return $this;
+ } // setProductSaleElementsRef()
+
/**
* Set the value of [title] column.
*
@@ -648,6 +802,27 @@ abstract class OrderProduct implements ActiveRecordInterface
return $this;
} // setTitle()
+ /**
+ * Set the value of [chapo] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProduct The current object (for fluent API support)
+ */
+ public function setChapo($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->chapo !== $v) {
+ $this->chapo = $v;
+ $this->modifiedColumns[] = OrderProductTableMap::CHAPO;
+ }
+
+
+ return $this;
+ } // setChapo()
+
/**
* Set the value of [description] column.
*
@@ -670,25 +845,25 @@ abstract class OrderProduct implements ActiveRecordInterface
} // setDescription()
/**
- * Set the value of [chapo] column.
+ * Set the value of [postscriptum] column.
*
* @param string $v new value
* @return \Thelia\Model\OrderProduct The current object (for fluent API support)
*/
- public function setChapo($v)
+ public function setPostscriptum($v)
{
if ($v !== null) {
$v = (string) $v;
}
- if ($this->chapo !== $v) {
- $this->chapo = $v;
- $this->modifiedColumns[] = OrderProductTableMap::CHAPO;
+ if ($this->postscriptum !== $v) {
+ $this->postscriptum = $v;
+ $this->modifiedColumns[] = OrderProductTableMap::POSTSCRIPTUM;
}
return $this;
- } // setChapo()
+ } // setPostscriptum()
/**
* Set the value of [quantity] column.
@@ -733,29 +908,134 @@ abstract class OrderProduct implements ActiveRecordInterface
} // setPrice()
/**
- * Set the value of [tax] column.
+ * Set the value of [promo_price] column.
*
- * @param double $v new value
+ * @param string $v new value
* @return \Thelia\Model\OrderProduct The current object (for fluent API support)
*/
- public function setTax($v)
+ public function setPromoPrice($v)
{
if ($v !== null) {
- $v = (double) $v;
+ $v = (string) $v;
}
- if ($this->tax !== $v) {
- $this->tax = $v;
- $this->modifiedColumns[] = OrderProductTableMap::TAX;
+ if ($this->promo_price !== $v) {
+ $this->promo_price = $v;
+ $this->modifiedColumns[] = OrderProductTableMap::PROMO_PRICE;
}
return $this;
- } // setTax()
+ } // setPromoPrice()
+
+ /**
+ * Set the value of [was_new] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\OrderProduct The current object (for fluent API support)
+ */
+ public function setWasNew($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->was_new !== $v) {
+ $this->was_new = $v;
+ $this->modifiedColumns[] = OrderProductTableMap::WAS_NEW;
+ }
+
+
+ return $this;
+ } // setWasNew()
+
+ /**
+ * Set the value of [was_in_promo] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\OrderProduct The current object (for fluent API support)
+ */
+ public function setWasInPromo($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->was_in_promo !== $v) {
+ $this->was_in_promo = $v;
+ $this->modifiedColumns[] = OrderProductTableMap::WAS_IN_PROMO;
+ }
+
+
+ return $this;
+ } // setWasInPromo()
+
+ /**
+ * Set the value of [weight] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProduct The current object (for fluent API support)
+ */
+ public function setWeight($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->weight !== $v) {
+ $this->weight = $v;
+ $this->modifiedColumns[] = OrderProductTableMap::WEIGHT;
+ }
+
+
+ return $this;
+ } // setWeight()
+
+ /**
+ * Set the value of [tax_rule_title] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProduct The current object (for fluent API support)
+ */
+ public function setTaxRuleTitle($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->tax_rule_title !== $v) {
+ $this->tax_rule_title = $v;
+ $this->modifiedColumns[] = OrderProductTableMap::TAX_RULE_TITLE;
+ }
+
+
+ return $this;
+ } // setTaxRuleTitle()
+
+ /**
+ * Set the value of [tax_rule_description] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProduct The current object (for fluent API support)
+ */
+ public function setTaxRuleDescription($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->tax_rule_description !== $v) {
+ $this->tax_rule_description = $v;
+ $this->modifiedColumns[] = OrderProductTableMap::TAX_RULE_DESCRIPTION;
+ }
+
+
+ return $this;
+ } // setTaxRuleDescription()
/**
* Set the value of [parent] column.
- *
+ * not managed yet
* @param int $v new value
* @return \Thelia\Model\OrderProduct The current object (for fluent API support)
*/
@@ -862,34 +1142,55 @@ abstract class OrderProduct implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : OrderProductTableMap::translateFieldName('ProductRef', TableMap::TYPE_PHPNAME, $indexType)];
$this->product_ref = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : OrderProductTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
- $this->title = (null !== $col) ? (string) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : OrderProductTableMap::translateFieldName('ProductSaleElementsRef', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->product_sale_elements_ref = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : OrderProductTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
- $this->description = (null !== $col) ? (string) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : OrderProductTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->title = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : OrderProductTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
$this->chapo = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : OrderProductTableMap::translateFieldName('Quantity', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : OrderProductTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->description = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : OrderProductTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->postscriptum = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : OrderProductTableMap::translateFieldName('Quantity', TableMap::TYPE_PHPNAME, $indexType)];
$this->quantity = (null !== $col) ? (double) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : OrderProductTableMap::translateFieldName('Price', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : OrderProductTableMap::translateFieldName('Price', TableMap::TYPE_PHPNAME, $indexType)];
$this->price = (null !== $col) ? (double) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : OrderProductTableMap::translateFieldName('Tax', TableMap::TYPE_PHPNAME, $indexType)];
- $this->tax = (null !== $col) ? (double) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : OrderProductTableMap::translateFieldName('PromoPrice', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->promo_price = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : OrderProductTableMap::translateFieldName('Parent', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : OrderProductTableMap::translateFieldName('WasNew', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->was_new = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : OrderProductTableMap::translateFieldName('WasInPromo', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->was_in_promo = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : OrderProductTableMap::translateFieldName('Weight', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->weight = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : OrderProductTableMap::translateFieldName('TaxRuleTitle', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->tax_rule_title = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : OrderProductTableMap::translateFieldName('TaxRuleDescription', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->tax_rule_description = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : OrderProductTableMap::translateFieldName('Parent', TableMap::TYPE_PHPNAME, $indexType)];
$this->parent = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : OrderProductTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : OrderProductTableMap::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 ? 11 + $startcol : OrderProductTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 18 + $startcol : OrderProductTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -902,7 +1203,7 @@ abstract class OrderProduct implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 12; // 12 = OrderProductTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 19; // 19 = OrderProductTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\OrderProduct object", 0, $e);
@@ -967,7 +1268,9 @@ abstract class OrderProduct implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->aOrder = null;
- $this->collOrderFeatures = null;
+ $this->collOrderProductAttributeCombinations = null;
+
+ $this->collOrderProductTaxes = null;
} // if (deep)
}
@@ -1114,17 +1417,34 @@ abstract class OrderProduct implements ActiveRecordInterface
$this->resetModified();
}
- if ($this->orderFeaturesScheduledForDeletion !== null) {
- if (!$this->orderFeaturesScheduledForDeletion->isEmpty()) {
- \Thelia\Model\OrderFeatureQuery::create()
- ->filterByPrimaryKeys($this->orderFeaturesScheduledForDeletion->getPrimaryKeys(false))
+ if ($this->orderProductAttributeCombinationsScheduledForDeletion !== null) {
+ if (!$this->orderProductAttributeCombinationsScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\OrderProductAttributeCombinationQuery::create()
+ ->filterByPrimaryKeys($this->orderProductAttributeCombinationsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
- $this->orderFeaturesScheduledForDeletion = null;
+ $this->orderProductAttributeCombinationsScheduledForDeletion = null;
}
}
- if ($this->collOrderFeatures !== null) {
- foreach ($this->collOrderFeatures as $referrerFK) {
+ if ($this->collOrderProductAttributeCombinations !== null) {
+ foreach ($this->collOrderProductAttributeCombinations as $referrerFK) {
+ if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
+ if ($this->orderProductTaxesScheduledForDeletion !== null) {
+ if (!$this->orderProductTaxesScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\OrderProductTaxQuery::create()
+ ->filterByPrimaryKeys($this->orderProductTaxesScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->orderProductTaxesScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collOrderProductTaxes !== null) {
+ foreach ($this->collOrderProductTaxes as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
@@ -1166,14 +1486,20 @@ abstract class OrderProduct implements ActiveRecordInterface
if ($this->isColumnModified(OrderProductTableMap::PRODUCT_REF)) {
$modifiedColumns[':p' . $index++] = 'PRODUCT_REF';
}
+ if ($this->isColumnModified(OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF)) {
+ $modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_REF';
+ }
if ($this->isColumnModified(OrderProductTableMap::TITLE)) {
$modifiedColumns[':p' . $index++] = 'TITLE';
}
+ if ($this->isColumnModified(OrderProductTableMap::CHAPO)) {
+ $modifiedColumns[':p' . $index++] = 'CHAPO';
+ }
if ($this->isColumnModified(OrderProductTableMap::DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
}
- if ($this->isColumnModified(OrderProductTableMap::CHAPO)) {
- $modifiedColumns[':p' . $index++] = 'CHAPO';
+ if ($this->isColumnModified(OrderProductTableMap::POSTSCRIPTUM)) {
+ $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
}
if ($this->isColumnModified(OrderProductTableMap::QUANTITY)) {
$modifiedColumns[':p' . $index++] = 'QUANTITY';
@@ -1181,8 +1507,23 @@ abstract class OrderProduct implements ActiveRecordInterface
if ($this->isColumnModified(OrderProductTableMap::PRICE)) {
$modifiedColumns[':p' . $index++] = 'PRICE';
}
- if ($this->isColumnModified(OrderProductTableMap::TAX)) {
- $modifiedColumns[':p' . $index++] = 'TAX';
+ if ($this->isColumnModified(OrderProductTableMap::PROMO_PRICE)) {
+ $modifiedColumns[':p' . $index++] = 'PROMO_PRICE';
+ }
+ if ($this->isColumnModified(OrderProductTableMap::WAS_NEW)) {
+ $modifiedColumns[':p' . $index++] = 'WAS_NEW';
+ }
+ if ($this->isColumnModified(OrderProductTableMap::WAS_IN_PROMO)) {
+ $modifiedColumns[':p' . $index++] = 'WAS_IN_PROMO';
+ }
+ if ($this->isColumnModified(OrderProductTableMap::WEIGHT)) {
+ $modifiedColumns[':p' . $index++] = 'WEIGHT';
+ }
+ if ($this->isColumnModified(OrderProductTableMap::TAX_RULE_TITLE)) {
+ $modifiedColumns[':p' . $index++] = 'TAX_RULE_TITLE';
+ }
+ if ($this->isColumnModified(OrderProductTableMap::TAX_RULE_DESCRIPTION)) {
+ $modifiedColumns[':p' . $index++] = 'TAX_RULE_DESCRIPTION';
}
if ($this->isColumnModified(OrderProductTableMap::PARENT)) {
$modifiedColumns[':p' . $index++] = 'PARENT';
@@ -1213,14 +1554,20 @@ abstract class OrderProduct implements ActiveRecordInterface
case 'PRODUCT_REF':
$stmt->bindValue($identifier, $this->product_ref, PDO::PARAM_STR);
break;
+ case 'PRODUCT_SALE_ELEMENTS_REF':
+ $stmt->bindValue($identifier, $this->product_sale_elements_ref, PDO::PARAM_STR);
+ break;
case 'TITLE':
$stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
break;
+ case 'CHAPO':
+ $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR);
+ break;
case 'DESCRIPTION':
$stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
break;
- case 'CHAPO':
- $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR);
+ case 'POSTSCRIPTUM':
+ $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR);
break;
case 'QUANTITY':
$stmt->bindValue($identifier, $this->quantity, PDO::PARAM_STR);
@@ -1228,8 +1575,23 @@ abstract class OrderProduct implements ActiveRecordInterface
case 'PRICE':
$stmt->bindValue($identifier, $this->price, PDO::PARAM_STR);
break;
- case 'TAX':
- $stmt->bindValue($identifier, $this->tax, PDO::PARAM_STR);
+ case 'PROMO_PRICE':
+ $stmt->bindValue($identifier, $this->promo_price, PDO::PARAM_STR);
+ break;
+ case 'WAS_NEW':
+ $stmt->bindValue($identifier, $this->was_new, PDO::PARAM_INT);
+ break;
+ case 'WAS_IN_PROMO':
+ $stmt->bindValue($identifier, $this->was_in_promo, PDO::PARAM_INT);
+ break;
+ case 'WEIGHT':
+ $stmt->bindValue($identifier, $this->weight, PDO::PARAM_STR);
+ break;
+ case 'TAX_RULE_TITLE':
+ $stmt->bindValue($identifier, $this->tax_rule_title, PDO::PARAM_STR);
+ break;
+ case 'TAX_RULE_DESCRIPTION':
+ $stmt->bindValue($identifier, $this->tax_rule_description, PDO::PARAM_STR);
break;
case 'PARENT':
$stmt->bindValue($identifier, $this->parent, PDO::PARAM_INT);
@@ -1312,30 +1674,51 @@ abstract class OrderProduct implements ActiveRecordInterface
return $this->getProductRef();
break;
case 3:
- return $this->getTitle();
+ return $this->getProductSaleElementsRef();
break;
case 4:
- return $this->getDescription();
+ return $this->getTitle();
break;
case 5:
return $this->getChapo();
break;
case 6:
- return $this->getQuantity();
+ return $this->getDescription();
break;
case 7:
- return $this->getPrice();
+ return $this->getPostscriptum();
break;
case 8:
- return $this->getTax();
+ return $this->getQuantity();
break;
case 9:
- return $this->getParent();
+ return $this->getPrice();
break;
case 10:
- return $this->getCreatedAt();
+ return $this->getPromoPrice();
break;
case 11:
+ return $this->getWasNew();
+ break;
+ case 12:
+ return $this->getWasInPromo();
+ break;
+ case 13:
+ return $this->getWeight();
+ break;
+ case 14:
+ return $this->getTaxRuleTitle();
+ break;
+ case 15:
+ return $this->getTaxRuleDescription();
+ break;
+ case 16:
+ return $this->getParent();
+ break;
+ case 17:
+ return $this->getCreatedAt();
+ break;
+ case 18:
return $this->getUpdatedAt();
break;
default:
@@ -1370,15 +1753,22 @@ abstract class OrderProduct implements ActiveRecordInterface
$keys[0] => $this->getId(),
$keys[1] => $this->getOrderId(),
$keys[2] => $this->getProductRef(),
- $keys[3] => $this->getTitle(),
- $keys[4] => $this->getDescription(),
+ $keys[3] => $this->getProductSaleElementsRef(),
+ $keys[4] => $this->getTitle(),
$keys[5] => $this->getChapo(),
- $keys[6] => $this->getQuantity(),
- $keys[7] => $this->getPrice(),
- $keys[8] => $this->getTax(),
- $keys[9] => $this->getParent(),
- $keys[10] => $this->getCreatedAt(),
- $keys[11] => $this->getUpdatedAt(),
+ $keys[6] => $this->getDescription(),
+ $keys[7] => $this->getPostscriptum(),
+ $keys[8] => $this->getQuantity(),
+ $keys[9] => $this->getPrice(),
+ $keys[10] => $this->getPromoPrice(),
+ $keys[11] => $this->getWasNew(),
+ $keys[12] => $this->getWasInPromo(),
+ $keys[13] => $this->getWeight(),
+ $keys[14] => $this->getTaxRuleTitle(),
+ $keys[15] => $this->getTaxRuleDescription(),
+ $keys[16] => $this->getParent(),
+ $keys[17] => $this->getCreatedAt(),
+ $keys[18] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1390,8 +1780,11 @@ abstract class OrderProduct implements ActiveRecordInterface
if (null !== $this->aOrder) {
$result['Order'] = $this->aOrder->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
- if (null !== $this->collOrderFeatures) {
- $result['OrderFeatures'] = $this->collOrderFeatures->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ if (null !== $this->collOrderProductAttributeCombinations) {
+ $result['OrderProductAttributeCombinations'] = $this->collOrderProductAttributeCombinations->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ }
+ if (null !== $this->collOrderProductTaxes) {
+ $result['OrderProductTaxes'] = $this->collOrderProductTaxes->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
}
@@ -1437,30 +1830,51 @@ abstract class OrderProduct implements ActiveRecordInterface
$this->setProductRef($value);
break;
case 3:
- $this->setTitle($value);
+ $this->setProductSaleElementsRef($value);
break;
case 4:
- $this->setDescription($value);
+ $this->setTitle($value);
break;
case 5:
$this->setChapo($value);
break;
case 6:
- $this->setQuantity($value);
+ $this->setDescription($value);
break;
case 7:
- $this->setPrice($value);
+ $this->setPostscriptum($value);
break;
case 8:
- $this->setTax($value);
+ $this->setQuantity($value);
break;
case 9:
- $this->setParent($value);
+ $this->setPrice($value);
break;
case 10:
- $this->setCreatedAt($value);
+ $this->setPromoPrice($value);
break;
case 11:
+ $this->setWasNew($value);
+ break;
+ case 12:
+ $this->setWasInPromo($value);
+ break;
+ case 13:
+ $this->setWeight($value);
+ break;
+ case 14:
+ $this->setTaxRuleTitle($value);
+ break;
+ case 15:
+ $this->setTaxRuleDescription($value);
+ break;
+ case 16:
+ $this->setParent($value);
+ break;
+ case 17:
+ $this->setCreatedAt($value);
+ break;
+ case 18:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1490,15 +1904,22 @@ abstract class OrderProduct implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setOrderId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setProductRef($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setTitle($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setDescription($arr[$keys[4]]);
+ if (array_key_exists($keys[3], $arr)) $this->setProductSaleElementsRef($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setTitle($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setChapo($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setQuantity($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setPrice($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setTax($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setParent($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setCreatedAt($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setUpdatedAt($arr[$keys[11]]);
+ if (array_key_exists($keys[6], $arr)) $this->setDescription($arr[$keys[6]]);
+ if (array_key_exists($keys[7], $arr)) $this->setPostscriptum($arr[$keys[7]]);
+ if (array_key_exists($keys[8], $arr)) $this->setQuantity($arr[$keys[8]]);
+ if (array_key_exists($keys[9], $arr)) $this->setPrice($arr[$keys[9]]);
+ if (array_key_exists($keys[10], $arr)) $this->setPromoPrice($arr[$keys[10]]);
+ if (array_key_exists($keys[11], $arr)) $this->setWasNew($arr[$keys[11]]);
+ if (array_key_exists($keys[12], $arr)) $this->setWasInPromo($arr[$keys[12]]);
+ if (array_key_exists($keys[13], $arr)) $this->setWeight($arr[$keys[13]]);
+ if (array_key_exists($keys[14], $arr)) $this->setTaxRuleTitle($arr[$keys[14]]);
+ if (array_key_exists($keys[15], $arr)) $this->setTaxRuleDescription($arr[$keys[15]]);
+ if (array_key_exists($keys[16], $arr)) $this->setParent($arr[$keys[16]]);
+ if (array_key_exists($keys[17], $arr)) $this->setCreatedAt($arr[$keys[17]]);
+ if (array_key_exists($keys[18], $arr)) $this->setUpdatedAt($arr[$keys[18]]);
}
/**
@@ -1513,12 +1934,19 @@ abstract class OrderProduct implements ActiveRecordInterface
if ($this->isColumnModified(OrderProductTableMap::ID)) $criteria->add(OrderProductTableMap::ID, $this->id);
if ($this->isColumnModified(OrderProductTableMap::ORDER_ID)) $criteria->add(OrderProductTableMap::ORDER_ID, $this->order_id);
if ($this->isColumnModified(OrderProductTableMap::PRODUCT_REF)) $criteria->add(OrderProductTableMap::PRODUCT_REF, $this->product_ref);
+ if ($this->isColumnModified(OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF)) $criteria->add(OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF, $this->product_sale_elements_ref);
if ($this->isColumnModified(OrderProductTableMap::TITLE)) $criteria->add(OrderProductTableMap::TITLE, $this->title);
- if ($this->isColumnModified(OrderProductTableMap::DESCRIPTION)) $criteria->add(OrderProductTableMap::DESCRIPTION, $this->description);
if ($this->isColumnModified(OrderProductTableMap::CHAPO)) $criteria->add(OrderProductTableMap::CHAPO, $this->chapo);
+ if ($this->isColumnModified(OrderProductTableMap::DESCRIPTION)) $criteria->add(OrderProductTableMap::DESCRIPTION, $this->description);
+ if ($this->isColumnModified(OrderProductTableMap::POSTSCRIPTUM)) $criteria->add(OrderProductTableMap::POSTSCRIPTUM, $this->postscriptum);
if ($this->isColumnModified(OrderProductTableMap::QUANTITY)) $criteria->add(OrderProductTableMap::QUANTITY, $this->quantity);
if ($this->isColumnModified(OrderProductTableMap::PRICE)) $criteria->add(OrderProductTableMap::PRICE, $this->price);
- if ($this->isColumnModified(OrderProductTableMap::TAX)) $criteria->add(OrderProductTableMap::TAX, $this->tax);
+ if ($this->isColumnModified(OrderProductTableMap::PROMO_PRICE)) $criteria->add(OrderProductTableMap::PROMO_PRICE, $this->promo_price);
+ if ($this->isColumnModified(OrderProductTableMap::WAS_NEW)) $criteria->add(OrderProductTableMap::WAS_NEW, $this->was_new);
+ if ($this->isColumnModified(OrderProductTableMap::WAS_IN_PROMO)) $criteria->add(OrderProductTableMap::WAS_IN_PROMO, $this->was_in_promo);
+ if ($this->isColumnModified(OrderProductTableMap::WEIGHT)) $criteria->add(OrderProductTableMap::WEIGHT, $this->weight);
+ if ($this->isColumnModified(OrderProductTableMap::TAX_RULE_TITLE)) $criteria->add(OrderProductTableMap::TAX_RULE_TITLE, $this->tax_rule_title);
+ if ($this->isColumnModified(OrderProductTableMap::TAX_RULE_DESCRIPTION)) $criteria->add(OrderProductTableMap::TAX_RULE_DESCRIPTION, $this->tax_rule_description);
if ($this->isColumnModified(OrderProductTableMap::PARENT)) $criteria->add(OrderProductTableMap::PARENT, $this->parent);
if ($this->isColumnModified(OrderProductTableMap::CREATED_AT)) $criteria->add(OrderProductTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(OrderProductTableMap::UPDATED_AT)) $criteria->add(OrderProductTableMap::UPDATED_AT, $this->updated_at);
@@ -1587,12 +2015,19 @@ abstract class OrderProduct implements ActiveRecordInterface
{
$copyObj->setOrderId($this->getOrderId());
$copyObj->setProductRef($this->getProductRef());
+ $copyObj->setProductSaleElementsRef($this->getProductSaleElementsRef());
$copyObj->setTitle($this->getTitle());
- $copyObj->setDescription($this->getDescription());
$copyObj->setChapo($this->getChapo());
+ $copyObj->setDescription($this->getDescription());
+ $copyObj->setPostscriptum($this->getPostscriptum());
$copyObj->setQuantity($this->getQuantity());
$copyObj->setPrice($this->getPrice());
- $copyObj->setTax($this->getTax());
+ $copyObj->setPromoPrice($this->getPromoPrice());
+ $copyObj->setWasNew($this->getWasNew());
+ $copyObj->setWasInPromo($this->getWasInPromo());
+ $copyObj->setWeight($this->getWeight());
+ $copyObj->setTaxRuleTitle($this->getTaxRuleTitle());
+ $copyObj->setTaxRuleDescription($this->getTaxRuleDescription());
$copyObj->setParent($this->getParent());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -1602,9 +2037,15 @@ abstract class OrderProduct implements ActiveRecordInterface
// the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false);
- foreach ($this->getOrderFeatures() as $relObj) {
+ foreach ($this->getOrderProductAttributeCombinations() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
- $copyObj->addOrderFeature($relObj->copy($deepCopy));
+ $copyObj->addOrderProductAttributeCombination($relObj->copy($deepCopy));
+ }
+ }
+
+ foreach ($this->getOrderProductTaxes() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addOrderProductTax($relObj->copy($deepCopy));
}
}
@@ -1700,37 +2141,40 @@ abstract class OrderProduct implements ActiveRecordInterface
*/
public function initRelation($relationName)
{
- if ('OrderFeature' == $relationName) {
- return $this->initOrderFeatures();
+ if ('OrderProductAttributeCombination' == $relationName) {
+ return $this->initOrderProductAttributeCombinations();
+ }
+ if ('OrderProductTax' == $relationName) {
+ return $this->initOrderProductTaxes();
}
}
/**
- * Clears out the collOrderFeatures collection
+ * Clears out the collOrderProductAttributeCombinations 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 addOrderFeatures()
+ * @see addOrderProductAttributeCombinations()
*/
- public function clearOrderFeatures()
+ public function clearOrderProductAttributeCombinations()
{
- $this->collOrderFeatures = null; // important to set this to NULL since that means it is uninitialized
+ $this->collOrderProductAttributeCombinations = null; // important to set this to NULL since that means it is uninitialized
}
/**
- * Reset is the collOrderFeatures collection loaded partially.
+ * Reset is the collOrderProductAttributeCombinations collection loaded partially.
*/
- public function resetPartialOrderFeatures($v = true)
+ public function resetPartialOrderProductAttributeCombinations($v = true)
{
- $this->collOrderFeaturesPartial = $v;
+ $this->collOrderProductAttributeCombinationsPartial = $v;
}
/**
- * Initializes the collOrderFeatures collection.
+ * Initializes the collOrderProductAttributeCombinations collection.
*
- * By default this just sets the collOrderFeatures collection to an empty array (like clearcollOrderFeatures());
+ * By default this just sets the collOrderProductAttributeCombinations collection to an empty array (like clearcollOrderProductAttributeCombinations());
* 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.
*
@@ -1739,17 +2183,17 @@ abstract class OrderProduct implements ActiveRecordInterface
*
* @return void
*/
- public function initOrderFeatures($overrideExisting = true)
+ public function initOrderProductAttributeCombinations($overrideExisting = true)
{
- if (null !== $this->collOrderFeatures && !$overrideExisting) {
+ if (null !== $this->collOrderProductAttributeCombinations && !$overrideExisting) {
return;
}
- $this->collOrderFeatures = new ObjectCollection();
- $this->collOrderFeatures->setModel('\Thelia\Model\OrderFeature');
+ $this->collOrderProductAttributeCombinations = new ObjectCollection();
+ $this->collOrderProductAttributeCombinations->setModel('\Thelia\Model\OrderProductAttributeCombination');
}
/**
- * Gets an array of ChildOrderFeature objects which contain a foreign key that references this object.
+ * Gets an array of ChildOrderProductAttributeCombination 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.
@@ -1759,109 +2203,109 @@ abstract class OrderProduct implements ActiveRecordInterface
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
- * @return Collection|ChildOrderFeature[] List of ChildOrderFeature objects
+ * @return Collection|ChildOrderProductAttributeCombination[] List of ChildOrderProductAttributeCombination objects
* @throws PropelException
*/
- public function getOrderFeatures($criteria = null, ConnectionInterface $con = null)
+ public function getOrderProductAttributeCombinations($criteria = null, ConnectionInterface $con = null)
{
- $partial = $this->collOrderFeaturesPartial && !$this->isNew();
- if (null === $this->collOrderFeatures || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collOrderFeatures) {
+ $partial = $this->collOrderProductAttributeCombinationsPartial && !$this->isNew();
+ if (null === $this->collOrderProductAttributeCombinations || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collOrderProductAttributeCombinations) {
// return empty collection
- $this->initOrderFeatures();
+ $this->initOrderProductAttributeCombinations();
} else {
- $collOrderFeatures = ChildOrderFeatureQuery::create(null, $criteria)
+ $collOrderProductAttributeCombinations = ChildOrderProductAttributeCombinationQuery::create(null, $criteria)
->filterByOrderProduct($this)
->find($con);
if (null !== $criteria) {
- if (false !== $this->collOrderFeaturesPartial && count($collOrderFeatures)) {
- $this->initOrderFeatures(false);
+ if (false !== $this->collOrderProductAttributeCombinationsPartial && count($collOrderProductAttributeCombinations)) {
+ $this->initOrderProductAttributeCombinations(false);
- foreach ($collOrderFeatures as $obj) {
- if (false == $this->collOrderFeatures->contains($obj)) {
- $this->collOrderFeatures->append($obj);
+ foreach ($collOrderProductAttributeCombinations as $obj) {
+ if (false == $this->collOrderProductAttributeCombinations->contains($obj)) {
+ $this->collOrderProductAttributeCombinations->append($obj);
}
}
- $this->collOrderFeaturesPartial = true;
+ $this->collOrderProductAttributeCombinationsPartial = true;
}
- $collOrderFeatures->getInternalIterator()->rewind();
+ $collOrderProductAttributeCombinations->getInternalIterator()->rewind();
- return $collOrderFeatures;
+ return $collOrderProductAttributeCombinations;
}
- if ($partial && $this->collOrderFeatures) {
- foreach ($this->collOrderFeatures as $obj) {
+ if ($partial && $this->collOrderProductAttributeCombinations) {
+ foreach ($this->collOrderProductAttributeCombinations as $obj) {
if ($obj->isNew()) {
- $collOrderFeatures[] = $obj;
+ $collOrderProductAttributeCombinations[] = $obj;
}
}
}
- $this->collOrderFeatures = $collOrderFeatures;
- $this->collOrderFeaturesPartial = false;
+ $this->collOrderProductAttributeCombinations = $collOrderProductAttributeCombinations;
+ $this->collOrderProductAttributeCombinationsPartial = false;
}
}
- return $this->collOrderFeatures;
+ return $this->collOrderProductAttributeCombinations;
}
/**
- * Sets a collection of OrderFeature objects related by a one-to-many relationship
+ * Sets a collection of OrderProductAttributeCombination 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 $orderFeatures A Propel collection.
+ * @param Collection $orderProductAttributeCombinations A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildOrderProduct The current object (for fluent API support)
*/
- public function setOrderFeatures(Collection $orderFeatures, ConnectionInterface $con = null)
+ public function setOrderProductAttributeCombinations(Collection $orderProductAttributeCombinations, ConnectionInterface $con = null)
{
- $orderFeaturesToDelete = $this->getOrderFeatures(new Criteria(), $con)->diff($orderFeatures);
+ $orderProductAttributeCombinationsToDelete = $this->getOrderProductAttributeCombinations(new Criteria(), $con)->diff($orderProductAttributeCombinations);
- $this->orderFeaturesScheduledForDeletion = $orderFeaturesToDelete;
+ $this->orderProductAttributeCombinationsScheduledForDeletion = $orderProductAttributeCombinationsToDelete;
- foreach ($orderFeaturesToDelete as $orderFeatureRemoved) {
- $orderFeatureRemoved->setOrderProduct(null);
+ foreach ($orderProductAttributeCombinationsToDelete as $orderProductAttributeCombinationRemoved) {
+ $orderProductAttributeCombinationRemoved->setOrderProduct(null);
}
- $this->collOrderFeatures = null;
- foreach ($orderFeatures as $orderFeature) {
- $this->addOrderFeature($orderFeature);
+ $this->collOrderProductAttributeCombinations = null;
+ foreach ($orderProductAttributeCombinations as $orderProductAttributeCombination) {
+ $this->addOrderProductAttributeCombination($orderProductAttributeCombination);
}
- $this->collOrderFeatures = $orderFeatures;
- $this->collOrderFeaturesPartial = false;
+ $this->collOrderProductAttributeCombinations = $orderProductAttributeCombinations;
+ $this->collOrderProductAttributeCombinationsPartial = false;
return $this;
}
/**
- * Returns the number of related OrderFeature objects.
+ * Returns the number of related OrderProductAttributeCombination objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
- * @return int Count of related OrderFeature objects.
+ * @return int Count of related OrderProductAttributeCombination objects.
* @throws PropelException
*/
- public function countOrderFeatures(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ public function countOrderProductAttributeCombinations(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
- $partial = $this->collOrderFeaturesPartial && !$this->isNew();
- if (null === $this->collOrderFeatures || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collOrderFeatures) {
+ $partial = $this->collOrderProductAttributeCombinationsPartial && !$this->isNew();
+ if (null === $this->collOrderProductAttributeCombinations || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collOrderProductAttributeCombinations) {
return 0;
}
if ($partial && !$criteria) {
- return count($this->getOrderFeatures());
+ return count($this->getOrderProductAttributeCombinations());
}
- $query = ChildOrderFeatureQuery::create(null, $criteria);
+ $query = ChildOrderProductAttributeCombinationQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
@@ -1871,53 +2315,271 @@ abstract class OrderProduct implements ActiveRecordInterface
->count($con);
}
- return count($this->collOrderFeatures);
+ return count($this->collOrderProductAttributeCombinations);
}
/**
- * Method called to associate a ChildOrderFeature object to this object
- * through the ChildOrderFeature foreign key attribute.
+ * Method called to associate a ChildOrderProductAttributeCombination object to this object
+ * through the ChildOrderProductAttributeCombination foreign key attribute.
*
- * @param ChildOrderFeature $l ChildOrderFeature
+ * @param ChildOrderProductAttributeCombination $l ChildOrderProductAttributeCombination
* @return \Thelia\Model\OrderProduct The current object (for fluent API support)
*/
- public function addOrderFeature(ChildOrderFeature $l)
+ public function addOrderProductAttributeCombination(ChildOrderProductAttributeCombination $l)
{
- if ($this->collOrderFeatures === null) {
- $this->initOrderFeatures();
- $this->collOrderFeaturesPartial = true;
+ if ($this->collOrderProductAttributeCombinations === null) {
+ $this->initOrderProductAttributeCombinations();
+ $this->collOrderProductAttributeCombinationsPartial = true;
}
- if (!in_array($l, $this->collOrderFeatures->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
- $this->doAddOrderFeature($l);
+ if (!in_array($l, $this->collOrderProductAttributeCombinations->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddOrderProductAttributeCombination($l);
}
return $this;
}
/**
- * @param OrderFeature $orderFeature The orderFeature object to add.
+ * @param OrderProductAttributeCombination $orderProductAttributeCombination The orderProductAttributeCombination object to add.
*/
- protected function doAddOrderFeature($orderFeature)
+ protected function doAddOrderProductAttributeCombination($orderProductAttributeCombination)
{
- $this->collOrderFeatures[]= $orderFeature;
- $orderFeature->setOrderProduct($this);
+ $this->collOrderProductAttributeCombinations[]= $orderProductAttributeCombination;
+ $orderProductAttributeCombination->setOrderProduct($this);
}
/**
- * @param OrderFeature $orderFeature The orderFeature object to remove.
+ * @param OrderProductAttributeCombination $orderProductAttributeCombination The orderProductAttributeCombination object to remove.
* @return ChildOrderProduct The current object (for fluent API support)
*/
- public function removeOrderFeature($orderFeature)
+ public function removeOrderProductAttributeCombination($orderProductAttributeCombination)
{
- if ($this->getOrderFeatures()->contains($orderFeature)) {
- $this->collOrderFeatures->remove($this->collOrderFeatures->search($orderFeature));
- if (null === $this->orderFeaturesScheduledForDeletion) {
- $this->orderFeaturesScheduledForDeletion = clone $this->collOrderFeatures;
- $this->orderFeaturesScheduledForDeletion->clear();
+ if ($this->getOrderProductAttributeCombinations()->contains($orderProductAttributeCombination)) {
+ $this->collOrderProductAttributeCombinations->remove($this->collOrderProductAttributeCombinations->search($orderProductAttributeCombination));
+ if (null === $this->orderProductAttributeCombinationsScheduledForDeletion) {
+ $this->orderProductAttributeCombinationsScheduledForDeletion = clone $this->collOrderProductAttributeCombinations;
+ $this->orderProductAttributeCombinationsScheduledForDeletion->clear();
}
- $this->orderFeaturesScheduledForDeletion[]= clone $orderFeature;
- $orderFeature->setOrderProduct(null);
+ $this->orderProductAttributeCombinationsScheduledForDeletion[]= clone $orderProductAttributeCombination;
+ $orderProductAttributeCombination->setOrderProduct(null);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clears out the collOrderProductTaxes 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 addOrderProductTaxes()
+ */
+ public function clearOrderProductTaxes()
+ {
+ $this->collOrderProductTaxes = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collOrderProductTaxes collection loaded partially.
+ */
+ public function resetPartialOrderProductTaxes($v = true)
+ {
+ $this->collOrderProductTaxesPartial = $v;
+ }
+
+ /**
+ * Initializes the collOrderProductTaxes collection.
+ *
+ * By default this just sets the collOrderProductTaxes collection to an empty array (like clearcollOrderProductTaxes());
+ * 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 initOrderProductTaxes($overrideExisting = true)
+ {
+ if (null !== $this->collOrderProductTaxes && !$overrideExisting) {
+ return;
+ }
+ $this->collOrderProductTaxes = new ObjectCollection();
+ $this->collOrderProductTaxes->setModel('\Thelia\Model\OrderProductTax');
+ }
+
+ /**
+ * Gets an array of ChildOrderProductTax 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 ChildOrderProduct 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|ChildOrderProductTax[] List of ChildOrderProductTax objects
+ * @throws PropelException
+ */
+ public function getOrderProductTaxes($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collOrderProductTaxesPartial && !$this->isNew();
+ if (null === $this->collOrderProductTaxes || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collOrderProductTaxes) {
+ // return empty collection
+ $this->initOrderProductTaxes();
+ } else {
+ $collOrderProductTaxes = ChildOrderProductTaxQuery::create(null, $criteria)
+ ->filterByOrderProduct($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collOrderProductTaxesPartial && count($collOrderProductTaxes)) {
+ $this->initOrderProductTaxes(false);
+
+ foreach ($collOrderProductTaxes as $obj) {
+ if (false == $this->collOrderProductTaxes->contains($obj)) {
+ $this->collOrderProductTaxes->append($obj);
+ }
+ }
+
+ $this->collOrderProductTaxesPartial = true;
+ }
+
+ $collOrderProductTaxes->getInternalIterator()->rewind();
+
+ return $collOrderProductTaxes;
+ }
+
+ if ($partial && $this->collOrderProductTaxes) {
+ foreach ($this->collOrderProductTaxes as $obj) {
+ if ($obj->isNew()) {
+ $collOrderProductTaxes[] = $obj;
+ }
+ }
+ }
+
+ $this->collOrderProductTaxes = $collOrderProductTaxes;
+ $this->collOrderProductTaxesPartial = false;
+ }
+ }
+
+ return $this->collOrderProductTaxes;
+ }
+
+ /**
+ * Sets a collection of OrderProductTax 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 $orderProductTaxes A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildOrderProduct The current object (for fluent API support)
+ */
+ public function setOrderProductTaxes(Collection $orderProductTaxes, ConnectionInterface $con = null)
+ {
+ $orderProductTaxesToDelete = $this->getOrderProductTaxes(new Criteria(), $con)->diff($orderProductTaxes);
+
+
+ $this->orderProductTaxesScheduledForDeletion = $orderProductTaxesToDelete;
+
+ foreach ($orderProductTaxesToDelete as $orderProductTaxRemoved) {
+ $orderProductTaxRemoved->setOrderProduct(null);
+ }
+
+ $this->collOrderProductTaxes = null;
+ foreach ($orderProductTaxes as $orderProductTax) {
+ $this->addOrderProductTax($orderProductTax);
+ }
+
+ $this->collOrderProductTaxes = $orderProductTaxes;
+ $this->collOrderProductTaxesPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related OrderProductTax objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related OrderProductTax objects.
+ * @throws PropelException
+ */
+ public function countOrderProductTaxes(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collOrderProductTaxesPartial && !$this->isNew();
+ if (null === $this->collOrderProductTaxes || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collOrderProductTaxes) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getOrderProductTaxes());
+ }
+
+ $query = ChildOrderProductTaxQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterByOrderProduct($this)
+ ->count($con);
+ }
+
+ return count($this->collOrderProductTaxes);
+ }
+
+ /**
+ * Method called to associate a ChildOrderProductTax object to this object
+ * through the ChildOrderProductTax foreign key attribute.
+ *
+ * @param ChildOrderProductTax $l ChildOrderProductTax
+ * @return \Thelia\Model\OrderProduct The current object (for fluent API support)
+ */
+ public function addOrderProductTax(ChildOrderProductTax $l)
+ {
+ if ($this->collOrderProductTaxes === null) {
+ $this->initOrderProductTaxes();
+ $this->collOrderProductTaxesPartial = true;
+ }
+
+ if (!in_array($l, $this->collOrderProductTaxes->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddOrderProductTax($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param OrderProductTax $orderProductTax The orderProductTax object to add.
+ */
+ protected function doAddOrderProductTax($orderProductTax)
+ {
+ $this->collOrderProductTaxes[]= $orderProductTax;
+ $orderProductTax->setOrderProduct($this);
+ }
+
+ /**
+ * @param OrderProductTax $orderProductTax The orderProductTax object to remove.
+ * @return ChildOrderProduct The current object (for fluent API support)
+ */
+ public function removeOrderProductTax($orderProductTax)
+ {
+ if ($this->getOrderProductTaxes()->contains($orderProductTax)) {
+ $this->collOrderProductTaxes->remove($this->collOrderProductTaxes->search($orderProductTax));
+ if (null === $this->orderProductTaxesScheduledForDeletion) {
+ $this->orderProductTaxesScheduledForDeletion = clone $this->collOrderProductTaxes;
+ $this->orderProductTaxesScheduledForDeletion->clear();
+ }
+ $this->orderProductTaxesScheduledForDeletion[]= clone $orderProductTax;
+ $orderProductTax->setOrderProduct(null);
}
return $this;
@@ -1931,12 +2593,19 @@ abstract class OrderProduct implements ActiveRecordInterface
$this->id = null;
$this->order_id = null;
$this->product_ref = null;
+ $this->product_sale_elements_ref = null;
$this->title = null;
- $this->description = null;
$this->chapo = null;
+ $this->description = null;
+ $this->postscriptum = null;
$this->quantity = null;
$this->price = null;
- $this->tax = null;
+ $this->promo_price = null;
+ $this->was_new = null;
+ $this->was_in_promo = null;
+ $this->weight = null;
+ $this->tax_rule_title = null;
+ $this->tax_rule_description = null;
$this->parent = null;
$this->created_at = null;
$this->updated_at = null;
@@ -1959,17 +2628,26 @@ abstract class OrderProduct implements ActiveRecordInterface
public function clearAllReferences($deep = false)
{
if ($deep) {
- if ($this->collOrderFeatures) {
- foreach ($this->collOrderFeatures as $o) {
+ if ($this->collOrderProductAttributeCombinations) {
+ foreach ($this->collOrderProductAttributeCombinations as $o) {
+ $o->clearAllReferences($deep);
+ }
+ }
+ if ($this->collOrderProductTaxes) {
+ foreach ($this->collOrderProductTaxes as $o) {
$o->clearAllReferences($deep);
}
}
} // if ($deep)
- if ($this->collOrderFeatures instanceof Collection) {
- $this->collOrderFeatures->clearIterator();
+ if ($this->collOrderProductAttributeCombinations instanceof Collection) {
+ $this->collOrderProductAttributeCombinations->clearIterator();
}
- $this->collOrderFeatures = null;
+ $this->collOrderProductAttributeCombinations = null;
+ if ($this->collOrderProductTaxes instanceof Collection) {
+ $this->collOrderProductTaxes->clearIterator();
+ }
+ $this->collOrderProductTaxes = null;
$this->aOrder = null;
}
diff --git a/core/lib/Thelia/Model/Base/OrderProductAttributeCombination.php b/core/lib/Thelia/Model/Base/OrderProductAttributeCombination.php
new file mode 100644
index 000000000..e02bc9cc5
--- /dev/null
+++ b/core/lib/Thelia/Model/Base/OrderProductAttributeCombination.php
@@ -0,0 +1,1824 @@
+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 in_array($col, $this->modifiedColumns);
+ }
+
+ /**
+ * 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 array_unique($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 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) {
+ while (false !== ($offset = array_search($col, $this->modifiedColumns))) {
+ array_splice($this->modifiedColumns, $offset, 1);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another OrderProductAttributeCombination instance. If
+ * obj is an instance of OrderProductAttributeCombination, delegates to
+ * equals(OrderProductAttributeCombination). Otherwise, returns false.
+ *
+ * @param obj The object to compare to.
+ * @return 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
+ *
+ * @param string $name The virtual column name
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @return mixed
+ */
+ 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 OrderProductAttributeCombination 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 OrderProductAttributeCombination The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+ }
+
+ /**
+ * 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 [order_product_id] column value.
+ *
+ * @return int
+ */
+ public function getOrderProductId()
+ {
+
+ return $this->order_product_id;
+ }
+
+ /**
+ * Get the [attribute_title] column value.
+ *
+ * @return string
+ */
+ public function getAttributeTitle()
+ {
+
+ return $this->attribute_title;
+ }
+
+ /**
+ * Get the [attribute_chapo] column value.
+ *
+ * @return string
+ */
+ public function getAttributeChapo()
+ {
+
+ return $this->attribute_chapo;
+ }
+
+ /**
+ * Get the [attribute_description] column value.
+ *
+ * @return string
+ */
+ public function getAttributeDescription()
+ {
+
+ return $this->attribute_description;
+ }
+
+ /**
+ * Get the [attribute_postscriptumn] column value.
+ *
+ * @return string
+ */
+ public function getAttributePostscriptumn()
+ {
+
+ return $this->attribute_postscriptumn;
+ }
+
+ /**
+ * Get the [attribute_av_title] column value.
+ *
+ * @return string
+ */
+ public function getAttributeAvTitle()
+ {
+
+ return $this->attribute_av_title;
+ }
+
+ /**
+ * Get the [attribute_av_chapo] column value.
+ *
+ * @return string
+ */
+ public function getAttributeAvChapo()
+ {
+
+ return $this->attribute_av_chapo;
+ }
+
+ /**
+ * Get the [attribute_av_description] column value.
+ *
+ * @return string
+ */
+ public function getAttributeAvDescription()
+ {
+
+ return $this->attribute_av_description;
+ }
+
+ /**
+ * Get the [attribute_av_postscriptum] column value.
+ *
+ * @return string
+ */
+ public function getAttributeAvPostscriptum()
+ {
+
+ return $this->attribute_av_postscriptum;
+ }
+
+ /**
+ * 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 !== null ? $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 !== null ? $this->updated_at->format($format) : null;
+ }
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination 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[] = OrderProductAttributeCombinationTableMap::ID;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [order_product_id] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function setOrderProductId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->order_product_id !== $v) {
+ $this->order_product_id = $v;
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID;
+ }
+
+ if ($this->aOrderProduct !== null && $this->aOrderProduct->getId() !== $v) {
+ $this->aOrderProduct = null;
+ }
+
+
+ return $this;
+ } // setOrderProductId()
+
+ /**
+ * Set the value of [attribute_title] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function setAttributeTitle($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->attribute_title !== $v) {
+ $this->attribute_title = $v;
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE;
+ }
+
+
+ return $this;
+ } // setAttributeTitle()
+
+ /**
+ * Set the value of [attribute_chapo] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function setAttributeChapo($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->attribute_chapo !== $v) {
+ $this->attribute_chapo = $v;
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO;
+ }
+
+
+ return $this;
+ } // setAttributeChapo()
+
+ /**
+ * Set the value of [attribute_description] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function setAttributeDescription($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->attribute_description !== $v) {
+ $this->attribute_description = $v;
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION;
+ }
+
+
+ return $this;
+ } // setAttributeDescription()
+
+ /**
+ * Set the value of [attribute_postscriptumn] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function setAttributePostscriptumn($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->attribute_postscriptumn !== $v) {
+ $this->attribute_postscriptumn = $v;
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN;
+ }
+
+
+ return $this;
+ } // setAttributePostscriptumn()
+
+ /**
+ * Set the value of [attribute_av_title] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function setAttributeAvTitle($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->attribute_av_title !== $v) {
+ $this->attribute_av_title = $v;
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE;
+ }
+
+
+ return $this;
+ } // setAttributeAvTitle()
+
+ /**
+ * Set the value of [attribute_av_chapo] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function setAttributeAvChapo($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->attribute_av_chapo !== $v) {
+ $this->attribute_av_chapo = $v;
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO;
+ }
+
+
+ return $this;
+ } // setAttributeAvChapo()
+
+ /**
+ * Set the value of [attribute_av_description] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function setAttributeAvDescription($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->attribute_av_description !== $v) {
+ $this->attribute_av_description = $v;
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION;
+ }
+
+
+ return $this;
+ } // setAttributeAvDescription()
+
+ /**
+ * Set the value of [attribute_av_postscriptum] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function setAttributeAvPostscriptum($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->attribute_av_postscriptum !== $v) {
+ $this->attribute_av_postscriptum = $v;
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_POSTSCRIPTUM;
+ }
+
+
+ return $this;
+ } // setAttributeAvPostscriptum()
+
+ /**
+ * 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 \Thelia\Model\OrderProductAttributeCombination 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[] = OrderProductAttributeCombinationTableMap::CREATED_AT;
+ }
+ } // 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 \Thelia\Model\OrderProductAttributeCombination 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[] = OrderProductAttributeCombinationTableMap::UPDATED_AT;
+ }
+ } // 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 : OrderProductAttributeCombinationTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('OrderProductId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->order_product_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributeTitle', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->attribute_title = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributeChapo', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->attribute_chapo = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributeDescription', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->attribute_description = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributePostscriptumn', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->attribute_postscriptumn = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributeAvTitle', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->attribute_av_title = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributeAvChapo', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->attribute_av_chapo = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributeAvDescription', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->attribute_av_description = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : OrderProductAttributeCombinationTableMap::translateFieldName('AttributeAvPostscriptum', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->attribute_av_postscriptum = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : OrderProductAttributeCombinationTableMap::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 ? 11 + $startcol : OrderProductAttributeCombinationTableMap::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 + 12; // 12 = OrderProductAttributeCombinationTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \Thelia\Model\OrderProductAttributeCombination 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->aOrderProduct !== null && $this->order_product_id !== $this->aOrderProduct->getId()) {
+ $this->aOrderProduct = 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(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildOrderProductAttributeCombinationQuery::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->aOrderProduct = null;
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see OrderProductAttributeCombination::setDeleted()
+ * @see OrderProductAttributeCombination::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(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildOrderProductAttributeCombinationQuery::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(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ // timestampable behavior
+ if (!$this->isColumnModified(OrderProductAttributeCombinationTableMap::CREATED_AT)) {
+ $this->setCreatedAt(time());
+ }
+ if (!$this->isColumnModified(OrderProductAttributeCombinationTableMap::UPDATED_AT)) {
+ $this->setUpdatedAt(time());
+ }
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ // timestampable behavior
+ if ($this->isModified() && !$this->isColumnModified(OrderProductAttributeCombinationTableMap::UPDATED_AT)) {
+ $this->setUpdatedAt(time());
+ }
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ OrderProductAttributeCombinationTableMap::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->aOrderProduct !== null) {
+ if ($this->aOrderProduct->isModified() || $this->aOrderProduct->isNew()) {
+ $affectedRows += $this->aOrderProduct->save($con);
+ }
+ $this->setOrderProduct($this->aOrderProduct);
+ }
+
+ 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[] = OrderProductAttributeCombinationTableMap::ID;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . OrderProductAttributeCombinationTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID)) {
+ $modifiedColumns[':p' . $index++] = 'ORDER_PRODUCT_ID';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE)) {
+ $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_TITLE';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO)) {
+ $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_CHAPO';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION)) {
+ $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_DESCRIPTION';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN)) {
+ $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_POSTSCRIPTUMN';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE)) {
+ $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_TITLE';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO)) {
+ $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_CHAPO';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION)) {
+ $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_DESCRIPTION';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_POSTSCRIPTUM)) {
+ $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_POSTSCRIPTUM';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::CREATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'CREATED_AT';
+ }
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::UPDATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'UPDATED_AT';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO order_product_attribute_combination (%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 'ORDER_PRODUCT_ID':
+ $stmt->bindValue($identifier, $this->order_product_id, PDO::PARAM_INT);
+ break;
+ case 'ATTRIBUTE_TITLE':
+ $stmt->bindValue($identifier, $this->attribute_title, PDO::PARAM_STR);
+ break;
+ case 'ATTRIBUTE_CHAPO':
+ $stmt->bindValue($identifier, $this->attribute_chapo, PDO::PARAM_STR);
+ break;
+ case 'ATTRIBUTE_DESCRIPTION':
+ $stmt->bindValue($identifier, $this->attribute_description, PDO::PARAM_STR);
+ break;
+ case 'ATTRIBUTE_POSTSCRIPTUMN':
+ $stmt->bindValue($identifier, $this->attribute_postscriptumn, PDO::PARAM_STR);
+ break;
+ case 'ATTRIBUTE_AV_TITLE':
+ $stmt->bindValue($identifier, $this->attribute_av_title, PDO::PARAM_STR);
+ break;
+ case 'ATTRIBUTE_AV_CHAPO':
+ $stmt->bindValue($identifier, $this->attribute_av_chapo, PDO::PARAM_STR);
+ break;
+ case 'ATTRIBUTE_AV_DESCRIPTION':
+ $stmt->bindValue($identifier, $this->attribute_av_description, PDO::PARAM_STR);
+ break;
+ case 'ATTRIBUTE_AV_POSTSCRIPTUM':
+ $stmt->bindValue($identifier, $this->attribute_av_postscriptum, PDO::PARAM_STR);
+ 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 = OrderProductAttributeCombinationTableMap::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->getOrderProductId();
+ break;
+ case 2:
+ return $this->getAttributeTitle();
+ break;
+ case 3:
+ return $this->getAttributeChapo();
+ break;
+ case 4:
+ return $this->getAttributeDescription();
+ break;
+ case 5:
+ return $this->getAttributePostscriptumn();
+ break;
+ case 6:
+ return $this->getAttributeAvTitle();
+ break;
+ case 7:
+ return $this->getAttributeAvChapo();
+ break;
+ case 8:
+ return $this->getAttributeAvDescription();
+ break;
+ case 9:
+ return $this->getAttributeAvPostscriptum();
+ break;
+ case 10:
+ return $this->getCreatedAt();
+ break;
+ case 11:
+ 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
+ * @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['OrderProductAttributeCombination'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['OrderProductAttributeCombination'][$this->getPrimaryKey()] = true;
+ $keys = OrderProductAttributeCombinationTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getOrderProductId(),
+ $keys[2] => $this->getAttributeTitle(),
+ $keys[3] => $this->getAttributeChapo(),
+ $keys[4] => $this->getAttributeDescription(),
+ $keys[5] => $this->getAttributePostscriptumn(),
+ $keys[6] => $this->getAttributeAvTitle(),
+ $keys[7] => $this->getAttributeAvChapo(),
+ $keys[8] => $this->getAttributeAvDescription(),
+ $keys[9] => $this->getAttributeAvPostscriptum(),
+ $keys[10] => $this->getCreatedAt(),
+ $keys[11] => $this->getUpdatedAt(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach($virtualColumns as $key => $virtualColumn)
+ {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aOrderProduct) {
+ $result['OrderProduct'] = $this->aOrderProduct->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 = OrderProductAttributeCombinationTableMap::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->setOrderProductId($value);
+ break;
+ case 2:
+ $this->setAttributeTitle($value);
+ break;
+ case 3:
+ $this->setAttributeChapo($value);
+ break;
+ case 4:
+ $this->setAttributeDescription($value);
+ break;
+ case 5:
+ $this->setAttributePostscriptumn($value);
+ break;
+ case 6:
+ $this->setAttributeAvTitle($value);
+ break;
+ case 7:
+ $this->setAttributeAvChapo($value);
+ break;
+ case 8:
+ $this->setAttributeAvDescription($value);
+ break;
+ case 9:
+ $this->setAttributeAvPostscriptum($value);
+ break;
+ case 10:
+ $this->setCreatedAt($value);
+ break;
+ case 11:
+ $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 = OrderProductAttributeCombinationTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setOrderProductId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setAttributeTitle($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setAttributeChapo($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setAttributeDescription($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setAttributePostscriptumn($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setAttributeAvTitle($arr[$keys[6]]);
+ if (array_key_exists($keys[7], $arr)) $this->setAttributeAvChapo($arr[$keys[7]]);
+ if (array_key_exists($keys[8], $arr)) $this->setAttributeAvDescription($arr[$keys[8]]);
+ if (array_key_exists($keys[9], $arr)) $this->setAttributeAvPostscriptum($arr[$keys[9]]);
+ if (array_key_exists($keys[10], $arr)) $this->setCreatedAt($arr[$keys[10]]);
+ if (array_key_exists($keys[11], $arr)) $this->setUpdatedAt($arr[$keys[11]]);
+ }
+
+ /**
+ * 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(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ID)) $criteria->add(OrderProductAttributeCombinationTableMap::ID, $this->id);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID)) $criteria->add(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID, $this->order_product_id);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE, $this->attribute_title);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO, $this->attribute_chapo);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION, $this->attribute_description);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN, $this->attribute_postscriptumn);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE, $this->attribute_av_title);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO, $this->attribute_av_chapo);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION, $this->attribute_av_description);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_POSTSCRIPTUM)) $criteria->add(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_POSTSCRIPTUM, $this->attribute_av_postscriptum);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::CREATED_AT)) $criteria->add(OrderProductAttributeCombinationTableMap::CREATED_AT, $this->created_at);
+ if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::UPDATED_AT)) $criteria->add(OrderProductAttributeCombinationTableMap::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(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+ $criteria->add(OrderProductAttributeCombinationTableMap::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 \Thelia\Model\OrderProductAttributeCombination (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->setOrderProductId($this->getOrderProductId());
+ $copyObj->setAttributeTitle($this->getAttributeTitle());
+ $copyObj->setAttributeChapo($this->getAttributeChapo());
+ $copyObj->setAttributeDescription($this->getAttributeDescription());
+ $copyObj->setAttributePostscriptumn($this->getAttributePostscriptumn());
+ $copyObj->setAttributeAvTitle($this->getAttributeAvTitle());
+ $copyObj->setAttributeAvChapo($this->getAttributeAvChapo());
+ $copyObj->setAttributeAvDescription($this->getAttributeAvDescription());
+ $copyObj->setAttributeAvPostscriptum($this->getAttributeAvPostscriptum());
+ $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 \Thelia\Model\OrderProductAttributeCombination 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 ChildOrderProduct object.
+ *
+ * @param ChildOrderProduct $v
+ * @return \Thelia\Model\OrderProductAttributeCombination The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setOrderProduct(ChildOrderProduct $v = null)
+ {
+ if ($v === null) {
+ $this->setOrderProductId(NULL);
+ } else {
+ $this->setOrderProductId($v->getId());
+ }
+
+ $this->aOrderProduct = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildOrderProduct object, it will not be re-added.
+ if ($v !== null) {
+ $v->addOrderProductAttributeCombination($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildOrderProduct object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildOrderProduct The associated ChildOrderProduct object.
+ * @throws PropelException
+ */
+ public function getOrderProduct(ConnectionInterface $con = null)
+ {
+ if ($this->aOrderProduct === null && ($this->order_product_id !== null)) {
+ $this->aOrderProduct = ChildOrderProductQuery::create()->findPk($this->order_product_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->aOrderProduct->addOrderProductAttributeCombinations($this);
+ */
+ }
+
+ return $this->aOrderProduct;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->order_product_id = null;
+ $this->attribute_title = null;
+ $this->attribute_chapo = null;
+ $this->attribute_description = null;
+ $this->attribute_postscriptumn = null;
+ $this->attribute_av_title = null;
+ $this->attribute_av_chapo = null;
+ $this->attribute_av_description = null;
+ $this->attribute_av_postscriptum = 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)
+
+ $this->aOrderProduct = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(OrderProductAttributeCombinationTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ // timestampable behavior
+
+ /**
+ * Mark the current object so that the update date doesn't get updated during next save
+ *
+ * @return ChildOrderProductAttributeCombination The current object (for fluent API support)
+ */
+ public function keepUpdateDateUnchanged()
+ {
+ $this->modifiedColumns[] = OrderProductAttributeCombinationTableMap::UPDATED_AT;
+
+ 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/core/lib/Thelia/Model/Base/OrderProductAttributeCombinationQuery.php b/core/lib/Thelia/Model/Base/OrderProductAttributeCombinationQuery.php
new file mode 100644
index 000000000..9e8298aa5
--- /dev/null
+++ b/core/lib/Thelia/Model/Base/OrderProductAttributeCombinationQuery.php
@@ -0,0 +1,897 @@
+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 ChildOrderProductAttributeCombination|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = OrderProductAttributeCombinationTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(OrderProductAttributeCombinationTableMap::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 ChildOrderProductAttributeCombination A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, ORDER_PRODUCT_ID, ATTRIBUTE_TITLE, ATTRIBUTE_CHAPO, ATTRIBUTE_DESCRIPTION, ATTRIBUTE_POSTSCRIPTUMN, ATTRIBUTE_AV_TITLE, ATTRIBUTE_AV_CHAPO, ATTRIBUTE_AV_DESCRIPTION, ATTRIBUTE_AV_POSTSCRIPTUM, CREATED_AT, UPDATED_AT FROM order_product_attribute_combination 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 ChildOrderProductAttributeCombination();
+ $obj->hydrate($row);
+ OrderProductAttributeCombinationTableMap::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 ChildOrderProductAttributeCombination|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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::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 ChildOrderProductAttributeCombinationQuery 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(OrderProductAttributeCombinationTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the order_product_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByOrderProductId(1234); // WHERE order_product_id = 1234
+ * $query->filterByOrderProductId(array(12, 34)); // WHERE order_product_id IN (12, 34)
+ * $query->filterByOrderProductId(array('min' => 12)); // WHERE order_product_id > 12
+ *
+ *
+ * @see filterByOrderProduct()
+ *
+ * @param mixed $orderProductId 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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByOrderProductId($orderProductId = null, $comparison = null)
+ {
+ if (is_array($orderProductId)) {
+ $useMinMax = false;
+ if (isset($orderProductId['min'])) {
+ $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID, $orderProductId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($orderProductId['max'])) {
+ $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID, $orderProductId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID, $orderProductId, $comparison);
+ }
+
+ /**
+ * Filter the query on the attribute_title column
+ *
+ * Example usage:
+ *
+ * $query->filterByAttributeTitle('fooValue'); // WHERE attribute_title = 'fooValue'
+ * $query->filterByAttributeTitle('%fooValue%'); // WHERE attribute_title LIKE '%fooValue%'
+ *
+ *
+ * @param string $attributeTitle 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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByAttributeTitle($attributeTitle = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($attributeTitle)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $attributeTitle)) {
+ $attributeTitle = str_replace('*', '%', $attributeTitle);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE, $attributeTitle, $comparison);
+ }
+
+ /**
+ * Filter the query on the attribute_chapo column
+ *
+ * Example usage:
+ *
+ * $query->filterByAttributeChapo('fooValue'); // WHERE attribute_chapo = 'fooValue'
+ * $query->filterByAttributeChapo('%fooValue%'); // WHERE attribute_chapo LIKE '%fooValue%'
+ *
+ *
+ * @param string $attributeChapo 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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByAttributeChapo($attributeChapo = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($attributeChapo)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $attributeChapo)) {
+ $attributeChapo = str_replace('*', '%', $attributeChapo);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO, $attributeChapo, $comparison);
+ }
+
+ /**
+ * Filter the query on the attribute_description column
+ *
+ * Example usage:
+ *
+ * $query->filterByAttributeDescription('fooValue'); // WHERE attribute_description = 'fooValue'
+ * $query->filterByAttributeDescription('%fooValue%'); // WHERE attribute_description LIKE '%fooValue%'
+ *
+ *
+ * @param string $attributeDescription 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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByAttributeDescription($attributeDescription = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($attributeDescription)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $attributeDescription)) {
+ $attributeDescription = str_replace('*', '%', $attributeDescription);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION, $attributeDescription, $comparison);
+ }
+
+ /**
+ * Filter the query on the attribute_postscriptumn column
+ *
+ * Example usage:
+ *
+ * $query->filterByAttributePostscriptumn('fooValue'); // WHERE attribute_postscriptumn = 'fooValue'
+ * $query->filterByAttributePostscriptumn('%fooValue%'); // WHERE attribute_postscriptumn LIKE '%fooValue%'
+ *
+ *
+ * @param string $attributePostscriptumn 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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByAttributePostscriptumn($attributePostscriptumn = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($attributePostscriptumn)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $attributePostscriptumn)) {
+ $attributePostscriptumn = str_replace('*', '%', $attributePostscriptumn);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN, $attributePostscriptumn, $comparison);
+ }
+
+ /**
+ * Filter the query on the attribute_av_title column
+ *
+ * Example usage:
+ *
+ * $query->filterByAttributeAvTitle('fooValue'); // WHERE attribute_av_title = 'fooValue'
+ * $query->filterByAttributeAvTitle('%fooValue%'); // WHERE attribute_av_title LIKE '%fooValue%'
+ *
+ *
+ * @param string $attributeAvTitle 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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByAttributeAvTitle($attributeAvTitle = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($attributeAvTitle)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $attributeAvTitle)) {
+ $attributeAvTitle = str_replace('*', '%', $attributeAvTitle);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE, $attributeAvTitle, $comparison);
+ }
+
+ /**
+ * Filter the query on the attribute_av_chapo column
+ *
+ * Example usage:
+ *
+ * $query->filterByAttributeAvChapo('fooValue'); // WHERE attribute_av_chapo = 'fooValue'
+ * $query->filterByAttributeAvChapo('%fooValue%'); // WHERE attribute_av_chapo LIKE '%fooValue%'
+ *
+ *
+ * @param string $attributeAvChapo 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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByAttributeAvChapo($attributeAvChapo = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($attributeAvChapo)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $attributeAvChapo)) {
+ $attributeAvChapo = str_replace('*', '%', $attributeAvChapo);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO, $attributeAvChapo, $comparison);
+ }
+
+ /**
+ * Filter the query on the attribute_av_description column
+ *
+ * Example usage:
+ *
+ * $query->filterByAttributeAvDescription('fooValue'); // WHERE attribute_av_description = 'fooValue'
+ * $query->filterByAttributeAvDescription('%fooValue%'); // WHERE attribute_av_description LIKE '%fooValue%'
+ *
+ *
+ * @param string $attributeAvDescription 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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByAttributeAvDescription($attributeAvDescription = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($attributeAvDescription)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $attributeAvDescription)) {
+ $attributeAvDescription = str_replace('*', '%', $attributeAvDescription);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION, $attributeAvDescription, $comparison);
+ }
+
+ /**
+ * Filter the query on the attribute_av_postscriptum column
+ *
+ * Example usage:
+ *
+ * $query->filterByAttributeAvPostscriptum('fooValue'); // WHERE attribute_av_postscriptum = 'fooValue'
+ * $query->filterByAttributeAvPostscriptum('%fooValue%'); // WHERE attribute_av_postscriptum LIKE '%fooValue%'
+ *
+ *
+ * @param string $attributeAvPostscriptum 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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByAttributeAvPostscriptum($attributeAvPostscriptum = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($attributeAvPostscriptum)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $attributeAvPostscriptum)) {
+ $attributeAvPostscriptum = str_replace('*', '%', $attributeAvPostscriptum);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_POSTSCRIPTUM, $attributeAvPostscriptum, $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 ChildOrderProductAttributeCombinationQuery 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(OrderProductAttributeCombinationTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($createdAt['max'])) {
+ $this->addUsingAlias(OrderProductAttributeCombinationTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::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 ChildOrderProductAttributeCombinationQuery 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(OrderProductAttributeCombinationTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($updatedAt['max'])) {
+ $this->addUsingAlias(OrderProductAttributeCombinationTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::UPDATED_AT, $updatedAt, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\OrderProduct object
+ *
+ * @param \Thelia\Model\OrderProduct|ObjectCollection $orderProduct The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function filterByOrderProduct($orderProduct, $comparison = null)
+ {
+ if ($orderProduct instanceof \Thelia\Model\OrderProduct) {
+ return $this
+ ->addUsingAlias(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID, $orderProduct->getId(), $comparison);
+ } elseif ($orderProduct instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID, $orderProduct->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByOrderProduct() only accepts arguments of type \Thelia\Model\OrderProduct or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the OrderProduct relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function joinOrderProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('OrderProduct');
+
+ // 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, 'OrderProduct');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the OrderProduct relation OrderProduct object
+ *
+ * @see useQuery()
+ *
+ * @param string $relationAlias optional alias for the relation,
+ * to be used as main alias in the secondary query
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return \Thelia\Model\OrderProductQuery A secondary query class using the current class as primary query
+ */
+ public function useOrderProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinOrderProduct($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'OrderProduct', '\Thelia\Model\OrderProductQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildOrderProductAttributeCombination $orderProductAttributeCombination Object to remove from the list of results
+ *
+ * @return ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function prune($orderProductAttributeCombination = null)
+ {
+ if ($orderProductAttributeCombination) {
+ $this->addUsingAlias(OrderProductAttributeCombinationTableMap::ID, $orderProductAttributeCombination->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the order_product_attribute_combination 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(OrderProductAttributeCombinationTableMap::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).
+ OrderProductAttributeCombinationTableMap::clearInstancePool();
+ OrderProductAttributeCombinationTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildOrderProductAttributeCombination or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildOrderProductAttributeCombination 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(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(OrderProductAttributeCombinationTableMap::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();
+
+
+ OrderProductAttributeCombinationTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ OrderProductAttributeCombinationTableMap::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 ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function recentlyUpdated($nbDays = 7)
+ {
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Filter by the latest created
+ *
+ * @param int $nbDays Maximum age of in days
+ *
+ * @return ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function recentlyCreated($nbDays = 7)
+ {
+ return $this->addUsingAlias(OrderProductAttributeCombinationTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Order by update date desc
+ *
+ * @return ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function lastUpdatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(OrderProductAttributeCombinationTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by update date asc
+ *
+ * @return ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function firstUpdatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(OrderProductAttributeCombinationTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by create date desc
+ *
+ * @return ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function lastCreatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(OrderProductAttributeCombinationTableMap::CREATED_AT);
+ }
+
+ /**
+ * Order by create date asc
+ *
+ * @return ChildOrderProductAttributeCombinationQuery The current query, for fluid interface
+ */
+ public function firstCreatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(OrderProductAttributeCombinationTableMap::CREATED_AT);
+ }
+
+} // OrderProductAttributeCombinationQuery
diff --git a/core/lib/Thelia/Model/Base/OrderProductQuery.php b/core/lib/Thelia/Model/Base/OrderProductQuery.php
index b007c89e1..f28102dfb 100644
--- a/core/lib/Thelia/Model/Base/OrderProductQuery.php
+++ b/core/lib/Thelia/Model/Base/OrderProductQuery.php
@@ -24,12 +24,19 @@ use Thelia\Model\Map\OrderProductTableMap;
* @method ChildOrderProductQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildOrderProductQuery orderByOrderId($order = Criteria::ASC) Order by the order_id column
* @method ChildOrderProductQuery orderByProductRef($order = Criteria::ASC) Order by the product_ref column
+ * @method ChildOrderProductQuery orderByProductSaleElementsRef($order = Criteria::ASC) Order by the product_sale_elements_ref column
* @method ChildOrderProductQuery orderByTitle($order = Criteria::ASC) Order by the title column
- * @method ChildOrderProductQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildOrderProductQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
+ * @method ChildOrderProductQuery orderByDescription($order = Criteria::ASC) Order by the description column
+ * @method ChildOrderProductQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
* @method ChildOrderProductQuery orderByQuantity($order = Criteria::ASC) Order by the quantity column
* @method ChildOrderProductQuery orderByPrice($order = Criteria::ASC) Order by the price column
- * @method ChildOrderProductQuery orderByTax($order = Criteria::ASC) Order by the tax column
+ * @method ChildOrderProductQuery orderByPromoPrice($order = Criteria::ASC) Order by the promo_price column
+ * @method ChildOrderProductQuery orderByWasNew($order = Criteria::ASC) Order by the was_new column
+ * @method ChildOrderProductQuery orderByWasInPromo($order = Criteria::ASC) Order by the was_in_promo column
+ * @method ChildOrderProductQuery orderByWeight($order = Criteria::ASC) Order by the weight column
+ * @method ChildOrderProductQuery orderByTaxRuleTitle($order = Criteria::ASC) Order by the tax_rule_title column
+ * @method ChildOrderProductQuery orderByTaxRuleDescription($order = Criteria::ASC) Order by the tax_rule_description column
* @method ChildOrderProductQuery orderByParent($order = Criteria::ASC) Order by the parent column
* @method ChildOrderProductQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildOrderProductQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
@@ -37,12 +44,19 @@ use Thelia\Model\Map\OrderProductTableMap;
* @method ChildOrderProductQuery groupById() Group by the id column
* @method ChildOrderProductQuery groupByOrderId() Group by the order_id column
* @method ChildOrderProductQuery groupByProductRef() Group by the product_ref column
+ * @method ChildOrderProductQuery groupByProductSaleElementsRef() Group by the product_sale_elements_ref column
* @method ChildOrderProductQuery groupByTitle() Group by the title column
- * @method ChildOrderProductQuery groupByDescription() Group by the description column
* @method ChildOrderProductQuery groupByChapo() Group by the chapo column
+ * @method ChildOrderProductQuery groupByDescription() Group by the description column
+ * @method ChildOrderProductQuery groupByPostscriptum() Group by the postscriptum column
* @method ChildOrderProductQuery groupByQuantity() Group by the quantity column
* @method ChildOrderProductQuery groupByPrice() Group by the price column
- * @method ChildOrderProductQuery groupByTax() Group by the tax column
+ * @method ChildOrderProductQuery groupByPromoPrice() Group by the promo_price column
+ * @method ChildOrderProductQuery groupByWasNew() Group by the was_new column
+ * @method ChildOrderProductQuery groupByWasInPromo() Group by the was_in_promo column
+ * @method ChildOrderProductQuery groupByWeight() Group by the weight column
+ * @method ChildOrderProductQuery groupByTaxRuleTitle() Group by the tax_rule_title column
+ * @method ChildOrderProductQuery groupByTaxRuleDescription() Group by the tax_rule_description column
* @method ChildOrderProductQuery groupByParent() Group by the parent column
* @method ChildOrderProductQuery groupByCreatedAt() Group by the created_at column
* @method ChildOrderProductQuery groupByUpdatedAt() Group by the updated_at column
@@ -55,9 +69,13 @@ use Thelia\Model\Map\OrderProductTableMap;
* @method ChildOrderProductQuery rightJoinOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Order relation
* @method ChildOrderProductQuery innerJoinOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the Order relation
*
- * @method ChildOrderProductQuery leftJoinOrderFeature($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderFeature relation
- * @method ChildOrderProductQuery rightJoinOrderFeature($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderFeature relation
- * @method ChildOrderProductQuery innerJoinOrderFeature($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderFeature relation
+ * @method ChildOrderProductQuery leftJoinOrderProductAttributeCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderProductAttributeCombination relation
+ * @method ChildOrderProductQuery rightJoinOrderProductAttributeCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderProductAttributeCombination relation
+ * @method ChildOrderProductQuery innerJoinOrderProductAttributeCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderProductAttributeCombination relation
+ *
+ * @method ChildOrderProductQuery leftJoinOrderProductTax($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderProductTax relation
+ * @method ChildOrderProductQuery rightJoinOrderProductTax($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderProductTax relation
+ * @method ChildOrderProductQuery innerJoinOrderProductTax($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderProductTax relation
*
* @method ChildOrderProduct findOne(ConnectionInterface $con = null) Return the first ChildOrderProduct matching the query
* @method ChildOrderProduct findOneOrCreate(ConnectionInterface $con = null) Return the first ChildOrderProduct matching the query, or a new ChildOrderProduct object populated from the query conditions when no match is found
@@ -65,12 +83,19 @@ use Thelia\Model\Map\OrderProductTableMap;
* @method ChildOrderProduct findOneById(int $id) Return the first ChildOrderProduct filtered by the id column
* @method ChildOrderProduct findOneByOrderId(int $order_id) Return the first ChildOrderProduct filtered by the order_id column
* @method ChildOrderProduct findOneByProductRef(string $product_ref) Return the first ChildOrderProduct filtered by the product_ref column
+ * @method ChildOrderProduct findOneByProductSaleElementsRef(string $product_sale_elements_ref) Return the first ChildOrderProduct filtered by the product_sale_elements_ref column
* @method ChildOrderProduct findOneByTitle(string $title) Return the first ChildOrderProduct filtered by the title column
- * @method ChildOrderProduct findOneByDescription(string $description) Return the first ChildOrderProduct filtered by the description column
* @method ChildOrderProduct findOneByChapo(string $chapo) Return the first ChildOrderProduct filtered by the chapo column
+ * @method ChildOrderProduct findOneByDescription(string $description) Return the first ChildOrderProduct filtered by the description column
+ * @method ChildOrderProduct findOneByPostscriptum(string $postscriptum) Return the first ChildOrderProduct filtered by the postscriptum column
* @method ChildOrderProduct findOneByQuantity(double $quantity) Return the first ChildOrderProduct filtered by the quantity column
* @method ChildOrderProduct findOneByPrice(double $price) Return the first ChildOrderProduct filtered by the price column
- * @method ChildOrderProduct findOneByTax(double $tax) Return the first ChildOrderProduct filtered by the tax column
+ * @method ChildOrderProduct findOneByPromoPrice(string $promo_price) Return the first ChildOrderProduct filtered by the promo_price column
+ * @method ChildOrderProduct findOneByWasNew(int $was_new) Return the first ChildOrderProduct filtered by the was_new column
+ * @method ChildOrderProduct findOneByWasInPromo(int $was_in_promo) Return the first ChildOrderProduct filtered by the was_in_promo column
+ * @method ChildOrderProduct findOneByWeight(string $weight) Return the first ChildOrderProduct filtered by the weight column
+ * @method ChildOrderProduct findOneByTaxRuleTitle(string $tax_rule_title) Return the first ChildOrderProduct filtered by the tax_rule_title column
+ * @method ChildOrderProduct findOneByTaxRuleDescription(string $tax_rule_description) Return the first ChildOrderProduct filtered by the tax_rule_description column
* @method ChildOrderProduct findOneByParent(int $parent) Return the first ChildOrderProduct filtered by the parent column
* @method ChildOrderProduct findOneByCreatedAt(string $created_at) Return the first ChildOrderProduct filtered by the created_at column
* @method ChildOrderProduct findOneByUpdatedAt(string $updated_at) Return the first ChildOrderProduct filtered by the updated_at column
@@ -78,12 +103,19 @@ use Thelia\Model\Map\OrderProductTableMap;
* @method array findById(int $id) Return ChildOrderProduct objects filtered by the id column
* @method array findByOrderId(int $order_id) Return ChildOrderProduct objects filtered by the order_id column
* @method array findByProductRef(string $product_ref) Return ChildOrderProduct objects filtered by the product_ref column
+ * @method array findByProductSaleElementsRef(string $product_sale_elements_ref) Return ChildOrderProduct objects filtered by the product_sale_elements_ref column
* @method array findByTitle(string $title) Return ChildOrderProduct objects filtered by the title column
- * @method array findByDescription(string $description) Return ChildOrderProduct objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildOrderProduct objects filtered by the chapo column
+ * @method array findByDescription(string $description) Return ChildOrderProduct objects filtered by the description column
+ * @method array findByPostscriptum(string $postscriptum) Return ChildOrderProduct objects filtered by the postscriptum column
* @method array findByQuantity(double $quantity) Return ChildOrderProduct objects filtered by the quantity column
* @method array findByPrice(double $price) Return ChildOrderProduct objects filtered by the price column
- * @method array findByTax(double $tax) Return ChildOrderProduct objects filtered by the tax column
+ * @method array findByPromoPrice(string $promo_price) Return ChildOrderProduct objects filtered by the promo_price column
+ * @method array findByWasNew(int $was_new) Return ChildOrderProduct objects filtered by the was_new column
+ * @method array findByWasInPromo(int $was_in_promo) Return ChildOrderProduct objects filtered by the was_in_promo column
+ * @method array findByWeight(string $weight) Return ChildOrderProduct objects filtered by the weight column
+ * @method array findByTaxRuleTitle(string $tax_rule_title) Return ChildOrderProduct objects filtered by the tax_rule_title column
+ * @method array findByTaxRuleDescription(string $tax_rule_description) Return ChildOrderProduct objects filtered by the tax_rule_description column
* @method array findByParent(int $parent) Return ChildOrderProduct objects filtered by the parent column
* @method array findByCreatedAt(string $created_at) Return ChildOrderProduct objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildOrderProduct objects filtered by the updated_at column
@@ -175,7 +207,7 @@ abstract class OrderProductQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, ORDER_ID, PRODUCT_REF, TITLE, DESCRIPTION, CHAPO, QUANTITY, PRICE, TAX, PARENT, CREATED_AT, UPDATED_AT FROM order_product WHERE ID = :p0';
+ $sql = 'SELECT ID, ORDER_ID, PRODUCT_REF, PRODUCT_SALE_ELEMENTS_REF, TITLE, CHAPO, DESCRIPTION, POSTSCRIPTUM, QUANTITY, PRICE, PROMO_PRICE, WAS_NEW, WAS_IN_PROMO, WEIGHT, TAX_RULE_TITLE, TAX_RULE_DESCRIPTION, PARENT, CREATED_AT, UPDATED_AT FROM order_product WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -377,6 +409,35 @@ abstract class OrderProductQuery extends ModelCriteria
return $this->addUsingAlias(OrderProductTableMap::PRODUCT_REF, $productRef, $comparison);
}
+ /**
+ * Filter the query on the product_sale_elements_ref column
+ *
+ * Example usage:
+ *
+ * $query->filterByProductSaleElementsRef('fooValue'); // WHERE product_sale_elements_ref = 'fooValue'
+ * $query->filterByProductSaleElementsRef('%fooValue%'); // WHERE product_sale_elements_ref LIKE '%fooValue%'
+ *
+ *
+ * @param string $productSaleElementsRef 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 ChildOrderProductQuery The current query, for fluid interface
+ */
+ public function filterByProductSaleElementsRef($productSaleElementsRef = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($productSaleElementsRef)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $productSaleElementsRef)) {
+ $productSaleElementsRef = str_replace('*', '%', $productSaleElementsRef);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF, $productSaleElementsRef, $comparison);
+ }
+
/**
* Filter the query on the title column
*
@@ -406,6 +467,35 @@ abstract class OrderProductQuery extends ModelCriteria
return $this->addUsingAlias(OrderProductTableMap::TITLE, $title, $comparison);
}
+ /**
+ * Filter the query on the chapo column
+ *
+ * Example usage:
+ *
+ * $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
+ * $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
+ *
+ *
+ * @param string $chapo 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 ChildOrderProductQuery The current query, for fluid interface
+ */
+ public function filterByChapo($chapo = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($chapo)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $chapo)) {
+ $chapo = str_replace('*', '%', $chapo);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductTableMap::CHAPO, $chapo, $comparison);
+ }
+
/**
* Filter the query on the description column
*
@@ -436,32 +526,32 @@ abstract class OrderProductQuery extends ModelCriteria
}
/**
- * Filter the query on the chapo column
+ * Filter the query on the postscriptum column
*
* Example usage:
*
- * $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
- * $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
+ * $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
+ * $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
*
*
- * @param string $chapo The value to use as filter.
+ * @param string $postscriptum 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 ChildOrderProductQuery The current query, for fluid interface
*/
- public function filterByChapo($chapo = null, $comparison = null)
+ public function filterByPostscriptum($postscriptum = null, $comparison = null)
{
if (null === $comparison) {
- if (is_array($chapo)) {
+ if (is_array($postscriptum)) {
$comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $chapo)) {
- $chapo = str_replace('*', '%', $chapo);
+ } elseif (preg_match('/[\%\*]/', $postscriptum)) {
+ $postscriptum = str_replace('*', '%', $postscriptum);
$comparison = Criteria::LIKE;
}
}
- return $this->addUsingAlias(OrderProductTableMap::CHAPO, $chapo, $comparison);
+ return $this->addUsingAlias(OrderProductTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
}
/**
@@ -547,16 +637,45 @@ abstract class OrderProductQuery extends ModelCriteria
}
/**
- * Filter the query on the tax column
+ * Filter the query on the promo_price column
*
* Example usage:
*
- * $query->filterByTax(1234); // WHERE tax = 1234
- * $query->filterByTax(array(12, 34)); // WHERE tax IN (12, 34)
- * $query->filterByTax(array('min' => 12)); // WHERE tax > 12
+ * $query->filterByPromoPrice('fooValue'); // WHERE promo_price = 'fooValue'
+ * $query->filterByPromoPrice('%fooValue%'); // WHERE promo_price LIKE '%fooValue%'
*
*
- * @param mixed $tax The value to use as filter.
+ * @param string $promoPrice 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 ChildOrderProductQuery The current query, for fluid interface
+ */
+ public function filterByPromoPrice($promoPrice = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($promoPrice)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $promoPrice)) {
+ $promoPrice = str_replace('*', '%', $promoPrice);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductTableMap::PROMO_PRICE, $promoPrice, $comparison);
+ }
+
+ /**
+ * Filter the query on the was_new column
+ *
+ * Example usage:
+ *
+ * $query->filterByWasNew(1234); // WHERE was_new = 1234
+ * $query->filterByWasNew(array(12, 34)); // WHERE was_new IN (12, 34)
+ * $query->filterByWasNew(array('min' => 12)); // WHERE was_new > 12
+ *
+ *
+ * @param mixed $wasNew 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.
@@ -564,16 +683,16 @@ abstract class OrderProductQuery extends ModelCriteria
*
* @return ChildOrderProductQuery The current query, for fluid interface
*/
- public function filterByTax($tax = null, $comparison = null)
+ public function filterByWasNew($wasNew = null, $comparison = null)
{
- if (is_array($tax)) {
+ if (is_array($wasNew)) {
$useMinMax = false;
- if (isset($tax['min'])) {
- $this->addUsingAlias(OrderProductTableMap::TAX, $tax['min'], Criteria::GREATER_EQUAL);
+ if (isset($wasNew['min'])) {
+ $this->addUsingAlias(OrderProductTableMap::WAS_NEW, $wasNew['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($tax['max'])) {
- $this->addUsingAlias(OrderProductTableMap::TAX, $tax['max'], Criteria::LESS_EQUAL);
+ if (isset($wasNew['max'])) {
+ $this->addUsingAlias(OrderProductTableMap::WAS_NEW, $wasNew['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -584,7 +703,135 @@ abstract class OrderProductQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(OrderProductTableMap::TAX, $tax, $comparison);
+ return $this->addUsingAlias(OrderProductTableMap::WAS_NEW, $wasNew, $comparison);
+ }
+
+ /**
+ * Filter the query on the was_in_promo column
+ *
+ * Example usage:
+ *
+ * $query->filterByWasInPromo(1234); // WHERE was_in_promo = 1234
+ * $query->filterByWasInPromo(array(12, 34)); // WHERE was_in_promo IN (12, 34)
+ * $query->filterByWasInPromo(array('min' => 12)); // WHERE was_in_promo > 12
+ *
+ *
+ * @param mixed $wasInPromo 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 ChildOrderProductQuery The current query, for fluid interface
+ */
+ public function filterByWasInPromo($wasInPromo = null, $comparison = null)
+ {
+ if (is_array($wasInPromo)) {
+ $useMinMax = false;
+ if (isset($wasInPromo['min'])) {
+ $this->addUsingAlias(OrderProductTableMap::WAS_IN_PROMO, $wasInPromo['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($wasInPromo['max'])) {
+ $this->addUsingAlias(OrderProductTableMap::WAS_IN_PROMO, $wasInPromo['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductTableMap::WAS_IN_PROMO, $wasInPromo, $comparison);
+ }
+
+ /**
+ * Filter the query on the weight column
+ *
+ * Example usage:
+ *
+ * $query->filterByWeight('fooValue'); // WHERE weight = 'fooValue'
+ * $query->filterByWeight('%fooValue%'); // WHERE weight LIKE '%fooValue%'
+ *
+ *
+ * @param string $weight 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 ChildOrderProductQuery The current query, for fluid interface
+ */
+ public function filterByWeight($weight = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($weight)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $weight)) {
+ $weight = str_replace('*', '%', $weight);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductTableMap::WEIGHT, $weight, $comparison);
+ }
+
+ /**
+ * Filter the query on the tax_rule_title column
+ *
+ * Example usage:
+ *
+ * $query->filterByTaxRuleTitle('fooValue'); // WHERE tax_rule_title = 'fooValue'
+ * $query->filterByTaxRuleTitle('%fooValue%'); // WHERE tax_rule_title LIKE '%fooValue%'
+ *
+ *
+ * @param string $taxRuleTitle 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 ChildOrderProductQuery The current query, for fluid interface
+ */
+ public function filterByTaxRuleTitle($taxRuleTitle = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($taxRuleTitle)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $taxRuleTitle)) {
+ $taxRuleTitle = str_replace('*', '%', $taxRuleTitle);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductTableMap::TAX_RULE_TITLE, $taxRuleTitle, $comparison);
+ }
+
+ /**
+ * Filter the query on the tax_rule_description column
+ *
+ * Example usage:
+ *
+ * $query->filterByTaxRuleDescription('fooValue'); // WHERE tax_rule_description = 'fooValue'
+ * $query->filterByTaxRuleDescription('%fooValue%'); // WHERE tax_rule_description LIKE '%fooValue%'
+ *
+ *
+ * @param string $taxRuleDescription 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 ChildOrderProductQuery The current query, for fluid interface
+ */
+ public function filterByTaxRuleDescription($taxRuleDescription = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($taxRuleDescription)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $taxRuleDescription)) {
+ $taxRuleDescription = str_replace('*', '%', $taxRuleDescription);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductTableMap::TAX_RULE_DESCRIPTION, $taxRuleDescription, $comparison);
}
/**
@@ -790,40 +1037,40 @@ abstract class OrderProductQuery extends ModelCriteria
}
/**
- * Filter the query by a related \Thelia\Model\OrderFeature object
+ * Filter the query by a related \Thelia\Model\OrderProductAttributeCombination object
*
- * @param \Thelia\Model\OrderFeature|ObjectCollection $orderFeature the related object to use as filter
+ * @param \Thelia\Model\OrderProductAttributeCombination|ObjectCollection $orderProductAttributeCombination the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildOrderProductQuery The current query, for fluid interface
*/
- public function filterByOrderFeature($orderFeature, $comparison = null)
+ public function filterByOrderProductAttributeCombination($orderProductAttributeCombination, $comparison = null)
{
- if ($orderFeature instanceof \Thelia\Model\OrderFeature) {
+ if ($orderProductAttributeCombination instanceof \Thelia\Model\OrderProductAttributeCombination) {
return $this
- ->addUsingAlias(OrderProductTableMap::ID, $orderFeature->getOrderProductId(), $comparison);
- } elseif ($orderFeature instanceof ObjectCollection) {
+ ->addUsingAlias(OrderProductTableMap::ID, $orderProductAttributeCombination->getOrderProductId(), $comparison);
+ } elseif ($orderProductAttributeCombination instanceof ObjectCollection) {
return $this
- ->useOrderFeatureQuery()
- ->filterByPrimaryKeys($orderFeature->getPrimaryKeys())
+ ->useOrderProductAttributeCombinationQuery()
+ ->filterByPrimaryKeys($orderProductAttributeCombination->getPrimaryKeys())
->endUse();
} else {
- throw new PropelException('filterByOrderFeature() only accepts arguments of type \Thelia\Model\OrderFeature or Collection');
+ throw new PropelException('filterByOrderProductAttributeCombination() only accepts arguments of type \Thelia\Model\OrderProductAttributeCombination or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the OrderFeature relation
+ * Adds a JOIN clause to the query using the OrderProductAttributeCombination relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildOrderProductQuery The current query, for fluid interface
*/
- public function joinOrderFeature($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinOrderProductAttributeCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('OrderFeature');
+ $relationMap = $tableMap->getRelation('OrderProductAttributeCombination');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -838,14 +1085,14 @@ abstract class OrderProductQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'OrderFeature');
+ $this->addJoinObject($join, 'OrderProductAttributeCombination');
}
return $this;
}
/**
- * Use the OrderFeature relation OrderFeature object
+ * Use the OrderProductAttributeCombination relation OrderProductAttributeCombination object
*
* @see useQuery()
*
@@ -853,13 +1100,86 @@ abstract class OrderProductQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return \Thelia\Model\OrderFeatureQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\OrderProductAttributeCombinationQuery A secondary query class using the current class as primary query
*/
- public function useOrderFeatureQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useOrderProductAttributeCombinationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinOrderFeature($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'OrderFeature', '\Thelia\Model\OrderFeatureQuery');
+ ->joinOrderProductAttributeCombination($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'OrderProductAttributeCombination', '\Thelia\Model\OrderProductAttributeCombinationQuery');
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\OrderProductTax object
+ *
+ * @param \Thelia\Model\OrderProductTax|ObjectCollection $orderProductTax the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildOrderProductQuery The current query, for fluid interface
+ */
+ public function filterByOrderProductTax($orderProductTax, $comparison = null)
+ {
+ if ($orderProductTax instanceof \Thelia\Model\OrderProductTax) {
+ return $this
+ ->addUsingAlias(OrderProductTableMap::ID, $orderProductTax->getOrderProductId(), $comparison);
+ } elseif ($orderProductTax instanceof ObjectCollection) {
+ return $this
+ ->useOrderProductTaxQuery()
+ ->filterByPrimaryKeys($orderProductTax->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByOrderProductTax() only accepts arguments of type \Thelia\Model\OrderProductTax or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the OrderProductTax relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildOrderProductQuery The current query, for fluid interface
+ */
+ public function joinOrderProductTax($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('OrderProductTax');
+
+ // 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, 'OrderProductTax');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the OrderProductTax relation OrderProductTax object
+ *
+ * @see useQuery()
+ *
+ * @param string $relationAlias optional alias for the relation,
+ * to be used as main alias in the secondary query
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return \Thelia\Model\OrderProductTaxQuery A secondary query class using the current class as primary query
+ */
+ public function useOrderProductTaxQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinOrderProductTax($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'OrderProductTax', '\Thelia\Model\OrderProductTaxQuery');
}
/**
diff --git a/core/lib/Thelia/Model/Base/FeatureCategory.php b/core/lib/Thelia/Model/Base/OrderProductTax.php
similarity index 75%
rename from core/lib/Thelia/Model/Base/FeatureCategory.php
rename to core/lib/Thelia/Model/Base/OrderProductTax.php
index 035e077d2..544755ff4 100644
--- a/core/lib/Thelia/Model/Base/FeatureCategory.php
+++ b/core/lib/Thelia/Model/Base/OrderProductTax.php
@@ -16,20 +16,18 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
-use Thelia\Model\Category as ChildCategory;
-use Thelia\Model\CategoryQuery as ChildCategoryQuery;
-use Thelia\Model\Feature as ChildFeature;
-use Thelia\Model\FeatureCategory as ChildFeatureCategory;
-use Thelia\Model\FeatureCategoryQuery as ChildFeatureCategoryQuery;
-use Thelia\Model\FeatureQuery as ChildFeatureQuery;
-use Thelia\Model\Map\FeatureCategoryTableMap;
+use Thelia\Model\OrderProduct as ChildOrderProduct;
+use Thelia\Model\OrderProductQuery as ChildOrderProductQuery;
+use Thelia\Model\OrderProductTax as ChildOrderProductTax;
+use Thelia\Model\OrderProductTaxQuery as ChildOrderProductTaxQuery;
+use Thelia\Model\Map\OrderProductTaxTableMap;
-abstract class FeatureCategory implements ActiveRecordInterface
+abstract class OrderProductTax implements ActiveRecordInterface
{
/**
* TableMap class name
*/
- const TABLE_MAP = '\\Thelia\\Model\\Map\\FeatureCategoryTableMap';
+ const TABLE_MAP = '\\Thelia\\Model\\Map\\OrderProductTaxTableMap';
/**
@@ -65,16 +63,28 @@ abstract class FeatureCategory implements ActiveRecordInterface
protected $id;
/**
- * The value for the feature_id field.
+ * The value for the order_product_id field.
* @var int
*/
- protected $feature_id;
+ protected $order_product_id;
/**
- * The value for the category_id field.
- * @var int
+ * The value for the title field.
+ * @var string
*/
- protected $category_id;
+ protected $title;
+
+ /**
+ * The value for the description field.
+ * @var string
+ */
+ protected $description;
+
+ /**
+ * The value for the amount field.
+ * @var double
+ */
+ protected $amount;
/**
* The value for the created_at field.
@@ -89,14 +99,9 @@ abstract class FeatureCategory implements ActiveRecordInterface
protected $updated_at;
/**
- * @var Category
+ * @var OrderProduct
*/
- protected $aCategory;
-
- /**
- * @var Feature
- */
- protected $aFeature;
+ protected $aOrderProduct;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -107,7 +112,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
protected $alreadyInSave = false;
/**
- * Initializes internal state of Thelia\Model\Base\FeatureCategory object.
+ * Initializes internal state of Thelia\Model\Base\OrderProductTax object.
*/
public function __construct()
{
@@ -202,9 +207,9 @@ abstract class FeatureCategory implements ActiveRecordInterface
}
/**
- * Compares this with another FeatureCategory instance. If
- * obj is an instance of FeatureCategory, delegates to
- * equals(FeatureCategory). Otherwise, returns false.
+ * Compares this with another OrderProductTax instance. If
+ * obj is an instance of OrderProductTax, delegates to
+ * equals(OrderProductTax). Otherwise, returns false.
*
* @param obj The object to compare to.
* @return Whether equal to the object specified.
@@ -285,7 +290,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
* @param string $name The virtual column name
* @param mixed $value The value to give to the virtual column
*
- * @return FeatureCategory The current object, for fluid interface
+ * @return OrderProductTax The current object, for fluid interface
*/
public function setVirtualColumn($name, $value)
{
@@ -317,7 +322,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
* @param string $data The source data to import from
*
- * @return FeatureCategory The current object, for fluid interface
+ * @return OrderProductTax The current object, for fluid interface
*/
public function importFrom($parser, $data)
{
@@ -372,25 +377,47 @@ abstract class FeatureCategory implements ActiveRecordInterface
}
/**
- * Get the [feature_id] column value.
+ * Get the [order_product_id] column value.
*
* @return int
*/
- public function getFeatureId()
+ public function getOrderProductId()
{
- return $this->feature_id;
+ return $this->order_product_id;
}
/**
- * Get the [category_id] column value.
+ * Get the [title] column value.
*
- * @return int
+ * @return string
*/
- public function getCategoryId()
+ public function getTitle()
{
- return $this->category_id;
+ return $this->title;
+ }
+
+ /**
+ * Get the [description] column value.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+
+ return $this->description;
+ }
+
+ /**
+ * Get the [amount] column value.
+ *
+ * @return double
+ */
+ public function getAmount()
+ {
+
+ return $this->amount;
}
/**
@@ -437,7 +464,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
* Set the value of [id] column.
*
* @param int $v new value
- * @return \Thelia\Model\FeatureCategory The current object (for fluent API support)
+ * @return \Thelia\Model\OrderProductTax The current object (for fluent API support)
*/
public function setId($v)
{
@@ -447,7 +474,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
if ($this->id !== $v) {
$this->id = $v;
- $this->modifiedColumns[] = FeatureCategoryTableMap::ID;
+ $this->modifiedColumns[] = OrderProductTaxTableMap::ID;
}
@@ -455,61 +482,99 @@ abstract class FeatureCategory implements ActiveRecordInterface
} // setId()
/**
- * Set the value of [feature_id] column.
+ * Set the value of [order_product_id] column.
*
* @param int $v new value
- * @return \Thelia\Model\FeatureCategory The current object (for fluent API support)
+ * @return \Thelia\Model\OrderProductTax The current object (for fluent API support)
*/
- public function setFeatureId($v)
+ public function setOrderProductId($v)
{
if ($v !== null) {
$v = (int) $v;
}
- if ($this->feature_id !== $v) {
- $this->feature_id = $v;
- $this->modifiedColumns[] = FeatureCategoryTableMap::FEATURE_ID;
+ if ($this->order_product_id !== $v) {
+ $this->order_product_id = $v;
+ $this->modifiedColumns[] = OrderProductTaxTableMap::ORDER_PRODUCT_ID;
}
- if ($this->aFeature !== null && $this->aFeature->getId() !== $v) {
- $this->aFeature = null;
+ if ($this->aOrderProduct !== null && $this->aOrderProduct->getId() !== $v) {
+ $this->aOrderProduct = null;
}
return $this;
- } // setFeatureId()
+ } // setOrderProductId()
/**
- * Set the value of [category_id] column.
+ * Set the value of [title] column.
*
- * @param int $v new value
- * @return \Thelia\Model\FeatureCategory The current object (for fluent API support)
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductTax The current object (for fluent API support)
*/
- public function setCategoryId($v)
+ public function setTitle($v)
{
if ($v !== null) {
- $v = (int) $v;
+ $v = (string) $v;
}
- if ($this->category_id !== $v) {
- $this->category_id = $v;
- $this->modifiedColumns[] = FeatureCategoryTableMap::CATEGORY_ID;
- }
-
- if ($this->aCategory !== null && $this->aCategory->getId() !== $v) {
- $this->aCategory = null;
+ if ($this->title !== $v) {
+ $this->title = $v;
+ $this->modifiedColumns[] = OrderProductTaxTableMap::TITLE;
}
return $this;
- } // setCategoryId()
+ } // setTitle()
+
+ /**
+ * Set the value of [description] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\OrderProductTax The current object (for fluent API support)
+ */
+ public function setDescription($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->description !== $v) {
+ $this->description = $v;
+ $this->modifiedColumns[] = OrderProductTaxTableMap::DESCRIPTION;
+ }
+
+
+ return $this;
+ } // setDescription()
+
+ /**
+ * Set the value of [amount] column.
+ *
+ * @param double $v new value
+ * @return \Thelia\Model\OrderProductTax The current object (for fluent API support)
+ */
+ public function setAmount($v)
+ {
+ if ($v !== null) {
+ $v = (double) $v;
+ }
+
+ if ($this->amount !== $v) {
+ $this->amount = $v;
+ $this->modifiedColumns[] = OrderProductTaxTableMap::AMOUNT;
+ }
+
+
+ return $this;
+ } // setAmount()
/**
* 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 \Thelia\Model\FeatureCategory The current object (for fluent API support)
+ * @return \Thelia\Model\OrderProductTax The current object (for fluent API support)
*/
public function setCreatedAt($v)
{
@@ -517,7 +582,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
if ($this->created_at !== null || $dt !== null) {
if ($dt !== $this->created_at) {
$this->created_at = $dt;
- $this->modifiedColumns[] = FeatureCategoryTableMap::CREATED_AT;
+ $this->modifiedColumns[] = OrderProductTaxTableMap::CREATED_AT;
}
} // if either are not null
@@ -530,7 +595,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
- * @return \Thelia\Model\FeatureCategory The current object (for fluent API support)
+ * @return \Thelia\Model\OrderProductTax The current object (for fluent API support)
*/
public function setUpdatedAt($v)
{
@@ -538,7 +603,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
if ($this->updated_at !== null || $dt !== null) {
if ($dt !== $this->updated_at) {
$this->updated_at = $dt;
- $this->modifiedColumns[] = FeatureCategoryTableMap::UPDATED_AT;
+ $this->modifiedColumns[] = OrderProductTaxTableMap::UPDATED_AT;
}
} // if either are not null
@@ -583,22 +648,28 @@ abstract class FeatureCategory implements ActiveRecordInterface
try {
- $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : FeatureCategoryTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : OrderProductTaxTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : FeatureCategoryTableMap::translateFieldName('FeatureId', TableMap::TYPE_PHPNAME, $indexType)];
- $this->feature_id = (null !== $col) ? (int) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : OrderProductTaxTableMap::translateFieldName('OrderProductId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->order_product_id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FeatureCategoryTableMap::translateFieldName('CategoryId', TableMap::TYPE_PHPNAME, $indexType)];
- $this->category_id = (null !== $col) ? (int) $col : null;
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : OrderProductTaxTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->title = (null !== $col) ? (string) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FeatureCategoryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : OrderProductTaxTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->description = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : OrderProductTaxTableMap::translateFieldName('Amount', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->amount = (null !== $col) ? (double) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : OrderProductTaxTableMap::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 ? 4 + $startcol : FeatureCategoryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : OrderProductTaxTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -611,10 +682,10 @@ abstract class FeatureCategory implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 5; // 5 = FeatureCategoryTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 7; // 7 = OrderProductTaxTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
- throw new PropelException("Error populating \Thelia\Model\FeatureCategory object", 0, $e);
+ throw new PropelException("Error populating \Thelia\Model\OrderProductTax object", 0, $e);
}
}
@@ -633,11 +704,8 @@ abstract class FeatureCategory implements ActiveRecordInterface
*/
public function ensureConsistency()
{
- if ($this->aFeature !== null && $this->feature_id !== $this->aFeature->getId()) {
- $this->aFeature = null;
- }
- if ($this->aCategory !== null && $this->category_id !== $this->aCategory->getId()) {
- $this->aCategory = null;
+ if ($this->aOrderProduct !== null && $this->order_product_id !== $this->aOrderProduct->getId()) {
+ $this->aOrderProduct = null;
}
} // ensureConsistency
@@ -662,13 +730,13 @@ abstract class FeatureCategory implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(FeatureCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getReadConnection(OrderProductTaxTableMap::DATABASE_NAME);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
- $dataFetcher = ChildFeatureCategoryQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $dataFetcher = ChildOrderProductTaxQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$row = $dataFetcher->fetch();
$dataFetcher->close();
if (!$row) {
@@ -678,8 +746,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
- $this->aCategory = null;
- $this->aFeature = null;
+ $this->aOrderProduct = null;
} // if (deep)
}
@@ -689,8 +756,8 @@ abstract class FeatureCategory implements ActiveRecordInterface
* @param ConnectionInterface $con
* @return void
* @throws PropelException
- * @see FeatureCategory::setDeleted()
- * @see FeatureCategory::isDeleted()
+ * @see OrderProductTax::setDeleted()
+ * @see OrderProductTax::isDeleted()
*/
public function delete(ConnectionInterface $con = null)
{
@@ -699,12 +766,12 @@ abstract class FeatureCategory implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderProductTaxTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
- $deleteQuery = ChildFeatureCategoryQuery::create()
+ $deleteQuery = ChildOrderProductTaxQuery::create()
->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con);
if ($ret) {
@@ -741,7 +808,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderProductTaxTableMap::DATABASE_NAME);
}
$con->beginTransaction();
@@ -751,16 +818,16 @@ abstract class FeatureCategory implements ActiveRecordInterface
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
// timestampable behavior
- if (!$this->isColumnModified(FeatureCategoryTableMap::CREATED_AT)) {
+ if (!$this->isColumnModified(OrderProductTaxTableMap::CREATED_AT)) {
$this->setCreatedAt(time());
}
- if (!$this->isColumnModified(FeatureCategoryTableMap::UPDATED_AT)) {
+ if (!$this->isColumnModified(OrderProductTaxTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
// timestampable behavior
- if ($this->isModified() && !$this->isColumnModified(FeatureCategoryTableMap::UPDATED_AT)) {
+ if ($this->isModified() && !$this->isColumnModified(OrderProductTaxTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
}
@@ -772,7 +839,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
$this->postUpdate($con);
}
$this->postSave($con);
- FeatureCategoryTableMap::addInstanceToPool($this);
+ OrderProductTaxTableMap::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
@@ -807,18 +874,11 @@ abstract class FeatureCategory implements ActiveRecordInterface
// method. This object relates to these object(s) by a
// foreign key reference.
- if ($this->aCategory !== null) {
- if ($this->aCategory->isModified() || $this->aCategory->isNew()) {
- $affectedRows += $this->aCategory->save($con);
+ if ($this->aOrderProduct !== null) {
+ if ($this->aOrderProduct->isModified() || $this->aOrderProduct->isNew()) {
+ $affectedRows += $this->aOrderProduct->save($con);
}
- $this->setCategory($this->aCategory);
- }
-
- if ($this->aFeature !== null) {
- if ($this->aFeature->isModified() || $this->aFeature->isNew()) {
- $affectedRows += $this->aFeature->save($con);
- }
- $this->setFeature($this->aFeature);
+ $this->setOrderProduct($this->aOrderProduct);
}
if ($this->isNew() || $this->isModified()) {
@@ -852,30 +912,36 @@ abstract class FeatureCategory implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
- $this->modifiedColumns[] = FeatureCategoryTableMap::ID;
+ $this->modifiedColumns[] = OrderProductTaxTableMap::ID;
if (null !== $this->id) {
- throw new PropelException('Cannot insert a value for auto-increment primary key (' . FeatureCategoryTableMap::ID . ')');
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . OrderProductTaxTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries
- if ($this->isColumnModified(FeatureCategoryTableMap::ID)) {
+ if ($this->isColumnModified(OrderProductTaxTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
- if ($this->isColumnModified(FeatureCategoryTableMap::FEATURE_ID)) {
- $modifiedColumns[':p' . $index++] = 'FEATURE_ID';
+ if ($this->isColumnModified(OrderProductTaxTableMap::ORDER_PRODUCT_ID)) {
+ $modifiedColumns[':p' . $index++] = 'ORDER_PRODUCT_ID';
}
- if ($this->isColumnModified(FeatureCategoryTableMap::CATEGORY_ID)) {
- $modifiedColumns[':p' . $index++] = 'CATEGORY_ID';
+ if ($this->isColumnModified(OrderProductTaxTableMap::TITLE)) {
+ $modifiedColumns[':p' . $index++] = 'TITLE';
}
- if ($this->isColumnModified(FeatureCategoryTableMap::CREATED_AT)) {
+ if ($this->isColumnModified(OrderProductTaxTableMap::DESCRIPTION)) {
+ $modifiedColumns[':p' . $index++] = 'DESCRIPTION';
+ }
+ if ($this->isColumnModified(OrderProductTaxTableMap::AMOUNT)) {
+ $modifiedColumns[':p' . $index++] = 'AMOUNT';
+ }
+ if ($this->isColumnModified(OrderProductTaxTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
- if ($this->isColumnModified(FeatureCategoryTableMap::UPDATED_AT)) {
+ if ($this->isColumnModified(OrderProductTaxTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT';
}
$sql = sprintf(
- 'INSERT INTO feature_category (%s) VALUES (%s)',
+ 'INSERT INTO order_product_tax (%s) VALUES (%s)',
implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns))
);
@@ -887,11 +953,17 @@ abstract class FeatureCategory implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
- case 'FEATURE_ID':
- $stmt->bindValue($identifier, $this->feature_id, PDO::PARAM_INT);
+ case 'ORDER_PRODUCT_ID':
+ $stmt->bindValue($identifier, $this->order_product_id, PDO::PARAM_INT);
break;
- case 'CATEGORY_ID':
- $stmt->bindValue($identifier, $this->category_id, PDO::PARAM_INT);
+ case 'TITLE':
+ $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
+ break;
+ case 'DESCRIPTION':
+ $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
+ break;
+ case 'AMOUNT':
+ $stmt->bindValue($identifier, $this->amount, PDO::PARAM_STR);
break;
case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
@@ -945,7 +1017,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
*/
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
{
- $pos = FeatureCategoryTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = OrderProductTaxTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
@@ -965,15 +1037,21 @@ abstract class FeatureCategory implements ActiveRecordInterface
return $this->getId();
break;
case 1:
- return $this->getFeatureId();
+ return $this->getOrderProductId();
break;
case 2:
- return $this->getCategoryId();
+ return $this->getTitle();
break;
case 3:
- return $this->getCreatedAt();
+ return $this->getDescription();
break;
case 4:
+ return $this->getAmount();
+ break;
+ case 5:
+ return $this->getCreatedAt();
+ break;
+ case 6:
return $this->getUpdatedAt();
break;
default:
@@ -999,17 +1077,19 @@ abstract class FeatureCategory implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
- if (isset($alreadyDumpedObjects['FeatureCategory'][$this->getPrimaryKey()])) {
+ if (isset($alreadyDumpedObjects['OrderProductTax'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
- $alreadyDumpedObjects['FeatureCategory'][$this->getPrimaryKey()] = true;
- $keys = FeatureCategoryTableMap::getFieldNames($keyType);
+ $alreadyDumpedObjects['OrderProductTax'][$this->getPrimaryKey()] = true;
+ $keys = OrderProductTaxTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
- $keys[1] => $this->getFeatureId(),
- $keys[2] => $this->getCategoryId(),
- $keys[3] => $this->getCreatedAt(),
- $keys[4] => $this->getUpdatedAt(),
+ $keys[1] => $this->getOrderProductId(),
+ $keys[2] => $this->getTitle(),
+ $keys[3] => $this->getDescription(),
+ $keys[4] => $this->getAmount(),
+ $keys[5] => $this->getCreatedAt(),
+ $keys[6] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1018,11 +1098,8 @@ abstract class FeatureCategory implements ActiveRecordInterface
}
if ($includeForeignObjects) {
- if (null !== $this->aCategory) {
- $result['Category'] = $this->aCategory->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
- }
- if (null !== $this->aFeature) {
- $result['Feature'] = $this->aFeature->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ if (null !== $this->aOrderProduct) {
+ $result['OrderProduct'] = $this->aOrderProduct->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
@@ -1042,7 +1119,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
*/
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
{
- $pos = FeatureCategoryTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $pos = OrderProductTaxTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -1062,15 +1139,21 @@ abstract class FeatureCategory implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
- $this->setFeatureId($value);
+ $this->setOrderProductId($value);
break;
case 2:
- $this->setCategoryId($value);
+ $this->setTitle($value);
break;
case 3:
- $this->setCreatedAt($value);
+ $this->setDescription($value);
break;
case 4:
+ $this->setAmount($value);
+ break;
+ case 5:
+ $this->setCreatedAt($value);
+ break;
+ case 6:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1095,13 +1178,15 @@ abstract class FeatureCategory implements ActiveRecordInterface
*/
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
- $keys = FeatureCategoryTableMap::getFieldNames($keyType);
+ $keys = OrderProductTaxTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setFeatureId($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCategoryId($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
+ if (array_key_exists($keys[1], $arr)) $this->setOrderProductId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setTitle($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setDescription($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setAmount($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
}
/**
@@ -1111,13 +1196,15 @@ abstract class FeatureCategory implements ActiveRecordInterface
*/
public function buildCriteria()
{
- $criteria = new Criteria(FeatureCategoryTableMap::DATABASE_NAME);
+ $criteria = new Criteria(OrderProductTaxTableMap::DATABASE_NAME);
- if ($this->isColumnModified(FeatureCategoryTableMap::ID)) $criteria->add(FeatureCategoryTableMap::ID, $this->id);
- if ($this->isColumnModified(FeatureCategoryTableMap::FEATURE_ID)) $criteria->add(FeatureCategoryTableMap::FEATURE_ID, $this->feature_id);
- if ($this->isColumnModified(FeatureCategoryTableMap::CATEGORY_ID)) $criteria->add(FeatureCategoryTableMap::CATEGORY_ID, $this->category_id);
- if ($this->isColumnModified(FeatureCategoryTableMap::CREATED_AT)) $criteria->add(FeatureCategoryTableMap::CREATED_AT, $this->created_at);
- if ($this->isColumnModified(FeatureCategoryTableMap::UPDATED_AT)) $criteria->add(FeatureCategoryTableMap::UPDATED_AT, $this->updated_at);
+ if ($this->isColumnModified(OrderProductTaxTableMap::ID)) $criteria->add(OrderProductTaxTableMap::ID, $this->id);
+ if ($this->isColumnModified(OrderProductTaxTableMap::ORDER_PRODUCT_ID)) $criteria->add(OrderProductTaxTableMap::ORDER_PRODUCT_ID, $this->order_product_id);
+ if ($this->isColumnModified(OrderProductTaxTableMap::TITLE)) $criteria->add(OrderProductTaxTableMap::TITLE, $this->title);
+ if ($this->isColumnModified(OrderProductTaxTableMap::DESCRIPTION)) $criteria->add(OrderProductTaxTableMap::DESCRIPTION, $this->description);
+ if ($this->isColumnModified(OrderProductTaxTableMap::AMOUNT)) $criteria->add(OrderProductTaxTableMap::AMOUNT, $this->amount);
+ if ($this->isColumnModified(OrderProductTaxTableMap::CREATED_AT)) $criteria->add(OrderProductTaxTableMap::CREATED_AT, $this->created_at);
+ if ($this->isColumnModified(OrderProductTaxTableMap::UPDATED_AT)) $criteria->add(OrderProductTaxTableMap::UPDATED_AT, $this->updated_at);
return $criteria;
}
@@ -1132,8 +1219,8 @@ abstract class FeatureCategory implements ActiveRecordInterface
*/
public function buildPkeyCriteria()
{
- $criteria = new Criteria(FeatureCategoryTableMap::DATABASE_NAME);
- $criteria->add(FeatureCategoryTableMap::ID, $this->id);
+ $criteria = new Criteria(OrderProductTaxTableMap::DATABASE_NAME);
+ $criteria->add(OrderProductTaxTableMap::ID, $this->id);
return $criteria;
}
@@ -1174,15 +1261,17 @@ abstract class FeatureCategory implements ActiveRecordInterface
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
- * @param object $copyObj An object of \Thelia\Model\FeatureCategory (or compatible) type.
+ * @param object $copyObj An object of \Thelia\Model\OrderProductTax (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->setFeatureId($this->getFeatureId());
- $copyObj->setCategoryId($this->getCategoryId());
+ $copyObj->setOrderProductId($this->getOrderProductId());
+ $copyObj->setTitle($this->getTitle());
+ $copyObj->setDescription($this->getDescription());
+ $copyObj->setAmount($this->getAmount());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1200,7 +1289,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return \Thelia\Model\FeatureCategory Clone of current object.
+ * @return \Thelia\Model\OrderProductTax Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -1214,26 +1303,26 @@ abstract class FeatureCategory implements ActiveRecordInterface
}
/**
- * Declares an association between this object and a ChildCategory object.
+ * Declares an association between this object and a ChildOrderProduct object.
*
- * @param ChildCategory $v
- * @return \Thelia\Model\FeatureCategory The current object (for fluent API support)
+ * @param ChildOrderProduct $v
+ * @return \Thelia\Model\OrderProductTax The current object (for fluent API support)
* @throws PropelException
*/
- public function setCategory(ChildCategory $v = null)
+ public function setOrderProduct(ChildOrderProduct $v = null)
{
if ($v === null) {
- $this->setCategoryId(NULL);
+ $this->setOrderProductId(NULL);
} else {
- $this->setCategoryId($v->getId());
+ $this->setOrderProductId($v->getId());
}
- $this->aCategory = $v;
+ $this->aOrderProduct = $v;
// Add binding for other direction of this n:n relationship.
- // If this object has already been added to the ChildCategory object, it will not be re-added.
+ // If this object has already been added to the ChildOrderProduct object, it will not be re-added.
if ($v !== null) {
- $v->addFeatureCategory($this);
+ $v->addOrderProductTax($this);
}
@@ -1242,77 +1331,26 @@ abstract class FeatureCategory implements ActiveRecordInterface
/**
- * Get the associated ChildCategory object
+ * Get the associated ChildOrderProduct object
*
* @param ConnectionInterface $con Optional Connection object.
- * @return ChildCategory The associated ChildCategory object.
+ * @return ChildOrderProduct The associated ChildOrderProduct object.
* @throws PropelException
*/
- public function getCategory(ConnectionInterface $con = null)
+ public function getOrderProduct(ConnectionInterface $con = null)
{
- if ($this->aCategory === null && ($this->category_id !== null)) {
- $this->aCategory = ChildCategoryQuery::create()->findPk($this->category_id, $con);
+ if ($this->aOrderProduct === null && ($this->order_product_id !== null)) {
+ $this->aOrderProduct = ChildOrderProductQuery::create()->findPk($this->order_product_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->aCategory->addFeatureCategories($this);
+ $this->aOrderProduct->addOrderProductTaxes($this);
*/
}
- return $this->aCategory;
- }
-
- /**
- * Declares an association between this object and a ChildFeature object.
- *
- * @param ChildFeature $v
- * @return \Thelia\Model\FeatureCategory The current object (for fluent API support)
- * @throws PropelException
- */
- public function setFeature(ChildFeature $v = null)
- {
- if ($v === null) {
- $this->setFeatureId(NULL);
- } else {
- $this->setFeatureId($v->getId());
- }
-
- $this->aFeature = $v;
-
- // Add binding for other direction of this n:n relationship.
- // If this object has already been added to the ChildFeature object, it will not be re-added.
- if ($v !== null) {
- $v->addFeatureCategory($this);
- }
-
-
- return $this;
- }
-
-
- /**
- * Get the associated ChildFeature object
- *
- * @param ConnectionInterface $con Optional Connection object.
- * @return ChildFeature The associated ChildFeature object.
- * @throws PropelException
- */
- public function getFeature(ConnectionInterface $con = null)
- {
- if ($this->aFeature === null && ($this->feature_id !== null)) {
- $this->aFeature = ChildFeatureQuery::create()->findPk($this->feature_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->aFeature->addFeatureCategories($this);
- */
- }
-
- return $this->aFeature;
+ return $this->aOrderProduct;
}
/**
@@ -1321,8 +1359,10 @@ abstract class FeatureCategory implements ActiveRecordInterface
public function clear()
{
$this->id = null;
- $this->feature_id = null;
- $this->category_id = null;
+ $this->order_product_id = null;
+ $this->title = null;
+ $this->description = null;
+ $this->amount = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
@@ -1346,8 +1386,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
if ($deep) {
} // if ($deep)
- $this->aCategory = null;
- $this->aFeature = null;
+ $this->aOrderProduct = null;
}
/**
@@ -1357,7 +1396,7 @@ abstract class FeatureCategory implements ActiveRecordInterface
*/
public function __toString()
{
- return (string) $this->exportTo(FeatureCategoryTableMap::DEFAULT_STRING_FORMAT);
+ return (string) $this->exportTo(OrderProductTaxTableMap::DEFAULT_STRING_FORMAT);
}
// timestampable behavior
@@ -1365,11 +1404,11 @@ abstract class FeatureCategory implements ActiveRecordInterface
/**
* Mark the current object so that the update date doesn't get updated during next save
*
- * @return ChildFeatureCategory The current object (for fluent API support)
+ * @return ChildOrderProductTax The current object (for fluent API support)
*/
public function keepUpdateDateUnchanged()
{
- $this->modifiedColumns[] = FeatureCategoryTableMap::UPDATED_AT;
+ $this->modifiedColumns[] = OrderProductTaxTableMap::UPDATED_AT;
return $this;
}
diff --git a/core/lib/Thelia/Model/Base/FeatureCategoryQuery.php b/core/lib/Thelia/Model/Base/OrderProductTaxQuery.php
similarity index 56%
rename from core/lib/Thelia/Model/Base/FeatureCategoryQuery.php
rename to core/lib/Thelia/Model/Base/OrderProductTaxQuery.php
index b9c9a67be..d37c2c501 100644
--- a/core/lib/Thelia/Model/Base/FeatureCategoryQuery.php
+++ b/core/lib/Thelia/Model/Base/OrderProductTaxQuery.php
@@ -12,84 +12,88 @@ use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
-use Thelia\Model\FeatureCategory as ChildFeatureCategory;
-use Thelia\Model\FeatureCategoryQuery as ChildFeatureCategoryQuery;
-use Thelia\Model\Map\FeatureCategoryTableMap;
+use Thelia\Model\OrderProductTax as ChildOrderProductTax;
+use Thelia\Model\OrderProductTaxQuery as ChildOrderProductTaxQuery;
+use Thelia\Model\Map\OrderProductTaxTableMap;
/**
- * Base class that represents a query for the 'feature_category' table.
+ * Base class that represents a query for the 'order_product_tax' table.
*
*
*
- * @method ChildFeatureCategoryQuery orderById($order = Criteria::ASC) Order by the id column
- * @method ChildFeatureCategoryQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
- * @method ChildFeatureCategoryQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
- * @method ChildFeatureCategoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
- * @method ChildFeatureCategoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
+ * @method ChildOrderProductTaxQuery orderById($order = Criteria::ASC) Order by the id column
+ * @method ChildOrderProductTaxQuery orderByOrderProductId($order = Criteria::ASC) Order by the order_product_id column
+ * @method ChildOrderProductTaxQuery orderByTitle($order = Criteria::ASC) Order by the title column
+ * @method ChildOrderProductTaxQuery orderByDescription($order = Criteria::ASC) Order by the description column
+ * @method ChildOrderProductTaxQuery orderByAmount($order = Criteria::ASC) Order by the amount column
+ * @method ChildOrderProductTaxQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
+ * @method ChildOrderProductTaxQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
- * @method ChildFeatureCategoryQuery groupById() Group by the id column
- * @method ChildFeatureCategoryQuery groupByFeatureId() Group by the feature_id column
- * @method ChildFeatureCategoryQuery groupByCategoryId() Group by the category_id column
- * @method ChildFeatureCategoryQuery groupByCreatedAt() Group by the created_at column
- * @method ChildFeatureCategoryQuery groupByUpdatedAt() Group by the updated_at column
+ * @method ChildOrderProductTaxQuery groupById() Group by the id column
+ * @method ChildOrderProductTaxQuery groupByOrderProductId() Group by the order_product_id column
+ * @method ChildOrderProductTaxQuery groupByTitle() Group by the title column
+ * @method ChildOrderProductTaxQuery groupByDescription() Group by the description column
+ * @method ChildOrderProductTaxQuery groupByAmount() Group by the amount column
+ * @method ChildOrderProductTaxQuery groupByCreatedAt() Group by the created_at column
+ * @method ChildOrderProductTaxQuery groupByUpdatedAt() Group by the updated_at column
*
- * @method ChildFeatureCategoryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
- * @method ChildFeatureCategoryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
- * @method ChildFeatureCategoryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
+ * @method ChildOrderProductTaxQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
+ * @method ChildOrderProductTaxQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
+ * @method ChildOrderProductTaxQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
- * @method ChildFeatureCategoryQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
- * @method ChildFeatureCategoryQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
- * @method ChildFeatureCategoryQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
+ * @method ChildOrderProductTaxQuery leftJoinOrderProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderProduct relation
+ * @method ChildOrderProductTaxQuery rightJoinOrderProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderProduct relation
+ * @method ChildOrderProductTaxQuery innerJoinOrderProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderProduct relation
*
- * @method ChildFeatureCategoryQuery leftJoinFeature($relationAlias = null) Adds a LEFT JOIN clause to the query using the Feature relation
- * @method ChildFeatureCategoryQuery rightJoinFeature($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Feature relation
- * @method ChildFeatureCategoryQuery innerJoinFeature($relationAlias = null) Adds a INNER JOIN clause to the query using the Feature relation
+ * @method ChildOrderProductTax findOne(ConnectionInterface $con = null) Return the first ChildOrderProductTax matching the query
+ * @method ChildOrderProductTax findOneOrCreate(ConnectionInterface $con = null) Return the first ChildOrderProductTax matching the query, or a new ChildOrderProductTax object populated from the query conditions when no match is found
*
- * @method ChildFeatureCategory findOne(ConnectionInterface $con = null) Return the first ChildFeatureCategory matching the query
- * @method ChildFeatureCategory findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFeatureCategory matching the query, or a new ChildFeatureCategory object populated from the query conditions when no match is found
+ * @method ChildOrderProductTax findOneById(int $id) Return the first ChildOrderProductTax filtered by the id column
+ * @method ChildOrderProductTax findOneByOrderProductId(int $order_product_id) Return the first ChildOrderProductTax filtered by the order_product_id column
+ * @method ChildOrderProductTax findOneByTitle(string $title) Return the first ChildOrderProductTax filtered by the title column
+ * @method ChildOrderProductTax findOneByDescription(string $description) Return the first ChildOrderProductTax filtered by the description column
+ * @method ChildOrderProductTax findOneByAmount(double $amount) Return the first ChildOrderProductTax filtered by the amount column
+ * @method ChildOrderProductTax findOneByCreatedAt(string $created_at) Return the first ChildOrderProductTax filtered by the created_at column
+ * @method ChildOrderProductTax findOneByUpdatedAt(string $updated_at) Return the first ChildOrderProductTax filtered by the updated_at column
*
- * @method ChildFeatureCategory findOneById(int $id) Return the first ChildFeatureCategory filtered by the id column
- * @method ChildFeatureCategory findOneByFeatureId(int $feature_id) Return the first ChildFeatureCategory filtered by the feature_id column
- * @method ChildFeatureCategory findOneByCategoryId(int $category_id) Return the first ChildFeatureCategory filtered by the category_id column
- * @method ChildFeatureCategory findOneByCreatedAt(string $created_at) Return the first ChildFeatureCategory filtered by the created_at column
- * @method ChildFeatureCategory findOneByUpdatedAt(string $updated_at) Return the first ChildFeatureCategory filtered by the updated_at column
- *
- * @method array findById(int $id) Return ChildFeatureCategory objects filtered by the id column
- * @method array findByFeatureId(int $feature_id) Return ChildFeatureCategory objects filtered by the feature_id column
- * @method array findByCategoryId(int $category_id) Return ChildFeatureCategory objects filtered by the category_id column
- * @method array findByCreatedAt(string $created_at) Return ChildFeatureCategory objects filtered by the created_at column
- * @method array findByUpdatedAt(string $updated_at) Return ChildFeatureCategory objects filtered by the updated_at column
+ * @method array findById(int $id) Return ChildOrderProductTax objects filtered by the id column
+ * @method array findByOrderProductId(int $order_product_id) Return ChildOrderProductTax objects filtered by the order_product_id column
+ * @method array findByTitle(string $title) Return ChildOrderProductTax objects filtered by the title column
+ * @method array findByDescription(string $description) Return ChildOrderProductTax objects filtered by the description column
+ * @method array findByAmount(double $amount) Return ChildOrderProductTax objects filtered by the amount column
+ * @method array findByCreatedAt(string $created_at) Return ChildOrderProductTax objects filtered by the created_at column
+ * @method array findByUpdatedAt(string $updated_at) Return ChildOrderProductTax objects filtered by the updated_at column
*
*/
-abstract class FeatureCategoryQuery extends ModelCriteria
+abstract class OrderProductTaxQuery extends ModelCriteria
{
/**
- * Initializes internal state of \Thelia\Model\Base\FeatureCategoryQuery object.
+ * Initializes internal state of \Thelia\Model\Base\OrderProductTaxQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
- public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\FeatureCategory', $modelAlias = null)
+ public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\OrderProductTax', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
- * Returns a new ChildFeatureCategoryQuery object.
+ * Returns a new ChildOrderProductTaxQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
- * @return ChildFeatureCategoryQuery
+ * @return ChildOrderProductTaxQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
- if ($criteria instanceof \Thelia\Model\FeatureCategoryQuery) {
+ if ($criteria instanceof \Thelia\Model\OrderProductTaxQuery) {
return $criteria;
}
- $query = new \Thelia\Model\FeatureCategoryQuery();
+ $query = new \Thelia\Model\OrderProductTaxQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
@@ -112,19 +116,19 @@ abstract class FeatureCategoryQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
- * @return ChildFeatureCategory|array|mixed the result, formatted by the current formatter
+ * @return ChildOrderProductTax|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
- if ((null !== ($obj = FeatureCategoryTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ if ((null !== ($obj = OrderProductTaxTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
- $con = Propel::getServiceContainer()->getReadConnection(FeatureCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getReadConnection(OrderProductTaxTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
@@ -143,11 +147,11 @@ abstract class FeatureCategoryQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
- * @return ChildFeatureCategory A model object, or null if the key is not found
+ * @return ChildOrderProductTax A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, FEATURE_ID, CATEGORY_ID, CREATED_AT, UPDATED_AT FROM feature_category WHERE ID = :p0';
+ $sql = 'SELECT ID, ORDER_PRODUCT_ID, TITLE, DESCRIPTION, AMOUNT, CREATED_AT, UPDATED_AT FROM order_product_tax WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -158,9 +162,9 @@ abstract class FeatureCategoryQuery extends ModelCriteria
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
- $obj = new ChildFeatureCategory();
+ $obj = new ChildOrderProductTax();
$obj->hydrate($row);
- FeatureCategoryTableMap::addInstanceToPool($obj, (string) $key);
+ OrderProductTaxTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
@@ -173,7 +177,7 @@ abstract class FeatureCategoryQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
- * @return ChildFeatureCategory|array|mixed the result, formatted by the current formatter
+ * @return ChildOrderProductTax|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
@@ -215,12 +219,12 @@ abstract class FeatureCategoryQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
- return $this->addUsingAlias(FeatureCategoryTableMap::ID, $key, Criteria::EQUAL);
+ return $this->addUsingAlias(OrderProductTaxTableMap::ID, $key, Criteria::EQUAL);
}
/**
@@ -228,12 +232,12 @@ abstract class FeatureCategoryQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
- return $this->addUsingAlias(FeatureCategoryTableMap::ID, $keys, Criteria::IN);
+ return $this->addUsingAlias(OrderProductTaxTableMap::ID, $keys, Criteria::IN);
}
/**
@@ -252,18 +256,18 @@ abstract class FeatureCategoryQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery 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(FeatureCategoryTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(OrderProductTaxTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
- $this->addUsingAlias(FeatureCategoryTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(OrderProductTaxTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -274,39 +278,39 @@ abstract class FeatureCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureCategoryTableMap::ID, $id, $comparison);
+ return $this->addUsingAlias(OrderProductTaxTableMap::ID, $id, $comparison);
}
/**
- * Filter the query on the feature_id column
+ * Filter the query on the order_product_id column
*
* Example usage:
*
- * $query->filterByFeatureId(1234); // WHERE feature_id = 1234
- * $query->filterByFeatureId(array(12, 34)); // WHERE feature_id IN (12, 34)
- * $query->filterByFeatureId(array('min' => 12)); // WHERE feature_id > 12
+ * $query->filterByOrderProductId(1234); // WHERE order_product_id = 1234
+ * $query->filterByOrderProductId(array(12, 34)); // WHERE order_product_id IN (12, 34)
+ * $query->filterByOrderProductId(array('min' => 12)); // WHERE order_product_id > 12
*
*
- * @see filterByFeature()
+ * @see filterByOrderProduct()
*
- * @param mixed $featureId The value to use as filter.
+ * @param mixed $orderProductId 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 ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
- public function filterByFeatureId($featureId = null, $comparison = null)
+ public function filterByOrderProductId($orderProductId = null, $comparison = null)
{
- if (is_array($featureId)) {
+ if (is_array($orderProductId)) {
$useMinMax = false;
- if (isset($featureId['min'])) {
- $this->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $featureId['min'], Criteria::GREATER_EQUAL);
+ if (isset($orderProductId['min'])) {
+ $this->addUsingAlias(OrderProductTaxTableMap::ORDER_PRODUCT_ID, $orderProductId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($featureId['max'])) {
- $this->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $featureId['max'], Criteria::LESS_EQUAL);
+ if (isset($orderProductId['max'])) {
+ $this->addUsingAlias(OrderProductTaxTableMap::ORDER_PRODUCT_ID, $orderProductId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -317,39 +321,95 @@ abstract class FeatureCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $featureId, $comparison);
+ return $this->addUsingAlias(OrderProductTaxTableMap::ORDER_PRODUCT_ID, $orderProductId, $comparison);
}
/**
- * Filter the query on the category_id column
+ * Filter the query on the title column
*
* Example usage:
*
- * $query->filterByCategoryId(1234); // WHERE category_id = 1234
- * $query->filterByCategoryId(array(12, 34)); // WHERE category_id IN (12, 34)
- * $query->filterByCategoryId(array('min' => 12)); // WHERE category_id > 12
+ * $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
+ * $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
*
*
- * @see filterByCategory()
+ * @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
*
- * @param mixed $categoryId The value to use as filter.
+ * @return ChildOrderProductTaxQuery 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(OrderProductTaxTableMap::TITLE, $title, $comparison);
+ }
+
+ /**
+ * Filter the query on the description column
+ *
+ * Example usage:
+ *
+ * $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
+ * $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
+ *
+ *
+ * @param string $description 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 ChildOrderProductTaxQuery The current query, for fluid interface
+ */
+ public function filterByDescription($description = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($description)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $description)) {
+ $description = str_replace('*', '%', $description);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(OrderProductTaxTableMap::DESCRIPTION, $description, $comparison);
+ }
+
+ /**
+ * Filter the query on the amount column
+ *
+ * Example usage:
+ *
+ * $query->filterByAmount(1234); // WHERE amount = 1234
+ * $query->filterByAmount(array(12, 34)); // WHERE amount IN (12, 34)
+ * $query->filterByAmount(array('min' => 12)); // WHERE amount > 12
+ *
+ *
+ * @param mixed $amount 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 ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
- public function filterByCategoryId($categoryId = null, $comparison = null)
+ public function filterByAmount($amount = null, $comparison = null)
{
- if (is_array($categoryId)) {
+ if (is_array($amount)) {
$useMinMax = false;
- if (isset($categoryId['min'])) {
- $this->addUsingAlias(FeatureCategoryTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
+ if (isset($amount['min'])) {
+ $this->addUsingAlias(OrderProductTaxTableMap::AMOUNT, $amount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
- if (isset($categoryId['max'])) {
- $this->addUsingAlias(FeatureCategoryTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
+ if (isset($amount['max'])) {
+ $this->addUsingAlias(OrderProductTaxTableMap::AMOUNT, $amount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -360,7 +420,7 @@ abstract class FeatureCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureCategoryTableMap::CATEGORY_ID, $categoryId, $comparison);
+ return $this->addUsingAlias(OrderProductTaxTableMap::AMOUNT, $amount, $comparison);
}
/**
@@ -381,18 +441,18 @@ abstract class FeatureCategoryQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery 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(FeatureCategoryTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(OrderProductTaxTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
- $this->addUsingAlias(FeatureCategoryTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(OrderProductTaxTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -403,7 +463,7 @@ abstract class FeatureCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureCategoryTableMap::CREATED_AT, $createdAt, $comparison);
+ return $this->addUsingAlias(OrderProductTaxTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
@@ -424,18 +484,18 @@ abstract class FeatureCategoryQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery 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(FeatureCategoryTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
+ $this->addUsingAlias(OrderProductTaxTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
- $this->addUsingAlias(FeatureCategoryTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
+ $this->addUsingAlias(OrderProductTaxTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -446,46 +506,46 @@ abstract class FeatureCategoryQuery extends ModelCriteria
}
}
- return $this->addUsingAlias(FeatureCategoryTableMap::UPDATED_AT, $updatedAt, $comparison);
+ return $this->addUsingAlias(OrderProductTaxTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
- * Filter the query by a related \Thelia\Model\Category object
+ * Filter the query by a related \Thelia\Model\OrderProduct object
*
- * @param \Thelia\Model\Category|ObjectCollection $category The related object(s) to use as filter
+ * @param \Thelia\Model\OrderProduct|ObjectCollection $orderProduct The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
- public function filterByCategory($category, $comparison = null)
+ public function filterByOrderProduct($orderProduct, $comparison = null)
{
- if ($category instanceof \Thelia\Model\Category) {
+ if ($orderProduct instanceof \Thelia\Model\OrderProduct) {
return $this
- ->addUsingAlias(FeatureCategoryTableMap::CATEGORY_ID, $category->getId(), $comparison);
- } elseif ($category instanceof ObjectCollection) {
+ ->addUsingAlias(OrderProductTaxTableMap::ORDER_PRODUCT_ID, $orderProduct->getId(), $comparison);
+ } elseif ($orderProduct instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
- ->addUsingAlias(FeatureCategoryTableMap::CATEGORY_ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ ->addUsingAlias(OrderProductTaxTableMap::ORDER_PRODUCT_ID, $orderProduct->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
- throw new PropelException('filterByCategory() only accepts arguments of type \Thelia\Model\Category or Collection');
+ throw new PropelException('filterByOrderProduct() only accepts arguments of type \Thelia\Model\OrderProduct or Collection');
}
}
/**
- * Adds a JOIN clause to the query using the Category relation
+ * Adds a JOIN clause to the query using the OrderProduct relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
- public function joinCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinOrderProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Category');
+ $relationMap = $tableMap->getRelation('OrderProduct');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -500,14 +560,14 @@ abstract class FeatureCategoryQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
- $this->addJoinObject($join, 'Category');
+ $this->addJoinObject($join, 'OrderProduct');
}
return $this;
}
/**
- * Use the Category relation Category object
+ * Use the OrderProduct relation OrderProduct object
*
* @see useQuery()
*
@@ -515,108 +575,33 @@ abstract class FeatureCategoryQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
- * @return \Thelia\Model\CategoryQuery A secondary query class using the current class as primary query
+ * @return \Thelia\Model\OrderProductQuery A secondary query class using the current class as primary query
*/
- public function useCategoryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useOrderProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
- ->joinCategory($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Category', '\Thelia\Model\CategoryQuery');
- }
-
- /**
- * Filter the query by a related \Thelia\Model\Feature object
- *
- * @param \Thelia\Model\Feature|ObjectCollection $feature The related object(s) to use as filter
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
- */
- public function filterByFeature($feature, $comparison = null)
- {
- if ($feature instanceof \Thelia\Model\Feature) {
- return $this
- ->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $feature->getId(), $comparison);
- } elseif ($feature instanceof ObjectCollection) {
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
-
- return $this
- ->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $feature->toKeyValue('PrimaryKey', 'Id'), $comparison);
- } else {
- throw new PropelException('filterByFeature() only accepts arguments of type \Thelia\Model\Feature or Collection');
- }
- }
-
- /**
- * Adds a JOIN clause to the query using the Feature relation
- *
- * @param string $relationAlias optional alias for the relation
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
- */
- public function joinFeature($relationAlias = null, $joinType = Criteria::INNER_JOIN)
- {
- $tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('Feature');
-
- // 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, 'Feature');
- }
-
- return $this;
- }
-
- /**
- * Use the Feature relation Feature object
- *
- * @see useQuery()
- *
- * @param string $relationAlias optional alias for the relation,
- * to be used as main alias in the secondary query
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return \Thelia\Model\FeatureQuery A secondary query class using the current class as primary query
- */
- public function useFeatureQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
- {
- return $this
- ->joinFeature($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'Feature', '\Thelia\Model\FeatureQuery');
+ ->joinOrderProduct($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'OrderProduct', '\Thelia\Model\OrderProductQuery');
}
/**
* Exclude object from result
*
- * @param ChildFeatureCategory $featureCategory Object to remove from the list of results
+ * @param ChildOrderProductTax $orderProductTax Object to remove from the list of results
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
- public function prune($featureCategory = null)
+ public function prune($orderProductTax = null)
{
- if ($featureCategory) {
- $this->addUsingAlias(FeatureCategoryTableMap::ID, $featureCategory->getId(), Criteria::NOT_EQUAL);
+ if ($orderProductTax) {
+ $this->addUsingAlias(OrderProductTaxTableMap::ID, $orderProductTax->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
- * Deletes all rows from the feature_category table.
+ * Deletes all rows from the order_product_tax table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
@@ -624,7 +609,7 @@ abstract class FeatureCategoryQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderProductTaxTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
@@ -635,8 +620,8 @@ abstract class FeatureCategoryQuery extends ModelCriteria
// 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).
- FeatureCategoryTableMap::clearInstancePool();
- FeatureCategoryTableMap::clearRelatedInstancePool();
+ OrderProductTaxTableMap::clearInstancePool();
+ OrderProductTaxTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
@@ -648,9 +633,9 @@ abstract class FeatureCategoryQuery extends ModelCriteria
}
/**
- * Performs a DELETE on the database, given a ChildFeatureCategory or Criteria object OR a primary key value.
+ * Performs a DELETE on the database, given a ChildOrderProductTax or Criteria object OR a primary key value.
*
- * @param mixed $values Criteria or ChildFeatureCategory object or primary key or array of primary keys
+ * @param mixed $values Criteria or ChildOrderProductTax 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
@@ -661,13 +646,13 @@ abstract class FeatureCategoryQuery extends ModelCriteria
public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderProductTaxTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
- $criteria->setDbName(FeatureCategoryTableMap::DATABASE_NAME);
+ $criteria->setDbName(OrderProductTaxTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
@@ -677,10 +662,10 @@ abstract class FeatureCategoryQuery extends ModelCriteria
$con->beginTransaction();
- FeatureCategoryTableMap::removeInstanceFromPool($criteria);
+ OrderProductTaxTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
- FeatureCategoryTableMap::clearRelatedInstancePool();
+ OrderProductTaxTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
@@ -697,11 +682,11 @@ abstract class FeatureCategoryQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of the latest update in days
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
- return $this->addUsingAlias(FeatureCategoryTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ return $this->addUsingAlias(OrderProductTaxTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
@@ -709,51 +694,51 @@ abstract class FeatureCategoryQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of in days
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
- return $this->addUsingAlias(FeatureCategoryTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ return $this->addUsingAlias(OrderProductTaxTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
- return $this->addDescendingOrderByColumn(FeatureCategoryTableMap::UPDATED_AT);
+ return $this->addDescendingOrderByColumn(OrderProductTaxTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
- return $this->addAscendingOrderByColumn(FeatureCategoryTableMap::UPDATED_AT);
+ return $this->addAscendingOrderByColumn(OrderProductTaxTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
- return $this->addDescendingOrderByColumn(FeatureCategoryTableMap::CREATED_AT);
+ return $this->addDescendingOrderByColumn(OrderProductTaxTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
- * @return ChildFeatureCategoryQuery The current query, for fluid interface
+ * @return ChildOrderProductTaxQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
- return $this->addAscendingOrderByColumn(FeatureCategoryTableMap::CREATED_AT);
+ return $this->addAscendingOrderByColumn(OrderProductTaxTableMap::CREATED_AT);
}
-} // FeatureCategoryQuery
+} // OrderProductTaxQuery
diff --git a/core/lib/Thelia/Model/Base/ProductQuery.php b/core/lib/Thelia/Model/Base/ProductQuery.php
index 9b1710f03..9c3b0759c 100644
--- a/core/lib/Thelia/Model/Base/ProductQuery.php
+++ b/core/lib/Thelia/Model/Base/ProductQuery.php
@@ -857,7 +857,7 @@ abstract class ProductQuery extends ModelCriteria
*
* @return ChildProductQuery The current query, for fluid interface
*/
- public function joinTemplate($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinTemplate($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Template');
@@ -892,7 +892,7 @@ abstract class ProductQuery extends ModelCriteria
*
* @return \Thelia\Model\TemplateQuery A secondary query class using the current class as primary query
*/
- public function useTemplateQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useTemplateQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinTemplate($relationAlias, $joinType)
diff --git a/core/lib/Thelia/Model/Base/TaxRule.php b/core/lib/Thelia/Model/Base/TaxRule.php
index 9edb7b2fc..b361567d8 100644
--- a/core/lib/Thelia/Model/Base/TaxRule.php
+++ b/core/lib/Thelia/Model/Base/TaxRule.php
@@ -67,6 +67,13 @@ abstract class TaxRule implements ActiveRecordInterface
*/
protected $id;
+ /**
+ * The value for the is_default field.
+ * Note: this column has a database default value of: false
+ * @var boolean
+ */
+ protected $is_default;
+
/**
* The value for the created_at field.
* @var string
@@ -137,11 +144,24 @@ abstract class TaxRule implements ActiveRecordInterface
*/
protected $taxRuleI18nsScheduledForDeletion = null;
+ /**
+ * Applies default values to this object.
+ * This method should be called from the object's constructor (or
+ * equivalent initialization method).
+ * @see __construct()
+ */
+ public function applyDefaultValues()
+ {
+ $this->is_default = false;
+ }
+
/**
* Initializes internal state of Thelia\Model\Base\TaxRule object.
+ * @see applyDefaults()
*/
public function __construct()
{
+ $this->applyDefaultValues();
}
/**
@@ -402,6 +422,17 @@ abstract class TaxRule implements ActiveRecordInterface
return $this->id;
}
+ /**
+ * Get the [is_default] column value.
+ *
+ * @return boolean
+ */
+ public function getIsDefault()
+ {
+
+ return $this->is_default;
+ }
+
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -463,6 +494,35 @@ abstract class TaxRule implements ActiveRecordInterface
return $this;
} // setId()
+ /**
+ * Sets the value of the [is_default] 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 \Thelia\Model\TaxRule The current object (for fluent API support)
+ */
+ public function setIsDefault($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->is_default !== $v) {
+ $this->is_default = $v;
+ $this->modifiedColumns[] = TaxRuleTableMap::IS_DEFAULT;
+ }
+
+
+ return $this;
+ } // setIsDefault()
+
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -515,6 +575,10 @@ abstract class TaxRule implements ActiveRecordInterface
*/
public function hasOnlyDefaultValues()
{
+ if ($this->is_default !== false) {
+ return false;
+ }
+
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
@@ -545,13 +609,16 @@ abstract class TaxRule implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : TaxRuleTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
- $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : TaxRuleTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : TaxRuleTableMap::translateFieldName('IsDefault', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->is_default = (null !== $col) ? (boolean) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : TaxRuleTableMap::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 ? 2 + $startcol : TaxRuleTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : TaxRuleTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -564,7 +631,7 @@ abstract class TaxRule implements ActiveRecordInterface
$this->ensureConsistency();
}
- return $startcol + 3; // 3 = TaxRuleTableMap::NUM_HYDRATE_COLUMNS.
+ return $startcol + 4; // 4 = TaxRuleTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\TaxRule object", 0, $e);
@@ -845,6 +912,9 @@ abstract class TaxRule implements ActiveRecordInterface
if ($this->isColumnModified(TaxRuleTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
+ if ($this->isColumnModified(TaxRuleTableMap::IS_DEFAULT)) {
+ $modifiedColumns[':p' . $index++] = 'IS_DEFAULT';
+ }
if ($this->isColumnModified(TaxRuleTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -865,6 +935,9 @@ abstract class TaxRule implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
+ case 'IS_DEFAULT':
+ $stmt->bindValue($identifier, (int) $this->is_default, PDO::PARAM_INT);
+ break;
case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break;
@@ -937,9 +1010,12 @@ abstract class TaxRule implements ActiveRecordInterface
return $this->getId();
break;
case 1:
- return $this->getCreatedAt();
+ return $this->getIsDefault();
break;
case 2:
+ return $this->getCreatedAt();
+ break;
+ case 3:
return $this->getUpdatedAt();
break;
default:
@@ -972,8 +1048,9 @@ abstract class TaxRule implements ActiveRecordInterface
$keys = TaxRuleTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
- $keys[1] => $this->getCreatedAt(),
- $keys[2] => $this->getUpdatedAt(),
+ $keys[1] => $this->getIsDefault(),
+ $keys[2] => $this->getCreatedAt(),
+ $keys[3] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1029,9 +1106,12 @@ abstract class TaxRule implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
- $this->setCreatedAt($value);
+ $this->setIsDefault($value);
break;
case 2:
+ $this->setCreatedAt($value);
+ break;
+ case 3:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1059,8 +1139,9 @@ abstract class TaxRule implements ActiveRecordInterface
$keys = TaxRuleTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setCreatedAt($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setUpdatedAt($arr[$keys[2]]);
+ if (array_key_exists($keys[1], $arr)) $this->setIsDefault($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]]);
}
/**
@@ -1073,6 +1154,7 @@ abstract class TaxRule implements ActiveRecordInterface
$criteria = new Criteria(TaxRuleTableMap::DATABASE_NAME);
if ($this->isColumnModified(TaxRuleTableMap::ID)) $criteria->add(TaxRuleTableMap::ID, $this->id);
+ if ($this->isColumnModified(TaxRuleTableMap::IS_DEFAULT)) $criteria->add(TaxRuleTableMap::IS_DEFAULT, $this->is_default);
if ($this->isColumnModified(TaxRuleTableMap::CREATED_AT)) $criteria->add(TaxRuleTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(TaxRuleTableMap::UPDATED_AT)) $criteria->add(TaxRuleTableMap::UPDATED_AT, $this->updated_at);
@@ -1138,6 +1220,7 @@ abstract class TaxRule implements ActiveRecordInterface
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
+ $copyObj->setIsDefault($this->getIsDefault());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -1961,10 +2044,12 @@ abstract class TaxRule implements ActiveRecordInterface
public function clear()
{
$this->id = null;
+ $this->is_default = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
+ $this->applyDefaultValues();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);
diff --git a/core/lib/Thelia/Model/Base/TaxRuleQuery.php b/core/lib/Thelia/Model/Base/TaxRuleQuery.php
index 8ee264415..bc20c44b1 100644
--- a/core/lib/Thelia/Model/Base/TaxRuleQuery.php
+++ b/core/lib/Thelia/Model/Base/TaxRuleQuery.php
@@ -23,10 +23,12 @@ use Thelia\Model\Map\TaxRuleTableMap;
*
*
* @method ChildTaxRuleQuery orderById($order = Criteria::ASC) Order by the id column
+ * @method ChildTaxRuleQuery orderByIsDefault($order = Criteria::ASC) Order by the is_default column
* @method ChildTaxRuleQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildTaxRuleQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildTaxRuleQuery groupById() Group by the id column
+ * @method ChildTaxRuleQuery groupByIsDefault() Group by the is_default column
* @method ChildTaxRuleQuery groupByCreatedAt() Group by the created_at column
* @method ChildTaxRuleQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -50,10 +52,12 @@ use Thelia\Model\Map\TaxRuleTableMap;
* @method ChildTaxRule findOneOrCreate(ConnectionInterface $con = null) Return the first ChildTaxRule matching the query, or a new ChildTaxRule object populated from the query conditions when no match is found
*
* @method ChildTaxRule findOneById(int $id) Return the first ChildTaxRule filtered by the id column
+ * @method ChildTaxRule findOneByIsDefault(boolean $is_default) Return the first ChildTaxRule filtered by the is_default column
* @method ChildTaxRule findOneByCreatedAt(string $created_at) Return the first ChildTaxRule filtered by the created_at column
* @method ChildTaxRule findOneByUpdatedAt(string $updated_at) Return the first ChildTaxRule filtered by the updated_at column
*
* @method array findById(int $id) Return ChildTaxRule objects filtered by the id column
+ * @method array findByIsDefault(boolean $is_default) Return ChildTaxRule objects filtered by the is_default column
* @method array findByCreatedAt(string $created_at) Return ChildTaxRule objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildTaxRule objects filtered by the updated_at column
*
@@ -144,7 +148,7 @@ abstract class TaxRuleQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT ID, CREATED_AT, UPDATED_AT FROM tax_rule WHERE ID = :p0';
+ $sql = 'SELECT ID, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM tax_rule WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -274,6 +278,33 @@ abstract class TaxRuleQuery extends ModelCriteria
return $this->addUsingAlias(TaxRuleTableMap::ID, $id, $comparison);
}
+ /**
+ * Filter the query on the is_default column
+ *
+ * Example usage:
+ *
+ * $query->filterByIsDefault(true); // WHERE is_default = true
+ * $query->filterByIsDefault('yes'); // WHERE is_default = true
+ *
+ *
+ * @param boolean|string $isDefault 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 ChildTaxRuleQuery The current query, for fluid interface
+ */
+ public function filterByIsDefault($isDefault = null, $comparison = null)
+ {
+ if (is_string($isDefault)) {
+ $is_default = in_array(strtolower($isDefault), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
+ }
+
+ return $this->addUsingAlias(TaxRuleTableMap::IS_DEFAULT, $isDefault, $comparison);
+ }
+
/**
* Filter the query on the created_at column
*
diff --git a/core/lib/Thelia/Model/Base/Template.php b/core/lib/Thelia/Model/Base/Template.php
index 77efa7ba0..08bb0f3a0 100644
--- a/core/lib/Thelia/Model/Base/Template.php
+++ b/core/lib/Thelia/Model/Base/Template.php
@@ -864,9 +864,10 @@ abstract class Template implements ActiveRecordInterface
if ($this->productsScheduledForDeletion !== null) {
if (!$this->productsScheduledForDeletion->isEmpty()) {
- \Thelia\Model\ProductQuery::create()
- ->filterByPrimaryKeys($this->productsScheduledForDeletion->getPrimaryKeys(false))
- ->delete($con);
+ foreach ($this->productsScheduledForDeletion as $product) {
+ // need to save related object because we set the relation to null
+ $product->save($con);
+ }
$this->productsScheduledForDeletion = null;
}
}
@@ -1553,7 +1554,7 @@ abstract class Template implements ActiveRecordInterface
$this->productsScheduledForDeletion = clone $this->collProducts;
$this->productsScheduledForDeletion->clear();
}
- $this->productsScheduledForDeletion[]= clone $product;
+ $this->productsScheduledForDeletion[]= $product;
$product->setTemplate(null);
}
diff --git a/core/lib/Thelia/Model/Base/TemplateQuery.php b/core/lib/Thelia/Model/Base/TemplateQuery.php
index 506d7d943..98c588dd8 100644
--- a/core/lib/Thelia/Model/Base/TemplateQuery.php
+++ b/core/lib/Thelia/Model/Base/TemplateQuery.php
@@ -395,7 +395,7 @@ abstract class TemplateQuery extends ModelCriteria
*
* @return ChildTemplateQuery The current query, for fluid interface
*/
- public function joinProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function joinProduct($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Product');
@@ -430,7 +430,7 @@ abstract class TemplateQuery extends ModelCriteria
*
* @return \Thelia\Model\ProductQuery A secondary query class using the current class as primary query
*/
- public function useProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ public function useProductQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinProduct($relationAlias, $joinType)
diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php
index 042864de0..347a0f7f7 100755
--- a/core/lib/Thelia/Model/Category.php
+++ b/core/lib/Thelia/Model/Category.php
@@ -28,7 +28,7 @@ class Category extends BaseCategory
/**
* {@inheritDoc}
*/
- protected function getRewritenUrlViewName() {
+ protected function getRewrittenUrlViewName() {
return 'category';
}
@@ -69,8 +69,6 @@ class Category extends BaseCategory
{
$this->setPosition($this->getNextPosition());
- $this->generateRewritenUrl($this->getLocale());
-
$this->dispatchEvent(TheliaEvents::BEFORE_CREATECATEGORY, new CategoryEvent($this));
return true;
diff --git a/core/lib/Thelia/Model/CategoryAssociatedContent.php b/core/lib/Thelia/Model/CategoryAssociatedContent.php
index 9296e6274..9154767bc 100644
--- a/core/lib/Thelia/Model/CategoryAssociatedContent.php
+++ b/core/lib/Thelia/Model/CategoryAssociatedContent.php
@@ -3,7 +3,66 @@
namespace Thelia\Model;
use Thelia\Model\Base\CategoryAssociatedContent as BaseCategoryAssociatedContent;
+use Thelia\Core\Event\CategoryAssociatedContentEvent;
+use Thelia\Core\Event\TheliaEvents;
+use Propel\Runtime\Connection\ConnectionInterface;
class CategoryAssociatedContent extends BaseCategoryAssociatedContent {
+ use \Thelia\Model\Tools\ModelEventDispatcherTrait;
+
+ /**
+ * {@inheritDoc}
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::BEFORE_CREATECATEGORY_ASSOCIATED_CONTENT, new CategoryAssociatedContentEvent($this));
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::AFTER_CREATECATEGORY_ASSOCIATED_CONTENT, new CategoryAssociatedContentEvent($this));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::BEFORE_UPDATECATEGORY_ASSOCIATED_CONTENT, new CategoryAssociatedContentEvent($this));
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::AFTER_UPDATECATEGORY_ASSOCIATED_CONTENT, new CategoryAssociatedContentEvent($this));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::BEFORE_DELETECATEGORY_ASSOCIATED_CONTENT, new CategoryAssociatedContentEvent($this));
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::AFTER_DELETECATEGORY_ASSOCIATED_CONTENT, new CategoryAssociatedContentEvent($this));
+ }
+
}
diff --git a/core/lib/Thelia/Model/CategoryI18n.php b/core/lib/Thelia/Model/CategoryI18n.php
index bb4e7b3f3..de3e38663 100755
--- a/core/lib/Thelia/Model/CategoryI18n.php
+++ b/core/lib/Thelia/Model/CategoryI18n.php
@@ -2,8 +2,13 @@
namespace Thelia\Model;
+use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Model\Base\CategoryI18n as BaseCategoryI18n;
class CategoryI18n extends BaseCategoryI18n {
-
+ public function postInsert(ConnectionInterface $con = null)
+ {
+ $category = $this->getCategory();
+ $category->generateRewrittenUrl($this->getLocale());
+ }
}
diff --git a/core/lib/Thelia/Model/ConfigQuery.php b/core/lib/Thelia/Model/ConfigQuery.php
index 7df592fd2..7f65b103d 100755
--- a/core/lib/Thelia/Model/ConfigQuery.php
+++ b/core/lib/Thelia/Model/ConfigQuery.php
@@ -56,9 +56,15 @@ class ConfigQuery extends BaseConfigQuery {
public static function getPageNotFoundView()
{
- return self::read("page_not_found_view", '404.html');
+ return self::read("page_not_found_view", '404');
}
+ public static function getPassedUrlView()
+ {
+ return self::read('passed_url_view', 'passed-url');
+ }
+
+
public static function getActiveTemplate()
{
return self::read('active-template', 'default');
diff --git a/core/lib/Thelia/Model/Content.php b/core/lib/Thelia/Model/Content.php
index 79660f93a..10ed2afe3 100755
--- a/core/lib/Thelia/Model/Content.php
+++ b/core/lib/Thelia/Model/Content.php
@@ -17,7 +17,7 @@ class Content extends BaseContent
/**
* {@inheritDoc}
*/
- protected function getRewritenUrlViewName() {
+ protected function getRewrittenUrlViewName() {
return 'content';
}
@@ -37,8 +37,6 @@ class Content extends BaseContent
{
$this->setPosition($this->getNextPosition());
- $this->generateRewritenUrl($this->getLocale());
-
return true;
}
}
diff --git a/core/lib/Thelia/Model/ContentI18n.php b/core/lib/Thelia/Model/ContentI18n.php
index 5b29d894f..11713d57b 100755
--- a/core/lib/Thelia/Model/ContentI18n.php
+++ b/core/lib/Thelia/Model/ContentI18n.php
@@ -2,8 +2,13 @@
namespace Thelia\Model;
+use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Model\Base\ContentI18n as BaseContentI18n;
class ContentI18n extends BaseContentI18n {
-
+ public function postInsert(ConnectionInterface $con = null)
+ {
+ $content = $this->getContent();
+ $content->generateRewrittenUrl($this->getLocale());
+ }
}
diff --git a/core/lib/Thelia/Model/CouponRule.php b/core/lib/Thelia/Model/CouponRule.php
deleted file mode 100755
index 14c84deb2..000000000
--- a/core/lib/Thelia/Model/CouponRule.php
+++ /dev/null
@@ -1,9 +0,0 @@
-filterByCategory($child)
+ $contentsCount += ContentQuery::create()
+ ->filterByFolder($child)
->count();
}
@@ -67,8 +69,37 @@ class Folder extends BaseFolder
{
$this->setPosition($this->getNextPosition());
- $this->generateRewritenUrl($this->getLocale());
+ $this->dispatchEvent(TheliaEvents::BEFORE_CREATEFOLDER, new FolderEvent($this));
return true;
}
+
+ public function postInsert(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::AFTER_CREATEFOLDER, new FolderEvent($this));
+ }
+
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::BEFORE_UPDATEFOLDER, new FolderEvent($this));
+
+ return true;
+ }
+
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::AFTER_UPDATEFOLDER, new FolderEvent($this));
+ }
+
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::BEFORE_DELETEFOLDER, new FolderEvent($this));
+
+ return true;
+ }
+
+ public function postDelete(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::AFTER_DELETEFOLDER, new FolderEvent($this));
+ }
}
diff --git a/core/lib/Thelia/Model/FolderI18n.php b/core/lib/Thelia/Model/FolderI18n.php
index d1044452b..7ede39502 100755
--- a/core/lib/Thelia/Model/FolderI18n.php
+++ b/core/lib/Thelia/Model/FolderI18n.php
@@ -2,8 +2,14 @@
namespace Thelia\Model;
+use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Model\Base\FolderI18n as BaseFolderI18n;
class FolderI18n extends BaseFolderI18n {
+ public function postInsert(ConnectionInterface $con = null)
+ {
+ $folder = $this->getFolder();
+ $folder->generateRewrittenUrl($this->getLocale());
+ }
}
diff --git a/core/lib/Thelia/Model/Map/ModuleImageI18nTableMap.php b/core/lib/Thelia/Model/Map/ModuleImageI18nTableMap.php
new file mode 100644
index 000000000..76c29e11c
--- /dev/null
+++ b/core/lib/Thelia/Model/Map/ModuleImageI18nTableMap.php
@@ -0,0 +1,497 @@
+ array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
+ self::TYPE_COLNAME => array(ModuleImageI18nTableMap::ID, ModuleImageI18nTableMap::LOCALE, ModuleImageI18nTableMap::TITLE, ModuleImageI18nTableMap::DESCRIPTION, ModuleImageI18nTableMap::CHAPO, ModuleImageI18nTableMap::POSTSCRIPTUM, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
+ self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * 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, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
+ self::TYPE_COLNAME => array(ModuleImageI18nTableMap::ID => 0, ModuleImageI18nTableMap::LOCALE => 1, ModuleImageI18nTableMap::TITLE => 2, ModuleImageI18nTableMap::DESCRIPTION => 3, ModuleImageI18nTableMap::CHAPO => 4, ModuleImageI18nTableMap::POSTSCRIPTUM => 5, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * 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('module_image_i18n');
+ $this->setPhpName('ModuleImageI18n');
+ $this->setClassName('\\Thelia\\Model\\ModuleImageI18n');
+ $this->setPackage('Thelia.Model');
+ $this->setUseIdGenerator(false);
+ // columns
+ $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'module_image', 'ID', true, null, null);
+ $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
+ $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
+ $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
+ $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
+ $this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('ModuleImage', '\\Thelia\\Model\\ModuleImage', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
+ } // buildRelations()
+
+ /**
+ * Adds an object to the instance pool.
+ *
+ * Propel keeps cached copies of objects in an instance pool when they are retrieved
+ * from the database. In some cases you may need to explicitly add objects
+ * to the cache in order to ensure that the same objects are always returned by find*()
+ * and findPk*() calls.
+ *
+ * @param \Thelia\Model\ModuleImageI18n $obj A \Thelia\Model\ModuleImageI18n object.
+ * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
+ */
+ public static function addInstanceToPool($obj, $key = null)
+ {
+ if (Propel::isInstancePoolingEnabled()) {
+ if (null === $key) {
+ $key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
+ } // if key === null
+ self::$instances[$key] = $obj;
+ }
+ }
+
+ /**
+ * Removes an object from the instance pool.
+ *
+ * Propel keeps cached copies of objects in an instance pool when they are retrieved
+ * from the database. In some cases -- especially when you override doDelete
+ * methods in your stub classes -- you may need to explicitly remove objects
+ * from the cache in order to prevent returning objects that no longer exist.
+ *
+ * @param mixed $value A \Thelia\Model\ModuleImageI18n object or a primary key value.
+ */
+ public static function removeInstanceFromPool($value)
+ {
+ if (Propel::isInstancePoolingEnabled() && null !== $value) {
+ if (is_object($value) && $value instanceof \Thelia\Model\ModuleImageI18n) {
+ $key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
+
+ } elseif (is_array($value) && count($value) === 2) {
+ // assume we've been passed a primary key";
+ $key = serialize(array((string) $value[0], (string) $value[1]));
+ } elseif ($value instanceof Criteria) {
+ self::$instances = [];
+
+ return;
+ } else {
+ $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ModuleImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
+ throw $e;
+ }
+
+ unset(self::$instances[$key]);
+ }
+ }
+
+ /**
+ * 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 && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', 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 $pks;
+ }
+
+ /**
+ * 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 ? ModuleImageI18nTableMap::CLASS_DEFAULT : ModuleImageI18nTableMap::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 (ModuleImageI18n object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = ModuleImageI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = ModuleImageI18nTableMap::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 + ModuleImageI18nTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = ModuleImageI18nTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ ModuleImageI18nTableMap::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 = ModuleImageI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = ModuleImageI18nTableMap::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;
+ ModuleImageI18nTableMap::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(ModuleImageI18nTableMap::ID);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::LOCALE);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::TITLE);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::DESCRIPTION);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::CHAPO);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::POSTSCRIPTUM);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.LOCALE');
+ $criteria->addSelectColumn($alias . '.TITLE');
+ $criteria->addSelectColumn($alias . '.DESCRIPTION');
+ $criteria->addSelectColumn($alias . '.CHAPO');
+ $criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
+ }
+ }
+
+ /**
+ * 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(ModuleImageI18nTableMap::DATABASE_NAME)->getTable(ModuleImageI18nTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(ModuleImageI18nTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(ModuleImageI18nTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new ModuleImageI18nTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ModuleImageI18n or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ModuleImageI18n 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(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \Thelia\Model\ModuleImageI18n) { // 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(ModuleImageI18nTableMap::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ foreach ($values as $value) {
+ $criterion = $criteria->getNewCriterion(ModuleImageI18nTableMap::ID, $value[0]);
+ $criterion->addAnd($criteria->getNewCriterion(ModuleImageI18nTableMap::LOCALE, $value[1]));
+ $criteria->addOr($criterion);
+ }
+ }
+
+ $query = ModuleImageI18nQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { ModuleImageI18nTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { ModuleImageI18nTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the module_image_i18n 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 ModuleImageI18nQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a ModuleImageI18n or Criteria object.
+ *
+ * @param mixed $criteria Criteria or ModuleImageI18n 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(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from ModuleImageI18n object
+ }
+
+
+ // Set the correct dbName
+ $query = ModuleImageI18nQuery::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;
+ }
+
+} // ModuleImageI18nTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+ModuleImageI18nTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/AttributeCategoryTableMap.php b/core/lib/Thelia/Model/Map/ModuleImageTableMap.php
similarity index 63%
rename from core/lib/Thelia/Model/Map/AttributeCategoryTableMap.php
rename to core/lib/Thelia/Model/Map/ModuleImageTableMap.php
index b2525e8c3..718ac47c5 100644
--- a/core/lib/Thelia/Model/Map/AttributeCategoryTableMap.php
+++ b/core/lib/Thelia/Model/Map/ModuleImageTableMap.php
@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
-use Thelia\Model\AttributeCategory;
-use Thelia\Model\AttributeCategoryQuery;
+use Thelia\Model\ModuleImage;
+use Thelia\Model\ModuleImageQuery;
/**
- * This class defines the structure of the 'attribute_category' table.
+ * This class defines the structure of the 'module_image' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\AttributeCategoryQuery;
* (i.e. if it's a text column type).
*
*/
-class AttributeCategoryTableMap extends TableMap
+class ModuleImageTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
- const CLASS_NAME = 'Thelia.Model.Map.AttributeCategoryTableMap';
+ const CLASS_NAME = 'Thelia.Model.Map.ModuleImageTableMap';
/**
* The default database name for this class
@@ -42,22 +42,22 @@ class AttributeCategoryTableMap extends TableMap
/**
* The table name for this class
*/
- const TABLE_NAME = 'attribute_category';
+ const TABLE_NAME = 'module_image';
/**
* The related Propel class for this table
*/
- const OM_CLASS = '\\Thelia\\Model\\AttributeCategory';
+ const OM_CLASS = '\\Thelia\\Model\\ModuleImage';
/**
* A class that can be returned by this tableMap
*/
- const CLASS_DEFAULT = 'Thelia.Model.AttributeCategory';
+ const CLASS_DEFAULT = 'Thelia.Model.ModuleImage';
/**
* The total number of columns
*/
- const NUM_COLUMNS = 5;
+ const NUM_COLUMNS = 6;
/**
* The number of lazy-loaded columns
@@ -67,38 +67,52 @@ class AttributeCategoryTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 5;
+ const NUM_HYDRATE_COLUMNS = 6;
/**
* the column name for the ID field
*/
- const ID = 'attribute_category.ID';
+ const ID = 'module_image.ID';
/**
- * the column name for the CATEGORY_ID field
+ * the column name for the MODULE_ID field
*/
- const CATEGORY_ID = 'attribute_category.CATEGORY_ID';
+ const MODULE_ID = 'module_image.MODULE_ID';
/**
- * the column name for the ATTRIBUTE_ID field
+ * the column name for the FILE field
*/
- const ATTRIBUTE_ID = 'attribute_category.ATTRIBUTE_ID';
+ const FILE = 'module_image.FILE';
+
+ /**
+ * the column name for the POSITION field
+ */
+ const POSITION = 'module_image.POSITION';
/**
* the column name for the CREATED_AT field
*/
- const CREATED_AT = 'attribute_category.CREATED_AT';
+ const CREATED_AT = 'module_image.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
- const UPDATED_AT = 'attribute_category.UPDATED_AT';
+ const UPDATED_AT = 'module_image.UPDATED_AT';
/**
* The default string format for model objects of the related table
*/
const DEFAULT_STRING_FORMAT = 'YAML';
+ // i18n behavior
+
+ /**
+ * The default locale to use for translations.
+ *
+ * @var string
+ */
+ const DEFAULT_LOCALE = 'en_US';
+
/**
* holds an array of fieldnames
*
@@ -106,12 +120,12 @@ class AttributeCategoryTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'CategoryId', 'AttributeId', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'categoryId', 'attributeId', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(AttributeCategoryTableMap::ID, AttributeCategoryTableMap::CATEGORY_ID, AttributeCategoryTableMap::ATTRIBUTE_ID, AttributeCategoryTableMap::CREATED_AT, AttributeCategoryTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'CATEGORY_ID', 'ATTRIBUTE_ID', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'category_id', 'attribute_id', 'created_at', 'updated_at', ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, )
+ self::TYPE_PHPNAME => array('Id', 'ModuleId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'moduleId', 'file', 'position', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(ModuleImageTableMap::ID, ModuleImageTableMap::MODULE_ID, ModuleImageTableMap::FILE, ModuleImageTableMap::POSITION, ModuleImageTableMap::CREATED_AT, ModuleImageTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'MODULE_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'module_id', 'file', 'position', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
);
/**
@@ -121,12 +135,12 @@ class AttributeCategoryTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'CategoryId' => 1, 'AttributeId' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'categoryId' => 1, 'attributeId' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
- self::TYPE_COLNAME => array(AttributeCategoryTableMap::ID => 0, AttributeCategoryTableMap::CATEGORY_ID => 1, AttributeCategoryTableMap::ATTRIBUTE_ID => 2, AttributeCategoryTableMap::CREATED_AT => 3, AttributeCategoryTableMap::UPDATED_AT => 4, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'CATEGORY_ID' => 1, 'ATTRIBUTE_ID' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'category_id' => 1, 'attribute_id' => 2, 'created_at' => 3, 'updated_at' => 4, ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, )
+ self::TYPE_PHPNAME => array('Id' => 0, 'ModuleId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'moduleId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
+ self::TYPE_COLNAME => array(ModuleImageTableMap::ID => 0, ModuleImageTableMap::MODULE_ID => 1, ModuleImageTableMap::FILE => 2, ModuleImageTableMap::POSITION => 3, ModuleImageTableMap::CREATED_AT => 4, ModuleImageTableMap::UPDATED_AT => 5, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'MODULE_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'module_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
);
/**
@@ -139,16 +153,16 @@ class AttributeCategoryTableMap extends TableMap
public function initialize()
{
// attributes
- $this->setName('attribute_category');
- $this->setPhpName('AttributeCategory');
- $this->setClassName('\\Thelia\\Model\\AttributeCategory');
+ $this->setName('module_image');
+ $this->setPhpName('ModuleImage');
+ $this->setClassName('\\Thelia\\Model\\ModuleImage');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
- $this->setIsCrossRef(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
- $this->addForeignKey('CATEGORY_ID', 'CategoryId', 'INTEGER', 'category', 'ID', true, null, null);
- $this->addForeignKey('ATTRIBUTE_ID', 'AttributeId', 'INTEGER', 'attribute', 'ID', true, null, null);
+ $this->addForeignKey('MODULE_ID', 'ModuleId', 'INTEGER', 'module', 'ID', true, null, null);
+ $this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
+ $this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -158,8 +172,8 @@ class AttributeCategoryTableMap extends TableMap
*/
public function buildRelations()
{
- $this->addRelation('Category', '\\Thelia\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), 'CASCADE', 'RESTRICT');
- $this->addRelation('Attribute', '\\Thelia\\Model\\Attribute', RelationMap::MANY_TO_ONE, array('attribute_id' => 'id', ), 'CASCADE', 'RESTRICT');
+ $this->addRelation('Module', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('module_id' => 'id', ), 'CASCADE', 'RESTRICT');
+ $this->addRelation('ModuleImageI18n', '\\Thelia\\Model\\ModuleImageI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModuleImageI18ns');
} // buildRelations()
/**
@@ -172,8 +186,18 @@ class AttributeCategoryTableMap extends TableMap
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
+ 'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
);
} // getBehaviors()
+ /**
+ * Method to invalidate the instance pool of all tables related to module_image * by a foreign key with ON DELETE CASCADE
+ */
+ public static function clearRelatedInstancePool()
+ {
+ // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
+ // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
+ ModuleImageI18nTableMap::clearInstancePool();
+ }
/**
* 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.
@@ -231,7 +255,7 @@ class AttributeCategoryTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
- return $withPrefix ? AttributeCategoryTableMap::CLASS_DEFAULT : AttributeCategoryTableMap::OM_CLASS;
+ return $withPrefix ? ModuleImageTableMap::CLASS_DEFAULT : ModuleImageTableMap::OM_CLASS;
}
/**
@@ -245,21 +269,21 @@ class AttributeCategoryTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
- * @return array (AttributeCategory object, last column rank)
+ * @return array (ModuleImage object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
- $key = AttributeCategoryTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
- if (null !== ($obj = AttributeCategoryTableMap::getInstanceFromPool($key))) {
+ $key = ModuleImageTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = ModuleImageTableMap::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 + AttributeCategoryTableMap::NUM_HYDRATE_COLUMNS;
+ $col = $offset + ModuleImageTableMap::NUM_HYDRATE_COLUMNS;
} else {
- $cls = AttributeCategoryTableMap::OM_CLASS;
+ $cls = ModuleImageTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
- AttributeCategoryTableMap::addInstanceToPool($obj, $key);
+ ModuleImageTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -282,8 +306,8 @@ class AttributeCategoryTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
- $key = AttributeCategoryTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
- if (null !== ($obj = AttributeCategoryTableMap::getInstanceFromPool($key))) {
+ $key = ModuleImageTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = ModuleImageTableMap::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
@@ -292,7 +316,7 @@ class AttributeCategoryTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
- AttributeCategoryTableMap::addInstanceToPool($obj, $key);
+ ModuleImageTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -313,15 +337,17 @@ class AttributeCategoryTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
- $criteria->addSelectColumn(AttributeCategoryTableMap::ID);
- $criteria->addSelectColumn(AttributeCategoryTableMap::CATEGORY_ID);
- $criteria->addSelectColumn(AttributeCategoryTableMap::ATTRIBUTE_ID);
- $criteria->addSelectColumn(AttributeCategoryTableMap::CREATED_AT);
- $criteria->addSelectColumn(AttributeCategoryTableMap::UPDATED_AT);
+ $criteria->addSelectColumn(ModuleImageTableMap::ID);
+ $criteria->addSelectColumn(ModuleImageTableMap::MODULE_ID);
+ $criteria->addSelectColumn(ModuleImageTableMap::FILE);
+ $criteria->addSelectColumn(ModuleImageTableMap::POSITION);
+ $criteria->addSelectColumn(ModuleImageTableMap::CREATED_AT);
+ $criteria->addSelectColumn(ModuleImageTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
- $criteria->addSelectColumn($alias . '.CATEGORY_ID');
- $criteria->addSelectColumn($alias . '.ATTRIBUTE_ID');
+ $criteria->addSelectColumn($alias . '.MODULE_ID');
+ $criteria->addSelectColumn($alias . '.FILE');
+ $criteria->addSelectColumn($alias . '.POSITION');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
@@ -336,7 +362,7 @@ class AttributeCategoryTableMap extends TableMap
*/
public static function getTableMap()
{
- return Propel::getServiceContainer()->getDatabaseMap(AttributeCategoryTableMap::DATABASE_NAME)->getTable(AttributeCategoryTableMap::TABLE_NAME);
+ return Propel::getServiceContainer()->getDatabaseMap(ModuleImageTableMap::DATABASE_NAME)->getTable(ModuleImageTableMap::TABLE_NAME);
}
/**
@@ -344,16 +370,16 @@ class AttributeCategoryTableMap extends TableMap
*/
public static function buildTableMap()
{
- $dbMap = Propel::getServiceContainer()->getDatabaseMap(AttributeCategoryTableMap::DATABASE_NAME);
- if (!$dbMap->hasTable(AttributeCategoryTableMap::TABLE_NAME)) {
- $dbMap->addTableObject(new AttributeCategoryTableMap());
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(ModuleImageTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(ModuleImageTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new ModuleImageTableMap());
}
}
/**
- * Performs a DELETE on the database, given a AttributeCategory or Criteria object OR a primary key value.
+ * Performs a DELETE on the database, given a ModuleImage or Criteria object OR a primary key value.
*
- * @param mixed $values Criteria or AttributeCategory object or primary key or array of primary keys
+ * @param mixed $values Criteria or ModuleImage 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
@@ -364,25 +390,25 @@ class AttributeCategoryTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(AttributeCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
- } elseif ($values instanceof \Thelia\Model\AttributeCategory) { // it's a model object
+ } elseif ($values instanceof \Thelia\Model\ModuleImage) { // 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(AttributeCategoryTableMap::DATABASE_NAME);
- $criteria->add(AttributeCategoryTableMap::ID, (array) $values, Criteria::IN);
+ $criteria = new Criteria(ModuleImageTableMap::DATABASE_NAME);
+ $criteria->add(ModuleImageTableMap::ID, (array) $values, Criteria::IN);
}
- $query = AttributeCategoryQuery::create()->mergeWith($criteria);
+ $query = ModuleImageQuery::create()->mergeWith($criteria);
- if ($values instanceof Criteria) { AttributeCategoryTableMap::clearInstancePool();
+ if ($values instanceof Criteria) { ModuleImageTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
- foreach ((array) $values as $singleval) { AttributeCategoryTableMap::removeInstanceFromPool($singleval);
+ foreach ((array) $values as $singleval) { ModuleImageTableMap::removeInstanceFromPool($singleval);
}
}
@@ -390,20 +416,20 @@ class AttributeCategoryTableMap extends TableMap
}
/**
- * Deletes all rows from the attribute_category table.
+ * Deletes all rows from the module_image 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 AttributeCategoryQuery::create()->doDeleteAll($con);
+ return ModuleImageQuery::create()->doDeleteAll($con);
}
/**
- * Performs an INSERT on the database, given a AttributeCategory or Criteria object.
+ * Performs an INSERT on the database, given a ModuleImage or Criteria object.
*
- * @param mixed $criteria Criteria or AttributeCategory object containing data that is used to create the INSERT statement.
+ * @param mixed $criteria Criteria or ModuleImage 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
@@ -412,22 +438,22 @@ class AttributeCategoryTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(AttributeCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
- $criteria = $criteria->buildCriteria(); // build Criteria from AttributeCategory object
+ $criteria = $criteria->buildCriteria(); // build Criteria from ModuleImage object
}
- if ($criteria->containsKey(AttributeCategoryTableMap::ID) && $criteria->keyContainsValue(AttributeCategoryTableMap::ID) ) {
- throw new PropelException('Cannot insert a value for auto-increment primary key ('.AttributeCategoryTableMap::ID.')');
+ if ($criteria->containsKey(ModuleImageTableMap::ID) && $criteria->keyContainsValue(ModuleImageTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.ModuleImageTableMap::ID.')');
}
// Set the correct dbName
- $query = AttributeCategoryQuery::create()->mergeWith($criteria);
+ $query = ModuleImageQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -443,7 +469,7 @@ class AttributeCategoryTableMap extends TableMap
return $pk;
}
-} // AttributeCategoryTableMap
+} // ModuleImageTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
-AttributeCategoryTableMap::buildTableMap();
+ModuleImageTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/ModuleTableMap.php b/core/lib/Thelia/Model/Map/ModuleTableMap.php
index 1a2f63692..788048e28 100644
--- a/core/lib/Thelia/Model/Map/ModuleTableMap.php
+++ b/core/lib/Thelia/Model/Map/ModuleTableMap.php
@@ -188,6 +188,7 @@ class ModuleTableMap extends TableMap
$this->addRelation('OrderRelatedByDeliveryModuleId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByDeliveryModuleId');
$this->addRelation('AreaDeliveryModule', '\\Thelia\\Model\\AreaDeliveryModule', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'CASCADE', 'RESTRICT', 'AreaDeliveryModules');
$this->addRelation('GroupModule', '\\Thelia\\Model\\GroupModule', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'GroupModules');
+ $this->addRelation('ModuleImage', '\\Thelia\\Model\\ModuleImage', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'ModuleImages');
$this->addRelation('ModuleI18n', '\\Thelia\\Model\\ModuleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModuleI18ns');
} // buildRelations()
@@ -213,6 +214,7 @@ class ModuleTableMap extends TableMap
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
AreaDeliveryModuleTableMap::clearInstancePool();
GroupModuleTableMap::clearInstancePool();
+ ModuleImageTableMap::clearInstancePool();
ModuleI18nTableMap::clearInstancePool();
}
diff --git a/core/lib/Thelia/Model/Map/OrderProductAttributeCombinationTableMap.php b/core/lib/Thelia/Model/Map/OrderProductAttributeCombinationTableMap.php
new file mode 100644
index 000000000..582bd2305
--- /dev/null
+++ b/core/lib/Thelia/Model/Map/OrderProductAttributeCombinationTableMap.php
@@ -0,0 +1,503 @@
+ array('Id', 'OrderProductId', 'AttributeTitle', 'AttributeChapo', 'AttributeDescription', 'AttributePostscriptumn', 'AttributeAvTitle', 'AttributeAvChapo', 'AttributeAvDescription', 'AttributeAvPostscriptum', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'orderProductId', 'attributeTitle', 'attributeChapo', 'attributeDescription', 'attributePostscriptumn', 'attributeAvTitle', 'attributeAvChapo', 'attributeAvDescription', 'attributeAvPostscriptum', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(OrderProductAttributeCombinationTableMap::ID, OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID, OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE, OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO, OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION, OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN, OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE, OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO, OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION, OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_POSTSCRIPTUM, OrderProductAttributeCombinationTableMap::CREATED_AT, OrderProductAttributeCombinationTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'ORDER_PRODUCT_ID', 'ATTRIBUTE_TITLE', 'ATTRIBUTE_CHAPO', 'ATTRIBUTE_DESCRIPTION', 'ATTRIBUTE_POSTSCRIPTUMN', 'ATTRIBUTE_AV_TITLE', 'ATTRIBUTE_AV_CHAPO', 'ATTRIBUTE_AV_DESCRIPTION', 'ATTRIBUTE_AV_POSTSCRIPTUM', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'order_product_id', 'attribute_title', 'attribute_chapo', 'attribute_description', 'attribute_postscriptumn', 'attribute_av_title', 'attribute_av_chapo', 'attribute_av_description', 'attribute_av_postscriptum', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
+ );
+
+ /**
+ * 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, 'OrderProductId' => 1, 'AttributeTitle' => 2, 'AttributeChapo' => 3, 'AttributeDescription' => 4, 'AttributePostscriptumn' => 5, 'AttributeAvTitle' => 6, 'AttributeAvChapo' => 7, 'AttributeAvDescription' => 8, 'AttributeAvPostscriptum' => 9, 'CreatedAt' => 10, 'UpdatedAt' => 11, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'orderProductId' => 1, 'attributeTitle' => 2, 'attributeChapo' => 3, 'attributeDescription' => 4, 'attributePostscriptumn' => 5, 'attributeAvTitle' => 6, 'attributeAvChapo' => 7, 'attributeAvDescription' => 8, 'attributeAvPostscriptum' => 9, 'createdAt' => 10, 'updatedAt' => 11, ),
+ self::TYPE_COLNAME => array(OrderProductAttributeCombinationTableMap::ID => 0, OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID => 1, OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE => 2, OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO => 3, OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION => 4, OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN => 5, OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE => 6, OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO => 7, OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION => 8, OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_POSTSCRIPTUM => 9, OrderProductAttributeCombinationTableMap::CREATED_AT => 10, OrderProductAttributeCombinationTableMap::UPDATED_AT => 11, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'ORDER_PRODUCT_ID' => 1, 'ATTRIBUTE_TITLE' => 2, 'ATTRIBUTE_CHAPO' => 3, 'ATTRIBUTE_DESCRIPTION' => 4, 'ATTRIBUTE_POSTSCRIPTUMN' => 5, 'ATTRIBUTE_AV_TITLE' => 6, 'ATTRIBUTE_AV_CHAPO' => 7, 'ATTRIBUTE_AV_DESCRIPTION' => 8, 'ATTRIBUTE_AV_POSTSCRIPTUM' => 9, 'CREATED_AT' => 10, 'UPDATED_AT' => 11, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'order_product_id' => 1, 'attribute_title' => 2, 'attribute_chapo' => 3, 'attribute_description' => 4, 'attribute_postscriptumn' => 5, 'attribute_av_title' => 6, 'attribute_av_chapo' => 7, 'attribute_av_description' => 8, 'attribute_av_postscriptum' => 9, 'created_at' => 10, 'updated_at' => 11, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
+ );
+
+ /**
+ * 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_product_attribute_combination');
+ $this->setPhpName('OrderProductAttributeCombination');
+ $this->setClassName('\\Thelia\\Model\\OrderProductAttributeCombination');
+ $this->setPackage('Thelia.Model');
+ $this->setUseIdGenerator(true);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addForeignKey('ORDER_PRODUCT_ID', 'OrderProductId', 'INTEGER', 'order_product', 'ID', true, null, null);
+ $this->addColumn('ATTRIBUTE_TITLE', 'AttributeTitle', 'VARCHAR', true, 255, null);
+ $this->addColumn('ATTRIBUTE_CHAPO', 'AttributeChapo', 'LONGVARCHAR', false, null, null);
+ $this->addColumn('ATTRIBUTE_DESCRIPTION', 'AttributeDescription', 'CLOB', false, null, null);
+ $this->addColumn('ATTRIBUTE_POSTSCRIPTUMN', 'AttributePostscriptumn', 'LONGVARCHAR', false, null, null);
+ $this->addColumn('ATTRIBUTE_AV_TITLE', 'AttributeAvTitle', 'VARCHAR', true, 255, null);
+ $this->addColumn('ATTRIBUTE_AV_CHAPO', 'AttributeAvChapo', 'LONGVARCHAR', false, null, null);
+ $this->addColumn('ATTRIBUTE_AV_DESCRIPTION', 'AttributeAvDescription', 'CLOB', false, null, null);
+ $this->addColumn('ATTRIBUTE_AV_POSTSCRIPTUM', 'AttributeAvPostscriptum', 'LONGVARCHAR', false, null, 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()
+ {
+ $this->addRelation('OrderProduct', '\\Thelia\\Model\\OrderProduct', RelationMap::MANY_TO_ONE, array('order_product_id' => 'id', ), 'CASCADE', 'RESTRICT');
+ } // 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 ? OrderProductAttributeCombinationTableMap::CLASS_DEFAULT : OrderProductAttributeCombinationTableMap::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 (OrderProductAttributeCombination object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = OrderProductAttributeCombinationTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = OrderProductAttributeCombinationTableMap::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 + OrderProductAttributeCombinationTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = OrderProductAttributeCombinationTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ OrderProductAttributeCombinationTableMap::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 = OrderProductAttributeCombinationTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = OrderProductAttributeCombinationTableMap::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;
+ OrderProductAttributeCombinationTableMap::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(OrderProductAttributeCombinationTableMap::ID);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUMN);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_POSTSCRIPTUM);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::CREATED_AT);
+ $criteria->addSelectColumn(OrderProductAttributeCombinationTableMap::UPDATED_AT);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.ORDER_PRODUCT_ID');
+ $criteria->addSelectColumn($alias . '.ATTRIBUTE_TITLE');
+ $criteria->addSelectColumn($alias . '.ATTRIBUTE_CHAPO');
+ $criteria->addSelectColumn($alias . '.ATTRIBUTE_DESCRIPTION');
+ $criteria->addSelectColumn($alias . '.ATTRIBUTE_POSTSCRIPTUMN');
+ $criteria->addSelectColumn($alias . '.ATTRIBUTE_AV_TITLE');
+ $criteria->addSelectColumn($alias . '.ATTRIBUTE_AV_CHAPO');
+ $criteria->addSelectColumn($alias . '.ATTRIBUTE_AV_DESCRIPTION');
+ $criteria->addSelectColumn($alias . '.ATTRIBUTE_AV_POSTSCRIPTUM');
+ $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(OrderProductAttributeCombinationTableMap::DATABASE_NAME)->getTable(OrderProductAttributeCombinationTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(OrderProductAttributeCombinationTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new OrderProductAttributeCombinationTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a OrderProductAttributeCombination or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or OrderProductAttributeCombination 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(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \Thelia\Model\OrderProductAttributeCombination) { // 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(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+ $criteria->add(OrderProductAttributeCombinationTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = OrderProductAttributeCombinationQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { OrderProductAttributeCombinationTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { OrderProductAttributeCombinationTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the order_product_attribute_combination 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 OrderProductAttributeCombinationQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a OrderProductAttributeCombination or Criteria object.
+ *
+ * @param mixed $criteria Criteria or OrderProductAttributeCombination 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(OrderProductAttributeCombinationTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from OrderProductAttributeCombination object
+ }
+
+ if ($criteria->containsKey(OrderProductAttributeCombinationTableMap::ID) && $criteria->keyContainsValue(OrderProductAttributeCombinationTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.OrderProductAttributeCombinationTableMap::ID.')');
+ }
+
+
+ // Set the correct dbName
+ $query = OrderProductAttributeCombinationQuery::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;
+ }
+
+} // OrderProductAttributeCombinationTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+OrderProductAttributeCombinationTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/OrderProductTableMap.php b/core/lib/Thelia/Model/Map/OrderProductTableMap.php
index 038d12863..8144f23a7 100644
--- a/core/lib/Thelia/Model/Map/OrderProductTableMap.php
+++ b/core/lib/Thelia/Model/Map/OrderProductTableMap.php
@@ -57,7 +57,7 @@ class OrderProductTableMap extends TableMap
/**
* The total number of columns
*/
- const NUM_COLUMNS = 12;
+ const NUM_COLUMNS = 19;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class OrderProductTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 12;
+ const NUM_HYDRATE_COLUMNS = 19;
/**
* the column name for the ID field
@@ -84,20 +84,30 @@ class OrderProductTableMap extends TableMap
*/
const PRODUCT_REF = 'order_product.PRODUCT_REF';
+ /**
+ * the column name for the PRODUCT_SALE_ELEMENTS_REF field
+ */
+ const PRODUCT_SALE_ELEMENTS_REF = 'order_product.PRODUCT_SALE_ELEMENTS_REF';
+
/**
* the column name for the TITLE field
*/
const TITLE = 'order_product.TITLE';
+ /**
+ * the column name for the CHAPO field
+ */
+ const CHAPO = 'order_product.CHAPO';
+
/**
* the column name for the DESCRIPTION field
*/
const DESCRIPTION = 'order_product.DESCRIPTION';
/**
- * the column name for the CHAPO field
+ * the column name for the POSTSCRIPTUM field
*/
- const CHAPO = 'order_product.CHAPO';
+ const POSTSCRIPTUM = 'order_product.POSTSCRIPTUM';
/**
* the column name for the QUANTITY field
@@ -110,9 +120,34 @@ class OrderProductTableMap extends TableMap
const PRICE = 'order_product.PRICE';
/**
- * the column name for the TAX field
+ * the column name for the PROMO_PRICE field
*/
- const TAX = 'order_product.TAX';
+ const PROMO_PRICE = 'order_product.PROMO_PRICE';
+
+ /**
+ * the column name for the WAS_NEW field
+ */
+ const WAS_NEW = 'order_product.WAS_NEW';
+
+ /**
+ * the column name for the WAS_IN_PROMO field
+ */
+ const WAS_IN_PROMO = 'order_product.WAS_IN_PROMO';
+
+ /**
+ * the column name for the WEIGHT field
+ */
+ const WEIGHT = 'order_product.WEIGHT';
+
+ /**
+ * the column name for the TAX_RULE_TITLE field
+ */
+ const TAX_RULE_TITLE = 'order_product.TAX_RULE_TITLE';
+
+ /**
+ * the column name for the TAX_RULE_DESCRIPTION field
+ */
+ const TAX_RULE_DESCRIPTION = 'order_product.TAX_RULE_DESCRIPTION';
/**
* the column name for the PARENT field
@@ -141,12 +176,12 @@ class OrderProductTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'OrderId', 'ProductRef', 'Title', 'Description', 'Chapo', 'Quantity', 'Price', 'Tax', 'Parent', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'orderId', 'productRef', 'title', 'description', 'chapo', 'quantity', 'price', 'tax', 'parent', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(OrderProductTableMap::ID, OrderProductTableMap::ORDER_ID, OrderProductTableMap::PRODUCT_REF, OrderProductTableMap::TITLE, OrderProductTableMap::DESCRIPTION, OrderProductTableMap::CHAPO, OrderProductTableMap::QUANTITY, OrderProductTableMap::PRICE, OrderProductTableMap::TAX, OrderProductTableMap::PARENT, OrderProductTableMap::CREATED_AT, OrderProductTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'ORDER_ID', 'PRODUCT_REF', 'TITLE', 'DESCRIPTION', 'CHAPO', 'QUANTITY', 'PRICE', 'TAX', 'PARENT', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'order_id', 'product_ref', 'title', 'description', 'chapo', 'quantity', 'price', 'tax', 'parent', 'created_at', 'updated_at', ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
+ self::TYPE_PHPNAME => array('Id', 'OrderId', 'ProductRef', 'ProductSaleElementsRef', 'Title', 'Chapo', 'Description', 'Postscriptum', 'Quantity', 'Price', 'PromoPrice', 'WasNew', 'WasInPromo', 'Weight', 'TaxRuleTitle', 'TaxRuleDescription', 'Parent', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'orderId', 'productRef', 'productSaleElementsRef', 'title', 'chapo', 'description', 'postscriptum', 'quantity', 'price', 'promoPrice', 'wasNew', 'wasInPromo', 'weight', 'taxRuleTitle', 'taxRuleDescription', 'parent', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(OrderProductTableMap::ID, OrderProductTableMap::ORDER_ID, OrderProductTableMap::PRODUCT_REF, OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF, OrderProductTableMap::TITLE, OrderProductTableMap::CHAPO, OrderProductTableMap::DESCRIPTION, OrderProductTableMap::POSTSCRIPTUM, OrderProductTableMap::QUANTITY, OrderProductTableMap::PRICE, OrderProductTableMap::PROMO_PRICE, OrderProductTableMap::WAS_NEW, OrderProductTableMap::WAS_IN_PROMO, OrderProductTableMap::WEIGHT, OrderProductTableMap::TAX_RULE_TITLE, OrderProductTableMap::TAX_RULE_DESCRIPTION, OrderProductTableMap::PARENT, OrderProductTableMap::CREATED_AT, OrderProductTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'ORDER_ID', 'PRODUCT_REF', 'PRODUCT_SALE_ELEMENTS_REF', 'TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM', 'QUANTITY', 'PRICE', 'PROMO_PRICE', 'WAS_NEW', 'WAS_IN_PROMO', 'WEIGHT', 'TAX_RULE_TITLE', 'TAX_RULE_DESCRIPTION', 'PARENT', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'order_id', 'product_ref', 'product_sale_elements_ref', 'title', 'chapo', 'description', 'postscriptum', 'quantity', 'price', 'promo_price', 'was_new', 'was_in_promo', 'weight', 'tax_rule_title', 'tax_rule_description', 'parent', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
);
/**
@@ -156,12 +191,12 @@ class OrderProductTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'OrderId' => 1, 'ProductRef' => 2, 'Title' => 3, 'Description' => 4, 'Chapo' => 5, 'Quantity' => 6, 'Price' => 7, 'Tax' => 8, 'Parent' => 9, 'CreatedAt' => 10, 'UpdatedAt' => 11, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'orderId' => 1, 'productRef' => 2, 'title' => 3, 'description' => 4, 'chapo' => 5, 'quantity' => 6, 'price' => 7, 'tax' => 8, 'parent' => 9, 'createdAt' => 10, 'updatedAt' => 11, ),
- self::TYPE_COLNAME => array(OrderProductTableMap::ID => 0, OrderProductTableMap::ORDER_ID => 1, OrderProductTableMap::PRODUCT_REF => 2, OrderProductTableMap::TITLE => 3, OrderProductTableMap::DESCRIPTION => 4, OrderProductTableMap::CHAPO => 5, OrderProductTableMap::QUANTITY => 6, OrderProductTableMap::PRICE => 7, OrderProductTableMap::TAX => 8, OrderProductTableMap::PARENT => 9, OrderProductTableMap::CREATED_AT => 10, OrderProductTableMap::UPDATED_AT => 11, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'ORDER_ID' => 1, 'PRODUCT_REF' => 2, 'TITLE' => 3, 'DESCRIPTION' => 4, 'CHAPO' => 5, 'QUANTITY' => 6, 'PRICE' => 7, 'TAX' => 8, 'PARENT' => 9, 'CREATED_AT' => 10, 'UPDATED_AT' => 11, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'order_id' => 1, 'product_ref' => 2, 'title' => 3, 'description' => 4, 'chapo' => 5, 'quantity' => 6, 'price' => 7, 'tax' => 8, 'parent' => 9, 'created_at' => 10, 'updated_at' => 11, ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
+ self::TYPE_PHPNAME => array('Id' => 0, 'OrderId' => 1, 'ProductRef' => 2, 'ProductSaleElementsRef' => 3, 'Title' => 4, 'Chapo' => 5, 'Description' => 6, 'Postscriptum' => 7, 'Quantity' => 8, 'Price' => 9, 'PromoPrice' => 10, 'WasNew' => 11, 'WasInPromo' => 12, 'Weight' => 13, 'TaxRuleTitle' => 14, 'TaxRuleDescription' => 15, 'Parent' => 16, 'CreatedAt' => 17, 'UpdatedAt' => 18, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'orderId' => 1, 'productRef' => 2, 'productSaleElementsRef' => 3, 'title' => 4, 'chapo' => 5, 'description' => 6, 'postscriptum' => 7, 'quantity' => 8, 'price' => 9, 'promoPrice' => 10, 'wasNew' => 11, 'wasInPromo' => 12, 'weight' => 13, 'taxRuleTitle' => 14, 'taxRuleDescription' => 15, 'parent' => 16, 'createdAt' => 17, 'updatedAt' => 18, ),
+ self::TYPE_COLNAME => array(OrderProductTableMap::ID => 0, OrderProductTableMap::ORDER_ID => 1, OrderProductTableMap::PRODUCT_REF => 2, OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF => 3, OrderProductTableMap::TITLE => 4, OrderProductTableMap::CHAPO => 5, OrderProductTableMap::DESCRIPTION => 6, OrderProductTableMap::POSTSCRIPTUM => 7, OrderProductTableMap::QUANTITY => 8, OrderProductTableMap::PRICE => 9, OrderProductTableMap::PROMO_PRICE => 10, OrderProductTableMap::WAS_NEW => 11, OrderProductTableMap::WAS_IN_PROMO => 12, OrderProductTableMap::WEIGHT => 13, OrderProductTableMap::TAX_RULE_TITLE => 14, OrderProductTableMap::TAX_RULE_DESCRIPTION => 15, OrderProductTableMap::PARENT => 16, OrderProductTableMap::CREATED_AT => 17, OrderProductTableMap::UPDATED_AT => 18, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'ORDER_ID' => 1, 'PRODUCT_REF' => 2, 'PRODUCT_SALE_ELEMENTS_REF' => 3, 'TITLE' => 4, 'CHAPO' => 5, 'DESCRIPTION' => 6, 'POSTSCRIPTUM' => 7, 'QUANTITY' => 8, 'PRICE' => 9, 'PROMO_PRICE' => 10, 'WAS_NEW' => 11, 'WAS_IN_PROMO' => 12, 'WEIGHT' => 13, 'TAX_RULE_TITLE' => 14, 'TAX_RULE_DESCRIPTION' => 15, 'PARENT' => 16, 'CREATED_AT' => 17, 'UPDATED_AT' => 18, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'order_id' => 1, 'product_ref' => 2, 'product_sale_elements_ref' => 3, 'title' => 4, 'chapo' => 5, 'description' => 6, 'postscriptum' => 7, 'quantity' => 8, 'price' => 9, 'promo_price' => 10, 'was_new' => 11, 'was_in_promo' => 12, 'weight' => 13, 'tax_rule_title' => 14, 'tax_rule_description' => 15, 'parent' => 16, 'created_at' => 17, 'updated_at' => 18, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
);
/**
@@ -182,13 +217,20 @@ class OrderProductTableMap extends TableMap
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('ORDER_ID', 'OrderId', 'INTEGER', 'order', 'ID', true, null, null);
- $this->addColumn('PRODUCT_REF', 'ProductRef', 'VARCHAR', false, 255, null);
+ $this->addColumn('PRODUCT_REF', 'ProductRef', 'VARCHAR', true, 255, null);
+ $this->addColumn('PRODUCT_SALE_ELEMENTS_REF', 'ProductSaleElementsRef', 'VARCHAR', true, 255, null);
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
- $this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
+ $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
+ $this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
$this->addColumn('QUANTITY', 'Quantity', 'FLOAT', true, null, null);
$this->addColumn('PRICE', 'Price', 'FLOAT', true, null, null);
- $this->addColumn('TAX', 'Tax', 'FLOAT', false, null, null);
+ $this->addColumn('PROMO_PRICE', 'PromoPrice', 'VARCHAR', false, 45, null);
+ $this->addColumn('WAS_NEW', 'WasNew', 'TINYINT', true, null, null);
+ $this->addColumn('WAS_IN_PROMO', 'WasInPromo', 'TINYINT', true, null, null);
+ $this->addColumn('WEIGHT', 'Weight', 'VARCHAR', false, 45, null);
+ $this->addColumn('TAX_RULE_TITLE', 'TaxRuleTitle', 'VARCHAR', false, 255, null);
+ $this->addColumn('TAX_RULE_DESCRIPTION', 'TaxRuleDescription', 'CLOB', false, null, null);
$this->addColumn('PARENT', 'Parent', 'INTEGER', false, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
@@ -200,7 +242,8 @@ class OrderProductTableMap extends TableMap
public function buildRelations()
{
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::MANY_TO_ONE, array('order_id' => 'id', ), 'CASCADE', 'RESTRICT');
- $this->addRelation('OrderFeature', '\\Thelia\\Model\\OrderFeature', RelationMap::ONE_TO_MANY, array('id' => 'order_product_id', ), 'CASCADE', 'RESTRICT', 'OrderFeatures');
+ $this->addRelation('OrderProductAttributeCombination', '\\Thelia\\Model\\OrderProductAttributeCombination', RelationMap::ONE_TO_MANY, array('id' => 'order_product_id', ), 'CASCADE', 'RESTRICT', 'OrderProductAttributeCombinations');
+ $this->addRelation('OrderProductTax', '\\Thelia\\Model\\OrderProductTax', RelationMap::ONE_TO_MANY, array('id' => 'order_product_id', ), 'CASCADE', 'RESTRICT', 'OrderProductTaxes');
} // buildRelations()
/**
@@ -222,7 +265,8 @@ class OrderProductTableMap extends TableMap
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
- OrderFeatureTableMap::clearInstancePool();
+ OrderProductAttributeCombinationTableMap::clearInstancePool();
+ OrderProductTaxTableMap::clearInstancePool();
}
/**
@@ -366,12 +410,19 @@ class OrderProductTableMap extends TableMap
$criteria->addSelectColumn(OrderProductTableMap::ID);
$criteria->addSelectColumn(OrderProductTableMap::ORDER_ID);
$criteria->addSelectColumn(OrderProductTableMap::PRODUCT_REF);
+ $criteria->addSelectColumn(OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF);
$criteria->addSelectColumn(OrderProductTableMap::TITLE);
- $criteria->addSelectColumn(OrderProductTableMap::DESCRIPTION);
$criteria->addSelectColumn(OrderProductTableMap::CHAPO);
+ $criteria->addSelectColumn(OrderProductTableMap::DESCRIPTION);
+ $criteria->addSelectColumn(OrderProductTableMap::POSTSCRIPTUM);
$criteria->addSelectColumn(OrderProductTableMap::QUANTITY);
$criteria->addSelectColumn(OrderProductTableMap::PRICE);
- $criteria->addSelectColumn(OrderProductTableMap::TAX);
+ $criteria->addSelectColumn(OrderProductTableMap::PROMO_PRICE);
+ $criteria->addSelectColumn(OrderProductTableMap::WAS_NEW);
+ $criteria->addSelectColumn(OrderProductTableMap::WAS_IN_PROMO);
+ $criteria->addSelectColumn(OrderProductTableMap::WEIGHT);
+ $criteria->addSelectColumn(OrderProductTableMap::TAX_RULE_TITLE);
+ $criteria->addSelectColumn(OrderProductTableMap::TAX_RULE_DESCRIPTION);
$criteria->addSelectColumn(OrderProductTableMap::PARENT);
$criteria->addSelectColumn(OrderProductTableMap::CREATED_AT);
$criteria->addSelectColumn(OrderProductTableMap::UPDATED_AT);
@@ -379,12 +430,19 @@ class OrderProductTableMap extends TableMap
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.ORDER_ID');
$criteria->addSelectColumn($alias . '.PRODUCT_REF');
+ $criteria->addSelectColumn($alias . '.PRODUCT_SALE_ELEMENTS_REF');
$criteria->addSelectColumn($alias . '.TITLE');
- $criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.CHAPO');
+ $criteria->addSelectColumn($alias . '.DESCRIPTION');
+ $criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
$criteria->addSelectColumn($alias . '.QUANTITY');
$criteria->addSelectColumn($alias . '.PRICE');
- $criteria->addSelectColumn($alias . '.TAX');
+ $criteria->addSelectColumn($alias . '.PROMO_PRICE');
+ $criteria->addSelectColumn($alias . '.WAS_NEW');
+ $criteria->addSelectColumn($alias . '.WAS_IN_PROMO');
+ $criteria->addSelectColumn($alias . '.WEIGHT');
+ $criteria->addSelectColumn($alias . '.TAX_RULE_TITLE');
+ $criteria->addSelectColumn($alias . '.TAX_RULE_DESCRIPTION');
$criteria->addSelectColumn($alias . '.PARENT');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
diff --git a/core/lib/Thelia/Model/Map/FeatureCategoryTableMap.php b/core/lib/Thelia/Model/Map/OrderProductTaxTableMap.php
similarity index 64%
rename from core/lib/Thelia/Model/Map/FeatureCategoryTableMap.php
rename to core/lib/Thelia/Model/Map/OrderProductTaxTableMap.php
index 3e20805b6..2e8460a6a 100644
--- a/core/lib/Thelia/Model/Map/FeatureCategoryTableMap.php
+++ b/core/lib/Thelia/Model/Map/OrderProductTaxTableMap.php
@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
-use Thelia\Model\FeatureCategory;
-use Thelia\Model\FeatureCategoryQuery;
+use Thelia\Model\OrderProductTax;
+use Thelia\Model\OrderProductTaxQuery;
/**
- * This class defines the structure of the 'feature_category' table.
+ * This class defines the structure of the 'order_product_tax' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\FeatureCategoryQuery;
* (i.e. if it's a text column type).
*
*/
-class FeatureCategoryTableMap extends TableMap
+class OrderProductTaxTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
- const CLASS_NAME = 'Thelia.Model.Map.FeatureCategoryTableMap';
+ const CLASS_NAME = 'Thelia.Model.Map.OrderProductTaxTableMap';
/**
* The default database name for this class
@@ -42,22 +42,22 @@ class FeatureCategoryTableMap extends TableMap
/**
* The table name for this class
*/
- const TABLE_NAME = 'feature_category';
+ const TABLE_NAME = 'order_product_tax';
/**
* The related Propel class for this table
*/
- const OM_CLASS = '\\Thelia\\Model\\FeatureCategory';
+ const OM_CLASS = '\\Thelia\\Model\\OrderProductTax';
/**
* A class that can be returned by this tableMap
*/
- const CLASS_DEFAULT = 'Thelia.Model.FeatureCategory';
+ const CLASS_DEFAULT = 'Thelia.Model.OrderProductTax';
/**
* The total number of columns
*/
- const NUM_COLUMNS = 5;
+ const NUM_COLUMNS = 7;
/**
* The number of lazy-loaded columns
@@ -67,32 +67,42 @@ class FeatureCategoryTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 5;
+ const NUM_HYDRATE_COLUMNS = 7;
/**
* the column name for the ID field
*/
- const ID = 'feature_category.ID';
+ const ID = 'order_product_tax.ID';
/**
- * the column name for the FEATURE_ID field
+ * the column name for the ORDER_PRODUCT_ID field
*/
- const FEATURE_ID = 'feature_category.FEATURE_ID';
+ const ORDER_PRODUCT_ID = 'order_product_tax.ORDER_PRODUCT_ID';
/**
- * the column name for the CATEGORY_ID field
+ * the column name for the TITLE field
*/
- const CATEGORY_ID = 'feature_category.CATEGORY_ID';
+ const TITLE = 'order_product_tax.TITLE';
+
+ /**
+ * the column name for the DESCRIPTION field
+ */
+ const DESCRIPTION = 'order_product_tax.DESCRIPTION';
+
+ /**
+ * the column name for the AMOUNT field
+ */
+ const AMOUNT = 'order_product_tax.AMOUNT';
/**
* the column name for the CREATED_AT field
*/
- const CREATED_AT = 'feature_category.CREATED_AT';
+ const CREATED_AT = 'order_product_tax.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
- const UPDATED_AT = 'feature_category.UPDATED_AT';
+ const UPDATED_AT = 'order_product_tax.UPDATED_AT';
/**
* The default string format for model objects of the related table
@@ -106,12 +116,12 @@ class FeatureCategoryTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'FeatureId', 'CategoryId', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'featureId', 'categoryId', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(FeatureCategoryTableMap::ID, FeatureCategoryTableMap::FEATURE_ID, FeatureCategoryTableMap::CATEGORY_ID, FeatureCategoryTableMap::CREATED_AT, FeatureCategoryTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'FEATURE_ID', 'CATEGORY_ID', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'feature_id', 'category_id', 'created_at', 'updated_at', ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, )
+ self::TYPE_PHPNAME => array('Id', 'OrderProductId', 'Title', 'Description', 'Amount', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'orderProductId', 'title', 'description', 'amount', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(OrderProductTaxTableMap::ID, OrderProductTaxTableMap::ORDER_PRODUCT_ID, OrderProductTaxTableMap::TITLE, OrderProductTaxTableMap::DESCRIPTION, OrderProductTaxTableMap::AMOUNT, OrderProductTaxTableMap::CREATED_AT, OrderProductTaxTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'ORDER_PRODUCT_ID', 'TITLE', 'DESCRIPTION', 'AMOUNT', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'order_product_id', 'title', 'description', 'amount', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
/**
@@ -121,12 +131,12 @@ class FeatureCategoryTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'FeatureId' => 1, 'CategoryId' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'featureId' => 1, 'categoryId' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
- self::TYPE_COLNAME => array(FeatureCategoryTableMap::ID => 0, FeatureCategoryTableMap::FEATURE_ID => 1, FeatureCategoryTableMap::CATEGORY_ID => 2, FeatureCategoryTableMap::CREATED_AT => 3, FeatureCategoryTableMap::UPDATED_AT => 4, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'FEATURE_ID' => 1, 'CATEGORY_ID' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'feature_id' => 1, 'category_id' => 2, 'created_at' => 3, 'updated_at' => 4, ),
- self::TYPE_NUM => array(0, 1, 2, 3, 4, )
+ self::TYPE_PHPNAME => array('Id' => 0, 'OrderProductId' => 1, 'Title' => 2, 'Description' => 3, 'Amount' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'orderProductId' => 1, 'title' => 2, 'description' => 3, 'amount' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
+ self::TYPE_COLNAME => array(OrderProductTaxTableMap::ID => 0, OrderProductTaxTableMap::ORDER_PRODUCT_ID => 1, OrderProductTaxTableMap::TITLE => 2, OrderProductTaxTableMap::DESCRIPTION => 3, OrderProductTaxTableMap::AMOUNT => 4, OrderProductTaxTableMap::CREATED_AT => 5, OrderProductTaxTableMap::UPDATED_AT => 6, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'ORDER_PRODUCT_ID' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'AMOUNT' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'order_product_id' => 1, 'title' => 2, 'description' => 3, 'amount' => 4, 'created_at' => 5, 'updated_at' => 6, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
/**
@@ -139,16 +149,17 @@ class FeatureCategoryTableMap extends TableMap
public function initialize()
{
// attributes
- $this->setName('feature_category');
- $this->setPhpName('FeatureCategory');
- $this->setClassName('\\Thelia\\Model\\FeatureCategory');
+ $this->setName('order_product_tax');
+ $this->setPhpName('OrderProductTax');
+ $this->setClassName('\\Thelia\\Model\\OrderProductTax');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
- $this->setIsCrossRef(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
- $this->addForeignKey('FEATURE_ID', 'FeatureId', 'INTEGER', 'feature', 'ID', true, null, null);
- $this->addForeignKey('CATEGORY_ID', 'CategoryId', 'INTEGER', 'category', 'ID', true, null, null);
+ $this->addForeignKey('ORDER_PRODUCT_ID', 'OrderProductId', 'INTEGER', 'order_product', 'ID', true, null, null);
+ $this->addColumn('TITLE', 'Title', 'VARCHAR', true, 255, null);
+ $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
+ $this->addColumn('AMOUNT', 'Amount', 'FLOAT', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -158,8 +169,7 @@ class FeatureCategoryTableMap extends TableMap
*/
public function buildRelations()
{
- $this->addRelation('Category', '\\Thelia\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), 'CASCADE', 'RESTRICT');
- $this->addRelation('Feature', '\\Thelia\\Model\\Feature', RelationMap::MANY_TO_ONE, array('feature_id' => 'id', ), 'CASCADE', 'RESTRICT');
+ $this->addRelation('OrderProduct', '\\Thelia\\Model\\OrderProduct', RelationMap::MANY_TO_ONE, array('order_product_id' => 'id', ), 'CASCADE', 'RESTRICT');
} // buildRelations()
/**
@@ -231,7 +241,7 @@ class FeatureCategoryTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
- return $withPrefix ? FeatureCategoryTableMap::CLASS_DEFAULT : FeatureCategoryTableMap::OM_CLASS;
+ return $withPrefix ? OrderProductTaxTableMap::CLASS_DEFAULT : OrderProductTaxTableMap::OM_CLASS;
}
/**
@@ -245,21 +255,21 @@ class FeatureCategoryTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
- * @return array (FeatureCategory object, last column rank)
+ * @return array (OrderProductTax object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
- $key = FeatureCategoryTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
- if (null !== ($obj = FeatureCategoryTableMap::getInstanceFromPool($key))) {
+ $key = OrderProductTaxTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = OrderProductTaxTableMap::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 + FeatureCategoryTableMap::NUM_HYDRATE_COLUMNS;
+ $col = $offset + OrderProductTaxTableMap::NUM_HYDRATE_COLUMNS;
} else {
- $cls = FeatureCategoryTableMap::OM_CLASS;
+ $cls = OrderProductTaxTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
- FeatureCategoryTableMap::addInstanceToPool($obj, $key);
+ OrderProductTaxTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -282,8 +292,8 @@ class FeatureCategoryTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
- $key = FeatureCategoryTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
- if (null !== ($obj = FeatureCategoryTableMap::getInstanceFromPool($key))) {
+ $key = OrderProductTaxTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = OrderProductTaxTableMap::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
@@ -292,7 +302,7 @@ class FeatureCategoryTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
- FeatureCategoryTableMap::addInstanceToPool($obj, $key);
+ OrderProductTaxTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -313,15 +323,19 @@ class FeatureCategoryTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
- $criteria->addSelectColumn(FeatureCategoryTableMap::ID);
- $criteria->addSelectColumn(FeatureCategoryTableMap::FEATURE_ID);
- $criteria->addSelectColumn(FeatureCategoryTableMap::CATEGORY_ID);
- $criteria->addSelectColumn(FeatureCategoryTableMap::CREATED_AT);
- $criteria->addSelectColumn(FeatureCategoryTableMap::UPDATED_AT);
+ $criteria->addSelectColumn(OrderProductTaxTableMap::ID);
+ $criteria->addSelectColumn(OrderProductTaxTableMap::ORDER_PRODUCT_ID);
+ $criteria->addSelectColumn(OrderProductTaxTableMap::TITLE);
+ $criteria->addSelectColumn(OrderProductTaxTableMap::DESCRIPTION);
+ $criteria->addSelectColumn(OrderProductTaxTableMap::AMOUNT);
+ $criteria->addSelectColumn(OrderProductTaxTableMap::CREATED_AT);
+ $criteria->addSelectColumn(OrderProductTaxTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
- $criteria->addSelectColumn($alias . '.FEATURE_ID');
- $criteria->addSelectColumn($alias . '.CATEGORY_ID');
+ $criteria->addSelectColumn($alias . '.ORDER_PRODUCT_ID');
+ $criteria->addSelectColumn($alias . '.TITLE');
+ $criteria->addSelectColumn($alias . '.DESCRIPTION');
+ $criteria->addSelectColumn($alias . '.AMOUNT');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
@@ -336,7 +350,7 @@ class FeatureCategoryTableMap extends TableMap
*/
public static function getTableMap()
{
- return Propel::getServiceContainer()->getDatabaseMap(FeatureCategoryTableMap::DATABASE_NAME)->getTable(FeatureCategoryTableMap::TABLE_NAME);
+ return Propel::getServiceContainer()->getDatabaseMap(OrderProductTaxTableMap::DATABASE_NAME)->getTable(OrderProductTaxTableMap::TABLE_NAME);
}
/**
@@ -344,16 +358,16 @@ class FeatureCategoryTableMap extends TableMap
*/
public static function buildTableMap()
{
- $dbMap = Propel::getServiceContainer()->getDatabaseMap(FeatureCategoryTableMap::DATABASE_NAME);
- if (!$dbMap->hasTable(FeatureCategoryTableMap::TABLE_NAME)) {
- $dbMap->addTableObject(new FeatureCategoryTableMap());
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(OrderProductTaxTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(OrderProductTaxTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new OrderProductTaxTableMap());
}
}
/**
- * Performs a DELETE on the database, given a FeatureCategory or Criteria object OR a primary key value.
+ * Performs a DELETE on the database, given a OrderProductTax or Criteria object OR a primary key value.
*
- * @param mixed $values Criteria or FeatureCategory object or primary key or array of primary keys
+ * @param mixed $values Criteria or OrderProductTax 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
@@ -364,25 +378,25 @@ class FeatureCategoryTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderProductTaxTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
- } elseif ($values instanceof \Thelia\Model\FeatureCategory) { // it's a model object
+ } elseif ($values instanceof \Thelia\Model\OrderProductTax) { // 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(FeatureCategoryTableMap::DATABASE_NAME);
- $criteria->add(FeatureCategoryTableMap::ID, (array) $values, Criteria::IN);
+ $criteria = new Criteria(OrderProductTaxTableMap::DATABASE_NAME);
+ $criteria->add(OrderProductTaxTableMap::ID, (array) $values, Criteria::IN);
}
- $query = FeatureCategoryQuery::create()->mergeWith($criteria);
+ $query = OrderProductTaxQuery::create()->mergeWith($criteria);
- if ($values instanceof Criteria) { FeatureCategoryTableMap::clearInstancePool();
+ if ($values instanceof Criteria) { OrderProductTaxTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
- foreach ((array) $values as $singleval) { FeatureCategoryTableMap::removeInstanceFromPool($singleval);
+ foreach ((array) $values as $singleval) { OrderProductTaxTableMap::removeInstanceFromPool($singleval);
}
}
@@ -390,20 +404,20 @@ class FeatureCategoryTableMap extends TableMap
}
/**
- * Deletes all rows from the feature_category table.
+ * Deletes all rows from the order_product_tax 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 FeatureCategoryQuery::create()->doDeleteAll($con);
+ return OrderProductTaxQuery::create()->doDeleteAll($con);
}
/**
- * Performs an INSERT on the database, given a FeatureCategory or Criteria object.
+ * Performs an INSERT on the database, given a OrderProductTax or Criteria object.
*
- * @param mixed $criteria Criteria or FeatureCategory object containing data that is used to create the INSERT statement.
+ * @param mixed $criteria Criteria or OrderProductTax 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
@@ -412,22 +426,22 @@ class FeatureCategoryTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
- $con = Propel::getServiceContainer()->getWriteConnection(FeatureCategoryTableMap::DATABASE_NAME);
+ $con = Propel::getServiceContainer()->getWriteConnection(OrderProductTaxTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
- $criteria = $criteria->buildCriteria(); // build Criteria from FeatureCategory object
+ $criteria = $criteria->buildCriteria(); // build Criteria from OrderProductTax object
}
- if ($criteria->containsKey(FeatureCategoryTableMap::ID) && $criteria->keyContainsValue(FeatureCategoryTableMap::ID) ) {
- throw new PropelException('Cannot insert a value for auto-increment primary key ('.FeatureCategoryTableMap::ID.')');
+ if ($criteria->containsKey(OrderProductTaxTableMap::ID) && $criteria->keyContainsValue(OrderProductTaxTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.OrderProductTaxTableMap::ID.')');
}
// Set the correct dbName
- $query = FeatureCategoryQuery::create()->mergeWith($criteria);
+ $query = OrderProductTaxQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -443,7 +457,7 @@ class FeatureCategoryTableMap extends TableMap
return $pk;
}
-} // FeatureCategoryTableMap
+} // OrderProductTaxTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
-FeatureCategoryTableMap::buildTableMap();
+OrderProductTaxTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/OrderStatusTableMap.php b/core/lib/Thelia/Model/Map/OrderStatusTableMap.php
index bc283a3e8..f29ed9464 100644
--- a/core/lib/Thelia/Model/Map/OrderStatusTableMap.php
+++ b/core/lib/Thelia/Model/Map/OrderStatusTableMap.php
@@ -150,7 +150,7 @@ class OrderStatusTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
- $this->addColumn('CODE', 'Code', 'VARCHAR', false, 45, null);
+ $this->addColumn('CODE', 'Code', 'VARCHAR', true, 45, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
diff --git a/core/lib/Thelia/Model/Map/OrderTableMap.php b/core/lib/Thelia/Model/Map/OrderTableMap.php
index ae43bd768..7daabb665 100644
--- a/core/lib/Thelia/Model/Map/OrderTableMap.php
+++ b/core/lib/Thelia/Model/Map/OrderTableMap.php
@@ -215,7 +215,7 @@ class OrderTableMap extends TableMap
$this->addForeignKey('CUSTOMER_ID', 'CustomerId', 'INTEGER', 'customer', 'ID', true, null, null);
$this->addForeignKey('INVOICE_ORDER_ADDRESS_ID', 'InvoiceOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null);
$this->addForeignKey('DELIVERY_ORDER_ADDRESS_ID', 'DeliveryOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null);
- $this->addColumn('INVOICE_DATE', 'InvoiceDate', 'DATE', true, null, null);
+ $this->addColumn('INVOICE_DATE', 'InvoiceDate', 'DATE', false, null, null);
$this->addForeignKey('CURRENCY_ID', 'CurrencyId', 'INTEGER', 'currency', 'ID', true, null, null);
$this->addColumn('CURRENCY_RATE', 'CurrencyRate', 'FLOAT', true, null, null);
$this->addColumn('TRANSACTION_REF', 'TransactionRef', 'VARCHAR', false, 100, null);
diff --git a/core/lib/Thelia/Model/Map/ProductTableMap.php b/core/lib/Thelia/Model/Map/ProductTableMap.php
index 17c4585f0..59ac236ac 100644
--- a/core/lib/Thelia/Model/Map/ProductTableMap.php
+++ b/core/lib/Thelia/Model/Map/ProductTableMap.php
@@ -189,7 +189,7 @@ class ProductTableMap extends TableMap
$this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null);
$this->addColumn('VISIBLE', 'Visible', 'TINYINT', true, null, 0);
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
- $this->addForeignKey('TEMPLATE_ID', 'TemplateId', 'INTEGER', 'template', 'ID', true, null, null);
+ $this->addForeignKey('TEMPLATE_ID', 'TemplateId', 'INTEGER', 'template', 'ID', false, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('VERSION', 'Version', 'INTEGER', false, null, 0);
diff --git a/core/lib/Thelia/Model/Map/ProductVersionTableMap.php b/core/lib/Thelia/Model/Map/ProductVersionTableMap.php
index 4e84b4db8..14d38a764 100644
--- a/core/lib/Thelia/Model/Map/ProductVersionTableMap.php
+++ b/core/lib/Thelia/Model/Map/ProductVersionTableMap.php
@@ -180,7 +180,7 @@ class ProductVersionTableMap extends TableMap
$this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null);
$this->addColumn('VISIBLE', 'Visible', 'TINYINT', true, null, 0);
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
- $this->addColumn('TEMPLATE_ID', 'TemplateId', 'INTEGER', true, null, null);
+ $this->addColumn('TEMPLATE_ID', 'TemplateId', 'INTEGER', false, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
$this->addPrimaryKey('VERSION', 'Version', 'INTEGER', true, null, 0);
diff --git a/core/lib/Thelia/Model/Map/TaxI18nTableMap.php b/core/lib/Thelia/Model/Map/TaxI18nTableMap.php
index a06230c37..c50a30c90 100644
--- a/core/lib/Thelia/Model/Map/TaxI18nTableMap.php
+++ b/core/lib/Thelia/Model/Map/TaxI18nTableMap.php
@@ -143,7 +143,7 @@ class TaxI18nTableMap extends TableMap
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
- $this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null);
+ $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
} // initialize()
/**
diff --git a/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php b/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php
index 012ad2e72..24f8a41d7 100644
--- a/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php
+++ b/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php
@@ -143,7 +143,7 @@ class TaxRuleI18nTableMap extends TableMap
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax_rule', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
- $this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null);
+ $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
} // initialize()
/**
diff --git a/core/lib/Thelia/Model/Map/TaxRuleTableMap.php b/core/lib/Thelia/Model/Map/TaxRuleTableMap.php
index 391e23b6d..ccc41e013 100644
--- a/core/lib/Thelia/Model/Map/TaxRuleTableMap.php
+++ b/core/lib/Thelia/Model/Map/TaxRuleTableMap.php
@@ -57,7 +57,7 @@ class TaxRuleTableMap extends TableMap
/**
* The total number of columns
*/
- const NUM_COLUMNS = 3;
+ const NUM_COLUMNS = 4;
/**
* The number of lazy-loaded columns
@@ -67,13 +67,18 @@ class TaxRuleTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
- const NUM_HYDRATE_COLUMNS = 3;
+ const NUM_HYDRATE_COLUMNS = 4;
/**
* the column name for the ID field
*/
const ID = 'tax_rule.ID';
+ /**
+ * the column name for the IS_DEFAULT field
+ */
+ const IS_DEFAULT = 'tax_rule.IS_DEFAULT';
+
/**
* the column name for the CREATED_AT field
*/
@@ -105,12 +110,12 @@ class TaxRuleTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- self::TYPE_PHPNAME => array('Id', 'CreatedAt', 'UpdatedAt', ),
- self::TYPE_STUDLYPHPNAME => array('id', 'createdAt', 'updatedAt', ),
- self::TYPE_COLNAME => array(TaxRuleTableMap::ID, TaxRuleTableMap::CREATED_AT, TaxRuleTableMap::UPDATED_AT, ),
- self::TYPE_RAW_COLNAME => array('ID', 'CREATED_AT', 'UPDATED_AT', ),
- self::TYPE_FIELDNAME => array('id', 'created_at', 'updated_at', ),
- self::TYPE_NUM => array(0, 1, 2, )
+ self::TYPE_PHPNAME => array('Id', 'IsDefault', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'isDefault', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(TaxRuleTableMap::ID, TaxRuleTableMap::IS_DEFAULT, TaxRuleTableMap::CREATED_AT, TaxRuleTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'IS_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'is_default', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
);
/**
@@ -120,12 +125,12 @@ class TaxRuleTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- self::TYPE_PHPNAME => array('Id' => 0, 'CreatedAt' => 1, 'UpdatedAt' => 2, ),
- self::TYPE_STUDLYPHPNAME => array('id' => 0, 'createdAt' => 1, 'updatedAt' => 2, ),
- self::TYPE_COLNAME => array(TaxRuleTableMap::ID => 0, TaxRuleTableMap::CREATED_AT => 1, TaxRuleTableMap::UPDATED_AT => 2, ),
- self::TYPE_RAW_COLNAME => array('ID' => 0, 'CREATED_AT' => 1, 'UPDATED_AT' => 2, ),
- self::TYPE_FIELDNAME => array('id' => 0, 'created_at' => 1, 'updated_at' => 2, ),
- self::TYPE_NUM => array(0, 1, 2, )
+ self::TYPE_PHPNAME => array('Id' => 0, 'IsDefault' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'isDefault' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
+ self::TYPE_COLNAME => array(TaxRuleTableMap::ID => 0, TaxRuleTableMap::IS_DEFAULT => 1, TaxRuleTableMap::CREATED_AT => 2, TaxRuleTableMap::UPDATED_AT => 3, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'IS_DEFAULT' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'is_default' => 1, 'created_at' => 2, 'updated_at' => 3, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, )
);
/**
@@ -145,6 +150,7 @@ class TaxRuleTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addColumn('IS_DEFAULT', 'IsDefault', 'BOOLEAN', true, 1, false);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -323,10 +329,12 @@ class TaxRuleTableMap extends TableMap
{
if (null === $alias) {
$criteria->addSelectColumn(TaxRuleTableMap::ID);
+ $criteria->addSelectColumn(TaxRuleTableMap::IS_DEFAULT);
$criteria->addSelectColumn(TaxRuleTableMap::CREATED_AT);
$criteria->addSelectColumn(TaxRuleTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.IS_DEFAULT');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
diff --git a/core/lib/Thelia/Model/ModuleImage.php b/core/lib/Thelia/Model/ModuleImage.php
new file mode 100644
index 000000000..7ea5415bc
--- /dev/null
+++ b/core/lib/Thelia/Model/ModuleImage.php
@@ -0,0 +1,10 @@
+dispatchEvent(TheliaEvents::ORDER_BEFORE_CREATE, new OrderEvent($this));
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::ORDER_AFTER_CREATE, new OrderEvent($this));
+ }
/**
* calculate the total amount
*
- * @TODO create body method
+ * @param int $tax
*
- * @return int
+ * @return int|string|Base\double
*/
- public function getTotalAmount()
+ public function getTotalAmount(&$tax = 0)
{
- return 2;
+ $amount = 0;
+ $tax = 0;
+
+ /* browse all products */
+ $orderProductIds = array();
+ foreach($this->getOrderProducts() as $orderProduct) {
+ $taxAmount = OrderProductTaxQuery::create()
+ ->withColumn('SUM(' . OrderProductTaxTableMap::AMOUNT . ')', 'total_tax')
+ ->filterByOrderProductId($orderProduct->getId(), Criteria::EQUAL)
+ ->findOne();
+ $amount += ($orderProduct->getWasInPromo() == 1 ? $orderProduct->getPromoPrice() : $orderProduct->getPrice()) * $orderProduct->getQuantity();
+ $tax += round($taxAmount->getVirtualColumn('total_tax'), 2) * $orderProduct->getQuantity();
+ }
+
+ return $amount + $tax + $this->getPostage(); // @todo : manage discount
+ }
+
+ /**
+ * PROPEL SHOULD FIX IT
+ *
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+ $this->modifiedColumns[] = OrderTableMap::ID;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . OrderTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(OrderTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(OrderTableMap::REF)) {
+ $modifiedColumns[':p' . $index++] = 'REF';
+ }
+ if ($this->isColumnModified(OrderTableMap::CUSTOMER_ID)) {
+ $modifiedColumns[':p' . $index++] = 'CUSTOMER_ID';
+ }
+ if ($this->isColumnModified(OrderTableMap::INVOICE_ORDER_ADDRESS_ID)) {
+ $modifiedColumns[':p' . $index++] = 'INVOICE_ORDER_ADDRESS_ID';
+ }
+ if ($this->isColumnModified(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID)) {
+ $modifiedColumns[':p' . $index++] = 'DELIVERY_ORDER_ADDRESS_ID';
+ }
+ if ($this->isColumnModified(OrderTableMap::INVOICE_DATE)) {
+ $modifiedColumns[':p' . $index++] = 'INVOICE_DATE';
+ }
+ if ($this->isColumnModified(OrderTableMap::CURRENCY_ID)) {
+ $modifiedColumns[':p' . $index++] = 'CURRENCY_ID';
+ }
+ if ($this->isColumnModified(OrderTableMap::CURRENCY_RATE)) {
+ $modifiedColumns[':p' . $index++] = 'CURRENCY_RATE';
+ }
+ if ($this->isColumnModified(OrderTableMap::TRANSACTION_REF)) {
+ $modifiedColumns[':p' . $index++] = 'TRANSACTION_REF';
+ }
+ if ($this->isColumnModified(OrderTableMap::DELIVERY_REF)) {
+ $modifiedColumns[':p' . $index++] = 'DELIVERY_REF';
+ }
+ if ($this->isColumnModified(OrderTableMap::INVOICE_REF)) {
+ $modifiedColumns[':p' . $index++] = 'INVOICE_REF';
+ }
+ if ($this->isColumnModified(OrderTableMap::POSTAGE)) {
+ $modifiedColumns[':p' . $index++] = 'POSTAGE';
+ }
+ if ($this->isColumnModified(OrderTableMap::PAYMENT_MODULE_ID)) {
+ $modifiedColumns[':p' . $index++] = 'PAYMENT_MODULE_ID';
+ }
+ if ($this->isColumnModified(OrderTableMap::DELIVERY_MODULE_ID)) {
+ $modifiedColumns[':p' . $index++] = 'DELIVERY_MODULE_ID';
+ }
+ if ($this->isColumnModified(OrderTableMap::STATUS_ID)) {
+ $modifiedColumns[':p' . $index++] = 'STATUS_ID';
+ }
+ if ($this->isColumnModified(OrderTableMap::LANG_ID)) {
+ $modifiedColumns[':p' . $index++] = 'LANG_ID';
+ }
+ if ($this->isColumnModified(OrderTableMap::CREATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'CREATED_AT';
+ }
+ if ($this->isColumnModified(OrderTableMap::UPDATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'UPDATED_AT';
+ }
+
+ $db = Propel::getServiceContainer()->getAdapter(OrderTableMap::DATABASE_NAME);
+
+ if ($db->useQuoteIdentifier()) {
+ $tableName = $db->quoteIdentifierTable(OrderTableMap::TABLE_NAME);
+ } else {
+ $tableName = OrderTableMap::TABLE_NAME;
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO %s (%s) VALUES (%s)',
+ $tableName,
+ 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 'REF':
+ $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR);
+ break;
+ case 'CUSTOMER_ID':
+ $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT);
+ break;
+ case 'INVOICE_ORDER_ADDRESS_ID':
+ $stmt->bindValue($identifier, $this->invoice_order_address_id, PDO::PARAM_INT);
+ break;
+ case 'DELIVERY_ORDER_ADDRESS_ID':
+ $stmt->bindValue($identifier, $this->delivery_order_address_id, PDO::PARAM_INT);
+ break;
+ case 'INVOICE_DATE':
+ $stmt->bindValue($identifier, $this->invoice_date ? $this->invoice_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
+ break;
+ case 'CURRENCY_ID':
+ $stmt->bindValue($identifier, $this->currency_id, PDO::PARAM_INT);
+ break;
+ case 'CURRENCY_RATE':
+ $stmt->bindValue($identifier, $this->currency_rate, PDO::PARAM_STR);
+ break;
+ case 'TRANSACTION_REF':
+ $stmt->bindValue($identifier, $this->transaction_ref, PDO::PARAM_STR);
+ break;
+ case 'DELIVERY_REF':
+ $stmt->bindValue($identifier, $this->delivery_ref, PDO::PARAM_STR);
+ break;
+ case 'INVOICE_REF':
+ $stmt->bindValue($identifier, $this->invoice_ref, PDO::PARAM_STR);
+ break;
+ case 'POSTAGE':
+ $stmt->bindValue($identifier, $this->postage, PDO::PARAM_STR);
+ break;
+ case 'PAYMENT_MODULE_ID':
+ $stmt->bindValue($identifier, $this->payment_module_id, PDO::PARAM_INT);
+ break;
+ case 'DELIVERY_MODULE_ID':
+ $stmt->bindValue($identifier, $this->delivery_module_id, PDO::PARAM_INT);
+ break;
+ case 'STATUS_ID':
+ $stmt->bindValue($identifier, $this->status_id, PDO::PARAM_INT);
+ break;
+ case 'LANG_ID':
+ $stmt->bindValue($identifier, $this->lang_id, 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);
}
}
diff --git a/core/lib/Thelia/Model/OrderProduct.php b/core/lib/Thelia/Model/OrderProduct.php
old mode 100755
new mode 100644
index 2c0e189aa..235eaf259
--- a/core/lib/Thelia/Model/OrderProduct.php
+++ b/core/lib/Thelia/Model/OrderProduct.php
@@ -2,8 +2,30 @@
namespace Thelia\Model;
+use Propel\Runtime\Connection\ConnectionInterface;
+use Thelia\Core\Event\OrderEvent;
+use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Base\OrderProduct as BaseOrderProduct;
-class OrderProduct extends BaseOrderProduct {
+class OrderProduct extends BaseOrderProduct
+{
+ use \Thelia\Model\Tools\ModelEventDispatcherTrait;
+ /**
+ * {@inheritDoc}
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::ORDER_PRODUCT_BEFORE_CREATE, new OrderEvent($this->getOrder()));
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::ORDER_PRODUCT_AFTER_CREATE, new OrderEvent($this->getOrder()));
+ }
}
diff --git a/core/lib/Thelia/Model/OrderProductAttributeCombination.php b/core/lib/Thelia/Model/OrderProductAttributeCombination.php
new file mode 100644
index 000000000..1f9cee13d
--- /dev/null
+++ b/core/lib/Thelia/Model/OrderProductAttributeCombination.php
@@ -0,0 +1,10 @@
+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 Order();
+ $obj->hydrate($row);
+ OrderTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+ return $obj;
+ }
} // OrderQuery
diff --git a/core/lib/Thelia/Model/OrderStatus.php b/core/lib/Thelia/Model/OrderStatus.php
index 2927019d0..f78e9c79d 100755
--- a/core/lib/Thelia/Model/OrderStatus.php
+++ b/core/lib/Thelia/Model/OrderStatus.php
@@ -4,6 +4,11 @@ namespace Thelia\Model;
use Thelia\Model\Base\OrderStatus as BaseOrderStatus;
-class OrderStatus extends BaseOrderStatus {
-
+class OrderStatus extends BaseOrderStatus
+{
+ const CODE_NOT_PAID = "not_paid";
+ const CODE_PAID = "paid";
+ const CODE_PROCESSED = "processed";
+ const CODE_SENT = "sent";
+ const CODE_CANCELED = "canceled";
}
diff --git a/core/lib/Thelia/Model/Product.php b/core/lib/Thelia/Model/Product.php
index 541668ddb..cbb6c0051 100755
--- a/core/lib/Thelia/Model/Product.php
+++ b/core/lib/Thelia/Model/Product.php
@@ -10,6 +10,8 @@ use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\ProductEvent;
use Propel\Runtime\ActiveQuery\Criteria;
+use Propel\Runtime\Propel;
+use Thelia\Model\Map\ProductTableMap;
class Product extends BaseProduct
{
@@ -22,7 +24,7 @@ class Product extends BaseProduct
/**
* {@inheritDoc}
*/
- protected function getRewritenUrlViewName() {
+ protected function getRewrittenUrlViewName() {
return 'product';
}
@@ -41,11 +43,12 @@ class Product extends BaseProduct
public function getTaxedPrice(Country $country)
{
$taxCalculator = new Calculator();
- return round($taxCalculator->load($this, $country)->getTaxedPrice($this->getRealLowestPrice()), 2);
+
+ return $taxCalculator->load($this, $country)->getTaxedPrice($this->getRealLowestPrice());
}
/**
- * @return the current default category for this product
+ * @return the current default category ID for this product
*/
public function getDefaultCategoryId()
{
@@ -84,6 +87,72 @@ class Product extends BaseProduct
return $this;
}
+ /**
+ * Create a new product, along with the default category ID
+ *
+ * @param int $defaultCategoryId the default category ID of this product
+ */
+ public function create($defaultCategoryId) {
+
+ $con = Propel::getWriteConnection(ProductTableMap::DATABASE_NAME);
+
+ $con->beginTransaction();
+
+ $this->dispatchEvent(TheliaEvents::BEFORE_CREATEPRODUCT, new ProductEvent($this));
+
+ try {
+ // Create the product
+ $this->save($con);
+
+ // Add the default category
+ $pc = new ProductCategory();
+
+ $pc
+ ->setProduct($this)
+ ->setCategoryId($defaultCategoryId)
+ ->setDefaultCategory(true)
+ ->save($con)
+ ;
+
+ // Set the position
+ $this->setPosition($this->getNextPosition())->save($con);
+
+ // Create an empty product sale element
+ $sale_elements = new ProductSaleElements();
+
+ $sale_elements
+ ->setProduct($this)
+ ->setRef($this->getRef())
+ ->setPromo(0)
+ ->setNewness(0)
+ ->setWeight(0)
+ ->save($con)
+ ;
+
+ // Create an empty product price in the default currency
+ $product_price = new ProductPrice();
+
+ $product_price
+ ->setProductSaleElements($sale_elements)
+ ->setPromoPrice(0)
+ ->setPrice(0)
+ ->setCurrency(CurrencyQuery::create()->findOneByByDefault(true))
+ ->save($con)
+ ;
+
+ // Store all the stuff !
+ $con->commit();
+
+ $this->dispatchEvent(TheliaEvents::AFTER_CREATEPRODUCT, new ProductEvent($this));
+ }
+ catch(\Exception $ex) {
+
+ $con->rollback();
+
+ throw $ex;
+ }
+ }
+
/**
* Calculate next position relative to our default category
*/
@@ -100,31 +169,7 @@ class Product extends BaseProduct
if ($produits != null) $query->filterById($produits, Criteria::IN);
}
- /**
- * {@inheritDoc}
- */
- public function preInsert(ConnectionInterface $con = null)
- {
- $this->setPosition($this->getNextPosition());
- $this->generateRewritenUrl($this->getLocale());
-
- $this->dispatchEvent(TheliaEvents::BEFORE_CREATEPRODUCT, new ProductEvent($this));
-
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public function postInsert(ConnectionInterface $con = null)
- {
- $this->dispatchEvent(TheliaEvents::AFTER_CREATEPRODUCT, new ProductEvent($this));
- }
-
- /**
- * {@inheritDoc}
- */
public function preUpdate(ConnectionInterface $con = null)
{
$this->dispatchEvent(TheliaEvents::BEFORE_UPDATEPRODUCT, new ProductEvent($this));
@@ -155,7 +200,12 @@ class Product extends BaseProduct
*/
public function postDelete(ConnectionInterface $con = null)
{
+ RewritingUrlQuery::create()
+ ->filterByView($this->getRewrittenUrlViewName())
+ ->filterByViewId($this->getId())
+ ->update(array(
+ "View" => ConfigQuery::getPassedUrlView()
+ ));
$this->dispatchEvent(TheliaEvents::AFTER_DELETEPRODUCT, new ProductEvent($this));
}
-
}
diff --git a/core/lib/Thelia/Model/ProductAssociatedContent.php b/core/lib/Thelia/Model/ProductAssociatedContent.php
index 9b007baf1..e07ee2cd6 100644
--- a/core/lib/Thelia/Model/ProductAssociatedContent.php
+++ b/core/lib/Thelia/Model/ProductAssociatedContent.php
@@ -3,7 +3,65 @@
namespace Thelia\Model;
use Thelia\Model\Base\ProductAssociatedContent as BaseProductAssociatedContent;
+use Propel\Runtime\Connection\ConnectionInterface;
+use Thelia\Core\Event\ProductAssociatedContentEvent;
+use Thelia\Core\Event\TheliaEvents;
class ProductAssociatedContent extends BaseProductAssociatedContent {
+ use \Thelia\Model\Tools\ModelEventDispatcherTrait;
+
+ /**
+ * {@inheritDoc}
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::BEFORE_CREATEPRODUCT_ASSOCIATED_CONTENT, new ProductAssociatedContentEvent($this));
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::AFTER_CREATEPRODUCT_ASSOCIATED_CONTENT, new ProductAssociatedContentEvent($this));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::BEFORE_UPDATEPRODUCT_ASSOCIATED_CONTENT, new ProductAssociatedContentEvent($this));
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::AFTER_UPDATEPRODUCT_ASSOCIATED_CONTENT, new ProductAssociatedContentEvent($this));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::BEFORE_DELETEPRODUCT_ASSOCIATED_CONTENT, new ProductAssociatedContentEvent($this));
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+ $this->dispatchEvent(TheliaEvents::AFTER_DELETEPRODUCT_ASSOCIATED_CONTENT, new ProductAssociatedContentEvent($this));
+ }
}
diff --git a/core/lib/Thelia/Model/ProductI18n.php b/core/lib/Thelia/Model/ProductI18n.php
index 7507bceb1..6ec3ac4a3 100755
--- a/core/lib/Thelia/Model/ProductI18n.php
+++ b/core/lib/Thelia/Model/ProductI18n.php
@@ -2,8 +2,14 @@
namespace Thelia\Model;
+use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Model\Base\ProductI18n as BaseProductI18n;
class ProductI18n extends BaseProductI18n {
+ public function postInsert(ConnectionInterface $con = null)
+ {
+ $product = $this->getProduct();
+ $product->generateRewrittenUrl($this->getLocale());
+ }
}
diff --git a/core/lib/Thelia/Model/Rewriting.php b/core/lib/Thelia/Model/Rewriting.php
deleted file mode 100644
index 8d6f75fab..000000000
--- a/core/lib/Thelia/Model/Rewriting.php
+++ /dev/null
@@ -1,9 +0,0 @@
-getRedirected()) {
+ //check if rewriting url alredy exists and put redirect to the new one
+ RewritingUrlQuery::create()
+ ->filterByView($this->getView())
+ ->filterByViewId($this->getViewId())
+ ->filterByViewLocale($this->getViewLocale())
+ ->filterByRedirected($this->getId(), Criteria::NOT_IN)
+ ->update(array(
+ "Redirected" => $this->getId()
+ ));
+ }
+ }
}
diff --git a/core/lib/Thelia/Model/TaxRule.php b/core/lib/Thelia/Model/TaxRule.php
index 36f80a044..024fd8923 100755
--- a/core/lib/Thelia/Model/TaxRule.php
+++ b/core/lib/Thelia/Model/TaxRule.php
@@ -3,7 +3,25 @@
namespace Thelia\Model;
use Thelia\Model\Base\TaxRule as BaseTaxRule;
+use Thelia\TaxEngine\Calculator;
+use Thelia\TaxEngine\OrderProductTaxCollection;
-class TaxRule extends BaseTaxRule {
+class TaxRule extends BaseTaxRule
+{
+ /**
+ * @param Country $country
+ * @param $untaxedAmount
+ * @param null $askedLocale
+ *
+ * @return OrderProductTaxCollection
+ */
+ public function getTaxDetail(Country $country, $untaxedAmount, $askedLocale = null)
+ {
+ $taxCalculator = new Calculator();
+ $taxCollection = new OrderProductTaxCollection();
+ $taxCalculator->loadTaxRule($this, $country)->getTaxedPrice($untaxedAmount, $taxCollection, $askedLocale);
+
+ return $taxCollection;
+ }
}
diff --git a/core/lib/Thelia/Model/TaxRuleQuery.php b/core/lib/Thelia/Model/TaxRuleQuery.php
index d5ce47546..572500003 100755
--- a/core/lib/Thelia/Model/TaxRuleQuery.php
+++ b/core/lib/Thelia/Model/TaxRuleQuery.php
@@ -21,13 +21,19 @@ class TaxRuleQuery extends BaseTaxRuleQuery
{
const ALIAS_FOR_TAX_RULE_COUNTRY_POSITION = 'taxRuleCountryPosition';
- public function getTaxCalculatorCollection(Product $product, Country $country)
+ /**
+ * @param TaxRule $taxRule
+ * @param Country $country
+ *
+ * @return array|mixed|\Propel\Runtime\Collection\ObjectCollection
+ */
+ public function getTaxCalculatorCollection(TaxRule $taxRule, Country $country)
{
$search = TaxQuery::create()
->filterByTaxRuleCountry(
TaxRuleCountryQuery::create()
->filterByCountry($country, Criteria::EQUAL)
- ->filterByTaxRuleId($product->getTaxRuleId())
+ ->filterByTaxRuleId($taxRule->getId())
->orderByPosition()
->find()
)
diff --git a/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php b/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php
index 6ab24fbc4..0a8af40c8 100644
--- a/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php
+++ b/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php
@@ -23,6 +23,11 @@
namespace Thelia\Model\Tools;
+use Thelia\Core\Event\GenerateRewrittenUrlEvent;
+use Thelia\Core\Event\TheliaEvents;
+use Thelia\Exception\UrlRewritingException;
+use Thelia\Model\RewritingUrlQuery;
+use Thelia\Model\RewritingUrl;
use Thelia\Tools\URL;
/**
* A trait for managing Rewriten URLs from model classes
@@ -32,16 +37,19 @@ trait UrlRewritingTrait {
/**
* @returns string the view name of the rewriten object (e.g., 'category', 'product')
*/
- protected abstract function getRewritenUrlViewName();
+ protected abstract function getRewrittenUrlViewName();
/**
* Get the object URL for the given locale, rewriten if rewriting is enabled.
*
* @param string $locale a valid locale (e.g. en_US)
*/
- public function getUrl($locale)
+ public function getUrl($locale = null)
{
- return URL::getInstance()->retrieve($this->getRewritenUrlViewName(), $this->getId(), $locale)->toString();
+ if(null === $locale) {
+ $locale = $this->getLocale();
+ }
+ return URL::getInstance()->retrieve($this->getRewrittenUrlViewName(), $this->getId(), $locale)->toString();
}
/**
@@ -49,27 +57,93 @@ trait UrlRewritingTrait {
*
* @param string $locale a valid locale (e.g. en_US)
*/
- public function generateRewritenUrl($locale)
+ public function generateRewrittenUrl($locale)
{
- URL::getInstance()->generateRewritenUrl($this->getRewritenUrlViewName(), $this->getId(), $locale, $this->getTitle());
+ if ($this->isNew()) {
+ throw new \RuntimeException(sprintf('Object %s must be saved before generating url', $this->getRewrittenUrlViewName()));
+ }
+ // Borrowed from http://stackoverflow.com/questions/2668854/sanitizing-strings-to-make-them-url-and-filename-safe
+
+ $this->setLocale($locale);
+
+ $generateEvent = new GenerateRewrittenUrlEvent($this, $locale);
+
+ $this->dispatchEvent(TheliaEvents::GENERATE_REWRITTENURL, $generateEvent);
+
+
+ if($generateEvent->isRewritten())
+ {
+ return $generateEvent->getUrl();
+ }
+
+ $title = $this->getTitle();
+
+ if(null == $title) {
+ throw new \RuntimeException('Impossible to create an url if title is null');
+ }
+ // Replace all weird characters with dashes
+ $string = preg_replace('/[^\w\-~_\.]+/u', '-', $title);
+
+ // Only allow one dash separator at a time (and make string lowercase)
+ $cleanString = mb_strtolower(preg_replace('/--+/u', '-', $string), 'UTF-8');
+
+ $urlFilePart = rtrim($cleanString, '.-~_') . ".html";
+
+ // TODO :
+ // check if URL url already exists, and add a numeric suffix, or the like
+ try{
+ $i=0;
+ while(URL::getInstance()->resolve($urlFilePart)) {
+ $i++;
+ $urlFilePart = sprintf("%s-%d.html",$cleanString, $i);
+ }
+ } catch (UrlRewritingException $e) {
+ $rewritingUrl = new RewritingUrl();
+ $rewritingUrl->setUrl($urlFilePart)
+ ->setView($this->getRewrittenUrlViewName())
+ ->setViewId($this->getId())
+ ->setViewLocale($locale)
+ ->save()
+ ;
+ }
+
+ return $urlFilePart;
+
}
/**
* return the rewriten URL for the given locale
*
* @param string $locale a valid locale (e.g. en_US)
+ * @return null
*/
- public function getRewritenUrl($locale)
+ public function getRewrittenUrl($locale)
{
- return "fake url - TODO";
+ $rewritingUrl = RewritingUrlQuery::create()
+ ->filterByViewLocale($locale)
+ ->filterByView($this->getRewrittenUrlViewName())
+ ->filterByViewId($this->getId())
+ ->filterByRedirected(null)
+ ->findOne()
+ ;
+
+ if($rewritingUrl) {
+ $url = $rewritingUrl->getUrl();
+ } else {
+ $url = null;
+ }
+
+ return $url;
}
/**
* Set the rewriten URL for the given locale
*
* @param string $locale a valid locale (e.g. en_US)
+ * @param $url the wanted url
+ * @return $this
*/
- public function setRewritenUrl($locale, $url)
+ public function setRewrittenUrl($locale, $url)
{
// TODO - code me !
diff --git a/core/lib/Thelia/Module/BaseModule.php b/core/lib/Thelia/Module/BaseModule.php
index a13403482..8efc76e6e 100755
--- a/core/lib/Thelia/Module/BaseModule.php
+++ b/core/lib/Thelia/Module/BaseModule.php
@@ -25,6 +25,14 @@
namespace Thelia\Module;
use Symfony\Component\DependencyInjection\ContainerAware;
+use Thelia\Model\ModuleI18nQuery;
+use Thelia\Model\Map\ModuleImageTableMap;
+use Thelia\Model\ModuleI18n;
+use Thelia\Tools\Image;
+use Thelia\Exception\ModuleException;
+use Thelia\Model\Module;
+use Thelia\Model\ModuleImage;
+use Thelia\Model\ModuleQuery;
abstract class BaseModule extends ContainerAware
{
@@ -32,14 +40,28 @@ abstract class BaseModule extends ContainerAware
const DELIVERY_MODULE_TYPE = 2;
const PAYMENT_MODULE_TYPE = 3;
+ const IS_ACTIVATED = 1;
+ const IS_NOT_ACTIVATED = 0;
+
public function __construct()
{
}
- protected function activate()
+ public function activate()
{
-
+ $moduleModel = $this->getModuleModel();
+ if($moduleModel->getActivate() == self::IS_NOT_ACTIVATED) {
+ $moduleModel->setActivate(self::IS_ACTIVATED);
+ $moduleModel->save();
+ try {
+ $this->afterActivation();
+ } catch(\Exception $e) {
+ $moduleModel->setActivate(self::IS_NOT_ACTIVATED);
+ $moduleModel->save();
+ throw $e;
+ }
+ }
}
public function hasContainer()
@@ -56,7 +78,109 @@ abstract class BaseModule extends ContainerAware
return $this->container;
}
+ public function setTitle(Module $module, $titles)
+ {
+ if(is_array($titles)) {
+ foreach($titles as $locale => $title) {
+ $moduleI18n = ModuleI18nQuery::create()->filterById($module->getId())->filterByLocale($locale)->findOne();
+ if(null === $moduleI18n) {
+ $moduleI18n = new ModuleI18n();
+ $moduleI18n
+ ->setId($module->getId())
+ ->setLocale($locale)
+ ->setTitle($title)
+ ;
+ $moduleI18n->save();
+ } else {
+ $moduleI18n->setTitle($title);
+ $moduleI18n->save();
+ }
+ }
+ }
+ }
+
+ public function deployImageFolder(Module $module, $folderPath)
+ {
+ try {
+ $directoryBrowser = new \DirectoryIterator($folderPath);
+ } catch(\UnexpectedValueException $e) {
+ throw $e;
+ }
+
+ $con = \Propel\Runtime\Propel::getConnection(
+ ModuleImageTableMap::DATABASE_NAME
+ );
+
+ /* browse the directory */
+ $imagePosition = 1;
+ foreach($directoryBrowser as $directoryContent) {
+ /* is it a file ? */
+ if ($directoryContent->isFile()) {
+
+ $fileName = $directoryContent->getFilename();
+ $filePath = $directoryContent->getPathName();
+
+ /* is it a picture ? */
+ if( Image::isImage($filePath) ) {
+
+ $con->beginTransaction();
+
+ $image = new ModuleImage();
+ $image->setModuleId($module->getId());
+ $image->setPosition($imagePosition);
+ $image->save($con);
+
+ $imageDirectory = sprintf("%s/../../../../local/media/images/module", __DIR__);
+ $imageFileName = sprintf("%s-%d-%s", $module->getCode(), $image->getId(), $fileName);
+
+ $increment = 0;
+ while(file_exists($imageDirectory . '/' . $imageFileName)) {
+ $imageFileName = sprintf("%s-%d-%d-%s", $module->getCode(), $image->getId(), $increment, $fileName);
+ $increment++;
+ }
+
+ $imagePath = sprintf('%s/%s', $imageDirectory, $imageFileName);
+
+ if (! is_dir($imageDirectory)) {
+ if(! @mkdir($imageDirectory, 0777, true)) {
+ $con->rollBack();
+ throw new ModuleException(sprintf("Cannot create directory : %s", $imageDirectory), ModuleException::CODE_NOT_FOUND);
+ }
+ }
+
+ if(! @copy($filePath, $imagePath)) {
+ $con->rollBack();
+ throw new ModuleException(sprintf("Cannot copy file : %s to : %s", $filePath, $imagePath), ModuleException::CODE_NOT_FOUND);
+ }
+
+ $image->setFile($imageFileName);
+ $image->save($con);
+
+ $con->commit();
+ $imagePosition++;
+ }
+ }
+ }
+ }
+
+ /**
+ * @return Module
+ * @throws \Thelia\Exception\ModuleException
+ */
+ public function getModuleModel()
+ {
+ $moduleModel = ModuleQuery::create()->findOneByCode($this->getCode());
+
+ if(null === $moduleModel) {
+ throw new ModuleException(sprintf("Module Code `%s` not found", $this->getCode()), ModuleException::CODE_NOT_FOUND);
+ }
+
+ return $moduleModel;
+ }
+
+ abstract public function getCode();
abstract public function install();
+ abstract public function afterActivation();
abstract public function destroy();
}
diff --git a/core/lib/Thelia/Module/DeliveryModuleInterface.php b/core/lib/Thelia/Module/DeliveryModuleInterface.php
index 72f8769bc..17b000d4f 100644
--- a/core/lib/Thelia/Module/DeliveryModuleInterface.php
+++ b/core/lib/Thelia/Module/DeliveryModuleInterface.php
@@ -34,5 +34,5 @@ interface DeliveryModuleInterface extends BaseModuleInterface
*
* @return mixed
*/
- public function calculate(Country $country);
+ public function getPostage(Country $country);
}
diff --git a/core/lib/Thelia/Module/PaymentModuleInterface.php b/core/lib/Thelia/Module/PaymentModuleInterface.php
new file mode 100644
index 000000000..d864ae50a
--- /dev/null
+++ b/core/lib/Thelia/Module/PaymentModuleInterface.php
@@ -0,0 +1,34 @@
+. */
+/* */
+/*************************************************************************************/
+
+namespace Thelia\Module;
+
+use Thelia\Model\Country;
+
+interface PaymentModuleInterface extends BaseModuleInterface
+{
+ /**
+ * @return mixed
+ */
+ public function pay();
+}
diff --git a/core/lib/Thelia/TaxEngine/Calculator.php b/core/lib/Thelia/TaxEngine/Calculator.php
index b5a2f995e..8039dec39 100755
--- a/core/lib/Thelia/TaxEngine/Calculator.php
+++ b/core/lib/Thelia/TaxEngine/Calculator.php
@@ -24,8 +24,11 @@ namespace Thelia\TaxEngine;
use Thelia\Exception\TaxEngineException;
use Thelia\Model\Country;
+use Thelia\Model\OrderProductTax;
use Thelia\Model\Product;
+use Thelia\Model\TaxRule;
use Thelia\Model\TaxRuleQuery;
+use Thelia\Tools\I18n;
/**
* Class Calculator
@@ -68,14 +71,34 @@ class Calculator
$this->product = $product;
$this->country = $country;
- $this->taxRulesCollection = $this->taxRuleQuery->getTaxCalculatorCollection($product, $country);
+ $this->taxRulesCollection = $this->taxRuleQuery->getTaxCalculatorCollection($product->getTaxRule(), $country);
return $this;
}
- public function getTaxAmountFromUntaxedPrice($untaxedPrice)
+ public function loadTaxRule(TaxRule $taxRule, Country $country)
{
- return $this->getTaxedPrice($untaxedPrice) - $untaxedPrice;
+ $this->product = null;
+ $this->country = null;
+ $this->taxRulesCollection = null;
+
+ if($taxRule->getId() === null) {
+ throw new TaxEngineException('TaxRule id is empty in Calculator::loadTaxRule', TaxEngineException::UNDEFINED_TAX_RULE);
+ }
+ if($country->getId() === null) {
+ throw new TaxEngineException('Country id is empty in Calculator::loadTaxRule', TaxEngineException::UNDEFINED_COUNTRY);
+ }
+
+ $this->country = $country;
+
+ $this->taxRulesCollection = $this->taxRuleQuery->getTaxCalculatorCollection($taxRule, $country);
+
+ return $this;
+ }
+
+ public function getTaxAmountFromUntaxedPrice($untaxedPrice, &$taxCollection = null)
+ {
+ return $this->getTaxedPrice($untaxedPrice, $taxCollection) - $untaxedPrice;
}
public function getTaxAmountFromTaxedPrice($taxedPrice)
@@ -83,7 +106,15 @@ class Calculator
return $taxedPrice - $this->getUntaxedPrice($taxedPrice);
}
- public function getTaxedPrice($untaxedPrice)
+ /**
+ * @param $untaxedPrice
+ * @param null $taxCollection returns OrderProductTaxCollection
+ * @param null $askedLocale
+ *
+ * @return int
+ * @throws \Thelia\Exception\TaxEngineException
+ */
+ public function getTaxedPrice($untaxedPrice, &$taxCollection = null, $askedLocale = null)
{
if(null === $this->taxRulesCollection) {
throw new TaxEngineException('Tax rules collection is empty in Calculator::getTaxAmount', TaxEngineException::UNDEFINED_TAX_RULES_COLLECTION);
@@ -97,6 +128,9 @@ class Calculator
$currentPosition = 1;
$currentTax = 0;
+ if(null !== $taxCollection) {
+ $taxCollection = new OrderProductTaxCollection();
+ }
foreach($this->taxRulesCollection as $taxRule) {
$position = (int)$taxRule->getTaxRuleCountryPosition();
@@ -109,7 +143,17 @@ class Calculator
$currentPosition = $position;
}
- $currentTax += $taxType->calculate($taxedPrice);
+ $taxAmount = round($taxType->calculate($taxedPrice), 2);
+ $currentTax += $taxAmount;
+
+ if(null !== $taxCollection) {
+ $taxI18n = I18n::forceI18nRetrieving($askedLocale, 'Tax', $taxRule->getId());
+ $orderProductTax = new OrderProductTax();
+ $orderProductTax->setTitle($taxI18n->getTitle());
+ $orderProductTax->setDescription($taxI18n->getDescription());
+ $orderProductTax->setAmount($taxAmount);
+ $taxCollection->addTax($orderProductTax);
+ }
}
$taxedPrice += $currentTax;
diff --git a/core/lib/Thelia/TaxEngine/OrderProductTaxCollection.php b/core/lib/Thelia/TaxEngine/OrderProductTaxCollection.php
new file mode 100755
index 000000000..5c4ac2022
--- /dev/null
+++ b/core/lib/Thelia/TaxEngine/OrderProductTaxCollection.php
@@ -0,0 +1,126 @@
+. */
+/* */
+/*************************************************************************************/
+namespace Thelia\TaxEngine;
+
+use Thelia\Model\OrderProductTax;
+
+/**
+ *
+ * @author Etienne Roudeix
+ * Return the current element
+ * @link http://php.net/manual/en/iterator.current.php
+ * @return OrderProductTax
+ */
+ public function current()
+ {
+ return $this->taxes[$this->position];
+ }
+
+ /**
+ * (PHP 5 >= 5.0.0)
+ * Move forward to next element
+ * @link http://php.net/manual/en/iterator.next.php
+ * @return void Any returned value is ignored.
+ */
+ public function next()
+ {
+ $this->position++;
+ }
+
+ /**
+ * (PHP 5 >= 5.0.0)
+ * Return the key of the current element
+ * @link http://php.net/manual/en/iterator.key.php
+ * @return mixed scalar on success, or null on failure.
+ */
+ public function key()
+ {
+ return $this->position;
+ }
+
+ /**
+ * (PHP 5 >= 5.0.0)
+ * Checks if current position is valid
+ * @link http://php.net/manual/en/iterator.valid.php
+ * @return boolean The return value will be casted to boolean and then evaluated.
+ * Returns true on success or false on failure.
+ */
+ public function valid()
+ {
+ return isset($this->taxes[$this->position]);
+ }
+
+ /**
+ * (PHP 5 >= 5.0.0)
+ * Rewind the Iterator to the first element
+ * @link http://php.net/manual/en/iterator.rewind.php
+ * @return void Any returned value is ignored.
+ */
+ public function rewind()
+ {
+ $this->position = 0;
+ }
+
+ public function getKey($key)
+ {
+ return isset($this->taxes[$key]) ? $this->taxes[$key] : null;
+ }
+}
diff --git a/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php b/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php
new file mode 100755
index 000000000..1d6d08e92
--- /dev/null
+++ b/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php
@@ -0,0 +1,106 @@
+. */
+/* */
+/*************************************************************************************/
+namespace Thelia\Tests\Command;
+
+use Symfony\Component\Console\Tester\CommandTester;
+use Thelia\Command\ModuleActivateCommand;
+use Thelia\Core\Application;
+use Thelia\Model\ModuleQuery;
+use Thelia\Module\BaseModule;
+
+/**
+ * Class ModuleActivateCommandTest
+ *
+ * @package Thelia\Tests\Command
+ * @author Etienne Roudeix
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
');var f=false,q=false,u,o;var w=p[0];if(w.show){var t=w.data;if(this.numberRows){u=this.numberRows;if(!this.numberColumns){o=Math.ceil(t.length/u)}else{o=this.numberColumns}}else{if(this.numberColumns){o=this.numberColumns;u=Math.ceil(t.length/this.numberColumns)}else{u=t.length;o=1}}var n,m,r,g,e,l,k,h;var v=0;for(n=0;n').prependTo(this._elem)}else{r=c('
-
+
{intl l='ID'}
@@ -72,7 +73,7 @@
{/elseloop}
+
');var w=false,n=true,c,l;var p=o[0];var d=new b.jqplot.ColorGenerator(p.seriesColors);if(p.show){var x=p.data;if(this.numberRows){c=this.numberRows;if(!this.numberColumns){l=Math.ceil(x.length/c)}else{l=this.numberColumns}}else{if(this.numberColumns){l=this.numberColumns;c=Math.ceil(x.length/this.numberColumns)}else{c=x.length;l=1}}var v,u,e,h,g,k,m,t;var q=0;for(v=0;v
+
{intl l='ID'}
@@ -72,6 +73,7 @@
{/elseloop}
' + this.options.header + '
' : '';
+ var searchbox = this.options.liveSearch ? '' : '';
+ var drop =
+ "').appendTo(this._elem)}for(u=0;u ');g=b('');if(this.escapeHtml){g.text(k)}else{g.html(k)}if(n){g.prependTo(e);h.prependTo(e)}else{h.appendTo(e);g.appendTo(e)}w=true}q++}}e=null;h=null;g=null}}return this._elem};b.jqplot.MekkoLegendRenderer.prototype.pack=function(f){if(this.show){var e={_top:f.top,_left:f.left,_right:f.right,_bottom:this._plotDimensions.height-f.bottom};if(this.placement=="insideGrid"){switch(this.location){case"nw":var d=e._left+this.xoffset;var c=e._top+this.yoffset;this._elem.css("left",d);this._elem.css("top",c);break;case"n":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=e._top+this.yoffset;this._elem.css("left",d);this._elem.css("top",c);break;case"ne":var d=f.right+this.xoffset;var c=e._top+this.yoffset;this._elem.css({right:d,top:c});break;case"e":var d=f.right+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({right:d,top:c});break;case"se":var d=f.right+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({right:d,bottom:c});break;case"s":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"sw":var d=e._left+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"w":var d=e._left+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({left:d,top:c});break;default:var d=e._right-this.xoffset;var c=e._bottom+this.yoffset;this._elem.css({right:d,bottom:c});break}}else{switch(this.location){case"nw":var d=this._plotDimensions.width-e._left+this.xoffset;var c=e._top+this.yoffset;this._elem.css("right",d);this._elem.css("top",c);break;case"n":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=this._plotDimensions.height-e._top+this.yoffset;this._elem.css("left",d);this._elem.css("bottom",c);break;case"ne":var d=this._plotDimensions.width-f.right+this.xoffset;var c=e._top+this.yoffset;this._elem.css({left:d,top:c});break;case"e":var d=this._plotDimensions.width-f.right+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({left:d,top:c});break;case"se":var d=this._plotDimensions.width-f.right+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"s":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=this._plotDimensions.height-f.bottom+this.yoffset;this._elem.css({left:d,top:c});break;case"sw":var d=this._plotDimensions.width-e._left+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({right:d,bottom:c});break;case"w":var d=this._plotDimensions.width-e._left+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({right:d,top:c});break;default:var d=e._right-this.xoffset;var c=e._bottom+this.yoffset;this._elem.css({right:d,bottom:c});break}}}};function a(g,f,d){d=d||{};d.axesDefaults=d.axesDefaults||{};d.legend=d.legend||{};d.seriesDefaults=d.seriesDefaults||{};var c=false;if(d.seriesDefaults.renderer==b.jqplot.MekkoRenderer){c=true}else{if(d.series){for(var e=0;e ').appendTo(this._elem)}for(m=0;m ');e=c('');if(this.escapeHtml){e.text(l)}else{e.html(l)}if(q){e.prependTo(r);g.prependTo(r)}else{g.appendTo(r);e.appendTo(r)}f=true}v++}}}}return this._elem};function a(j,h,f){f=f||{};f.axesDefaults=f.axesDefaults||{};f.legend=f.legend||{};f.seriesDefaults=f.seriesDefaults||{};f.grid=f.grid||{};var e=false;if(f.seriesDefaults.renderer==c.jqplot.MeterGaugeRenderer){e=true}else{if(f.series){for(var g=0;g
'}}}})(jQuery);
\ No newline at end of file
diff --git a/templates/admin/default/assets/js/jqplot/plugins/jqplot.pieRenderer.min.js b/templates/admin/default/assets/js/jqplot/plugins/jqplot.pieRenderer.min.js
new file mode 100644
index 000000000..a09f8f107
--- /dev/null
+++ b/templates/admin/default/assets/js/jqplot/plugins/jqplot.pieRenderer.min.js
@@ -0,0 +1,3 @@
+/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
+ jsDate | (c) 2010-2013 Chris Leonello
+ */(function(e){e.jqplot.PieRenderer=function(){e.jqplot.LineRenderer.call(this)};e.jqplot.PieRenderer.prototype=new e.jqplot.LineRenderer();e.jqplot.PieRenderer.prototype.constructor=e.jqplot.PieRenderer;e.jqplot.PieRenderer.prototype.init=function(q,u){this.diameter=null;this.padding=20;this.sliceMargin=0;this.fill=true;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=5;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.dataLabels="percent";this.showDataLabels=false;this.dataLabelFormatString=null;this.dataLabelThreshold=3;this.dataLabelPositionFactor=0.52;this.dataLabelNudge=2;this.dataLabelCenterOn=true;this.startAngle=0;this.tickRenderer=e.jqplot.PieTickRenderer;this._drawData=true;this._type="pie";if(q.highlightMouseDown&&q.highlightMouseOver==null){q.highlightMouseOver=false}e.extend(true,this,q);if(this.sliceMargin<0){this.sliceMargin=0}this._diameter=null;this._radius=null;this._sliceAngles=[];this._highlightedPoint=null;if(this.highlightColors.length==0){for(var s=0;sdate: %s open: %s hi: %s low: %s close: %s
+
+
+
+
+ {admin_sortable_header
+ current_order=$attributeav_order
+ order='id'
+ reverse_order='id_reverse'
+ request_parameter_name='attributeav_order'
+ path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id}
+ label="{intl l='ID'}"
+ }
+
-
-
-
+ {elseloop rel="list"}
+
-
+
-
- {admin_sortable_header
- current_order=$attributeav_order
- order='id'
- reverse_order='id_reverse'
- request_parameter_name='attributeav_order'
- path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id}
- label="{intl l='ID'}"
- }
-
+
+ {admin_sortable_header
+ current_order=$attributeav_order
+ order='alpha'
+ reverse_order='alpha_reverse'
+ request_parameter_name='attributeav_order'
+ path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id}
+ label="{intl l='Value'}"
+ }
+
-
- {admin_sortable_header
- current_order=$attributeav_order
- order='alpha'
- reverse_order='alpha_reverse'
- request_parameter_name='attributeav_order'
- path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id}
- label="{intl l='Value'}"
- }
-
+
+ {admin_sortable_header
+ current_order=$attributeav_order
+ order='manual'
+ reverse_order='manual_reverse'
+ request_parameter_name='attributeav_order'
+ path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id}
+ label="{intl l="Position"}"
+ }
+
-
- {admin_sortable_header
- current_order=$attributeav_order
- order='manual'
- reverse_order='manual_reverse'
- request_parameter_name='attributeav_order'
- path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id}
- label="{intl l="Position"}"
- }
-
+ {module_include location='attributes_value_table_header'}
- {module_include location='attributes_value_table_header'}
+ {intl l="Actions"}
+ {intl l="Actions"}
-
-
+
+ {loop name="list" type="attribute_availability" attribute=$attribute_id backend_context="1" lang=$edit_language_id order=$attributeav_order}
+
+
- {loop name="list" type="attribute_availability" attribute=$attribute_id backend_context="1" lang=$edit_language_id order=$attributeav_order}
- {$ID}
-
-
+ {/loop}
- {$ID}
+
+ {* FIXME : integrate this in the encolsing form to provide standard form processing *}
+
+
-
- {* FIXME : integrate this in the encolsing form to provide standard form processing *}
-
-
+
+ {admin_position_block
+ permission="admin.attributes.edit"
+ path={url path='/admin/configuration/attributes-av/update-position' attribute_id=$attribute_id}
+ url_parameter="attributeav_id"
+ in_place_edit_class="positionChange"
+ position="$POSITION"
+ id="$ID"
+ }
+
-
- {admin_position_block
- permission="admin.attributes.edit"
- path={url path='/admin/configuration/attributes-av/update-position' attribute_id=$attribute_id}
- url_parameter="attributeav_id"
- in_place_edit_class="positionChange"
- position="$POSITION"
- id="$ID"
- }
-
+ {module_include location='attributes_value_table_row'}
- {module_include location='attributes_value_table_row'}
+
+
+
-
-
- {/loop}
-
- {elseloop rel="list"}
-
-
- {/elseloop}
-
-
-
-
+
+ {/elseloop}
+
+
+
+
+
+
-
-
+ {elseloop rel="can_create"}
+ {intl l="This category has no sub-categories."}
+ {/elseloop}
+
+
+
+
+ {/elseloop}
+
+
-
+
+ {loop name="category_list" type="category" visible="*" parent=$category_id order=$category_order backend_context="1" lang=$lang_id}
+
+ {admin_sortable_header
+ current_order=$category_order
+ order='id'
+ reverse_order='id_reverse'
+ path={url path='/admin/categories' id_category=$category_id}
+ request_parameter_name='category_order'
+ label="{intl l='ID'}"
+ }
+
- {ifloop rel="category_list"}
-
-
-
+
-
- {admin_sortable_header
- current_order=$category_order
- order='id'
- reverse_order='id_reverse'
- path={url path='/admin/categories' id_category=$category_id}
- request_parameter_name='category_order'
- label="{intl l='ID'}"
- }
-
+
-
+
+ {admin_sortable_header
+ current_order=$category_order
+ order='alpha'
+ reverse_order='alpha_reverse'
+ path={url path='/admin/categories' id_category=$category_id}
+ request_parameter_name='category_order'
+ label="{intl l='Category title'}"
+ }
+
-
- {admin_sortable_header
- current_order=$category_order
- order='alpha'
- reverse_order='alpha_reverse'
- path={url path='/admin/categories' id_category=$category_id}
- request_parameter_name='category_order'
- label="{intl l='Category title'}"
- }
-
+ {module_include location='category_list_header'}
- {module_include location='category_list_header'}
+
+ {admin_sortable_header
+ current_order=$category_order
+ order='visible'
+ reverse_order='visible_reverse'
+ path={url path='/admin/categories' id_category=$category_id}
+ request_parameter_name='category_order'
+ label="{intl l='Online'}"
+ }
+
-
- {admin_sortable_header
- current_order=$category_order
- order='visible'
- reverse_order='visible_reverse'
- path={url path='/admin/categories' id_category=$category_id}
- request_parameter_name='category_order'
- label="{intl l='Online'}"
- }
-
+
+ {admin_sortable_header
+ current_order=$category_order
+ order='manual'
+ reverse_order='manual_reverse'
+ path={url path='/admin/categories' id_category=$category_id}
+ request_parameter_name='category_order'
+ label="{intl l='Position'}"
+ }
+
-
- {admin_sortable_header
- current_order=$category_order
- order='manual'
- reverse_order='manual_reverse'
- path={url path='/admin/categories' id_category=$category_id}
- request_parameter_name='category_order'
- label="{intl l='Position'}"
- }
-
+ {intl l='Actions'}
+ {intl l='Actions'}
-
+
- {loop name="category_list" type="category" visible="*" parent=$category_id order=$category_order backend_context="1" lang=$lang_id}
- {$ID}
-
-
+ {/loop}
+
+ {/ifloop}
- {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.categories.delete"}
-
- {/loop}
-
-
-
- {/loop}
-
- {/ifloop}
+ {elseloop rel="category_list"}
+
+ {$ID}
+
+ {loop type="image" name="cat_image" source="category" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
+
-
+ {/loop}
+
- {loop type="image" name="cat_image" source="category" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
-
+
- {/loop}
-
+
+ {$TITLE}
+
+
-
-
- {$TITLE}
-
-
+ {module_include location='category_list_row'}
- {module_include location='category_list_row'}
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.categories.edit"}
+
- {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.categories.edit"}
-
- {elseloop rel="can_change"}
-
+ {admin_position_block
+ permission="admin.categories.edit"
+ path={url path='admin/categories/update-position' category_id=$ID}
+ url_parameter="category_id"
+ in_place_edit_class="categoryPositionChange"
+ position=$POSITION
+ id=$ID
+ }
+
-
- {admin_position_block
- permission="admin.categories.edit"
- path={url path='admin/categories/update-position' category_id=$ID}
- url_parameter="category_id"
- in_place_edit_class="categoryPositionChange"
- position=$POSITION
- id=$ID
- }
-
+
+
-
+
+
+
-
-
-
-
+ {elseloop rel="product_list"}
+
+
-
+
+ {loop name="product_list" type="product" visible="*" category_default=$category_id order=$product_order}
+
+ {admin_sortable_header
+ current_order=$product_order
+ order='id'
+ reverse_order='id_reverse'
+ path={url path='/admin/categories' id_category=$category_id target='products'}
+ label="{intl l='ID'}"
+ }
- {ifloop rel="product_list"}
-
-
-
+
-
- {admin_sortable_header
- current_order=$product_order
- order='id'
- reverse_order='id_reverse'
- path={url path='/admin/categories' id_category=$category_id target='products'}
- label="{intl l='ID'}"
- }
+
-
+
+ {admin_sortable_header
+ current_order=$product_order
+ order='ref'
+ reverse_order='ref_reverse'
+ path={url path='/admin/categories' id_category=$category_id target='products'}
+ label="{intl l='Reference'}"
+ }
+
-
- {admin_sortable_header
- current_order=$product_order
- order='ref'
- reverse_order='ref_reverse'
- path={url path='/admin/categories' id_category=$category_id target='products'}
- label="{intl l='Reference'}"
- }
-
+
+ {admin_sortable_header
+ current_order=$product_order
+ order='alpha'
+ reverse_order='alpha_reverse'
+ path={url path='/admin/categories' id_category=$category_id target='products'}
+ label="{intl l='Product title'}"
+ }
-
- {admin_sortable_header
- current_order=$product_order
- order='alpha'
- reverse_order='alpha_reverse'
- path={url path='/admin/categories' id_category=$category_id target='products'}
- label="{intl l='Product title'}"
- }
+ {module_include location='product_list_header'}
- {module_include location='product_list_header'}
+
+ {admin_sortable_header
+ current_order=$product_order
+ order='visible'
+ reverse_order='visible_reverse'
+ path={url path='/admin/categories' id_category=$category_id target='products'}
+ label="{intl l='Online'}"
+ }
+
-
- {admin_sortable_header
- current_order=$product_order
- order='visible'
- reverse_order='visible_reverse'
- path={url path='/admin/categories' id_category=$category_id target='products'}
- label="{intl l='Online'}"
- }
-
+
+ {admin_sortable_header
+ current_order=$product_order
+ order='manual'
+ reverse_order='manual_reverse'
+ path={url path='/admin/categories' id_category=$category_id target='products'}
+ label="{intl l='Position'}"
+ }
+
-
- {admin_sortable_header
- current_order=$product_order
- order='manual'
- reverse_order='manual_reverse'
- path={url path='/admin/categories' id_category=$category_id target='products'}
- label="{intl l='Position'}"
- }
-
+
+
-
+
- {loop name="product_list" type="product" visible="*" category_default=$category_id order=$product_order}
- {$ID}
-
-
+ {/loop}
+
+ {/ifloop}
- {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.product.delete"}
-
- {/loop}
-
-
-
- {/loop}
-
- {/ifloop}
-
- {elseloop rel="product_list"}
-
- {$ID}
+
+ {loop type="image" name="cat_image" source="product" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
+
+
+
+ {/loop}
-
- {loop type="image" name="cat_image" source="product" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
-
-
-
- {/loop}
+
{$REF}
- {$REF}
+ {$TITLE}
- {$TITLE}
+ {module_include location='product_list_row'}
- {module_include location='product_list_row'}
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.products.edit"}
+
- {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.products.edit"}
-
- {elseloop rel="can_delete"}
-
+ {admin_position_block
+ permission="admin.product.edit"
+ path={url path='/admin/products/update-position' product_id=$ID}
+ url_parameter="product_id"
+ in_place_edit_class="productPositionChange"
+ position=$POSITION
+ id=$ID
+ }
+
-
- {admin_position_block
- permission="admin.product.edit"
- path={url path='admin/product' category_id=$ID}
- url_parameter="product_id"
- in_place_edit_class="productPositionChange"
- position=$POSITION
- id=$ID
- }
-
+
+
-
-
-
- {/elseloop}
-
+
+
+
+ {/elseloop}
+
-
+
-
-
+
- {intl l='ID'}
+
+
+
+ {elseloop rel="assigned_contents"}
+
+
-
+ {intl l='ID'}
- {intl l='Attribute title'}
+ {intl l='Content title'}
- {module_include location='category_contents_table_header'}
+ {module_include location='category_contents_table_header'}
- {intl l="Actions"}
- {intl l="Actions"}
+
+
-
- {loop name="assigned_contents" type="associated_content" category="$category_id" backend_context="1" lang="$edit_language_id"}
-
-
+ {loop name="assigned_contents" type="associated_content" category="$category_id" backend_context="1" lang="$edit_language_id"}
+ {$ID}
+
+
- {/loop}
+ {$ID}
-
- {$TITLE}
-
+
+ {$TITLE}
+
- {module_include location='category_contents_table_row'}
+ {module_include location='category_contents_table_row'}
-
-
-
+
+
+ {/loop}
- {elseloop rel="assigned_contents"}
-
-
- {/elseloop}
-
-
-
-
+
+ {/elseloop}
+
+
+
+
+
+
+
+ {$TITLE}
+
+
+ {module_include location='folder_list_caption'}
+
+ {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.folders.create"}
+
+
+
+ {/loop}
+
+
+
+
+
+ {loop name="folder_list" type="folder" visible="*" parent=$folder_id order=$folder_order backend_context="1" lang=$lang_id}
+
+ {admin_sortable_header
+ current_order=$folder_order
+ order='id'
+ reverse_order='id_reverse'
+ path={url path='/admin/folders' folder_id=$folder_id}
+ request_parameter_name='folder_order'
+ label="{intl l='ID'}"
+ }
+
+
+
+
+
+ {admin_sortable_header
+ current_order=$folder_order
+ order='alpha'
+ reverse_order='alpha_reverse'
+ path={url path='/admin/folders' folder_id=$folder_id}
+ request_parameter_name='folder_order'
+ label="{intl l='Folder title'}"
+ }
+
+
+ {module_include location='folder_list_header'}
+
+
+ {admin_sortable_header
+ current_order=$folder_order
+ order='visible'
+ reverse_order='visible_reverse'
+ path={url path='/admin/folders' folder_id=$folder_id}
+ request_parameter_name='folder_order'
+ label="{intl l='Online'}"
+ }
+
+
+
+ {admin_sortable_header
+ current_order=$folder_order
+ order='manual'
+ reverse_order='manual_reverse'
+ path={url path='/admin/folders' folder_id=$folder_id}
+ request_parameter_name='folder_order'
+ label="{intl l='Position'}"
+ }
+
+
+ {intl l='Actions'}
+
+
+ {/loop}
+
+ {/ifloop}
+
+ {elseloop rel="folder_list"}
+
+ {$ID}
+
+
+ {loop type="image" name="folder_image" source="folder" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
+
+
+
+ {/loop}
+
+
+ {$TITLE}
+
+
+
+ {module_include location='folder_list_row'}
+
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.folders.edit"}
+
+
+
+ {admin_position_block
+ permission="admin.folders.edit"
+ path={url path='admin/folders/update-position' folder_id=$ID}
+ url_parameter="folder_id"
+ in_place_edit_class="folderPositionChange"
+ position=$POSITION
+ id=$ID
+ }
+
+
+
+
+
+
+
+
+
+ {/elseloop}
+
+
+
+
+
+
+
+ {loop name="content_list" type="content" visible="*" folder_default=$folder_id order=$content_order}
+
+ {admin_sortable_header
+ current_order=$content_order
+ order='id'
+ reverse_order='id_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id target='contents'}
+ label="{intl l='ID'}"
+ }
+
+
+
+
+ {admin_sortable_header
+ current_order=$content_order
+ order='alpha'
+ reverse_order='alpha_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id target='contents'}
+ label="{intl l='Content title'}"
+ }
+
+ {module_include location='content_list_header'}
+
+
+ {admin_sortable_header
+ current_order=$content_order
+ order='visible'
+ reverse_order='visible_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id target='contents'}
+ label="{intl l='Online'}"
+ }
+
+
+
+ {admin_sortable_header
+ current_order=$content_order
+ order='manual'
+ reverse_order='manual_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id target='contents'}
+ label="{intl l='Position'}"
+ }
+
+
+
+
+
+ {/loop}
+
+ {/ifloop}
+
+ {elseloop rel="content_list"}
+
+ {$ID}
+
+
+ {loop type="image" name="folder_image" source="content" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
+
+
+
+ {/loop}
+
+
{$TITLE}
+
+ {module_include location='content_list_row'}
+
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.contents.edit"}
+
+
+
+ {admin_position_block
+ permission="admin.content.edit"
+ path={url path='/admin/contents/update-position' content_id=$ID}
+ url_parameter="content_id"
+ in_place_edit_class="contentPositionChange"
+ position=$POSITION
+ id=$ID
+ }
+
+
+
+
+
+
+
+
+
+ {/elseloop}
+
+
+
+
+
+
+
+
+
+ {intl l="Customers"}
+ 1
+
+
+ {intl l="Categories"}
+ 8
+
+
+ {intl l="Products"}
+ 43
+
+
+ {intl l="Online products"}
+ 43
+
+
+ {intl l="Offline products"}
+ 0
+
+
+ {intl l="Orders"}
+ 1
+
+
+ {intl l="Pending orders"}
+ 1
+
+
+ {intl l="In process orderst"}
+ 0
+
+
+ {intl l="Shipped orders"}
+ 0
+
+
+
+ {intl l="Canceled orders"}
+ 0
+
+
+
+
+
+ {intl l="Overall sales"}
+ 2500.00 €
+
+
+ {intl l="Sales excluding shipping"}
+ 2000.00 €
+
+
+ {intl l="Yesterday sales"}
+ 1700.00 €
+
+
+ {intl l="Waiting orders"}
+ 4
+
+
+ {intl l="In process orders"}
+ 52
+
+
+ {intl l="Canceled orders"}
+ 3
+
+
+
+ {intl l="Average cart"}
+ 25.00 €
+
+
+
+
+
+ {intl l="Overall sales"}
+ 2500.00 €
+
+
+ {intl l="Sales excluding shipping"}
+ 2000.00 €
+
+
+ {intl l="Previous month sales"}
+ 1700.00 €
+
+
+ {intl l="Waiting orders"}
+ 4
+
+
+ {intl l="In process orders"}
+ 52
+
+
+ {intl l="Canceled orders"}
+ 3
+
+
+
+ {intl l="Average cart"}
+ 25.00 €
+
+
+
+
+
+ {intl l="Overall sales"}
+ 2500.00 €
+
+
+ {intl l="Sales excluding shipping"}
+ 2000.00 €
+
+
+ {intl l="Previous year sales"}
+ 1700.00 €
+
+
+ {intl l="Waiting orders"}
+ 4
+
+
+ {intl l="In process orders"}
+ 52
+
+
+ {intl l="Canceled orders"}
+ 3
+
+
+
+ {intl l="Average cart"}
+ 25.00 €
+
+
+
+
+
+ {intl l="Current version"}
+ V2.0.0-beta
+
+
+ {intl l="Latest version available"}
+ V1.5.4.2
+
+
+
+ {intl l="News"}
+ {intl l="Click here"}
+
+
+
+
+
+
+
+ {intl l="Name"}
+ {intl l="Description"}
+ {intl l="Enable/Disable"}
+
+ {module_include location='modules_table_header'}
+
+ {intl l="Actions"}
+
+
+ Tinymce
+ Eos minima maiores doloribus mollitia perspiciatis esse iusto odit error delectus aliquid! Eius, pariatur accusantium odit quidem laboriosam.
+
+
+
+ {module_include location='modules_table_row'}
+
+
+
+
+
+ So colissimo
+ Eos minima maiores doloribus mollitia perspiciatis esse iusto odit error delectus aliquid
+
+
+
+ {module_include location='modules_table_row'}
+
+
+
+
+
+
+ Title meta
+ Eos minima maiores doloribus mollitia perspiciatis esse iusto odit error delectus aliquid
+
+
+
+ {module_include location='modules_table_row'}
+
+
+
+
+
+
+
+
+
+
+ {intl l="Name"}
+ {intl l="Description"}
+ {intl l="Enable/Disable"}
+
+ {module_include location='modules_table_header'}
+
+ {intl l="Actions"}
+
+
+ Tinymce
+ Eos minima maiores doloribus mollitia perspiciatis esse iusto odit error delectus aliquid! Eius, pariatur accusantium odit quidem laboriosam.
+
+
+
+ {module_include location='modules_table_row'}
+
+
+
+
+
+ So colissimo
+ Eos minima maiores doloribus mollitia perspiciatis esse iusto odit error delectus aliquid
+
+
+
+ {module_include location='modules_table_row'}
+
+
+
+
+
+
+ Title meta
+ Eos minima maiores doloribus mollitia perspiciatis esse iusto odit error delectus aliquid
+
+
+
+ {module_include location='modules_table_row'}
+
+
+
+
-
+
-
-
+ {intl l="Designation"}
- {intl l="Price"}
- {intl l="Quantity"}
- {intl l="Total"}
-
+
+
+
+
+
-
- {intl l="Designation"}
+ {intl l="Price"}
+ {intl l="Quantity"}
+ {intl l="Total"}
+
-
- T-Shirt F T1
- 20.00 €
- 3
- 60.00 €
-
-
- T-Shirt F T1
- 20.00 €
- 3
- 60.00 €
-
-
-
-
- T-Shirt F T1
- 20.00 €
- 3
- 60.00 €
-
-
-
- Total
- 180.00 €
-
+
+ T-Shirt F T1
+ 20.00 €
+ 3
+ 60.00 €
+
+
+ T-Shirt F T1
+ 20.00 €
+ 3
+ 60.00 €
+
+
+
+
+ T-Shirt F T1
+ 20.00 €
+ 3
+ 60.00 €
+
+
+
+ Total
+ 180.00 €
+
-
+
-
-
+ {intl l="Bill n°"}
- {intl l="Compagny"}
- {intl l="Firstname & Lastname"}
- {intl l="Date & Hour"}
-
-
-
+
-
- {intl l="Type of payment"}
- Unknown
-
-
- {intl l="Transaction reference"}
- 141100
-
-
- {intl l="Total order before discount"}
- 60 €
-
-
- {intl l="Discount"}
- 10%
-
-
- {intl l="Coupon code"}
-
-
-
- {intl l="Total with discount"}
- 50 €
-
-
- {intl l="Freight"}
- 6 €
-
-
-
- {intl l="Total"}
- 56 €
-
+
+
+
+ {intl l="Type of payment"}
+ Unknown
+
+
+ {intl l="Transaction reference"}
+ 141100
+
+
+ {intl l="Total order before discount"}
+ 60 €
+
+
+ {intl l="Discount"}
+ 10%
+
+
+ {intl l="Coupon code"}
+
+
+
+ {intl l="Total with discount"}
+ 50 €
+
+
+ {intl l="Freight"}
+ 6 €
+
+
+
+ {intl l="Total"}
+ 56 €
+
-
+
-
- {intl l="Title"}
- Mr
-
-
- {intl l="Compagny"}
- Thelia
-
-
- {intl l="Firstname"}
- Espeche
-
-
- {intl l="Lastname"}
- Michaël
-
-
- {intl l="Street address"}
- 5, rue Rochon
-
-
- {intl l="Additional address"}
- Lorem ipsum dolor sit amet
-
-
- {intl l="Additional address"}
- Lorem ipsum dolor sit
-
-
- {intl l="Zip code"}
- 63000
-
-
- {intl l="City"}
- Clermont-Fd
-
-
- {intl l="Country"}
- France
-
-
-
- {intl l="Phone"}
- 01 02 03 04 05
-
+
+
+
+ {intl l="Title"}
+ Mr
+
+
+ {intl l="Compagny"}
+ Thelia
+
+
+ {intl l="Firstname"}
+ Espeche
+
+
+ {intl l="Lastname"}
+ Michaël
+
+
+ {intl l="Street address"}
+ 5, rue Rochon
+
+
+ {intl l="Additional address"}
+ Lorem ipsum dolor sit amet
+
+
+ {intl l="Additional address"}
+ Lorem ipsum dolor sit
+
+
+ {intl l="Zip code"}
+ 63000
+
+
+ {intl l="City"}
+ Clermont-Fd
+
+
+ {intl l="Country"}
+ France
+
+
+
+ {intl l="Phone"}
+ 01 02 03 04 05
+
-
+
-
- {intl l="Title"}
- Mr
-
-
- {intl l="Compagny"}
- Thelia
-
-
- {intl l="Firstname"}
- Espeche
-
-
- {intl l="Lastname"}
- Michaël
-
-
- {intl l="Street address"}
- 5, rue Rochon
-
-
- {intl l="Additional address"}
- Lorem ipsum dolor sit amet
-
-
- {intl l="Additional address"}
- Lorem ipsum dolor sit
-
-
- {intl l="Zip code"}
- 63000
-
-
- {intl l="City"}
- Clermont-Fd
-
-
- {intl l="Country"}
- France
-
-
-
- {intl l="Phone"}
- 01 02 03 04 05
-
+
+
+
+ {intl l="Title"}
+ Mr
+
+
+ {intl l="Compagny"}
+ Thelia
+
+
+ {intl l="Firstname"}
+ Espeche
+
+
+ {intl l="Lastname"}
+ Michaël
+
+
+ {intl l="Street address"}
+ 5, rue Rochon
+
+
+ {intl l="Additional address"}
+ Lorem ipsum dolor sit amet
+
+
+ {intl l="Additional address"}
+ Lorem ipsum dolor sit
+
+
+ {intl l="Zip code"}
+ 63000
+
+
+ {intl l="City"}
+ Clermont-Fd
+
+
+ {intl l="Country"}
+ France
+
+
+
+ {intl l="Phone"}
+ 01 02 03 04 05
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- {intl l='Bill'}
- {intl l='Download bill to pdf'}
-
-
-
-
- {intl l='Delivery'}
- {intl l='Download delivery to pdf'}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {intl l='Bill'}
+ {intl l='Download bill to pdf'}
+
+
+
+ {intl l='Delivery'}
+ {intl l='Download delivery to pdf'}
+
-
+
- {intl l="Order n°"}
- {intl l="Date & Hour"}
- {intl l="Compagny"}
- {intl l="Name"}
- {intl l="Amount"}
- {intl l="Status"}
+
+
+
+
+
-
+ {intl l="Order n°"}
+ {intl l="Date & Hour"}
+ {intl l="Compagny"}
+ {intl l="Name"}
+ {intl l="Amount"}
+ {intl l="Status"}
- {module_include location='orders_table_header'}
+ {module_include location='orders_table_header'}
- {intl l="Actions"}
- {intl l="Actions"}
+
+
-
-
+
+
-
- 01230450123045
- 11/09/2013 10:24:31
- Thelia
- Dupont
- 251 €
- Paid
+ 01230450123045
+ 11/09/2013 10:24:31
+ Thelia
+ Dupont
+ 251 €
+ Paid
- {module_include location='orders_table_row'}
+ {module_include location='orders_table_row'}
-
-
+
-
-
+ {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"}
+
+ {/loop}
+
+
+
+
-
- 01230450123045
- 11/09/2013 10:24:31
- Thelia
- Dupont
- 251 €
- Canceled
+ 01230450123045
+ 11/09/2013 10:24:31
+ Thelia
+ Dupont
+ 251 €
+ Canceled
- {module_include location='orders_table_row'}
+ {module_include location='orders_table_row'}
-
-
+
-
-
+ {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"}
+
+ {/loop}
+
+
+
+
-
+ {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"}
+
+ {/loop}
+
+
+
-
+
-
- 01230450123045
- 11/09/2013 10:24:31
- Thelia
- Dupont
- 251 €
- Current
+ 01230450123045
+ 11/09/2013 10:24:31
+ Thelia
+ Dupont
+ 251 €
+ Current
- {module_include location='orders_table_row'}
+ {module_include location='orders_table_row'}
-
-
+
-
-
+
+
+
+
+
+
+
+ {loop name="assigned_contents" type="associated_content" product="$product_id" backend_context="1" lang="$edit_language_id"}
+ {intl l='ID'}
+
+ {intl l='Content title'}
+
+ {module_include location='product_contents_table_header'}
+
+ {intl l="Actions"}
+
+
+ {/loop}
+
+ {elseloop rel="assigned_contents"}
+ {$ID}
+
+
+ {$TITLE}
+
+
+ {module_include location='product_contents_table_row'}
+
+
+
+
+
+ {/elseloop}
+
+
+
+
+
+
+
+
+
+
+
+ {loop name="assigned_accessories" order="accessory" type="accessory" product="$product_id" backend_context="1" lang="$edit_language_id"}
+ {intl l='ID'}
+
+ {intl l='Accessory title'}
+
+ {intl l='Position'}
+
+ {module_include location='product_accessories_table_header'}
+
+ {intl l="Actions"}
+
+
+ {/loop}
+
+ {elseloop rel="assigned_accessories"}
+ {$ID}
+
+
+ {$TITLE}
+
+
+
+ {admin_position_block
+ permission="admin.products.edit"
+ path={url path='/admin/products/update-accessory-position' product_id=$ID}
+ url_parameter="accessory_id"
+ in_place_edit_class="accessoryPositionChange"
+ position=$POSITION
+ id=$ID
+ }
+
+
+ {module_include location='product_accessories_table_row'}
+
+
+
+
+
+ {/elseloop}
+
+
+
+
+
+
+
+
+
+
+ {intl l="Description"}
+
+ {module_include location='shipping_configuration_table_header'}
+
+ {intl l="Actions"}
+
+
+ France
+
+ {module_include location='shipping_configuration_table_row'}
+
+
+ {if ! $SECURED}
+
+ {else}
+
+ {/if}
+
+
+
+ Outre-Mer DOM
+
+ {module_include location='shipping_configuration_table_row'}
+
+
+ {if ! $SECURED}
+
+ {else}
+
+ {/if}
+
+
+
+
+ Outre-Mer TOM
+
+ {module_include location='shipping_configuration_table_row'}
+
+
+ {if ! $SECURED}
+
+ {else}
+
+ {/if}
+
+
+
+
+
+
+
+
+ {intl l="Name"}
+
+ {module_include location='shipping_zones_table_header'}
+
+ {intl l="Actions"}
+
+
+ So Colissimo
+
+ {module_include location='shipping_zones_table_row'}
+
+
+ {if ! $SECURED}
+
+ {else}
+
+ {/if}
+
+
+
+ Chronopost
+
+ {module_include location='shipping_zones_table_row'}
+
+
+ {if ! $SECURED}
+
+ {else}
+
+ {/if}
+
+
+
+
+ Kiala
+
+ {module_include location='shipping_zones_table_row'}
+
+
+ {if ! $SECURED}
+
+ {else}
+
+ {/if}
+
+
+
+
-
+ {elseloop rel="list"}
+
+
-
+
+ {loop name="list" type="template" backend_context="1" lang=$lang_id order=$order}
+
+ {admin_sortable_header
+ current_order=$order
+ order='id'
+ reverse_order='id_reverse'
+ path='/admin/configuration/templates'
+ label="{intl l='ID'}"
+ }
+
- {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.templates.create"}
-
-
-
- {/loop}
-
-
-
-
+
-
- {admin_sortable_header
- current_order=$order
- order='id'
- reverse_order='id_reverse'
- path='/admin/configuration/templates'
- label="{intl l='ID'}"
- }
-
+
+ {admin_sortable_header
+ current_order=$order
+ order='alpha'
+ reverse_order='alpha_reverse'
+ path='/admin/configuration/templates'
+ label="{intl l='Title'}"
+ }
+
-
- {admin_sortable_header
- current_order=$order
- order='alpha'
- reverse_order='alpha_reverse'
- path='/admin/configuration/templates'
- label="{intl l='Title'}"
- }
-
+ {module_include location='templates_table_header'}
- {module_include location='templates_table_header'}
+ {intl l="Actions"}
+ {intl l="Actions"}
-
+
- {loop name="list" type="template" backend_context="1" lang=$lang_id order=$order}
- {$ID}
-
-
+ {/loop}
- {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.templates.delete"}
-
- {/loop}
-
-
-
- {/loop}
-
- {elseloop rel="list"}
- {$ID}
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.templates.change"}
+ {$NAME}
+ {/loop}
+ {elseloop rel="can_change"}
+ {$NAME}
+ {/elseloop}
+
-
- {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.templates.change"}
- {$NAME}
- {/loop}
- {elseloop rel="can_change"}
- {$NAME}
- {/elseloop}
-
+ {module_include location='templates_table_row'}
- {module_include location='templates_table_row'}
+
+
-
- {/elseloop}
-
-
-
-
+
+ {/elseloop}
+
+
+
+ Find a product
+
+
+ {/loop}
+ {elseloop rel="product_thumbnail"}
+ {images file="../assets/img/{$width}x{$height}.png"}
{/images}
+ {/elseloop}
+
+
+
+
{$TITLE}
+ {if $hasDescription}
+
@@ -57,7 +66,9 @@
{loop name="product_promo" type="product" limit="5" promo="yes"}
-
diff --git a/templates/default/layout.tpl b/templates/default/layout.tpl
index 7834bc706..4aba10120 100644
--- a/templates/default/layout.tpl
+++ b/templates/default/layout.tpl
@@ -62,7 +62,7 @@ URL: http://www.thelia.net
- {/ifloop}
- {elseloop rel="image_product_promo"}
- {images file='assets/img/218x146.png'}
{/images}
- {/elseloop}
-
-
-
-
{$CHAPO}
- Your Cart
-
jPlayer events that have occurred over the past 1 second:'
+ + '
(Backgrounds: Never occurred Occurred before Occurred Multiple occurrences reset)
Update jPlayer Inspector
' + + '' + + 'This jPlayer instance is running in your browser where:
"
+
+ for(i = 0; i < $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions.length; i++) {
+ var solution = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions[i];
+ jPlayerInfo += " jPlayer's " + solution + " solution is";
+ if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].used) {
+ jPlayerInfo += " being used and will support:";
+ for(format in $(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support) {
+ if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support[format]) {
+ jPlayerInfo += " " + format;
+ }
+ }
+ jPlayerInfo += "
";
+ } else {
+ jPlayerInfo += " not required
";
+ }
+ }
+ jPlayerInfo += "
status.formatType = '" + formatType + "'
";
+ if(formatType) {
+ jPlayerInfo += "Browser canPlay('" + $.jPlayer.prototype.format[formatType].codec + "')";
+ } else {
+ jPlayerInfo += "
status.src = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src + "'
status.media = {
";
+ for(prop in $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media) {
+ jPlayerInfo += " " + prop + ": " + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media[prop] + "
"; // Some are strings
+ }
+ jPlayerInfo += "};
";
+ jPlayerInfo += "status.videoWidth = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoWidth + "'";
+ jPlayerInfo += " | status.videoHeight = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoHeight + "'";
+ jPlayerInfo += "status.width = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.width + "'";
+ jPlayerInfo += " | status.height = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.height + "'";
+ jPlayerInfo += "
Raw browser test for HTML5 support. Should equal a function if HTML5 is available.
";
+ if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available) {
+ jPlayerInfo += "htmlElement.audio.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType) +"
"
+ }
+ if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.video.available) {
+ jPlayerInfo += "htmlElement.video.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.video.canPlayType) +"";
+ }
+ jPlayerInfo += "
This instance is using the constructor options:
"
+ + "$('#" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").internal.self.id + "').jPlayer({
"
+
+ + " swfPath: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "swfPath") + "',
"
+
+ + " solution: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "solution") + "',
"
+
+ + " supplied: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "supplied") + "',
"
+
+ + " preload: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "preload") + "',
"
+
+ + " volume: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "volume") + ",
"
+
+ + " muted: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "muted") + ",
"
+
+ + " backgroundColor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "backgroundColor") + "',
"
+
+ + " cssSelectorAncestor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelectorAncestor") + "',
"
+
+ + " cssSelector: {";
+
+ var cssSelector = $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector");
+ for(prop in cssSelector) {
+
+ // jPlayerInfo += "
" + prop + ": '" + cssSelector[prop] + "'," // This works too of course, but want to use option method for deep keys.
+ jPlayerInfo += "
" + prop + ": '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector." + prop) + "',"
+ }
+
+ jPlayerInfo = jPlayerInfo.slice(0, -1); // Because the sloppy comma was bugging me.
+
+ jPlayerInfo += "
},
"
+
+ + " errorAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "errorAlerts") + ",
"
+
+ + " warningAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "warningAlerts") + "
"
+
+ + "});
jPlayer is " + + ($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.paused ? "paused" : "playing") + + " at time: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentTime*10)/10 + "s." + + " (d: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.duration*10)/10 + "s" + + ", sp: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.seekPercent) + "%" + + ", cpr: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentRelative) + "%" + + ", cpa: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentAbsolute) + "%)
" + ); + return this; + } + }; + $.fn.jPlayerInspector = function( method ) { + // Method calling logic + if ( methods[method] ) { + return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object' || ! method ) { + return methods.init.apply( this, arguments ); + } else { + $.error( 'Method ' + method + ' does not exist on jQuery.jPlayerInspector' ); + } + }; +})(jQuery); diff --git a/web/tinymce/plugins/filemanager/jPlayer/jquery.jplayer.min.js b/web/tinymce/plugins/filemanager/jPlayer/jquery.jplayer.min.js new file mode 100755 index 000000000..ecd3ab514 --- /dev/null +++ b/web/tinymce/plugins/filemanager/jPlayer/jquery.jplayer.min.js @@ -0,0 +1,107 @@ +/* + * jPlayer Plugin for jQuery JavaScript Library + * http://www.jplayer.org + * + * Copyright (c) 2009 - 2013 Happyworm Ltd + * Licensed under the MIT license. + * http://opensource.org/licenses/MIT + * + * Author: Mark J Panaghiston + * Version: 2.4.0 + * Date: 5th June 2013 + */ + +(function(b,f){"function"===typeof define&&define.amd?define(["jquery"],f):b.jQuery?f(b.jQuery):f(b.Zepto)})(this,function(b,f){b.fn.jPlayer=function(a){var c="string"===typeof a,d=Array.prototype.slice.call(arguments,1),e=this;a=!c&&d.length?b.extend.apply(null,[!0,a].concat(d)):a;if(c&&"_"===a.charAt(0))return e;c?this.each(function(){var c=b(this).data("jPlayer"),h=c&&b.isFunction(c[a])?c[a].apply(c,d):c;if(h!==c&&h!==f)return e=h,!1}):this.each(function(){var c=b(this).data("jPlayer");c?c.option(a|| +{}):b(this).data("jPlayer",new b.jPlayer(a,this))});return e};b.jPlayer=function(a,c){if(arguments.length){this.element=b(c);this.options=b.extend(!0,{},this.options,a);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()});this._init()}};"function"!==typeof b.fn.stop&&(b.fn.stop=function(){});b.jPlayer.emulateMethods="load play pause";b.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";b.jPlayer.emulateOptions="muted volume";b.jPlayer.reservedEvent= +"ready flashreset resize repeat error warning";b.jPlayer.event={};b.each("ready flashreset resize repeat click error warning loadstart progress suspend abort emptied stalled play pause loadedmetadata loadeddata waiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange".split(" "),function(){b.jPlayer.event[this]="jPlayer_"+this});b.jPlayer.htmlEvent="loadstart abort emptied stalled loadedmetadata loadeddata canplay canplaythrough ratechange".split(" "); +b.jPlayer.pause=function(){b.each(b.jPlayer.prototype.instances,function(a,c){c.data("jPlayer").status.srcSet&&c.jPlayer("pause")})};b.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};var l=function(){this.init()};l.prototype={init:function(){this.options={timeFormat:b.jPlayer.timeFormat}},time:function(a){var c=new Date(1E3*(a&&"number"===typeof a?a:0)),b=c.getUTCHours();a=this.options.timeFormat.showHour?c.getUTCMinutes():c.getUTCMinutes()+ +60*b;c=this.options.timeFormat.showMin?c.getUTCSeconds():c.getUTCSeconds()+60*a;b=this.options.timeFormat.padHour&&10>b?"0"+b:b;a=this.options.timeFormat.padMin&&10>a?"0"+a:a;c=this.options.timeFormat.padSec&&10>c?"0"+c:c;b=""+(this.options.timeFormat.showHour?b+this.options.timeFormat.sepHour:"");b+=this.options.timeFormat.showMin?a+this.options.timeFormat.sepMin:"";return b+=this.options.timeFormat.showSec?c+this.options.timeFormat.sepSec:""}};var m=new l;b.jPlayer.convertTime=function(a){return m.time(a)}; +b.jPlayer.uaBrowser=function(a){a=a.toLowerCase();var b=/(opera)(?:.*version)?[ \/]([\w.]+)/,d=/(msie) ([\w.]+)/,e=/(mozilla)(?:.*? rv:([\w.]+))?/;a=/(webkit)[ \/]([\w.]+)/.exec(a)||b.exec(a)||d.exec(a)||0>a.indexOf("compatible")&&e.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}};b.jPlayer.uaPlatform=function(a){var b=a.toLowerCase(),d=/(android)/,e=/(mobile)/;a=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(b)||[];b=/(ipad|playbook)/.exec(b)||!e.exec(b)&&d.exec(b)|| +[];a[1]&&(a[1]=a[1].replace(/\s/g,"_"));return{platform:a[1]||"",tablet:b[1]||""}};b.jPlayer.browser={};b.jPlayer.platform={};var j=b.jPlayer.uaBrowser(navigator.userAgent);j.browser&&(b.jPlayer.browser[j.browser]=!0,b.jPlayer.browser.version=j.version);j=b.jPlayer.uaPlatform(navigator.userAgent);j.platform&&(b.jPlayer.platform[j.platform]=!0,b.jPlayer.platform.mobile=!j.tablet,b.jPlayer.platform.tablet=!!j.tablet);b.jPlayer.getDocMode=function(){var a;b.jPlayer.browser.msie&&(document.documentMode? +a=document.documentMode:(a=5,document.compatMode&&"CSS1Compat"===document.compatMode&&(a=7)));return a};b.jPlayer.browser.documentMode=b.jPlayer.getDocMode();b.jPlayer.nativeFeatures={init:function(){var a=document,b=a.createElement("video"),d={w3c:"fullscreenEnabled fullscreenElement requestFullscreen exitFullscreen fullscreenchange fullscreenerror".split(" "),moz:"mozFullScreenEnabled mozFullScreenElement mozRequestFullScreen mozCancelFullScreen mozfullscreenchange mozfullscreenerror".split(" "), +webkit:" webkitCurrentFullScreenElement webkitRequestFullScreen webkitCancelFullScreen webkitfullscreenchange ".split(" "),webkitVideo:"webkitSupportsFullscreen webkitDisplayingFullscreen webkitEnterFullscreen webkitExitFullscreen ".split(" ")},e=["w3c","moz","webkit","webkitVideo"],g,h;this.fullscreen=b={support:{w3c:!!a[d.w3c[0]],moz:!!a[d.moz[0]],webkit:"function"===typeof a[d.webkit[3]],webkitVideo:"function"===typeof b[d.webkitVideo[2]]},used:{}};g=0;for(h=e.length;g"+this.options.dictFallbackText+"
"),d+='
RESPONSIVE filemanager v.'+version+'
responsivefilemanager.com
Copyright © Tecrail - Alberto Peripolli. All rights reserved.
License
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.

RESPONSIVE filemanager v.'+version+'
responsivefilemanager.com
Copyright © Tecrail - Alberto Peripolli. All rights reserved.
License
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.