WIP Coupon

Update Coupon Model + SQL
Implementattion Fixtures for Coupon and CouponFactory
This commit is contained in:
gmorel
2013-08-22 20:02:03 +02:00
parent a9944c73f2
commit 73677b7c1a
52 changed files with 14325 additions and 1456 deletions

View File

@@ -891,6 +891,10 @@ abstract class Accessory implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = AccessoryTableMap::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . AccessoryTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AccessoryTableMap::ID)) {
@@ -948,6 +952,13 @@ abstract class Accessory 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);
}
@@ -1224,7 +1235,6 @@ abstract class Accessory implements ActiveRecordInterface
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setId($this->getId());
$copyObj->setProductId($this->getProductId());
$copyObj->setAccessory($this->getAccessory());
$copyObj->setPosition($this->getPosition());
@@ -1232,6 +1242,7 @@ abstract class Accessory implements ActiveRecordInterface
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
$copyObj->setNew(true);
$copyObj->setId(NULL); // this is a auto-increment column, so set to default value
}
}

View File

@@ -22,6 +22,8 @@ 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\CategoryAssociatedContent as ChildCategoryAssociatedContent;
use Thelia\Model\CategoryAssociatedContentQuery as ChildCategoryAssociatedContentQuery;
use Thelia\Model\CategoryDocument as ChildCategoryDocument;
use Thelia\Model\CategoryDocumentQuery as ChildCategoryDocumentQuery;
use Thelia\Model\CategoryI18n as ChildCategoryI18n;
@@ -31,8 +33,6 @@ use Thelia\Model\CategoryImageQuery as ChildCategoryImageQuery;
use Thelia\Model\CategoryQuery as ChildCategoryQuery;
use Thelia\Model\CategoryVersion as ChildCategoryVersion;
use Thelia\Model\CategoryVersionQuery as ChildCategoryVersionQuery;
use Thelia\Model\ContentAssoc as ChildContentAssoc;
use Thelia\Model\ContentAssocQuery as ChildContentAssocQuery;
use Thelia\Model\Feature as ChildFeature;
use Thelia\Model\FeatureCategory as ChildFeatureCategory;
use Thelia\Model\FeatureCategoryQuery as ChildFeatureCategoryQuery;
@@ -153,12 +153,6 @@ abstract class Category implements ActiveRecordInterface
protected $collAttributeCategories;
protected $collAttributeCategoriesPartial;
/**
* @var ObjectCollection|ChildContentAssoc[] Collection to store aggregation of ChildContentAssoc objects.
*/
protected $collContentAssocs;
protected $collContentAssocsPartial;
/**
* @var ObjectCollection|ChildRewriting[] Collection to store aggregation of ChildRewriting objects.
*/
@@ -177,6 +171,12 @@ abstract class Category implements ActiveRecordInterface
protected $collCategoryDocuments;
protected $collCategoryDocumentsPartial;
/**
* @var ObjectCollection|ChildCategoryAssociatedContent[] Collection to store aggregation of ChildCategoryAssociatedContent objects.
*/
protected $collCategoryAssociatedContents;
protected $collCategoryAssociatedContentsPartial;
/**
* @var ObjectCollection|ChildCategoryI18n[] Collection to store aggregation of ChildCategoryI18n objects.
*/
@@ -270,12 +270,6 @@ abstract class Category implements ActiveRecordInterface
*/
protected $attributeCategoriesScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $contentAssocsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
@@ -294,6 +288,12 @@ abstract class Category implements ActiveRecordInterface
*/
protected $categoryDocumentsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $categoryAssociatedContentsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
@@ -1039,14 +1039,14 @@ abstract class Category implements ActiveRecordInterface
$this->collAttributeCategories = null;
$this->collContentAssocs = null;
$this->collRewritings = null;
$this->collCategoryImages = null;
$this->collCategoryDocuments = null;
$this->collCategoryAssociatedContents = null;
$this->collCategoryI18ns = null;
$this->collCategoryVersions = null;
@@ -1331,23 +1331,6 @@ abstract class Category implements ActiveRecordInterface
}
}
if ($this->contentAssocsScheduledForDeletion !== null) {
if (!$this->contentAssocsScheduledForDeletion->isEmpty()) {
\Thelia\Model\ContentAssocQuery::create()
->filterByPrimaryKeys($this->contentAssocsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->contentAssocsScheduledForDeletion = null;
}
}
if ($this->collContentAssocs !== null) {
foreach ($this->collContentAssocs as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->rewritingsScheduledForDeletion !== null) {
if (!$this->rewritingsScheduledForDeletion->isEmpty()) {
\Thelia\Model\RewritingQuery::create()
@@ -1399,6 +1382,23 @@ abstract class Category implements ActiveRecordInterface
}
}
if ($this->categoryAssociatedContentsScheduledForDeletion !== null) {
if (!$this->categoryAssociatedContentsScheduledForDeletion->isEmpty()) {
\Thelia\Model\CategoryAssociatedContentQuery::create()
->filterByPrimaryKeys($this->categoryAssociatedContentsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->categoryAssociatedContentsScheduledForDeletion = null;
}
}
if ($this->collCategoryAssociatedContents !== null) {
foreach ($this->collCategoryAssociatedContents as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->categoryI18nsScheduledForDeletion !== null) {
if (!$this->categoryI18nsScheduledForDeletion->isEmpty()) {
\Thelia\Model\CategoryI18nQuery::create()
@@ -1668,9 +1668,6 @@ abstract class Category implements ActiveRecordInterface
if (null !== $this->collAttributeCategories) {
$result['AttributeCategories'] = $this->collAttributeCategories->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collContentAssocs) {
$result['ContentAssocs'] = $this->collContentAssocs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collRewritings) {
$result['Rewritings'] = $this->collRewritings->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
@@ -1680,6 +1677,9 @@ abstract class Category implements ActiveRecordInterface
if (null !== $this->collCategoryDocuments) {
$result['CategoryDocuments'] = $this->collCategoryDocuments->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collCategoryAssociatedContents) {
$result['CategoryAssociatedContents'] = $this->collCategoryAssociatedContents->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collCategoryI18ns) {
$result['CategoryI18ns'] = $this->collCategoryI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
@@ -1895,12 +1895,6 @@ abstract class Category implements ActiveRecordInterface
}
}
foreach ($this->getContentAssocs() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addContentAssoc($relObj->copy($deepCopy));
}
}
foreach ($this->getRewritings() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addRewriting($relObj->copy($deepCopy));
@@ -1919,6 +1913,12 @@ abstract class Category implements ActiveRecordInterface
}
}
foreach ($this->getCategoryAssociatedContents() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addCategoryAssociatedContent($relObj->copy($deepCopy));
}
}
foreach ($this->getCategoryI18ns() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addCategoryI18n($relObj->copy($deepCopy));
@@ -1981,9 +1981,6 @@ abstract class Category implements ActiveRecordInterface
if ('AttributeCategory' == $relationName) {
return $this->initAttributeCategories();
}
if ('ContentAssoc' == $relationName) {
return $this->initContentAssocs();
}
if ('Rewriting' == $relationName) {
return $this->initRewritings();
}
@@ -1993,6 +1990,9 @@ abstract class Category implements ActiveRecordInterface
if ('CategoryDocument' == $relationName) {
return $this->initCategoryDocuments();
}
if ('CategoryAssociatedContent' == $relationName) {
return $this->initCategoryAssociatedContents();
}
if ('CategoryI18n' == $relationName) {
return $this->initCategoryI18ns();
}
@@ -2733,274 +2733,6 @@ abstract class Category implements ActiveRecordInterface
return $this->getAttributeCategories($query, $con);
}
/**
* Clears out the collContentAssocs 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 addContentAssocs()
*/
public function clearContentAssocs()
{
$this->collContentAssocs = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collContentAssocs collection loaded partially.
*/
public function resetPartialContentAssocs($v = true)
{
$this->collContentAssocsPartial = $v;
}
/**
* Initializes the collContentAssocs collection.
*
* By default this just sets the collContentAssocs collection to an empty array (like clearcollContentAssocs());
* 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 initContentAssocs($overrideExisting = true)
{
if (null !== $this->collContentAssocs && !$overrideExisting) {
return;
}
$this->collContentAssocs = new ObjectCollection();
$this->collContentAssocs->setModel('\Thelia\Model\ContentAssoc');
}
/**
* Gets an array of ChildContentAssoc 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 ChildCategory 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|ChildContentAssoc[] List of ChildContentAssoc objects
* @throws PropelException
*/
public function getContentAssocs($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collContentAssocsPartial && !$this->isNew();
if (null === $this->collContentAssocs || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collContentAssocs) {
// return empty collection
$this->initContentAssocs();
} else {
$collContentAssocs = ChildContentAssocQuery::create(null, $criteria)
->filterByCategory($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collContentAssocsPartial && count($collContentAssocs)) {
$this->initContentAssocs(false);
foreach ($collContentAssocs as $obj) {
if (false == $this->collContentAssocs->contains($obj)) {
$this->collContentAssocs->append($obj);
}
}
$this->collContentAssocsPartial = true;
}
$collContentAssocs->getInternalIterator()->rewind();
return $collContentAssocs;
}
if ($partial && $this->collContentAssocs) {
foreach ($this->collContentAssocs as $obj) {
if ($obj->isNew()) {
$collContentAssocs[] = $obj;
}
}
}
$this->collContentAssocs = $collContentAssocs;
$this->collContentAssocsPartial = false;
}
}
return $this->collContentAssocs;
}
/**
* Sets a collection of ContentAssoc 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 $contentAssocs A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildCategory The current object (for fluent API support)
*/
public function setContentAssocs(Collection $contentAssocs, ConnectionInterface $con = null)
{
$contentAssocsToDelete = $this->getContentAssocs(new Criteria(), $con)->diff($contentAssocs);
$this->contentAssocsScheduledForDeletion = $contentAssocsToDelete;
foreach ($contentAssocsToDelete as $contentAssocRemoved) {
$contentAssocRemoved->setCategory(null);
}
$this->collContentAssocs = null;
foreach ($contentAssocs as $contentAssoc) {
$this->addContentAssoc($contentAssoc);
}
$this->collContentAssocs = $contentAssocs;
$this->collContentAssocsPartial = false;
return $this;
}
/**
* Returns the number of related ContentAssoc objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related ContentAssoc objects.
* @throws PropelException
*/
public function countContentAssocs(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collContentAssocsPartial && !$this->isNew();
if (null === $this->collContentAssocs || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collContentAssocs) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getContentAssocs());
}
$query = ChildContentAssocQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByCategory($this)
->count($con);
}
return count($this->collContentAssocs);
}
/**
* Method called to associate a ChildContentAssoc object to this object
* through the ChildContentAssoc foreign key attribute.
*
* @param ChildContentAssoc $l ChildContentAssoc
* @return \Thelia\Model\Category The current object (for fluent API support)
*/
public function addContentAssoc(ChildContentAssoc $l)
{
if ($this->collContentAssocs === null) {
$this->initContentAssocs();
$this->collContentAssocsPartial = true;
}
if (!in_array($l, $this->collContentAssocs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddContentAssoc($l);
}
return $this;
}
/**
* @param ContentAssoc $contentAssoc The contentAssoc object to add.
*/
protected function doAddContentAssoc($contentAssoc)
{
$this->collContentAssocs[]= $contentAssoc;
$contentAssoc->setCategory($this);
}
/**
* @param ContentAssoc $contentAssoc The contentAssoc object to remove.
* @return ChildCategory The current object (for fluent API support)
*/
public function removeContentAssoc($contentAssoc)
{
if ($this->getContentAssocs()->contains($contentAssoc)) {
$this->collContentAssocs->remove($this->collContentAssocs->search($contentAssoc));
if (null === $this->contentAssocsScheduledForDeletion) {
$this->contentAssocsScheduledForDeletion = clone $this->collContentAssocs;
$this->contentAssocsScheduledForDeletion->clear();
}
$this->contentAssocsScheduledForDeletion[]= $contentAssoc;
$contentAssoc->setCategory(null);
}
return $this;
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Category is new, it will return
* an empty collection; or if this Category has previously
* been saved, it will retrieve related ContentAssocs from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Category.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildContentAssoc[] List of ChildContentAssoc objects
*/
public function getContentAssocsJoinProduct($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildContentAssocQuery::create(null, $criteria);
$query->joinWith('Product', $joinBehavior);
return $this->getContentAssocs($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Category is new, it will return
* an empty collection; or if this Category has previously
* been saved, it will retrieve related ContentAssocs from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Category.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildContentAssoc[] List of ChildContentAssoc objects
*/
public function getContentAssocsJoinContent($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildContentAssocQuery::create(null, $criteria);
$query->joinWith('Content', $joinBehavior);
return $this->getContentAssocs($query, $con);
}
/**
* Clears out the collRewritings collection
*
@@ -3730,6 +3462,249 @@ abstract class Category implements ActiveRecordInterface
return $this;
}
/**
* Clears out the collCategoryAssociatedContents 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 addCategoryAssociatedContents()
*/
public function clearCategoryAssociatedContents()
{
$this->collCategoryAssociatedContents = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collCategoryAssociatedContents collection loaded partially.
*/
public function resetPartialCategoryAssociatedContents($v = true)
{
$this->collCategoryAssociatedContentsPartial = $v;
}
/**
* Initializes the collCategoryAssociatedContents collection.
*
* By default this just sets the collCategoryAssociatedContents collection to an empty array (like clearcollCategoryAssociatedContents());
* 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 initCategoryAssociatedContents($overrideExisting = true)
{
if (null !== $this->collCategoryAssociatedContents && !$overrideExisting) {
return;
}
$this->collCategoryAssociatedContents = new ObjectCollection();
$this->collCategoryAssociatedContents->setModel('\Thelia\Model\CategoryAssociatedContent');
}
/**
* Gets an array of ChildCategoryAssociatedContent 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 ChildCategory 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|ChildCategoryAssociatedContent[] List of ChildCategoryAssociatedContent objects
* @throws PropelException
*/
public function getCategoryAssociatedContents($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collCategoryAssociatedContentsPartial && !$this->isNew();
if (null === $this->collCategoryAssociatedContents || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collCategoryAssociatedContents) {
// return empty collection
$this->initCategoryAssociatedContents();
} else {
$collCategoryAssociatedContents = ChildCategoryAssociatedContentQuery::create(null, $criteria)
->filterByCategory($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collCategoryAssociatedContentsPartial && count($collCategoryAssociatedContents)) {
$this->initCategoryAssociatedContents(false);
foreach ($collCategoryAssociatedContents as $obj) {
if (false == $this->collCategoryAssociatedContents->contains($obj)) {
$this->collCategoryAssociatedContents->append($obj);
}
}
$this->collCategoryAssociatedContentsPartial = true;
}
$collCategoryAssociatedContents->getInternalIterator()->rewind();
return $collCategoryAssociatedContents;
}
if ($partial && $this->collCategoryAssociatedContents) {
foreach ($this->collCategoryAssociatedContents as $obj) {
if ($obj->isNew()) {
$collCategoryAssociatedContents[] = $obj;
}
}
}
$this->collCategoryAssociatedContents = $collCategoryAssociatedContents;
$this->collCategoryAssociatedContentsPartial = false;
}
}
return $this->collCategoryAssociatedContents;
}
/**
* Sets a collection of CategoryAssociatedContent 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 $categoryAssociatedContents A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildCategory The current object (for fluent API support)
*/
public function setCategoryAssociatedContents(Collection $categoryAssociatedContents, ConnectionInterface $con = null)
{
$categoryAssociatedContentsToDelete = $this->getCategoryAssociatedContents(new Criteria(), $con)->diff($categoryAssociatedContents);
$this->categoryAssociatedContentsScheduledForDeletion = $categoryAssociatedContentsToDelete;
foreach ($categoryAssociatedContentsToDelete as $categoryAssociatedContentRemoved) {
$categoryAssociatedContentRemoved->setCategory(null);
}
$this->collCategoryAssociatedContents = null;
foreach ($categoryAssociatedContents as $categoryAssociatedContent) {
$this->addCategoryAssociatedContent($categoryAssociatedContent);
}
$this->collCategoryAssociatedContents = $categoryAssociatedContents;
$this->collCategoryAssociatedContentsPartial = false;
return $this;
}
/**
* Returns the number of related CategoryAssociatedContent objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related CategoryAssociatedContent objects.
* @throws PropelException
*/
public function countCategoryAssociatedContents(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collCategoryAssociatedContentsPartial && !$this->isNew();
if (null === $this->collCategoryAssociatedContents || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collCategoryAssociatedContents) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getCategoryAssociatedContents());
}
$query = ChildCategoryAssociatedContentQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByCategory($this)
->count($con);
}
return count($this->collCategoryAssociatedContents);
}
/**
* Method called to associate a ChildCategoryAssociatedContent object to this object
* through the ChildCategoryAssociatedContent foreign key attribute.
*
* @param ChildCategoryAssociatedContent $l ChildCategoryAssociatedContent
* @return \Thelia\Model\Category The current object (for fluent API support)
*/
public function addCategoryAssociatedContent(ChildCategoryAssociatedContent $l)
{
if ($this->collCategoryAssociatedContents === null) {
$this->initCategoryAssociatedContents();
$this->collCategoryAssociatedContentsPartial = true;
}
if (!in_array($l, $this->collCategoryAssociatedContents->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddCategoryAssociatedContent($l);
}
return $this;
}
/**
* @param CategoryAssociatedContent $categoryAssociatedContent The categoryAssociatedContent object to add.
*/
protected function doAddCategoryAssociatedContent($categoryAssociatedContent)
{
$this->collCategoryAssociatedContents[]= $categoryAssociatedContent;
$categoryAssociatedContent->setCategory($this);
}
/**
* @param CategoryAssociatedContent $categoryAssociatedContent The categoryAssociatedContent object to remove.
* @return ChildCategory The current object (for fluent API support)
*/
public function removeCategoryAssociatedContent($categoryAssociatedContent)
{
if ($this->getCategoryAssociatedContents()->contains($categoryAssociatedContent)) {
$this->collCategoryAssociatedContents->remove($this->collCategoryAssociatedContents->search($categoryAssociatedContent));
if (null === $this->categoryAssociatedContentsScheduledForDeletion) {
$this->categoryAssociatedContentsScheduledForDeletion = clone $this->collCategoryAssociatedContents;
$this->categoryAssociatedContentsScheduledForDeletion->clear();
}
$this->categoryAssociatedContentsScheduledForDeletion[]= clone $categoryAssociatedContent;
$categoryAssociatedContent->setCategory(null);
}
return $this;
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Category is new, it will return
* an empty collection; or if this Category has previously
* been saved, it will retrieve related CategoryAssociatedContents from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Category.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildCategoryAssociatedContent[] List of ChildCategoryAssociatedContent objects
*/
public function getCategoryAssociatedContentsJoinContent($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildCategoryAssociatedContentQuery::create(null, $criteria);
$query->joinWith('Content', $joinBehavior);
return $this->getCategoryAssociatedContents($query, $con);
}
/**
* Clears out the collCategoryI18ns collection
*
@@ -4774,11 +4749,6 @@ abstract class Category implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
if ($this->collContentAssocs) {
foreach ($this->collContentAssocs as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collRewritings) {
foreach ($this->collRewritings as $o) {
$o->clearAllReferences($deep);
@@ -4794,6 +4764,11 @@ abstract class Category implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
if ($this->collCategoryAssociatedContents) {
foreach ($this->collCategoryAssociatedContents as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collCategoryI18ns) {
foreach ($this->collCategoryI18ns as $o) {
$o->clearAllReferences($deep);
@@ -4837,10 +4812,6 @@ abstract class Category implements ActiveRecordInterface
$this->collAttributeCategories->clearIterator();
}
$this->collAttributeCategories = null;
if ($this->collContentAssocs instanceof Collection) {
$this->collContentAssocs->clearIterator();
}
$this->collContentAssocs = null;
if ($this->collRewritings instanceof Collection) {
$this->collRewritings->clearIterator();
}
@@ -4853,6 +4824,10 @@ abstract class Category implements ActiveRecordInterface
$this->collCategoryDocuments->clearIterator();
}
$this->collCategoryDocuments = null;
if ($this->collCategoryAssociatedContents instanceof Collection) {
$this->collCategoryAssociatedContents->clearIterator();
}
$this->collCategoryAssociatedContents = null;
if ($this->collCategoryI18ns instanceof Collection) {
$this->collCategoryI18ns->clearIterator();
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,804 @@
<?php
namespace Thelia\Model\Base;
use \Exception;
use \PDO;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\CategoryAssociatedContent as ChildCategoryAssociatedContent;
use Thelia\Model\CategoryAssociatedContentQuery as ChildCategoryAssociatedContentQuery;
use Thelia\Model\Map\CategoryAssociatedContentTableMap;
/**
* Base class that represents a query for the 'category_associated_content' table.
*
*
*
* @method ChildCategoryAssociatedContentQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCategoryAssociatedContentQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
* @method ChildCategoryAssociatedContentQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
* @method ChildCategoryAssociatedContentQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildCategoryAssociatedContentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCategoryAssociatedContentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildCategoryAssociatedContentQuery groupById() Group by the id column
* @method ChildCategoryAssociatedContentQuery groupByCategoryId() Group by the category_id column
* @method ChildCategoryAssociatedContentQuery groupByContentId() Group by the content_id column
* @method ChildCategoryAssociatedContentQuery groupByPosition() Group by the position column
* @method ChildCategoryAssociatedContentQuery groupByCreatedAt() Group by the created_at column
* @method ChildCategoryAssociatedContentQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildCategoryAssociatedContentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCategoryAssociatedContentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCategoryAssociatedContentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCategoryAssociatedContentQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
* @method ChildCategoryAssociatedContentQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
* @method ChildCategoryAssociatedContentQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
*
* @method ChildCategoryAssociatedContentQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
* @method ChildCategoryAssociatedContentQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
* @method ChildCategoryAssociatedContentQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
*
* @method ChildCategoryAssociatedContent findOne(ConnectionInterface $con = null) Return the first ChildCategoryAssociatedContent matching the query
* @method ChildCategoryAssociatedContent findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryAssociatedContent matching the query, or a new ChildCategoryAssociatedContent object populated from the query conditions when no match is found
*
* @method ChildCategoryAssociatedContent findOneById(int $id) Return the first ChildCategoryAssociatedContent filtered by the id column
* @method ChildCategoryAssociatedContent findOneByCategoryId(int $category_id) Return the first ChildCategoryAssociatedContent filtered by the category_id column
* @method ChildCategoryAssociatedContent findOneByContentId(int $content_id) Return the first ChildCategoryAssociatedContent filtered by the content_id column
* @method ChildCategoryAssociatedContent findOneByPosition(int $position) Return the first ChildCategoryAssociatedContent filtered by the position column
* @method ChildCategoryAssociatedContent findOneByCreatedAt(string $created_at) Return the first ChildCategoryAssociatedContent filtered by the created_at column
* @method ChildCategoryAssociatedContent findOneByUpdatedAt(string $updated_at) Return the first ChildCategoryAssociatedContent filtered by the updated_at column
*
* @method array findById(int $id) Return ChildCategoryAssociatedContent objects filtered by the id column
* @method array findByCategoryId(int $category_id) Return ChildCategoryAssociatedContent objects filtered by the category_id column
* @method array findByContentId(int $content_id) Return ChildCategoryAssociatedContent objects filtered by the content_id column
* @method array findByPosition(int $position) Return ChildCategoryAssociatedContent objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildCategoryAssociatedContent objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCategoryAssociatedContent objects filtered by the updated_at column
*
*/
abstract class CategoryAssociatedContentQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CategoryAssociatedContentQuery 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\\CategoryAssociatedContent', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCategoryAssociatedContentQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCategoryAssociatedContentQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CategoryAssociatedContentQuery) {
return $criteria;
}
$query = new \Thelia\Model\CategoryAssociatedContentQuery();
if (null !== $modelAlias) {
$query->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.
*
* <code>
* $obj = $c->findPk(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildCategoryAssociatedContent|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CategoryAssociatedContentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(CategoryAssociatedContentTableMap::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 ChildCategoryAssociatedContent A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CATEGORY_ID, CONTENT_ID, POSITION, CREATED_AT, UPDATED_AT FROM category_associated_content 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 ChildCategoryAssociatedContent();
$obj->hydrate($row);
CategoryAssociatedContentTableMap::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 ChildCategoryAssociatedContent|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
* <code>
* $objs = $c->findPks(array(12, 56, 832), $con);
* </code>
* @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 ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CategoryAssociatedContentTableMap::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 ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CategoryAssociatedContentTableMap::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @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 ChildCategoryAssociatedContentQuery 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(CategoryAssociatedContentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryAssociatedContentTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the category_id column
*
* Example usage:
* <code>
* $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
* </code>
*
* @see filterByCategory()
*
* @param mixed $categoryId 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 ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function filterByCategoryId($categoryId = null, $comparison = null)
{
if (is_array($categoryId)) {
$useMinMax = false;
if (isset($categoryId['min'])) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($categoryId['max'])) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryAssociatedContentTableMap::CATEGORY_ID, $categoryId, $comparison);
}
/**
* Filter the query on the content_id column
*
* Example usage:
* <code>
* $query->filterByContentId(1234); // WHERE content_id = 1234
* $query->filterByContentId(array(12, 34)); // WHERE content_id IN (12, 34)
* $query->filterByContentId(array('min' => 12)); // WHERE content_id > 12
* </code>
*
* @see filterByContent()
*
* @param mixed $contentId 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 ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function filterByContentId($contentId = null, $comparison = null)
{
if (is_array($contentId)) {
$useMinMax = false;
if (isset($contentId['min'])) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($contentId['max'])) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryAssociatedContentTableMap::CONTENT_ID, $contentId, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @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 ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($position)) {
$useMinMax = false;
if (isset($position['min'])) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryAssociatedContentTableMap::POSITION, $position, $comparison);
}
/**
* Filter the query on the created_at column
*
* Example usage:
* <code>
* $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'
* </code>
*
* @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 ChildCategoryAssociatedContentQuery 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(CategoryAssociatedContentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryAssociatedContentTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
* Filter the query on the updated_at column
*
* Example usage:
* <code>
* $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'
* </code>
*
* @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 ChildCategoryAssociatedContentQuery 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(CategoryAssociatedContentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryAssociatedContentTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Category object
*
* @param \Thelia\Model\Category|ObjectCollection $category The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function filterByCategory($category, $comparison = null)
{
if ($category instanceof \Thelia\Model\Category) {
return $this
->addUsingAlias(CategoryAssociatedContentTableMap::CATEGORY_ID, $category->getId(), $comparison);
} elseif ($category instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CategoryAssociatedContentTableMap::CATEGORY_ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCategory() only accepts arguments of type \Thelia\Model\Category or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Category relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function joinCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Category');
// 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, 'Category');
}
return $this;
}
/**
* Use the Category relation Category 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\CategoryQuery A secondary query class using the current class as primary query
*/
public function useCategoryQuery($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\Content object
*
* @param \Thelia\Model\Content|ObjectCollection $content The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function filterByContent($content, $comparison = null)
{
if ($content instanceof \Thelia\Model\Content) {
return $this
->addUsingAlias(CategoryAssociatedContentTableMap::CONTENT_ID, $content->getId(), $comparison);
} elseif ($content instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CategoryAssociatedContentTableMap::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByContent() only accepts arguments of type \Thelia\Model\Content or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Content relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function joinContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Content');
// 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, 'Content');
}
return $this;
}
/**
* Use the Content relation Content 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\ContentQuery A secondary query class using the current class as primary query
*/
public function useContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Content', '\Thelia\Model\ContentQuery');
}
/**
* Exclude object from result
*
* @param ChildCategoryAssociatedContent $categoryAssociatedContent Object to remove from the list of results
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function prune($categoryAssociatedContent = null)
{
if ($categoryAssociatedContent) {
$this->addUsingAlias(CategoryAssociatedContentTableMap::ID, $categoryAssociatedContent->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the category_associated_content 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(CategoryAssociatedContentTableMap::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).
CategoryAssociatedContentTableMap::clearInstancePool();
CategoryAssociatedContentTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCategoryAssociatedContent or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCategoryAssociatedContent 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(CategoryAssociatedContentTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CategoryAssociatedContentTableMap::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();
CategoryAssociatedContentTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CategoryAssociatedContentTableMap::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 ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(CategoryAssociatedContentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(CategoryAssociatedContentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(CategoryAssociatedContentTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(CategoryAssociatedContentTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(CategoryAssociatedContentTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildCategoryAssociatedContentQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(CategoryAssociatedContentTableMap::CREATED_AT);
}
} // CategoryAssociatedContentQuery

View File

@@ -58,10 +58,6 @@ use Thelia\Model\Map\CategoryTableMap;
* @method ChildCategoryQuery rightJoinAttributeCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCategory relation
* @method ChildCategoryQuery innerJoinAttributeCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCategory relation
*
* @method ChildCategoryQuery leftJoinContentAssoc($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentAssoc relation
* @method ChildCategoryQuery rightJoinContentAssoc($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentAssoc relation
* @method ChildCategoryQuery innerJoinContentAssoc($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentAssoc relation
*
* @method ChildCategoryQuery leftJoinRewriting($relationAlias = null) Adds a LEFT JOIN clause to the query using the Rewriting relation
* @method ChildCategoryQuery rightJoinRewriting($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Rewriting relation
* @method ChildCategoryQuery innerJoinRewriting($relationAlias = null) Adds a INNER JOIN clause to the query using the Rewriting relation
@@ -74,6 +70,10 @@ use Thelia\Model\Map\CategoryTableMap;
* @method ChildCategoryQuery rightJoinCategoryDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryDocument relation
* @method ChildCategoryQuery innerJoinCategoryDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryDocument relation
*
* @method ChildCategoryQuery leftJoinCategoryAssociatedContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryAssociatedContent relation
* @method ChildCategoryQuery rightJoinCategoryAssociatedContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryAssociatedContent relation
* @method ChildCategoryQuery innerJoinCategoryAssociatedContent($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryAssociatedContent relation
*
* @method ChildCategoryQuery leftJoinCategoryI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryI18n relation
* @method ChildCategoryQuery rightJoinCategoryI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryI18n relation
* @method ChildCategoryQuery innerJoinCategoryI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryI18n relation
@@ -870,79 +870,6 @@ abstract class CategoryQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'AttributeCategory', '\Thelia\Model\AttributeCategoryQuery');
}
/**
* Filter the query by a related \Thelia\Model\ContentAssoc object
*
* @param \Thelia\Model\ContentAssoc|ObjectCollection $contentAssoc the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryQuery The current query, for fluid interface
*/
public function filterByContentAssoc($contentAssoc, $comparison = null)
{
if ($contentAssoc instanceof \Thelia\Model\ContentAssoc) {
return $this
->addUsingAlias(CategoryTableMap::ID, $contentAssoc->getCategoryId(), $comparison);
} elseif ($contentAssoc instanceof ObjectCollection) {
return $this
->useContentAssocQuery()
->filterByPrimaryKeys($contentAssoc->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByContentAssoc() only accepts arguments of type \Thelia\Model\ContentAssoc or Collection');
}
}
/**
* Adds a JOIN clause to the query using the ContentAssoc relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCategoryQuery The current query, for fluid interface
*/
public function joinContentAssoc($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ContentAssoc');
// 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, 'ContentAssoc');
}
return $this;
}
/**
* Use the ContentAssoc relation ContentAssoc 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\ContentAssocQuery A secondary query class using the current class as primary query
*/
public function useContentAssocQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinContentAssoc($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ContentAssoc', '\Thelia\Model\ContentAssocQuery');
}
/**
* Filter the query by a related \Thelia\Model\Rewriting object
*
@@ -1162,6 +1089,79 @@ abstract class CategoryQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'CategoryDocument', '\Thelia\Model\CategoryDocumentQuery');
}
/**
* Filter the query by a related \Thelia\Model\CategoryAssociatedContent object
*
* @param \Thelia\Model\CategoryAssociatedContent|ObjectCollection $categoryAssociatedContent the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryQuery The current query, for fluid interface
*/
public function filterByCategoryAssociatedContent($categoryAssociatedContent, $comparison = null)
{
if ($categoryAssociatedContent instanceof \Thelia\Model\CategoryAssociatedContent) {
return $this
->addUsingAlias(CategoryTableMap::ID, $categoryAssociatedContent->getCategoryId(), $comparison);
} elseif ($categoryAssociatedContent instanceof ObjectCollection) {
return $this
->useCategoryAssociatedContentQuery()
->filterByPrimaryKeys($categoryAssociatedContent->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByCategoryAssociatedContent() only accepts arguments of type \Thelia\Model\CategoryAssociatedContent or Collection');
}
}
/**
* Adds a JOIN clause to the query using the CategoryAssociatedContent relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCategoryQuery The current query, for fluid interface
*/
public function joinCategoryAssociatedContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CategoryAssociatedContent');
// 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, 'CategoryAssociatedContent');
}
return $this;
}
/**
* Use the CategoryAssociatedContent relation CategoryAssociatedContent 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\CategoryAssociatedContentQuery A secondary query class using the current class as primary query
*/
public function useCategoryAssociatedContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCategoryAssociatedContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CategoryAssociatedContent', '\Thelia\Model\CategoryAssociatedContentQuery');
}
/**
* Filter the query by a related \Thelia\Model\CategoryI18n object
*

File diff suppressed because it is too large Load Diff

View File

@@ -44,10 +44,6 @@ use Thelia\Model\Map\ContentTableMap;
* @method ChildContentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildContentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildContentQuery leftJoinContentAssoc($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentAssoc relation
* @method ChildContentQuery rightJoinContentAssoc($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentAssoc relation
* @method ChildContentQuery innerJoinContentAssoc($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentAssoc relation
*
* @method ChildContentQuery leftJoinRewriting($relationAlias = null) Adds a LEFT JOIN clause to the query using the Rewriting relation
* @method ChildContentQuery rightJoinRewriting($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Rewriting relation
* @method ChildContentQuery innerJoinRewriting($relationAlias = null) Adds a INNER JOIN clause to the query using the Rewriting relation
@@ -64,6 +60,14 @@ use Thelia\Model\Map\ContentTableMap;
* @method ChildContentQuery rightJoinContentDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentDocument relation
* @method ChildContentQuery innerJoinContentDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentDocument relation
*
* @method ChildContentQuery leftJoinProductAssociatedContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductAssociatedContent relation
* @method ChildContentQuery rightJoinProductAssociatedContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductAssociatedContent relation
* @method ChildContentQuery innerJoinProductAssociatedContent($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductAssociatedContent relation
*
* @method ChildContentQuery leftJoinCategoryAssociatedContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryAssociatedContent relation
* @method ChildContentQuery rightJoinCategoryAssociatedContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryAssociatedContent relation
* @method ChildContentQuery innerJoinCategoryAssociatedContent($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryAssociatedContent relation
*
* @method ChildContentQuery leftJoinContentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentI18n relation
* @method ChildContentQuery rightJoinContentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentI18n relation
* @method ChildContentQuery innerJoinContentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentI18n relation
@@ -598,79 +602,6 @@ abstract class ContentQuery extends ModelCriteria
return $this->addUsingAlias(ContentTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\ContentAssoc object
*
* @param \Thelia\Model\ContentAssoc|ObjectCollection $contentAssoc the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentQuery The current query, for fluid interface
*/
public function filterByContentAssoc($contentAssoc, $comparison = null)
{
if ($contentAssoc instanceof \Thelia\Model\ContentAssoc) {
return $this
->addUsingAlias(ContentTableMap::ID, $contentAssoc->getContentId(), $comparison);
} elseif ($contentAssoc instanceof ObjectCollection) {
return $this
->useContentAssocQuery()
->filterByPrimaryKeys($contentAssoc->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByContentAssoc() only accepts arguments of type \Thelia\Model\ContentAssoc or Collection');
}
}
/**
* Adds a JOIN clause to the query using the ContentAssoc relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildContentQuery The current query, for fluid interface
*/
public function joinContentAssoc($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ContentAssoc');
// 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, 'ContentAssoc');
}
return $this;
}
/**
* Use the ContentAssoc relation ContentAssoc 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\ContentAssocQuery A secondary query class using the current class as primary query
*/
public function useContentAssocQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinContentAssoc($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ContentAssoc', '\Thelia\Model\ContentAssocQuery');
}
/**
* Filter the query by a related \Thelia\Model\Rewriting object
*
@@ -963,6 +894,152 @@ abstract class ContentQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'ContentDocument', '\Thelia\Model\ContentDocumentQuery');
}
/**
* Filter the query by a related \Thelia\Model\ProductAssociatedContent object
*
* @param \Thelia\Model\ProductAssociatedContent|ObjectCollection $productAssociatedContent the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentQuery The current query, for fluid interface
*/
public function filterByProductAssociatedContent($productAssociatedContent, $comparison = null)
{
if ($productAssociatedContent instanceof \Thelia\Model\ProductAssociatedContent) {
return $this
->addUsingAlias(ContentTableMap::ID, $productAssociatedContent->getContentId(), $comparison);
} elseif ($productAssociatedContent instanceof ObjectCollection) {
return $this
->useProductAssociatedContentQuery()
->filterByPrimaryKeys($productAssociatedContent->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByProductAssociatedContent() only accepts arguments of type \Thelia\Model\ProductAssociatedContent or Collection');
}
}
/**
* Adds a JOIN clause to the query using the ProductAssociatedContent relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildContentQuery The current query, for fluid interface
*/
public function joinProductAssociatedContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ProductAssociatedContent');
// 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, 'ProductAssociatedContent');
}
return $this;
}
/**
* Use the ProductAssociatedContent relation ProductAssociatedContent 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\ProductAssociatedContentQuery A secondary query class using the current class as primary query
*/
public function useProductAssociatedContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinProductAssociatedContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ProductAssociatedContent', '\Thelia\Model\ProductAssociatedContentQuery');
}
/**
* Filter the query by a related \Thelia\Model\CategoryAssociatedContent object
*
* @param \Thelia\Model\CategoryAssociatedContent|ObjectCollection $categoryAssociatedContent the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentQuery The current query, for fluid interface
*/
public function filterByCategoryAssociatedContent($categoryAssociatedContent, $comparison = null)
{
if ($categoryAssociatedContent instanceof \Thelia\Model\CategoryAssociatedContent) {
return $this
->addUsingAlias(ContentTableMap::ID, $categoryAssociatedContent->getContentId(), $comparison);
} elseif ($categoryAssociatedContent instanceof ObjectCollection) {
return $this
->useCategoryAssociatedContentQuery()
->filterByPrimaryKeys($categoryAssociatedContent->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByCategoryAssociatedContent() only accepts arguments of type \Thelia\Model\CategoryAssociatedContent or Collection');
}
}
/**
* Adds a JOIN clause to the query using the CategoryAssociatedContent relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildContentQuery The current query, for fluid interface
*/
public function joinCategoryAssociatedContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CategoryAssociatedContent');
// 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, 'CategoryAssociatedContent');
}
return $this;
}
/**
* Use the CategoryAssociatedContent relation CategoryAssociatedContent 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\CategoryAssociatedContentQuery A secondary query class using the current class as primary query
*/
public function useCategoryAssociatedContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCategoryAssociatedContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CategoryAssociatedContent', '\Thelia\Model\CategoryAssociatedContentQuery');
}
/**
* Filter the query by a related \Thelia\Model\ContentI18n object
*

View File

@@ -99,10 +99,10 @@ abstract class Coupon implements ActiveRecordInterface
protected $description;
/**
* The value for the value field.
* The value for the amount field.
* @var double
*/
protected $value;
protected $amount;
/**
* The value for the is_used field.
@@ -123,10 +123,28 @@ abstract class Coupon implements ActiveRecordInterface
protected $expiration_date;
/**
* The value for the serialized_rules field.
* The value for the serialized_rules_type field.
* @var string
*/
protected $serialized_rules;
protected $serialized_rules_type;
/**
* The value for the serialized_rules_content field.
* @var string
*/
protected $serialized_rules_content;
/**
* The value for the is_cumulative field.
* @var int
*/
protected $is_cumulative;
/**
* The value for the is_removing_postage field.
* @var int
*/
protected $is_removing_postage;
/**
* The value for the created_at field.
@@ -547,14 +565,14 @@ abstract class Coupon implements ActiveRecordInterface
}
/**
* Get the [value] column value.
* Get the [amount] column value.
*
* @return double
*/
public function getValue()
public function getAmount()
{
return $this->value;
return $this->amount;
}
/**
@@ -600,14 +618,47 @@ abstract class Coupon implements ActiveRecordInterface
}
/**
* Get the [serialized_rules] column value.
* Get the [serialized_rules_type] column value.
*
* @return string
*/
public function getSerializedRules()
public function getSerializedRulesType()
{
return $this->serialized_rules;
return $this->serialized_rules_type;
}
/**
* Get the [serialized_rules_content] column value.
*
* @return string
*/
public function getSerializedRulesContent()
{
return $this->serialized_rules_content;
}
/**
* Get the [is_cumulative] column value.
*
* @return int
*/
public function getIsCumulative()
{
return $this->is_cumulative;
}
/**
* Get the [is_removing_postage] column value.
*
* @return int
*/
public function getIsRemovingPostage()
{
return $this->is_removing_postage;
}
/**
@@ -788,25 +839,25 @@ abstract class Coupon implements ActiveRecordInterface
} // setDescription()
/**
* Set the value of [value] column.
* Set the value of [amount] column.
*
* @param double $v new value
* @return \Thelia\Model\Coupon The current object (for fluent API support)
*/
public function setValue($v)
public function setAmount($v)
{
if ($v !== null) {
$v = (double) $v;
}
if ($this->value !== $v) {
$this->value = $v;
$this->modifiedColumns[] = CouponTableMap::VALUE;
if ($this->amount !== $v) {
$this->amount = $v;
$this->modifiedColumns[] = CouponTableMap::AMOUNT;
}
return $this;
} // setValue()
} // setAmount()
/**
* Set the value of [is_used] column.
@@ -872,25 +923,88 @@ abstract class Coupon implements ActiveRecordInterface
} // setExpirationDate()
/**
* Set the value of [serialized_rules] column.
* Set the value of [serialized_rules_type] column.
*
* @param string $v new value
* @return \Thelia\Model\Coupon The current object (for fluent API support)
*/
public function setSerializedRules($v)
public function setSerializedRulesType($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->serialized_rules !== $v) {
$this->serialized_rules = $v;
$this->modifiedColumns[] = CouponTableMap::SERIALIZED_RULES;
if ($this->serialized_rules_type !== $v) {
$this->serialized_rules_type = $v;
$this->modifiedColumns[] = CouponTableMap::SERIALIZED_RULES_TYPE;
}
return $this;
} // setSerializedRules()
} // setSerializedRulesType()
/**
* Set the value of [serialized_rules_content] column.
*
* @param string $v new value
* @return \Thelia\Model\Coupon The current object (for fluent API support)
*/
public function setSerializedRulesContent($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->serialized_rules_content !== $v) {
$this->serialized_rules_content = $v;
$this->modifiedColumns[] = CouponTableMap::SERIALIZED_RULES_CONTENT;
}
return $this;
} // setSerializedRulesContent()
/**
* Set the value of [is_cumulative] column.
*
* @param int $v new value
* @return \Thelia\Model\Coupon The current object (for fluent API support)
*/
public function setIsCumulative($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->is_cumulative !== $v) {
$this->is_cumulative = $v;
$this->modifiedColumns[] = CouponTableMap::IS_CUMULATIVE;
}
return $this;
} // setIsCumulative()
/**
* Set the value of [is_removing_postage] column.
*
* @param int $v new value
* @return \Thelia\Model\Coupon The current object (for fluent API support)
*/
public function setIsRemovingPostage($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->is_removing_postage !== $v) {
$this->is_removing_postage = $v;
$this->modifiedColumns[] = CouponTableMap::IS_REMOVING_POSTAGE;
}
return $this;
} // setIsRemovingPostage()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
@@ -1014,8 +1128,8 @@ abstract class Coupon implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CouponTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
$this->description = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CouponTableMap::translateFieldName('Value', TableMap::TYPE_PHPNAME, $indexType)];
$this->value = (null !== $col) ? (double) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CouponTableMap::translateFieldName('Amount', TableMap::TYPE_PHPNAME, $indexType)];
$this->amount = (null !== $col) ? (double) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CouponTableMap::translateFieldName('IsUsed', TableMap::TYPE_PHPNAME, $indexType)];
$this->is_used = (null !== $col) ? (int) $col : null;
@@ -1029,22 +1143,31 @@ abstract class Coupon implements ActiveRecordInterface
}
$this->expiration_date = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CouponTableMap::translateFieldName('SerializedRules', TableMap::TYPE_PHPNAME, $indexType)];
$this->serialized_rules = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CouponTableMap::translateFieldName('SerializedRulesType', TableMap::TYPE_PHPNAME, $indexType)];
$this->serialized_rules_type = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CouponTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CouponTableMap::translateFieldName('SerializedRulesContent', TableMap::TYPE_PHPNAME, $indexType)];
$this->serialized_rules_content = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : CouponTableMap::translateFieldName('IsCumulative', TableMap::TYPE_PHPNAME, $indexType)];
$this->is_cumulative = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : CouponTableMap::translateFieldName('IsRemovingPostage', TableMap::TYPE_PHPNAME, $indexType)];
$this->is_removing_postage = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : CouponTableMap::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 ? 12 + $startcol : CouponTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : CouponTableMap::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 ? 13 + $startcol : CouponTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : CouponTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
$this->version = (null !== $col) ? (int) $col : null;
$this->resetModified();
@@ -1054,7 +1177,7 @@ abstract class Coupon implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 14; // 14 = CouponTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 17; // 17 = CouponTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\Coupon object", 0, $e);
@@ -1358,8 +1481,8 @@ abstract class Coupon implements ActiveRecordInterface
if ($this->isColumnModified(CouponTableMap::DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
}
if ($this->isColumnModified(CouponTableMap::VALUE)) {
$modifiedColumns[':p' . $index++] = 'VALUE';
if ($this->isColumnModified(CouponTableMap::AMOUNT)) {
$modifiedColumns[':p' . $index++] = 'AMOUNT';
}
if ($this->isColumnModified(CouponTableMap::IS_USED)) {
$modifiedColumns[':p' . $index++] = 'IS_USED';
@@ -1370,8 +1493,17 @@ abstract class Coupon implements ActiveRecordInterface
if ($this->isColumnModified(CouponTableMap::EXPIRATION_DATE)) {
$modifiedColumns[':p' . $index++] = 'EXPIRATION_DATE';
}
if ($this->isColumnModified(CouponTableMap::SERIALIZED_RULES)) {
$modifiedColumns[':p' . $index++] = 'SERIALIZED_RULES';
if ($this->isColumnModified(CouponTableMap::SERIALIZED_RULES_TYPE)) {
$modifiedColumns[':p' . $index++] = 'SERIALIZED_RULES_TYPE';
}
if ($this->isColumnModified(CouponTableMap::SERIALIZED_RULES_CONTENT)) {
$modifiedColumns[':p' . $index++] = 'SERIALIZED_RULES_CONTENT';
}
if ($this->isColumnModified(CouponTableMap::IS_CUMULATIVE)) {
$modifiedColumns[':p' . $index++] = 'IS_CUMULATIVE';
}
if ($this->isColumnModified(CouponTableMap::IS_REMOVING_POSTAGE)) {
$modifiedColumns[':p' . $index++] = 'IS_REMOVING_POSTAGE';
}
if ($this->isColumnModified(CouponTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
@@ -1411,8 +1543,8 @@ abstract class Coupon implements ActiveRecordInterface
case 'DESCRIPTION':
$stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
break;
case 'VALUE':
$stmt->bindValue($identifier, $this->value, PDO::PARAM_STR);
case 'AMOUNT':
$stmt->bindValue($identifier, $this->amount, PDO::PARAM_STR);
break;
case 'IS_USED':
$stmt->bindValue($identifier, $this->is_used, PDO::PARAM_INT);
@@ -1423,8 +1555,17 @@ abstract class Coupon implements ActiveRecordInterface
case 'EXPIRATION_DATE':
$stmt->bindValue($identifier, $this->expiration_date ? $this->expiration_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break;
case 'SERIALIZED_RULES':
$stmt->bindValue($identifier, $this->serialized_rules, PDO::PARAM_STR);
case 'SERIALIZED_RULES_TYPE':
$stmt->bindValue($identifier, $this->serialized_rules_type, PDO::PARAM_STR);
break;
case 'SERIALIZED_RULES_CONTENT':
$stmt->bindValue($identifier, $this->serialized_rules_content, PDO::PARAM_STR);
break;
case 'IS_CUMULATIVE':
$stmt->bindValue($identifier, $this->is_cumulative, PDO::PARAM_INT);
break;
case 'IS_REMOVING_POSTAGE':
$stmt->bindValue($identifier, $this->is_removing_postage, 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);
@@ -1516,7 +1657,7 @@ abstract class Coupon implements ActiveRecordInterface
return $this->getDescription();
break;
case 6:
return $this->getValue();
return $this->getAmount();
break;
case 7:
return $this->getIsUsed();
@@ -1528,15 +1669,24 @@ abstract class Coupon implements ActiveRecordInterface
return $this->getExpirationDate();
break;
case 10:
return $this->getSerializedRules();
return $this->getSerializedRulesType();
break;
case 11:
return $this->getCreatedAt();
return $this->getSerializedRulesContent();
break;
case 12:
return $this->getUpdatedAt();
return $this->getIsCumulative();
break;
case 13:
return $this->getIsRemovingPostage();
break;
case 14:
return $this->getCreatedAt();
break;
case 15:
return $this->getUpdatedAt();
break;
case 16:
return $this->getVersion();
break;
default:
@@ -1574,14 +1724,17 @@ abstract class Coupon implements ActiveRecordInterface
$keys[3] => $this->getTitle(),
$keys[4] => $this->getShortDescription(),
$keys[5] => $this->getDescription(),
$keys[6] => $this->getValue(),
$keys[6] => $this->getAmount(),
$keys[7] => $this->getIsUsed(),
$keys[8] => $this->getIsEnabled(),
$keys[9] => $this->getExpirationDate(),
$keys[10] => $this->getSerializedRules(),
$keys[11] => $this->getCreatedAt(),
$keys[12] => $this->getUpdatedAt(),
$keys[13] => $this->getVersion(),
$keys[10] => $this->getSerializedRulesType(),
$keys[11] => $this->getSerializedRulesContent(),
$keys[12] => $this->getIsCumulative(),
$keys[13] => $this->getIsRemovingPostage(),
$keys[14] => $this->getCreatedAt(),
$keys[15] => $this->getUpdatedAt(),
$keys[16] => $this->getVersion(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1652,7 +1805,7 @@ abstract class Coupon implements ActiveRecordInterface
$this->setDescription($value);
break;
case 6:
$this->setValue($value);
$this->setAmount($value);
break;
case 7:
$this->setIsUsed($value);
@@ -1664,15 +1817,24 @@ abstract class Coupon implements ActiveRecordInterface
$this->setExpirationDate($value);
break;
case 10:
$this->setSerializedRules($value);
$this->setSerializedRulesType($value);
break;
case 11:
$this->setCreatedAt($value);
$this->setSerializedRulesContent($value);
break;
case 12:
$this->setUpdatedAt($value);
$this->setIsCumulative($value);
break;
case 13:
$this->setIsRemovingPostage($value);
break;
case 14:
$this->setCreatedAt($value);
break;
case 15:
$this->setUpdatedAt($value);
break;
case 16:
$this->setVersion($value);
break;
} // switch()
@@ -1705,14 +1867,17 @@ abstract class Coupon implements ActiveRecordInterface
if (array_key_exists($keys[3], $arr)) $this->setTitle($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setShortDescription($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDescription($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setValue($arr[$keys[6]]);
if (array_key_exists($keys[6], $arr)) $this->setAmount($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setIsUsed($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setIsEnabled($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setExpirationDate($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setSerializedRules($arr[$keys[10]]);
if (array_key_exists($keys[11], $arr)) $this->setCreatedAt($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setUpdatedAt($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setVersion($arr[$keys[13]]);
if (array_key_exists($keys[10], $arr)) $this->setSerializedRulesType($arr[$keys[10]]);
if (array_key_exists($keys[11], $arr)) $this->setSerializedRulesContent($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setIsCumulative($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setIsRemovingPostage($arr[$keys[13]]);
if (array_key_exists($keys[14], $arr)) $this->setCreatedAt($arr[$keys[14]]);
if (array_key_exists($keys[15], $arr)) $this->setUpdatedAt($arr[$keys[15]]);
if (array_key_exists($keys[16], $arr)) $this->setVersion($arr[$keys[16]]);
}
/**
@@ -1730,11 +1895,14 @@ abstract class Coupon implements ActiveRecordInterface
if ($this->isColumnModified(CouponTableMap::TITLE)) $criteria->add(CouponTableMap::TITLE, $this->title);
if ($this->isColumnModified(CouponTableMap::SHORT_DESCRIPTION)) $criteria->add(CouponTableMap::SHORT_DESCRIPTION, $this->short_description);
if ($this->isColumnModified(CouponTableMap::DESCRIPTION)) $criteria->add(CouponTableMap::DESCRIPTION, $this->description);
if ($this->isColumnModified(CouponTableMap::VALUE)) $criteria->add(CouponTableMap::VALUE, $this->value);
if ($this->isColumnModified(CouponTableMap::AMOUNT)) $criteria->add(CouponTableMap::AMOUNT, $this->amount);
if ($this->isColumnModified(CouponTableMap::IS_USED)) $criteria->add(CouponTableMap::IS_USED, $this->is_used);
if ($this->isColumnModified(CouponTableMap::IS_ENABLED)) $criteria->add(CouponTableMap::IS_ENABLED, $this->is_enabled);
if ($this->isColumnModified(CouponTableMap::EXPIRATION_DATE)) $criteria->add(CouponTableMap::EXPIRATION_DATE, $this->expiration_date);
if ($this->isColumnModified(CouponTableMap::SERIALIZED_RULES)) $criteria->add(CouponTableMap::SERIALIZED_RULES, $this->serialized_rules);
if ($this->isColumnModified(CouponTableMap::SERIALIZED_RULES_TYPE)) $criteria->add(CouponTableMap::SERIALIZED_RULES_TYPE, $this->serialized_rules_type);
if ($this->isColumnModified(CouponTableMap::SERIALIZED_RULES_CONTENT)) $criteria->add(CouponTableMap::SERIALIZED_RULES_CONTENT, $this->serialized_rules_content);
if ($this->isColumnModified(CouponTableMap::IS_CUMULATIVE)) $criteria->add(CouponTableMap::IS_CUMULATIVE, $this->is_cumulative);
if ($this->isColumnModified(CouponTableMap::IS_REMOVING_POSTAGE)) $criteria->add(CouponTableMap::IS_REMOVING_POSTAGE, $this->is_removing_postage);
if ($this->isColumnModified(CouponTableMap::CREATED_AT)) $criteria->add(CouponTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(CouponTableMap::UPDATED_AT)) $criteria->add(CouponTableMap::UPDATED_AT, $this->updated_at);
if ($this->isColumnModified(CouponTableMap::VERSION)) $criteria->add(CouponTableMap::VERSION, $this->version);
@@ -1806,11 +1974,14 @@ abstract class Coupon implements ActiveRecordInterface
$copyObj->setTitle($this->getTitle());
$copyObj->setShortDescription($this->getShortDescription());
$copyObj->setDescription($this->getDescription());
$copyObj->setValue($this->getValue());
$copyObj->setAmount($this->getAmount());
$copyObj->setIsUsed($this->getIsUsed());
$copyObj->setIsEnabled($this->getIsEnabled());
$copyObj->setExpirationDate($this->getExpirationDate());
$copyObj->setSerializedRules($this->getSerializedRules());
$copyObj->setSerializedRulesType($this->getSerializedRulesType());
$copyObj->setSerializedRulesContent($this->getSerializedRulesContent());
$copyObj->setIsCumulative($this->getIsCumulative());
$copyObj->setIsRemovingPostage($this->getIsRemovingPostage());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
$copyObj->setVersion($this->getVersion());
@@ -2590,11 +2761,14 @@ abstract class Coupon implements ActiveRecordInterface
$this->title = null;
$this->short_description = null;
$this->description = null;
$this->value = null;
$this->amount = null;
$this->is_used = null;
$this->is_enabled = null;
$this->expiration_date = null;
$this->serialized_rules = null;
$this->serialized_rules_type = null;
$this->serialized_rules_content = null;
$this->is_cumulative = null;
$this->is_removing_postage = null;
$this->created_at = null;
$this->updated_at = null;
$this->version = null;
@@ -2830,11 +3004,14 @@ abstract class Coupon implements ActiveRecordInterface
$version->setTitle($this->getTitle());
$version->setShortDescription($this->getShortDescription());
$version->setDescription($this->getDescription());
$version->setValue($this->getValue());
$version->setAmount($this->getAmount());
$version->setIsUsed($this->getIsUsed());
$version->setIsEnabled($this->getIsEnabled());
$version->setExpirationDate($this->getExpirationDate());
$version->setSerializedRules($this->getSerializedRules());
$version->setSerializedRulesType($this->getSerializedRulesType());
$version->setSerializedRulesContent($this->getSerializedRulesContent());
$version->setIsCumulative($this->getIsCumulative());
$version->setIsRemovingPostage($this->getIsRemovingPostage());
$version->setCreatedAt($this->getCreatedAt());
$version->setUpdatedAt($this->getUpdatedAt());
$version->setVersion($this->getVersion());
@@ -2881,11 +3058,14 @@ abstract class Coupon implements ActiveRecordInterface
$this->setTitle($version->getTitle());
$this->setShortDescription($version->getShortDescription());
$this->setDescription($version->getDescription());
$this->setValue($version->getValue());
$this->setAmount($version->getAmount());
$this->setIsUsed($version->getIsUsed());
$this->setIsEnabled($version->getIsEnabled());
$this->setExpirationDate($version->getExpirationDate());
$this->setSerializedRules($version->getSerializedRules());
$this->setSerializedRulesType($version->getSerializedRulesType());
$this->setSerializedRulesContent($version->getSerializedRulesContent());
$this->setIsCumulative($version->getIsCumulative());
$this->setIsRemovingPostage($version->getIsRemovingPostage());
$this->setCreatedAt($version->getCreatedAt());
$this->setUpdatedAt($version->getUpdatedAt());
$this->setVersion($version->getVersion());

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,475 @@
<?php
namespace Thelia\Model\Base;
use \Exception;
use \PDO;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\CouponI18n as ChildCouponI18n;
use Thelia\Model\CouponI18nQuery as ChildCouponI18nQuery;
use Thelia\Model\Map\CouponI18nTableMap;
/**
* Base class that represents a query for the 'coupon_i18n' table.
*
*
*
* @method ChildCouponI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCouponI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
*
* @method ChildCouponI18nQuery groupById() Group by the id column
* @method ChildCouponI18nQuery groupByLocale() Group by the locale column
*
* @method ChildCouponI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCouponI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCouponI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCouponI18nQuery leftJoinCoupon($relationAlias = null) Adds a LEFT JOIN clause to the query using the Coupon relation
* @method ChildCouponI18nQuery rightJoinCoupon($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Coupon relation
* @method ChildCouponI18nQuery innerJoinCoupon($relationAlias = null) Adds a INNER JOIN clause to the query using the Coupon relation
*
* @method ChildCouponI18n findOne(ConnectionInterface $con = null) Return the first ChildCouponI18n matching the query
* @method ChildCouponI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCouponI18n matching the query, or a new ChildCouponI18n object populated from the query conditions when no match is found
*
* @method ChildCouponI18n findOneById(int $id) Return the first ChildCouponI18n filtered by the id column
* @method ChildCouponI18n findOneByLocale(string $locale) Return the first ChildCouponI18n filtered by the locale column
*
* @method array findById(int $id) Return ChildCouponI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildCouponI18n objects filtered by the locale column
*
*/
abstract class CouponI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CouponI18nQuery 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\\CouponI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCouponI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCouponI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CouponI18nQuery) {
return $criteria;
}
$query = new \Thelia\Model\CouponI18nQuery();
if (null !== $modelAlias) {
$query->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.
*
* <code>
* $obj = $c->findPk(array(12, 34), $con);
* </code>
*
* @param array[$id, $locale] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildCouponI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CouponI18nTableMap::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(CouponI18nTableMap::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 ChildCouponI18n A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, LOCALE FROM coupon_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 ChildCouponI18n();
$obj->hydrate($row);
CouponI18nTableMap::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 ChildCouponI18n|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
* <code>
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
* </code>
* @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 ChildCouponI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(CouponI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(CouponI18nTableMap::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 ChildCouponI18nQuery 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(CouponI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(CouponI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$this->addOr($cton0);
}
return $this;
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @see filterByCoupon()
*
* @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 ChildCouponI18nQuery 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(CouponI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CouponI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponI18nTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the locale column
*
* Example usage:
* <code>
* $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
* $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
* </code>
*
* @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 ChildCouponI18nQuery 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(CouponI18nTableMap::LOCALE, $locale, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Coupon object
*
* @param \Thelia\Model\Coupon|ObjectCollection $coupon The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponI18nQuery The current query, for fluid interface
*/
public function filterByCoupon($coupon, $comparison = null)
{
if ($coupon instanceof \Thelia\Model\Coupon) {
return $this
->addUsingAlias(CouponI18nTableMap::ID, $coupon->getId(), $comparison);
} elseif ($coupon instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CouponI18nTableMap::ID, $coupon->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCoupon() only accepts arguments of type \Thelia\Model\Coupon or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Coupon relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCouponI18nQuery The current query, for fluid interface
*/
public function joinCoupon($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Coupon');
// 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, 'Coupon');
}
return $this;
}
/**
* Use the Coupon relation Coupon 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\CouponQuery A secondary query class using the current class as primary query
*/
public function useCouponQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinCoupon($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Coupon', '\Thelia\Model\CouponQuery');
}
/**
* Exclude object from result
*
* @param ChildCouponI18n $couponI18n Object to remove from the list of results
*
* @return ChildCouponI18nQuery The current query, for fluid interface
*/
public function prune($couponI18n = null)
{
if ($couponI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(CouponI18nTableMap::ID), $couponI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(CouponI18nTableMap::LOCALE), $couponI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the coupon_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(CouponI18nTableMap::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).
CouponI18nTableMap::clearInstancePool();
CouponI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCouponI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCouponI18n 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(CouponI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CouponI18nTableMap::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();
CouponI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CouponI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // CouponI18nQuery

View File

@@ -28,11 +28,14 @@ use Thelia\Model\Map\CouponTableMap;
* @method ChildCouponQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildCouponQuery orderByShortDescription($order = Criteria::ASC) Order by the short_description column
* @method ChildCouponQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildCouponQuery orderByValue($order = Criteria::ASC) Order by the value column
* @method ChildCouponQuery orderByAmount($order = Criteria::ASC) Order by the amount column
* @method ChildCouponQuery orderByIsUsed($order = Criteria::ASC) Order by the is_used column
* @method ChildCouponQuery orderByIsEnabled($order = Criteria::ASC) Order by the is_enabled column
* @method ChildCouponQuery orderByExpirationDate($order = Criteria::ASC) Order by the expiration_date column
* @method ChildCouponQuery orderBySerializedRules($order = Criteria::ASC) Order by the serialized_rules column
* @method ChildCouponQuery orderBySerializedRulesType($order = Criteria::ASC) Order by the serialized_rules_type column
* @method ChildCouponQuery orderBySerializedRulesContent($order = Criteria::ASC) Order by the serialized_rules_content column
* @method ChildCouponQuery orderByIsCumulative($order = Criteria::ASC) Order by the is_cumulative column
* @method ChildCouponQuery orderByIsRemovingPostage($order = Criteria::ASC) Order by the is_removing_postage column
* @method ChildCouponQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCouponQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
* @method ChildCouponQuery orderByVersion($order = Criteria::ASC) Order by the version column
@@ -43,11 +46,14 @@ use Thelia\Model\Map\CouponTableMap;
* @method ChildCouponQuery groupByTitle() Group by the title column
* @method ChildCouponQuery groupByShortDescription() Group by the short_description column
* @method ChildCouponQuery groupByDescription() Group by the description column
* @method ChildCouponQuery groupByValue() Group by the value column
* @method ChildCouponQuery groupByAmount() Group by the amount column
* @method ChildCouponQuery groupByIsUsed() Group by the is_used column
* @method ChildCouponQuery groupByIsEnabled() Group by the is_enabled column
* @method ChildCouponQuery groupByExpirationDate() Group by the expiration_date column
* @method ChildCouponQuery groupBySerializedRules() Group by the serialized_rules column
* @method ChildCouponQuery groupBySerializedRulesType() Group by the serialized_rules_type column
* @method ChildCouponQuery groupBySerializedRulesContent() Group by the serialized_rules_content column
* @method ChildCouponQuery groupByIsCumulative() Group by the is_cumulative column
* @method ChildCouponQuery groupByIsRemovingPostage() Group by the is_removing_postage column
* @method ChildCouponQuery groupByCreatedAt() Group by the created_at column
* @method ChildCouponQuery groupByUpdatedAt() Group by the updated_at column
* @method ChildCouponQuery groupByVersion() Group by the version column
@@ -77,11 +83,14 @@ use Thelia\Model\Map\CouponTableMap;
* @method ChildCoupon findOneByTitle(string $title) Return the first ChildCoupon filtered by the title column
* @method ChildCoupon findOneByShortDescription(string $short_description) Return the first ChildCoupon filtered by the short_description column
* @method ChildCoupon findOneByDescription(string $description) Return the first ChildCoupon filtered by the description column
* @method ChildCoupon findOneByValue(double $value) Return the first ChildCoupon filtered by the value column
* @method ChildCoupon findOneByAmount(double $amount) Return the first ChildCoupon filtered by the amount column
* @method ChildCoupon findOneByIsUsed(int $is_used) Return the first ChildCoupon filtered by the is_used column
* @method ChildCoupon findOneByIsEnabled(int $is_enabled) Return the first ChildCoupon filtered by the is_enabled column
* @method ChildCoupon findOneByExpirationDate(string $expiration_date) Return the first ChildCoupon filtered by the expiration_date column
* @method ChildCoupon findOneBySerializedRules(string $serialized_rules) Return the first ChildCoupon filtered by the serialized_rules column
* @method ChildCoupon findOneBySerializedRulesType(string $serialized_rules_type) Return the first ChildCoupon filtered by the serialized_rules_type column
* @method ChildCoupon findOneBySerializedRulesContent(string $serialized_rules_content) Return the first ChildCoupon filtered by the serialized_rules_content column
* @method ChildCoupon findOneByIsCumulative(int $is_cumulative) Return the first ChildCoupon filtered by the is_cumulative column
* @method ChildCoupon findOneByIsRemovingPostage(int $is_removing_postage) Return the first ChildCoupon filtered by the is_removing_postage column
* @method ChildCoupon findOneByCreatedAt(string $created_at) Return the first ChildCoupon filtered by the created_at column
* @method ChildCoupon findOneByUpdatedAt(string $updated_at) Return the first ChildCoupon filtered by the updated_at column
* @method ChildCoupon findOneByVersion(int $version) Return the first ChildCoupon filtered by the version column
@@ -92,11 +101,14 @@ use Thelia\Model\Map\CouponTableMap;
* @method array findByTitle(string $title) Return ChildCoupon objects filtered by the title column
* @method array findByShortDescription(string $short_description) Return ChildCoupon objects filtered by the short_description column
* @method array findByDescription(string $description) Return ChildCoupon objects filtered by the description column
* @method array findByValue(double $value) Return ChildCoupon objects filtered by the value column
* @method array findByAmount(double $amount) Return ChildCoupon objects filtered by the amount column
* @method array findByIsUsed(int $is_used) Return ChildCoupon objects filtered by the is_used column
* @method array findByIsEnabled(int $is_enabled) Return ChildCoupon objects filtered by the is_enabled column
* @method array findByExpirationDate(string $expiration_date) Return ChildCoupon objects filtered by the expiration_date column
* @method array findBySerializedRules(string $serialized_rules) Return ChildCoupon objects filtered by the serialized_rules column
* @method array findBySerializedRulesType(string $serialized_rules_type) Return ChildCoupon objects filtered by the serialized_rules_type column
* @method array findBySerializedRulesContent(string $serialized_rules_content) Return ChildCoupon objects filtered by the serialized_rules_content column
* @method array findByIsCumulative(int $is_cumulative) Return ChildCoupon objects filtered by the is_cumulative column
* @method array findByIsRemovingPostage(int $is_removing_postage) Return ChildCoupon objects filtered by the is_removing_postage column
* @method array findByCreatedAt(string $created_at) Return ChildCoupon objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCoupon objects filtered by the updated_at column
* @method array findByVersion(int $version) Return ChildCoupon objects filtered by the version column
@@ -195,7 +207,7 @@ abstract class CouponQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CODE, TYPE, TITLE, SHORT_DESCRIPTION, DESCRIPTION, VALUE, IS_USED, IS_ENABLED, EXPIRATION_DATE, SERIALIZED_RULES, CREATED_AT, UPDATED_AT, VERSION FROM coupon WHERE ID = :p0';
$sql = 'SELECT ID, CODE, TYPE, TITLE, SHORT_DESCRIPTION, DESCRIPTION, AMOUNT, IS_USED, IS_ENABLED, EXPIRATION_DATE, SERIALIZED_RULES_TYPE, SERIALIZED_RULES_CONTENT, IS_CUMULATIVE, IS_REMOVING_POSTAGE, CREATED_AT, UPDATED_AT, VERSION FROM coupon WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -471,16 +483,16 @@ abstract class CouponQuery extends ModelCriteria
}
/**
* Filter the query on the value column
* Filter the query on the amount column
*
* Example usage:
* <code>
* $query->filterByValue(1234); // WHERE value = 1234
* $query->filterByValue(array(12, 34)); // WHERE value IN (12, 34)
* $query->filterByValue(array('min' => 12)); // WHERE value > 12
* $query->filterByAmount(1234); // WHERE amount = 1234
* $query->filterByAmount(array(12, 34)); // WHERE amount IN (12, 34)
* $query->filterByAmount(array('min' => 12)); // WHERE amount > 12
* </code>
*
* @param mixed $value The value to use as filter.
* @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.
@@ -488,16 +500,16 @@ abstract class CouponQuery extends ModelCriteria
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function filterByValue($value = null, $comparison = null)
public function filterByAmount($amount = null, $comparison = null)
{
if (is_array($value)) {
if (is_array($amount)) {
$useMinMax = false;
if (isset($value['min'])) {
$this->addUsingAlias(CouponTableMap::VALUE, $value['min'], Criteria::GREATER_EQUAL);
if (isset($amount['min'])) {
$this->addUsingAlias(CouponTableMap::AMOUNT, $amount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($value['max'])) {
$this->addUsingAlias(CouponTableMap::VALUE, $value['max'], Criteria::LESS_EQUAL);
if (isset($amount['max'])) {
$this->addUsingAlias(CouponTableMap::AMOUNT, $amount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -508,7 +520,7 @@ abstract class CouponQuery extends ModelCriteria
}
}
return $this->addUsingAlias(CouponTableMap::VALUE, $value, $comparison);
return $this->addUsingAlias(CouponTableMap::AMOUNT, $amount, $comparison);
}
/**
@@ -637,32 +649,143 @@ abstract class CouponQuery extends ModelCriteria
}
/**
* Filter the query on the serialized_rules column
* Filter the query on the serialized_rules_type column
*
* Example usage:
* <code>
* $query->filterBySerializedRules('fooValue'); // WHERE serialized_rules = 'fooValue'
* $query->filterBySerializedRules('%fooValue%'); // WHERE serialized_rules LIKE '%fooValue%'
* $query->filterBySerializedRulesType('fooValue'); // WHERE serialized_rules_type = 'fooValue'
* $query->filterBySerializedRulesType('%fooValue%'); // WHERE serialized_rules_type LIKE '%fooValue%'
* </code>
*
* @param string $serializedRules The value to use as filter.
* @param string $serializedRulesType 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 ChildCouponQuery The current query, for fluid interface
*/
public function filterBySerializedRules($serializedRules = null, $comparison = null)
public function filterBySerializedRulesType($serializedRulesType = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($serializedRules)) {
if (is_array($serializedRulesType)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $serializedRules)) {
$serializedRules = str_replace('*', '%', $serializedRules);
} elseif (preg_match('/[\%\*]/', $serializedRulesType)) {
$serializedRulesType = str_replace('*', '%', $serializedRulesType);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CouponTableMap::SERIALIZED_RULES, $serializedRules, $comparison);
return $this->addUsingAlias(CouponTableMap::SERIALIZED_RULES_TYPE, $serializedRulesType, $comparison);
}
/**
* Filter the query on the serialized_rules_content column
*
* Example usage:
* <code>
* $query->filterBySerializedRulesContent('fooValue'); // WHERE serialized_rules_content = 'fooValue'
* $query->filterBySerializedRulesContent('%fooValue%'); // WHERE serialized_rules_content LIKE '%fooValue%'
* </code>
*
* @param string $serializedRulesContent 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 ChildCouponQuery The current query, for fluid interface
*/
public function filterBySerializedRulesContent($serializedRulesContent = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($serializedRulesContent)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $serializedRulesContent)) {
$serializedRulesContent = str_replace('*', '%', $serializedRulesContent);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CouponTableMap::SERIALIZED_RULES_CONTENT, $serializedRulesContent, $comparison);
}
/**
* Filter the query on the is_cumulative column
*
* Example usage:
* <code>
* $query->filterByIsCumulative(1234); // WHERE is_cumulative = 1234
* $query->filterByIsCumulative(array(12, 34)); // WHERE is_cumulative IN (12, 34)
* $query->filterByIsCumulative(array('min' => 12)); // WHERE is_cumulative > 12
* </code>
*
* @param mixed $isCumulative 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 ChildCouponQuery The current query, for fluid interface
*/
public function filterByIsCumulative($isCumulative = null, $comparison = null)
{
if (is_array($isCumulative)) {
$useMinMax = false;
if (isset($isCumulative['min'])) {
$this->addUsingAlias(CouponTableMap::IS_CUMULATIVE, $isCumulative['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($isCumulative['max'])) {
$this->addUsingAlias(CouponTableMap::IS_CUMULATIVE, $isCumulative['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::IS_CUMULATIVE, $isCumulative, $comparison);
}
/**
* Filter the query on the is_removing_postage column
*
* Example usage:
* <code>
* $query->filterByIsRemovingPostage(1234); // WHERE is_removing_postage = 1234
* $query->filterByIsRemovingPostage(array(12, 34)); // WHERE is_removing_postage IN (12, 34)
* $query->filterByIsRemovingPostage(array('min' => 12)); // WHERE is_removing_postage > 12
* </code>
*
* @param mixed $isRemovingPostage 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 ChildCouponQuery The current query, for fluid interface
*/
public function filterByIsRemovingPostage($isRemovingPostage = null, $comparison = null)
{
if (is_array($isRemovingPostage)) {
$useMinMax = false;
if (isset($isRemovingPostage['min'])) {
$this->addUsingAlias(CouponTableMap::IS_REMOVING_POSTAGE, $isRemovingPostage['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($isRemovingPostage['max'])) {
$this->addUsingAlias(CouponTableMap::IS_REMOVING_POSTAGE, $isRemovingPostage['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::IS_REMOVING_POSTAGE, $isRemovingPostage, $comparison);
}
/**

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -23,11 +23,11 @@ use Thelia\Model\CartItem as ChildCartItem;
use Thelia\Model\CartItemQuery as ChildCartItemQuery;
use Thelia\Model\Category as ChildCategory;
use Thelia\Model\CategoryQuery as ChildCategoryQuery;
use Thelia\Model\ContentAssoc as ChildContentAssoc;
use Thelia\Model\ContentAssocQuery as ChildContentAssocQuery;
use Thelia\Model\FeatureProduct as ChildFeatureProduct;
use Thelia\Model\FeatureProductQuery as ChildFeatureProductQuery;
use Thelia\Model\Product as ChildProduct;
use Thelia\Model\ProductAssociatedContent as ChildProductAssociatedContent;
use Thelia\Model\ProductAssociatedContentQuery as ChildProductAssociatedContentQuery;
use Thelia\Model\ProductCategory as ChildProductCategory;
use Thelia\Model\ProductCategoryQuery as ChildProductCategoryQuery;
use Thelia\Model\ProductDocument as ChildProductDocument;
@@ -167,12 +167,6 @@ abstract class Product implements ActiveRecordInterface
protected $collProductSaleElementss;
protected $collProductSaleElementssPartial;
/**
* @var ObjectCollection|ChildContentAssoc[] Collection to store aggregation of ChildContentAssoc objects.
*/
protected $collContentAssocs;
protected $collContentAssocsPartial;
/**
* @var ObjectCollection|ChildProductImage[] Collection to store aggregation of ChildProductImage objects.
*/
@@ -209,6 +203,12 @@ abstract class Product implements ActiveRecordInterface
protected $collCartItems;
protected $collCartItemsPartial;
/**
* @var ObjectCollection|ChildProductAssociatedContent[] Collection to store aggregation of ChildProductAssociatedContent objects.
*/
protected $collProductAssociatedContents;
protected $collProductAssociatedContentsPartial;
/**
* @var ObjectCollection|ChildProductI18n[] Collection to store aggregation of ChildProductI18n objects.
*/
@@ -302,12 +302,6 @@ abstract class Product implements ActiveRecordInterface
*/
protected $productSaleElementssScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $contentAssocsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
@@ -344,6 +338,12 @@ abstract class Product implements ActiveRecordInterface
*/
protected $cartItemsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $productAssociatedContentsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
@@ -1137,8 +1137,6 @@ abstract class Product implements ActiveRecordInterface
$this->collProductSaleElementss = null;
$this->collContentAssocs = null;
$this->collProductImages = null;
$this->collProductDocuments = null;
@@ -1151,6 +1149,8 @@ abstract class Product implements ActiveRecordInterface
$this->collCartItems = null;
$this->collProductAssociatedContents = null;
$this->collProductI18ns = null;
$this->collProductVersions = null;
@@ -1447,23 +1447,6 @@ abstract class Product implements ActiveRecordInterface
}
}
if ($this->contentAssocsScheduledForDeletion !== null) {
if (!$this->contentAssocsScheduledForDeletion->isEmpty()) {
\Thelia\Model\ContentAssocQuery::create()
->filterByPrimaryKeys($this->contentAssocsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->contentAssocsScheduledForDeletion = null;
}
}
if ($this->collContentAssocs !== null) {
foreach ($this->collContentAssocs as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->productImagesScheduledForDeletion !== null) {
if (!$this->productImagesScheduledForDeletion->isEmpty()) {
\Thelia\Model\ProductImageQuery::create()
@@ -1566,6 +1549,23 @@ abstract class Product implements ActiveRecordInterface
}
}
if ($this->productAssociatedContentsScheduledForDeletion !== null) {
if (!$this->productAssociatedContentsScheduledForDeletion->isEmpty()) {
\Thelia\Model\ProductAssociatedContentQuery::create()
->filterByPrimaryKeys($this->productAssociatedContentsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->productAssociatedContentsScheduledForDeletion = null;
}
}
if ($this->collProductAssociatedContents !== null) {
foreach ($this->collProductAssociatedContents as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->productI18nsScheduledForDeletion !== null) {
if (!$this->productI18nsScheduledForDeletion->isEmpty()) {
\Thelia\Model\ProductI18nQuery::create()
@@ -1848,9 +1848,6 @@ abstract class Product implements ActiveRecordInterface
if (null !== $this->collProductSaleElementss) {
$result['ProductSaleElementss'] = $this->collProductSaleElementss->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collContentAssocs) {
$result['ContentAssocs'] = $this->collContentAssocs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collProductImages) {
$result['ProductImages'] = $this->collProductImages->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
@@ -1869,6 +1866,9 @@ abstract class Product implements ActiveRecordInterface
if (null !== $this->collCartItems) {
$result['CartItems'] = $this->collCartItems->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collProductAssociatedContents) {
$result['ProductAssociatedContents'] = $this->collProductAssociatedContents->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collProductI18ns) {
$result['ProductI18ns'] = $this->collProductI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
@@ -2090,12 +2090,6 @@ abstract class Product implements ActiveRecordInterface
}
}
foreach ($this->getContentAssocs() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addContentAssoc($relObj->copy($deepCopy));
}
}
foreach ($this->getProductImages() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addProductImage($relObj->copy($deepCopy));
@@ -2132,6 +2126,12 @@ abstract class Product implements ActiveRecordInterface
}
}
foreach ($this->getProductAssociatedContents() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addProductAssociatedContent($relObj->copy($deepCopy));
}
}
foreach ($this->getProductI18ns() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addProductI18n($relObj->copy($deepCopy));
@@ -2245,9 +2245,6 @@ abstract class Product implements ActiveRecordInterface
if ('ProductSaleElements' == $relationName) {
return $this->initProductSaleElementss();
}
if ('ContentAssoc' == $relationName) {
return $this->initContentAssocs();
}
if ('ProductImage' == $relationName) {
return $this->initProductImages();
}
@@ -2266,6 +2263,9 @@ abstract class Product implements ActiveRecordInterface
if ('CartItem' == $relationName) {
return $this->initCartItems();
}
if ('ProductAssociatedContent' == $relationName) {
return $this->initProductAssociatedContents();
}
if ('ProductI18n' == $relationName) {
return $this->initProductI18ns();
}
@@ -3006,274 +3006,6 @@ abstract class Product implements ActiveRecordInterface
return $this;
}
/**
* Clears out the collContentAssocs 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 addContentAssocs()
*/
public function clearContentAssocs()
{
$this->collContentAssocs = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collContentAssocs collection loaded partially.
*/
public function resetPartialContentAssocs($v = true)
{
$this->collContentAssocsPartial = $v;
}
/**
* Initializes the collContentAssocs collection.
*
* By default this just sets the collContentAssocs collection to an empty array (like clearcollContentAssocs());
* 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 initContentAssocs($overrideExisting = true)
{
if (null !== $this->collContentAssocs && !$overrideExisting) {
return;
}
$this->collContentAssocs = new ObjectCollection();
$this->collContentAssocs->setModel('\Thelia\Model\ContentAssoc');
}
/**
* Gets an array of ChildContentAssoc 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 ChildProduct 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|ChildContentAssoc[] List of ChildContentAssoc objects
* @throws PropelException
*/
public function getContentAssocs($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collContentAssocsPartial && !$this->isNew();
if (null === $this->collContentAssocs || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collContentAssocs) {
// return empty collection
$this->initContentAssocs();
} else {
$collContentAssocs = ChildContentAssocQuery::create(null, $criteria)
->filterByProduct($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collContentAssocsPartial && count($collContentAssocs)) {
$this->initContentAssocs(false);
foreach ($collContentAssocs as $obj) {
if (false == $this->collContentAssocs->contains($obj)) {
$this->collContentAssocs->append($obj);
}
}
$this->collContentAssocsPartial = true;
}
$collContentAssocs->getInternalIterator()->rewind();
return $collContentAssocs;
}
if ($partial && $this->collContentAssocs) {
foreach ($this->collContentAssocs as $obj) {
if ($obj->isNew()) {
$collContentAssocs[] = $obj;
}
}
}
$this->collContentAssocs = $collContentAssocs;
$this->collContentAssocsPartial = false;
}
}
return $this->collContentAssocs;
}
/**
* Sets a collection of ContentAssoc 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 $contentAssocs A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildProduct The current object (for fluent API support)
*/
public function setContentAssocs(Collection $contentAssocs, ConnectionInterface $con = null)
{
$contentAssocsToDelete = $this->getContentAssocs(new Criteria(), $con)->diff($contentAssocs);
$this->contentAssocsScheduledForDeletion = $contentAssocsToDelete;
foreach ($contentAssocsToDelete as $contentAssocRemoved) {
$contentAssocRemoved->setProduct(null);
}
$this->collContentAssocs = null;
foreach ($contentAssocs as $contentAssoc) {
$this->addContentAssoc($contentAssoc);
}
$this->collContentAssocs = $contentAssocs;
$this->collContentAssocsPartial = false;
return $this;
}
/**
* Returns the number of related ContentAssoc objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related ContentAssoc objects.
* @throws PropelException
*/
public function countContentAssocs(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collContentAssocsPartial && !$this->isNew();
if (null === $this->collContentAssocs || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collContentAssocs) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getContentAssocs());
}
$query = ChildContentAssocQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByProduct($this)
->count($con);
}
return count($this->collContentAssocs);
}
/**
* Method called to associate a ChildContentAssoc object to this object
* through the ChildContentAssoc foreign key attribute.
*
* @param ChildContentAssoc $l ChildContentAssoc
* @return \Thelia\Model\Product The current object (for fluent API support)
*/
public function addContentAssoc(ChildContentAssoc $l)
{
if ($this->collContentAssocs === null) {
$this->initContentAssocs();
$this->collContentAssocsPartial = true;
}
if (!in_array($l, $this->collContentAssocs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddContentAssoc($l);
}
return $this;
}
/**
* @param ContentAssoc $contentAssoc The contentAssoc object to add.
*/
protected function doAddContentAssoc($contentAssoc)
{
$this->collContentAssocs[]= $contentAssoc;
$contentAssoc->setProduct($this);
}
/**
* @param ContentAssoc $contentAssoc The contentAssoc object to remove.
* @return ChildProduct The current object (for fluent API support)
*/
public function removeContentAssoc($contentAssoc)
{
if ($this->getContentAssocs()->contains($contentAssoc)) {
$this->collContentAssocs->remove($this->collContentAssocs->search($contentAssoc));
if (null === $this->contentAssocsScheduledForDeletion) {
$this->contentAssocsScheduledForDeletion = clone $this->collContentAssocs;
$this->contentAssocsScheduledForDeletion->clear();
}
$this->contentAssocsScheduledForDeletion[]= $contentAssoc;
$contentAssoc->setProduct(null);
}
return $this;
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Product is new, it will return
* an empty collection; or if this Product has previously
* been saved, it will retrieve related ContentAssocs from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Product.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildContentAssoc[] List of ChildContentAssoc objects
*/
public function getContentAssocsJoinCategory($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildContentAssocQuery::create(null, $criteria);
$query->joinWith('Category', $joinBehavior);
return $this->getContentAssocs($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Product is new, it will return
* an empty collection; or if this Product has previously
* been saved, it will retrieve related ContentAssocs from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Product.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildContentAssoc[] List of ChildContentAssoc objects
*/
public function getContentAssocsJoinContent($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildContentAssocQuery::create(null, $criteria);
$query->joinWith('Content', $joinBehavior);
return $this->getContentAssocs($query, $con);
}
/**
* Clears out the collProductImages collection
*
@@ -4707,6 +4439,249 @@ abstract class Product implements ActiveRecordInterface
return $this->getCartItems($query, $con);
}
/**
* Clears out the collProductAssociatedContents 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 addProductAssociatedContents()
*/
public function clearProductAssociatedContents()
{
$this->collProductAssociatedContents = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collProductAssociatedContents collection loaded partially.
*/
public function resetPartialProductAssociatedContents($v = true)
{
$this->collProductAssociatedContentsPartial = $v;
}
/**
* Initializes the collProductAssociatedContents collection.
*
* By default this just sets the collProductAssociatedContents collection to an empty array (like clearcollProductAssociatedContents());
* 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 initProductAssociatedContents($overrideExisting = true)
{
if (null !== $this->collProductAssociatedContents && !$overrideExisting) {
return;
}
$this->collProductAssociatedContents = new ObjectCollection();
$this->collProductAssociatedContents->setModel('\Thelia\Model\ProductAssociatedContent');
}
/**
* Gets an array of ChildProductAssociatedContent 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 ChildProduct 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|ChildProductAssociatedContent[] List of ChildProductAssociatedContent objects
* @throws PropelException
*/
public function getProductAssociatedContents($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collProductAssociatedContentsPartial && !$this->isNew();
if (null === $this->collProductAssociatedContents || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collProductAssociatedContents) {
// return empty collection
$this->initProductAssociatedContents();
} else {
$collProductAssociatedContents = ChildProductAssociatedContentQuery::create(null, $criteria)
->filterByProduct($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collProductAssociatedContentsPartial && count($collProductAssociatedContents)) {
$this->initProductAssociatedContents(false);
foreach ($collProductAssociatedContents as $obj) {
if (false == $this->collProductAssociatedContents->contains($obj)) {
$this->collProductAssociatedContents->append($obj);
}
}
$this->collProductAssociatedContentsPartial = true;
}
$collProductAssociatedContents->getInternalIterator()->rewind();
return $collProductAssociatedContents;
}
if ($partial && $this->collProductAssociatedContents) {
foreach ($this->collProductAssociatedContents as $obj) {
if ($obj->isNew()) {
$collProductAssociatedContents[] = $obj;
}
}
}
$this->collProductAssociatedContents = $collProductAssociatedContents;
$this->collProductAssociatedContentsPartial = false;
}
}
return $this->collProductAssociatedContents;
}
/**
* Sets a collection of ProductAssociatedContent 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 $productAssociatedContents A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildProduct The current object (for fluent API support)
*/
public function setProductAssociatedContents(Collection $productAssociatedContents, ConnectionInterface $con = null)
{
$productAssociatedContentsToDelete = $this->getProductAssociatedContents(new Criteria(), $con)->diff($productAssociatedContents);
$this->productAssociatedContentsScheduledForDeletion = $productAssociatedContentsToDelete;
foreach ($productAssociatedContentsToDelete as $productAssociatedContentRemoved) {
$productAssociatedContentRemoved->setProduct(null);
}
$this->collProductAssociatedContents = null;
foreach ($productAssociatedContents as $productAssociatedContent) {
$this->addProductAssociatedContent($productAssociatedContent);
}
$this->collProductAssociatedContents = $productAssociatedContents;
$this->collProductAssociatedContentsPartial = false;
return $this;
}
/**
* Returns the number of related ProductAssociatedContent objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related ProductAssociatedContent objects.
* @throws PropelException
*/
public function countProductAssociatedContents(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collProductAssociatedContentsPartial && !$this->isNew();
if (null === $this->collProductAssociatedContents || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collProductAssociatedContents) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getProductAssociatedContents());
}
$query = ChildProductAssociatedContentQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByProduct($this)
->count($con);
}
return count($this->collProductAssociatedContents);
}
/**
* Method called to associate a ChildProductAssociatedContent object to this object
* through the ChildProductAssociatedContent foreign key attribute.
*
* @param ChildProductAssociatedContent $l ChildProductAssociatedContent
* @return \Thelia\Model\Product The current object (for fluent API support)
*/
public function addProductAssociatedContent(ChildProductAssociatedContent $l)
{
if ($this->collProductAssociatedContents === null) {
$this->initProductAssociatedContents();
$this->collProductAssociatedContentsPartial = true;
}
if (!in_array($l, $this->collProductAssociatedContents->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddProductAssociatedContent($l);
}
return $this;
}
/**
* @param ProductAssociatedContent $productAssociatedContent The productAssociatedContent object to add.
*/
protected function doAddProductAssociatedContent($productAssociatedContent)
{
$this->collProductAssociatedContents[]= $productAssociatedContent;
$productAssociatedContent->setProduct($this);
}
/**
* @param ProductAssociatedContent $productAssociatedContent The productAssociatedContent object to remove.
* @return ChildProduct The current object (for fluent API support)
*/
public function removeProductAssociatedContent($productAssociatedContent)
{
if ($this->getProductAssociatedContents()->contains($productAssociatedContent)) {
$this->collProductAssociatedContents->remove($this->collProductAssociatedContents->search($productAssociatedContent));
if (null === $this->productAssociatedContentsScheduledForDeletion) {
$this->productAssociatedContentsScheduledForDeletion = clone $this->collProductAssociatedContents;
$this->productAssociatedContentsScheduledForDeletion->clear();
}
$this->productAssociatedContentsScheduledForDeletion[]= clone $productAssociatedContent;
$productAssociatedContent->setProduct(null);
}
return $this;
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Product is new, it will return
* an empty collection; or if this Product has previously
* been saved, it will retrieve related ProductAssociatedContents from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Product.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildProductAssociatedContent[] List of ChildProductAssociatedContent objects
*/
public function getProductAssociatedContentsJoinContent($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildProductAssociatedContentQuery::create(null, $criteria);
$query->joinWith('Content', $joinBehavior);
return $this->getProductAssociatedContents($query, $con);
}
/**
* Clears out the collProductI18ns collection
*
@@ -5752,11 +5727,6 @@ abstract class Product implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
if ($this->collContentAssocs) {
foreach ($this->collContentAssocs as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collProductImages) {
foreach ($this->collProductImages as $o) {
$o->clearAllReferences($deep);
@@ -5787,6 +5757,11 @@ abstract class Product implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
if ($this->collProductAssociatedContents) {
foreach ($this->collProductAssociatedContents as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collProductI18ns) {
foreach ($this->collProductI18ns as $o) {
$o->clearAllReferences($deep);
@@ -5830,10 +5805,6 @@ abstract class Product implements ActiveRecordInterface
$this->collProductSaleElementss->clearIterator();
}
$this->collProductSaleElementss = null;
if ($this->collContentAssocs instanceof Collection) {
$this->collContentAssocs->clearIterator();
}
$this->collContentAssocs = null;
if ($this->collProductImages instanceof Collection) {
$this->collProductImages->clearIterator();
}
@@ -5858,6 +5829,10 @@ abstract class Product implements ActiveRecordInterface
$this->collCartItems->clearIterator();
}
$this->collCartItems = null;
if ($this->collProductAssociatedContents instanceof Collection) {
$this->collProductAssociatedContents->clearIterator();
}
$this->collProductAssociatedContents = null;
if ($this->collProductI18ns instanceof Collection) {
$this->collProductI18ns->clearIterator();
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,804 @@
<?php
namespace Thelia\Model\Base;
use \Exception;
use \PDO;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\ProductAssociatedContent as ChildProductAssociatedContent;
use Thelia\Model\ProductAssociatedContentQuery as ChildProductAssociatedContentQuery;
use Thelia\Model\Map\ProductAssociatedContentTableMap;
/**
* Base class that represents a query for the 'product_associated_content' table.
*
*
*
* @method ChildProductAssociatedContentQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildProductAssociatedContentQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
* @method ChildProductAssociatedContentQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
* @method ChildProductAssociatedContentQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildProductAssociatedContentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildProductAssociatedContentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildProductAssociatedContentQuery groupById() Group by the id column
* @method ChildProductAssociatedContentQuery groupByProductId() Group by the product_id column
* @method ChildProductAssociatedContentQuery groupByContentId() Group by the content_id column
* @method ChildProductAssociatedContentQuery groupByPosition() Group by the position column
* @method ChildProductAssociatedContentQuery groupByCreatedAt() Group by the created_at column
* @method ChildProductAssociatedContentQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildProductAssociatedContentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildProductAssociatedContentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildProductAssociatedContentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildProductAssociatedContentQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
* @method ChildProductAssociatedContentQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
* @method ChildProductAssociatedContentQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
*
* @method ChildProductAssociatedContentQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
* @method ChildProductAssociatedContentQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
* @method ChildProductAssociatedContentQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
*
* @method ChildProductAssociatedContent findOne(ConnectionInterface $con = null) Return the first ChildProductAssociatedContent matching the query
* @method ChildProductAssociatedContent findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProductAssociatedContent matching the query, or a new ChildProductAssociatedContent object populated from the query conditions when no match is found
*
* @method ChildProductAssociatedContent findOneById(int $id) Return the first ChildProductAssociatedContent filtered by the id column
* @method ChildProductAssociatedContent findOneByProductId(int $product_id) Return the first ChildProductAssociatedContent filtered by the product_id column
* @method ChildProductAssociatedContent findOneByContentId(int $content_id) Return the first ChildProductAssociatedContent filtered by the content_id column
* @method ChildProductAssociatedContent findOneByPosition(int $position) Return the first ChildProductAssociatedContent filtered by the position column
* @method ChildProductAssociatedContent findOneByCreatedAt(string $created_at) Return the first ChildProductAssociatedContent filtered by the created_at column
* @method ChildProductAssociatedContent findOneByUpdatedAt(string $updated_at) Return the first ChildProductAssociatedContent filtered by the updated_at column
*
* @method array findById(int $id) Return ChildProductAssociatedContent objects filtered by the id column
* @method array findByProductId(int $product_id) Return ChildProductAssociatedContent objects filtered by the product_id column
* @method array findByContentId(int $content_id) Return ChildProductAssociatedContent objects filtered by the content_id column
* @method array findByPosition(int $position) Return ChildProductAssociatedContent objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildProductAssociatedContent objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildProductAssociatedContent objects filtered by the updated_at column
*
*/
abstract class ProductAssociatedContentQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\ProductAssociatedContentQuery 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\\ProductAssociatedContent', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildProductAssociatedContentQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildProductAssociatedContentQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\ProductAssociatedContentQuery) {
return $criteria;
}
$query = new \Thelia\Model\ProductAssociatedContentQuery();
if (null !== $modelAlias) {
$query->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.
*
* <code>
* $obj = $c->findPk(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildProductAssociatedContent|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = ProductAssociatedContentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(ProductAssociatedContentTableMap::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 ChildProductAssociatedContent A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, PRODUCT_ID, CONTENT_ID, POSITION, CREATED_AT, UPDATED_AT FROM product_associated_content 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 ChildProductAssociatedContent();
$obj->hydrate($row);
ProductAssociatedContentTableMap::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 ChildProductAssociatedContent|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
* <code>
* $objs = $c->findPks(array(12, 56, 832), $con);
* </code>
* @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 ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(ProductAssociatedContentTableMap::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 ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(ProductAssociatedContentTableMap::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @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 ChildProductAssociatedContentQuery 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(ProductAssociatedContentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(ProductAssociatedContentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ProductAssociatedContentTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the product_id column
*
* Example usage:
* <code>
* $query->filterByProductId(1234); // WHERE product_id = 1234
* $query->filterByProductId(array(12, 34)); // WHERE product_id IN (12, 34)
* $query->filterByProductId(array('min' => 12)); // WHERE product_id > 12
* </code>
*
* @see filterByProduct()
*
* @param mixed $productId 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 ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function filterByProductId($productId = null, $comparison = null)
{
if (is_array($productId)) {
$useMinMax = false;
if (isset($productId['min'])) {
$this->addUsingAlias(ProductAssociatedContentTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($productId['max'])) {
$this->addUsingAlias(ProductAssociatedContentTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ProductAssociatedContentTableMap::PRODUCT_ID, $productId, $comparison);
}
/**
* Filter the query on the content_id column
*
* Example usage:
* <code>
* $query->filterByContentId(1234); // WHERE content_id = 1234
* $query->filterByContentId(array(12, 34)); // WHERE content_id IN (12, 34)
* $query->filterByContentId(array('min' => 12)); // WHERE content_id > 12
* </code>
*
* @see filterByContent()
*
* @param mixed $contentId 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 ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function filterByContentId($contentId = null, $comparison = null)
{
if (is_array($contentId)) {
$useMinMax = false;
if (isset($contentId['min'])) {
$this->addUsingAlias(ProductAssociatedContentTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($contentId['max'])) {
$this->addUsingAlias(ProductAssociatedContentTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ProductAssociatedContentTableMap::CONTENT_ID, $contentId, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @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 ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($position)) {
$useMinMax = false;
if (isset($position['min'])) {
$this->addUsingAlias(ProductAssociatedContentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(ProductAssociatedContentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ProductAssociatedContentTableMap::POSITION, $position, $comparison);
}
/**
* Filter the query on the created_at column
*
* Example usage:
* <code>
* $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'
* </code>
*
* @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 ChildProductAssociatedContentQuery 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(ProductAssociatedContentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(ProductAssociatedContentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ProductAssociatedContentTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
* Filter the query on the updated_at column
*
* Example usage:
* <code>
* $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'
* </code>
*
* @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 ChildProductAssociatedContentQuery 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(ProductAssociatedContentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(ProductAssociatedContentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ProductAssociatedContentTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Product object
*
* @param \Thelia\Model\Product|ObjectCollection $product The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function filterByProduct($product, $comparison = null)
{
if ($product instanceof \Thelia\Model\Product) {
return $this
->addUsingAlias(ProductAssociatedContentTableMap::PRODUCT_ID, $product->getId(), $comparison);
} elseif ($product instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ProductAssociatedContentTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByProduct() only accepts arguments of type \Thelia\Model\Product or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Product relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function joinProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Product');
// 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, 'Product');
}
return $this;
}
/**
* Use the Product relation Product 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\ProductQuery A secondary query class using the current class as primary query
*/
public function useProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinProduct($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Product', '\Thelia\Model\ProductQuery');
}
/**
* Filter the query by a related \Thelia\Model\Content object
*
* @param \Thelia\Model\Content|ObjectCollection $content The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function filterByContent($content, $comparison = null)
{
if ($content instanceof \Thelia\Model\Content) {
return $this
->addUsingAlias(ProductAssociatedContentTableMap::CONTENT_ID, $content->getId(), $comparison);
} elseif ($content instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ProductAssociatedContentTableMap::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByContent() only accepts arguments of type \Thelia\Model\Content or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Content relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function joinContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Content');
// 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, 'Content');
}
return $this;
}
/**
* Use the Content relation Content 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\ContentQuery A secondary query class using the current class as primary query
*/
public function useContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Content', '\Thelia\Model\ContentQuery');
}
/**
* Exclude object from result
*
* @param ChildProductAssociatedContent $productAssociatedContent Object to remove from the list of results
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function prune($productAssociatedContent = null)
{
if ($productAssociatedContent) {
$this->addUsingAlias(ProductAssociatedContentTableMap::ID, $productAssociatedContent->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the product_associated_content 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(ProductAssociatedContentTableMap::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).
ProductAssociatedContentTableMap::clearInstancePool();
ProductAssociatedContentTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildProductAssociatedContent or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildProductAssociatedContent 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(ProductAssociatedContentTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(ProductAssociatedContentTableMap::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();
ProductAssociatedContentTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
ProductAssociatedContentTableMap::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 ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(ProductAssociatedContentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(ProductAssociatedContentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(ProductAssociatedContentTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(ProductAssociatedContentTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(ProductAssociatedContentTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildProductAssociatedContentQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(ProductAssociatedContentTableMap::CREATED_AT);
}
} // ProductAssociatedContentQuery

View File

@@ -64,10 +64,6 @@ use Thelia\Model\Map\ProductTableMap;
* @method ChildProductQuery rightJoinProductSaleElements($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductSaleElements relation
* @method ChildProductQuery innerJoinProductSaleElements($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductSaleElements relation
*
* @method ChildProductQuery leftJoinContentAssoc($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentAssoc relation
* @method ChildProductQuery rightJoinContentAssoc($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentAssoc relation
* @method ChildProductQuery innerJoinContentAssoc($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentAssoc relation
*
* @method ChildProductQuery leftJoinProductImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductImage relation
* @method ChildProductQuery rightJoinProductImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductImage relation
* @method ChildProductQuery innerJoinProductImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductImage relation
@@ -92,6 +88,10 @@ use Thelia\Model\Map\ProductTableMap;
* @method ChildProductQuery rightJoinCartItem($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CartItem relation
* @method ChildProductQuery innerJoinCartItem($relationAlias = null) Adds a INNER JOIN clause to the query using the CartItem relation
*
* @method ChildProductQuery leftJoinProductAssociatedContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductAssociatedContent relation
* @method ChildProductQuery rightJoinProductAssociatedContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductAssociatedContent relation
* @method ChildProductQuery innerJoinProductAssociatedContent($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductAssociatedContent relation
*
* @method ChildProductQuery leftJoinProductI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductI18n relation
* @method ChildProductQuery rightJoinProductI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductI18n relation
* @method ChildProductQuery innerJoinProductI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductI18n relation
@@ -996,79 +996,6 @@ abstract class ProductQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'ProductSaleElements', '\Thelia\Model\ProductSaleElementsQuery');
}
/**
* Filter the query by a related \Thelia\Model\ContentAssoc object
*
* @param \Thelia\Model\ContentAssoc|ObjectCollection $contentAssoc the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildProductQuery The current query, for fluid interface
*/
public function filterByContentAssoc($contentAssoc, $comparison = null)
{
if ($contentAssoc instanceof \Thelia\Model\ContentAssoc) {
return $this
->addUsingAlias(ProductTableMap::ID, $contentAssoc->getProductId(), $comparison);
} elseif ($contentAssoc instanceof ObjectCollection) {
return $this
->useContentAssocQuery()
->filterByPrimaryKeys($contentAssoc->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByContentAssoc() only accepts arguments of type \Thelia\Model\ContentAssoc or Collection');
}
}
/**
* Adds a JOIN clause to the query using the ContentAssoc relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildProductQuery The current query, for fluid interface
*/
public function joinContentAssoc($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ContentAssoc');
// 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, 'ContentAssoc');
}
return $this;
}
/**
* Use the ContentAssoc relation ContentAssoc 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\ContentAssocQuery A secondary query class using the current class as primary query
*/
public function useContentAssocQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinContentAssoc($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ContentAssoc', '\Thelia\Model\ContentAssocQuery');
}
/**
* Filter the query by a related \Thelia\Model\ProductImage object
*
@@ -1507,6 +1434,79 @@ abstract class ProductQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'CartItem', '\Thelia\Model\CartItemQuery');
}
/**
* Filter the query by a related \Thelia\Model\ProductAssociatedContent object
*
* @param \Thelia\Model\ProductAssociatedContent|ObjectCollection $productAssociatedContent the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildProductQuery The current query, for fluid interface
*/
public function filterByProductAssociatedContent($productAssociatedContent, $comparison = null)
{
if ($productAssociatedContent instanceof \Thelia\Model\ProductAssociatedContent) {
return $this
->addUsingAlias(ProductTableMap::ID, $productAssociatedContent->getProductId(), $comparison);
} elseif ($productAssociatedContent instanceof ObjectCollection) {
return $this
->useProductAssociatedContentQuery()
->filterByPrimaryKeys($productAssociatedContent->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByProductAssociatedContent() only accepts arguments of type \Thelia\Model\ProductAssociatedContent or Collection');
}
}
/**
* Adds a JOIN clause to the query using the ProductAssociatedContent relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildProductQuery The current query, for fluid interface
*/
public function joinProductAssociatedContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ProductAssociatedContent');
// 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, 'ProductAssociatedContent');
}
return $this;
}
/**
* Use the ProductAssociatedContent relation ProductAssociatedContent 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\ProductAssociatedContentQuery A secondary query class using the current class as primary query
*/
public function useProductAssociatedContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinProductAssociatedContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ProductAssociatedContent', '\Thelia\Model\ProductAssociatedContentQuery');
}
/**
* Filter the query by a related \Thelia\Model\ProductI18n object
*