new image and document management
This commit is contained in:
File diff suppressed because it is too large
Load Diff
1990
core/lib/Thelia/Model/Base/CategoryDocument.php
Normal file
1990
core/lib/Thelia/Model/Base/CategoryDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/CategoryDocumentI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/CategoryDocumentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/CategoryDocumentI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/CategoryDocumentI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?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\CategoryDocumentI18n as ChildCategoryDocumentI18n;
|
||||
use Thelia\Model\CategoryDocumentI18nQuery as ChildCategoryDocumentI18nQuery;
|
||||
use Thelia\Model\Map\CategoryDocumentI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'category_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildCategoryDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildCategoryDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildCategoryDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCategoryDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildCategoryDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildCategoryDocumentI18nQuery leftJoinCategoryDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryDocument relation
|
||||
* @method ChildCategoryDocumentI18nQuery rightJoinCategoryDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryDocument relation
|
||||
* @method ChildCategoryDocumentI18nQuery innerJoinCategoryDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryDocument relation
|
||||
*
|
||||
* @method ChildCategoryDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildCategoryDocumentI18n matching the query
|
||||
* @method ChildCategoryDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryDocumentI18n matching the query, or a new ChildCategoryDocumentI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildCategoryDocumentI18n findOneById(int $id) Return the first ChildCategoryDocumentI18n filtered by the id column
|
||||
* @method ChildCategoryDocumentI18n findOneByLocale(string $locale) Return the first ChildCategoryDocumentI18n filtered by the locale column
|
||||
* @method ChildCategoryDocumentI18n findOneByTitle(string $title) Return the first ChildCategoryDocumentI18n filtered by the title column
|
||||
* @method ChildCategoryDocumentI18n findOneByDescription(string $description) Return the first ChildCategoryDocumentI18n filtered by the description column
|
||||
* @method ChildCategoryDocumentI18n findOneByChapo(string $chapo) Return the first ChildCategoryDocumentI18n filtered by the chapo column
|
||||
* @method ChildCategoryDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildCategoryDocumentI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCategoryDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildCategoryDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildCategoryDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildCategoryDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildCategoryDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildCategoryDocumentI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class CategoryDocumentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryDocumentI18nQuery 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\\CategoryDocumentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildCategoryDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\CategoryDocumentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\CategoryDocumentI18nQuery();
|
||||
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 ChildCategoryDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = CategoryDocumentI18nTableMap::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(CategoryDocumentI18nTableMap::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 ChildCategoryDocumentI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM category_document_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 ChildCategoryDocumentI18n();
|
||||
$obj->hydrate($row);
|
||||
CategoryDocumentI18nTableMap::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 ChildCategoryDocumentI18n|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 ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(CategoryDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryDocumentI18nTableMap::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 ChildCategoryDocumentI18nQuery 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(CategoryDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(CategoryDocumentI18nTableMap::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 filterByCategoryDocument()
|
||||
*
|
||||
* @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 ChildCategoryDocumentI18nQuery 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(CategoryDocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::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 ChildCategoryDocumentI18nQuery 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(CategoryDocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryDocument object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryDocument|ObjectCollection $categoryDocument The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryDocument($categoryDocument, $comparison = null)
|
||||
{
|
||||
if ($categoryDocument instanceof \Thelia\Model\CategoryDocument) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentI18nTableMap::ID, $categoryDocument->getId(), $comparison);
|
||||
} elseif ($categoryDocument instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentI18nTableMap::ID, $categoryDocument->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryDocument() only accepts arguments of type \Thelia\Model\CategoryDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryDocument');
|
||||
|
||||
// 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, 'CategoryDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryDocument relation CategoryDocument 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\CategoryDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinCategoryDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryDocument', '\Thelia\Model\CategoryDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildCategoryDocumentI18n $categoryDocumentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryDocumentI18n = null)
|
||||
{
|
||||
if ($categoryDocumentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(CategoryDocumentI18nTableMap::ID), $categoryDocumentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(CategoryDocumentI18nTableMap::LOCALE), $categoryDocumentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_document_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(CategoryDocumentI18nTableMap::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).
|
||||
CategoryDocumentI18nTableMap::clearInstancePool();
|
||||
CategoryDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildCategoryDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildCategoryDocumentI18n 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(CategoryDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(CategoryDocumentI18nTableMap::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();
|
||||
|
||||
|
||||
CategoryDocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
CategoryDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // CategoryDocumentI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/CategoryDocumentQuery.php
Normal file
846
core/lib/Thelia/Model/Base/CategoryDocumentQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?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\CategoryDocument as ChildCategoryDocument;
|
||||
use Thelia\Model\CategoryDocumentI18nQuery as ChildCategoryDocumentI18nQuery;
|
||||
use Thelia\Model\CategoryDocumentQuery as ChildCategoryDocumentQuery;
|
||||
use Thelia\Model\Map\CategoryDocumentTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'category_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCategoryDocumentQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
|
||||
* @method ChildCategoryDocumentQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildCategoryDocumentQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildCategoryDocumentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCategoryDocumentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery groupById() Group by the id column
|
||||
* @method ChildCategoryDocumentQuery groupByCategoryId() Group by the category_id column
|
||||
* @method ChildCategoryDocumentQuery groupByFile() Group by the file column
|
||||
* @method ChildCategoryDocumentQuery groupByPosition() Group by the position column
|
||||
* @method ChildCategoryDocumentQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCategoryDocumentQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCategoryDocumentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildCategoryDocumentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
|
||||
* @method ChildCategoryDocumentQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
|
||||
* @method ChildCategoryDocumentQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery leftJoinCategoryDocumentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryDocumentI18n relation
|
||||
* @method ChildCategoryDocumentQuery rightJoinCategoryDocumentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryDocumentI18n relation
|
||||
* @method ChildCategoryDocumentQuery innerJoinCategoryDocumentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryDocumentI18n relation
|
||||
*
|
||||
* @method ChildCategoryDocument findOne(ConnectionInterface $con = null) Return the first ChildCategoryDocument matching the query
|
||||
* @method ChildCategoryDocument findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryDocument matching the query, or a new ChildCategoryDocument object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildCategoryDocument findOneById(int $id) Return the first ChildCategoryDocument filtered by the id column
|
||||
* @method ChildCategoryDocument findOneByCategoryId(int $category_id) Return the first ChildCategoryDocument filtered by the category_id column
|
||||
* @method ChildCategoryDocument findOneByFile(string $file) Return the first ChildCategoryDocument filtered by the file column
|
||||
* @method ChildCategoryDocument findOneByPosition(int $position) Return the first ChildCategoryDocument filtered by the position column
|
||||
* @method ChildCategoryDocument findOneByCreatedAt(string $created_at) Return the first ChildCategoryDocument filtered by the created_at column
|
||||
* @method ChildCategoryDocument findOneByUpdatedAt(string $updated_at) Return the first ChildCategoryDocument filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCategoryDocument objects filtered by the id column
|
||||
* @method array findByCategoryId(int $category_id) Return ChildCategoryDocument objects filtered by the category_id column
|
||||
* @method array findByFile(string $file) Return ChildCategoryDocument objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildCategoryDocument objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCategoryDocument objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCategoryDocument objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class CategoryDocumentQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryDocumentQuery 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\\CategoryDocument', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildCategoryDocumentQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\CategoryDocumentQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\CategoryDocumentQuery();
|
||||
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 ChildCategoryDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = CategoryDocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(CategoryDocumentTableMap::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 ChildCategoryDocument A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CATEGORY_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM category_document 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 ChildCategoryDocument();
|
||||
$obj->hydrate($row);
|
||||
CategoryDocumentTableMap::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 ChildCategoryDocument|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 ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::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 ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::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 ChildCategoryDocumentQuery 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(CategoryDocumentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::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 ChildCategoryDocumentQuery 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(CategoryDocumentTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($categoryId['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::CATEGORY_ID, $categoryId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::FILE, $file, $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 ChildCategoryDocumentQuery 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(CategoryDocumentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::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 ChildCategoryDocumentQuery 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(CategoryDocumentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::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 ChildCategoryDocumentQuery 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(CategoryDocumentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::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 ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategory($category, $comparison = null)
|
||||
{
|
||||
if ($category instanceof \Thelia\Model\Category) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentTableMap::CATEGORY_ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentTableMap::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 ChildCategoryDocumentQuery 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\CategoryDocumentI18n object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryDocumentI18n|ObjectCollection $categoryDocumentI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryDocumentI18n($categoryDocumentI18n, $comparison = null)
|
||||
{
|
||||
if ($categoryDocumentI18n instanceof \Thelia\Model\CategoryDocumentI18n) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentTableMap::ID, $categoryDocumentI18n->getId(), $comparison);
|
||||
} elseif ($categoryDocumentI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useCategoryDocumentI18nQuery()
|
||||
->filterByPrimaryKeys($categoryDocumentI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryDocumentI18n() only accepts arguments of type \Thelia\Model\CategoryDocumentI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryDocumentI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryDocumentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryDocumentI18n');
|
||||
|
||||
// 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, 'CategoryDocumentI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryDocumentI18n relation CategoryDocumentI18n 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\CategoryDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryDocumentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinCategoryDocumentI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryDocumentI18n', '\Thelia\Model\CategoryDocumentI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildCategoryDocument $categoryDocument Object to remove from the list of results
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryDocument = null)
|
||||
{
|
||||
if ($categoryDocument) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::ID, $categoryDocument->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_document 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(CategoryDocumentTableMap::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).
|
||||
CategoryDocumentTableMap::clearInstancePool();
|
||||
CategoryDocumentTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildCategoryDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildCategoryDocument 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(CategoryDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(CategoryDocumentTableMap::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();
|
||||
|
||||
|
||||
CategoryDocumentTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
CategoryDocumentTableMap::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 ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CategoryDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CategoryDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CategoryDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CategoryDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'CategoryDocumentI18n';
|
||||
|
||||
return $this
|
||||
->joinCategoryDocumentI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('CategoryDocumentI18n');
|
||||
$this->with['CategoryDocumentI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryDocumentI18n', '\Thelia\Model\CategoryDocumentI18nQuery');
|
||||
}
|
||||
|
||||
} // CategoryDocumentQuery
|
||||
1990
core/lib/Thelia/Model/Base/CategoryImage.php
Normal file
1990
core/lib/Thelia/Model/Base/CategoryImage.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/CategoryImageI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/CategoryImageI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/CategoryImageI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/CategoryImageI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?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\CategoryImageI18n as ChildCategoryImageI18n;
|
||||
use Thelia\Model\CategoryImageI18nQuery as ChildCategoryImageI18nQuery;
|
||||
use Thelia\Model\Map\CategoryImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'category_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildCategoryImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCategoryImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildCategoryImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildCategoryImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildCategoryImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildCategoryImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildCategoryImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildCategoryImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildCategoryImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildCategoryImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildCategoryImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildCategoryImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildCategoryImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCategoryImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildCategoryImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildCategoryImageI18nQuery leftJoinCategoryImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryImage relation
|
||||
* @method ChildCategoryImageI18nQuery rightJoinCategoryImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryImage relation
|
||||
* @method ChildCategoryImageI18nQuery innerJoinCategoryImage($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryImage relation
|
||||
*
|
||||
* @method ChildCategoryImageI18n findOne(ConnectionInterface $con = null) Return the first ChildCategoryImageI18n matching the query
|
||||
* @method ChildCategoryImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryImageI18n matching the query, or a new ChildCategoryImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildCategoryImageI18n findOneById(int $id) Return the first ChildCategoryImageI18n filtered by the id column
|
||||
* @method ChildCategoryImageI18n findOneByLocale(string $locale) Return the first ChildCategoryImageI18n filtered by the locale column
|
||||
* @method ChildCategoryImageI18n findOneByTitle(string $title) Return the first ChildCategoryImageI18n filtered by the title column
|
||||
* @method ChildCategoryImageI18n findOneByDescription(string $description) Return the first ChildCategoryImageI18n filtered by the description column
|
||||
* @method ChildCategoryImageI18n findOneByChapo(string $chapo) Return the first ChildCategoryImageI18n filtered by the chapo column
|
||||
* @method ChildCategoryImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildCategoryImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCategoryImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildCategoryImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildCategoryImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildCategoryImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildCategoryImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildCategoryImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class CategoryImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryImageI18nQuery 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\\CategoryImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildCategoryImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\CategoryImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\CategoryImageI18nQuery();
|
||||
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 ChildCategoryImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = CategoryImageI18nTableMap::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(CategoryImageI18nTableMap::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 ChildCategoryImageI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM category_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildCategoryImageI18n();
|
||||
$obj->hydrate($row);
|
||||
CategoryImageI18nTableMap::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 ChildCategoryImageI18n|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 ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(CategoryImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryImageI18nTableMap::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 ChildCategoryImageI18nQuery 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(CategoryImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(CategoryImageI18nTableMap::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 filterByCategoryImage()
|
||||
*
|
||||
* @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 ChildCategoryImageI18nQuery 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(CategoryImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::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 ChildCategoryImageI18nQuery 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(CategoryImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryImage object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryImage|ObjectCollection $categoryImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryImage($categoryImage, $comparison = null)
|
||||
{
|
||||
if ($categoryImage instanceof \Thelia\Model\CategoryImage) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageI18nTableMap::ID, $categoryImage->getId(), $comparison);
|
||||
} elseif ($categoryImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageI18nTableMap::ID, $categoryImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryImage() only accepts arguments of type \Thelia\Model\CategoryImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryImage');
|
||||
|
||||
// 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, 'CategoryImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryImage relation CategoryImage 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\CategoryImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinCategoryImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryImage', '\Thelia\Model\CategoryImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildCategoryImageI18n $categoryImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryImageI18n = null)
|
||||
{
|
||||
if ($categoryImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(CategoryImageI18nTableMap::ID), $categoryImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(CategoryImageI18nTableMap::LOCALE), $categoryImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryImageI18nTableMap::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).
|
||||
CategoryImageI18nTableMap::clearInstancePool();
|
||||
CategoryImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildCategoryImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildCategoryImageI18n 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(CategoryImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(CategoryImageI18nTableMap::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();
|
||||
|
||||
|
||||
CategoryImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
CategoryImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // CategoryImageI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/CategoryImageQuery.php
Normal file
846
core/lib/Thelia/Model/Base/CategoryImageQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?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\CategoryImage as ChildCategoryImage;
|
||||
use Thelia\Model\CategoryImageI18nQuery as ChildCategoryImageI18nQuery;
|
||||
use Thelia\Model\CategoryImageQuery as ChildCategoryImageQuery;
|
||||
use Thelia\Model\Map\CategoryImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'category_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildCategoryImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCategoryImageQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
|
||||
* @method ChildCategoryImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildCategoryImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildCategoryImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCategoryImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildCategoryImageQuery groupById() Group by the id column
|
||||
* @method ChildCategoryImageQuery groupByCategoryId() Group by the category_id column
|
||||
* @method ChildCategoryImageQuery groupByFile() Group by the file column
|
||||
* @method ChildCategoryImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildCategoryImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCategoryImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildCategoryImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCategoryImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildCategoryImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildCategoryImageQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
|
||||
* @method ChildCategoryImageQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
|
||||
* @method ChildCategoryImageQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
|
||||
*
|
||||
* @method ChildCategoryImageQuery leftJoinCategoryImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryImageI18n relation
|
||||
* @method ChildCategoryImageQuery rightJoinCategoryImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryImageI18n relation
|
||||
* @method ChildCategoryImageQuery innerJoinCategoryImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryImageI18n relation
|
||||
*
|
||||
* @method ChildCategoryImage findOne(ConnectionInterface $con = null) Return the first ChildCategoryImage matching the query
|
||||
* @method ChildCategoryImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryImage matching the query, or a new ChildCategoryImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildCategoryImage findOneById(int $id) Return the first ChildCategoryImage filtered by the id column
|
||||
* @method ChildCategoryImage findOneByCategoryId(int $category_id) Return the first ChildCategoryImage filtered by the category_id column
|
||||
* @method ChildCategoryImage findOneByFile(string $file) Return the first ChildCategoryImage filtered by the file column
|
||||
* @method ChildCategoryImage findOneByPosition(int $position) Return the first ChildCategoryImage filtered by the position column
|
||||
* @method ChildCategoryImage findOneByCreatedAt(string $created_at) Return the first ChildCategoryImage filtered by the created_at column
|
||||
* @method ChildCategoryImage findOneByUpdatedAt(string $updated_at) Return the first ChildCategoryImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCategoryImage objects filtered by the id column
|
||||
* @method array findByCategoryId(int $category_id) Return ChildCategoryImage objects filtered by the category_id column
|
||||
* @method array findByFile(string $file) Return ChildCategoryImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildCategoryImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCategoryImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCategoryImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class CategoryImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryImageQuery 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\\CategoryImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildCategoryImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildCategoryImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\CategoryImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\CategoryImageQuery();
|
||||
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 ChildCategoryImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = CategoryImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(CategoryImageTableMap::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 ChildCategoryImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CATEGORY_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM category_image 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 ChildCategoryImage();
|
||||
$obj->hydrate($row);
|
||||
CategoryImageTableMap::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 ChildCategoryImage|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 ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::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 ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::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 ChildCategoryImageQuery 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(CategoryImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::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 ChildCategoryImageQuery 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(CategoryImageTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($categoryId['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::CATEGORY_ID, $categoryId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::FILE, $file, $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 ChildCategoryImageQuery 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(CategoryImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::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 ChildCategoryImageQuery 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(CategoryImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::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 ChildCategoryImageQuery 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(CategoryImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::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 ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategory($category, $comparison = null)
|
||||
{
|
||||
if ($category instanceof \Thelia\Model\Category) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageTableMap::CATEGORY_ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageTableMap::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 ChildCategoryImageQuery 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\CategoryImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryImageI18n|ObjectCollection $categoryImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryImageI18n($categoryImageI18n, $comparison = null)
|
||||
{
|
||||
if ($categoryImageI18n instanceof \Thelia\Model\CategoryImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageTableMap::ID, $categoryImageI18n->getId(), $comparison);
|
||||
} elseif ($categoryImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useCategoryImageI18nQuery()
|
||||
->filterByPrimaryKeys($categoryImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryImageI18n() only accepts arguments of type \Thelia\Model\CategoryImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryImageI18n');
|
||||
|
||||
// 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, 'CategoryImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryImageI18n relation CategoryImageI18n 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\CategoryImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinCategoryImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryImageI18n', '\Thelia\Model\CategoryImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildCategoryImage $categoryImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryImage = null)
|
||||
{
|
||||
if ($categoryImage) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::ID, $categoryImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_image 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(CategoryImageTableMap::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).
|
||||
CategoryImageTableMap::clearInstancePool();
|
||||
CategoryImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildCategoryImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildCategoryImage 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(CategoryImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(CategoryImageTableMap::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();
|
||||
|
||||
|
||||
CategoryImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
CategoryImageTableMap::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 ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CategoryImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CategoryImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CategoryImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CategoryImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CategoryImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CategoryImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'CategoryImageI18n';
|
||||
|
||||
return $this
|
||||
->joinCategoryImageI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('CategoryImageI18n');
|
||||
$this->with['CategoryImageI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryImageI18n', '\Thelia\Model\CategoryImageI18nQuery');
|
||||
}
|
||||
|
||||
} // CategoryImageQuery
|
||||
@@ -62,18 +62,18 @@ use Thelia\Model\Map\CategoryTableMap;
|
||||
* @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 leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildCategoryQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildCategoryQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @method ChildCategoryQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildCategoryQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildCategoryQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document 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
|
||||
*
|
||||
* @method ChildCategoryQuery leftJoinCategoryImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryImage relation
|
||||
* @method ChildCategoryQuery rightJoinCategoryImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryImage relation
|
||||
* @method ChildCategoryQuery innerJoinCategoryImage($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryImage relation
|
||||
*
|
||||
* @method ChildCategoryQuery leftJoinCategoryDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryDocument relation
|
||||
* @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 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
|
||||
@@ -943,152 +943,6 @@ abstract class CategoryQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentAssoc', '\Thelia\Model\ContentAssocQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image 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 filterByImage($image, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryTableMap::ID, $image->getCategoryId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useImageQuery()
|
||||
->filterByPrimaryKeys($image->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image 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 joinImage($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
|
||||
// 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, 'Image');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image 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\ImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document 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 filterByDocument($document, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryTableMap::ID, $document->getCategoryId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useDocumentQuery()
|
||||
->filterByPrimaryKeys($document->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document 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 joinDocument($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
|
||||
// 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, 'Document');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document 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\DocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Rewriting object
|
||||
*
|
||||
@@ -1162,6 +1016,152 @@ abstract class CategoryQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'Rewriting', '\Thelia\Model\RewritingQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryImage object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryImage|ObjectCollection $categoryImage 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 filterByCategoryImage($categoryImage, $comparison = null)
|
||||
{
|
||||
if ($categoryImage instanceof \Thelia\Model\CategoryImage) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryTableMap::ID, $categoryImage->getCategoryId(), $comparison);
|
||||
} elseif ($categoryImage instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useCategoryImageQuery()
|
||||
->filterByPrimaryKeys($categoryImage->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryImage() only accepts arguments of type \Thelia\Model\CategoryImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryImage 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 joinCategoryImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryImage');
|
||||
|
||||
// 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, 'CategoryImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryImage relation CategoryImage 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\CategoryImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCategoryImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryImage', '\Thelia\Model\CategoryImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryDocument object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryDocument|ObjectCollection $categoryDocument 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 filterByCategoryDocument($categoryDocument, $comparison = null)
|
||||
{
|
||||
if ($categoryDocument instanceof \Thelia\Model\CategoryDocument) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryTableMap::ID, $categoryDocument->getCategoryId(), $comparison);
|
||||
} elseif ($categoryDocument instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useCategoryDocumentQuery()
|
||||
->filterByPrimaryKeys($categoryDocument->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryDocument() only accepts arguments of type \Thelia\Model\CategoryDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryDocument 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 joinCategoryDocument($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryDocument');
|
||||
|
||||
// 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, 'CategoryDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryDocument relation CategoryDocument 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\CategoryDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryDocumentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCategoryDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryDocument', '\Thelia\Model\CategoryDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryI18n object
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1990
core/lib/Thelia/Model/Base/ContentDocument.php
Normal file
1990
core/lib/Thelia/Model/Base/ContentDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/ContentDocumentI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/ContentDocumentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/ContentDocumentI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/ContentDocumentI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?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\ContentDocumentI18n as ChildContentDocumentI18n;
|
||||
use Thelia\Model\ContentDocumentI18nQuery as ChildContentDocumentI18nQuery;
|
||||
use Thelia\Model\Map\ContentDocumentI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'content_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildContentDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildContentDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildContentDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildContentDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildContentDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildContentDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildContentDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildContentDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildContentDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildContentDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildContentDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildContentDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildContentDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildContentDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildContentDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildContentDocumentI18nQuery leftJoinContentDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentDocument relation
|
||||
* @method ChildContentDocumentI18nQuery rightJoinContentDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentDocument relation
|
||||
* @method ChildContentDocumentI18nQuery innerJoinContentDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentDocument relation
|
||||
*
|
||||
* @method ChildContentDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildContentDocumentI18n matching the query
|
||||
* @method ChildContentDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentDocumentI18n matching the query, or a new ChildContentDocumentI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildContentDocumentI18n findOneById(int $id) Return the first ChildContentDocumentI18n filtered by the id column
|
||||
* @method ChildContentDocumentI18n findOneByLocale(string $locale) Return the first ChildContentDocumentI18n filtered by the locale column
|
||||
* @method ChildContentDocumentI18n findOneByTitle(string $title) Return the first ChildContentDocumentI18n filtered by the title column
|
||||
* @method ChildContentDocumentI18n findOneByDescription(string $description) Return the first ChildContentDocumentI18n filtered by the description column
|
||||
* @method ChildContentDocumentI18n findOneByChapo(string $chapo) Return the first ChildContentDocumentI18n filtered by the chapo column
|
||||
* @method ChildContentDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildContentDocumentI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildContentDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildContentDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildContentDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildContentDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildContentDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildContentDocumentI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class ContentDocumentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentDocumentI18nQuery 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\\ContentDocumentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildContentDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ContentDocumentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ContentDocumentI18nQuery();
|
||||
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 ChildContentDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ContentDocumentI18nTableMap::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(ContentDocumentI18nTableMap::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 ChildContentDocumentI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM content_document_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 ChildContentDocumentI18n();
|
||||
$obj->hydrate($row);
|
||||
ContentDocumentI18nTableMap::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 ChildContentDocumentI18n|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 ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ContentDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentDocumentI18nTableMap::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 ChildContentDocumentI18nQuery 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(ContentDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ContentDocumentI18nTableMap::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 filterByContentDocument()
|
||||
*
|
||||
* @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 ChildContentDocumentI18nQuery 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(ContentDocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::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 ChildContentDocumentI18nQuery 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(ContentDocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentDocument object
|
||||
*
|
||||
* @param \Thelia\Model\ContentDocument|ObjectCollection $contentDocument The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentDocument($contentDocument, $comparison = null)
|
||||
{
|
||||
if ($contentDocument instanceof \Thelia\Model\ContentDocument) {
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentI18nTableMap::ID, $contentDocument->getId(), $comparison);
|
||||
} elseif ($contentDocument instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentI18nTableMap::ID, $contentDocument->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContentDocument() only accepts arguments of type \Thelia\Model\ContentDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentDocument');
|
||||
|
||||
// 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, 'ContentDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentDocument relation ContentDocument 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\ContentDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinContentDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentDocument', '\Thelia\Model\ContentDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildContentDocumentI18n $contentDocumentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentDocumentI18n = null)
|
||||
{
|
||||
if ($contentDocumentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ContentDocumentI18nTableMap::ID), $contentDocumentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ContentDocumentI18nTableMap::LOCALE), $contentDocumentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_document_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(ContentDocumentI18nTableMap::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).
|
||||
ContentDocumentI18nTableMap::clearInstancePool();
|
||||
ContentDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildContentDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildContentDocumentI18n 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(ContentDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ContentDocumentI18nTableMap::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();
|
||||
|
||||
|
||||
ContentDocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ContentDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ContentDocumentI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/ContentDocumentQuery.php
Normal file
846
core/lib/Thelia/Model/Base/ContentDocumentQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?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\ContentDocument as ChildContentDocument;
|
||||
use Thelia\Model\ContentDocumentI18nQuery as ChildContentDocumentI18nQuery;
|
||||
use Thelia\Model\ContentDocumentQuery as ChildContentDocumentQuery;
|
||||
use Thelia\Model\Map\ContentDocumentTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'content_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildContentDocumentQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildContentDocumentQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
|
||||
* @method ChildContentDocumentQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildContentDocumentQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildContentDocumentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildContentDocumentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildContentDocumentQuery groupById() Group by the id column
|
||||
* @method ChildContentDocumentQuery groupByContentId() Group by the content_id column
|
||||
* @method ChildContentDocumentQuery groupByFile() Group by the file column
|
||||
* @method ChildContentDocumentQuery groupByPosition() Group by the position column
|
||||
* @method ChildContentDocumentQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildContentDocumentQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildContentDocumentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildContentDocumentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildContentDocumentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildContentDocumentQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
|
||||
* @method ChildContentDocumentQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
|
||||
* @method ChildContentDocumentQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
|
||||
*
|
||||
* @method ChildContentDocumentQuery leftJoinContentDocumentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentDocumentI18n relation
|
||||
* @method ChildContentDocumentQuery rightJoinContentDocumentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentDocumentI18n relation
|
||||
* @method ChildContentDocumentQuery innerJoinContentDocumentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentDocumentI18n relation
|
||||
*
|
||||
* @method ChildContentDocument findOne(ConnectionInterface $con = null) Return the first ChildContentDocument matching the query
|
||||
* @method ChildContentDocument findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentDocument matching the query, or a new ChildContentDocument object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildContentDocument findOneById(int $id) Return the first ChildContentDocument filtered by the id column
|
||||
* @method ChildContentDocument findOneByContentId(int $content_id) Return the first ChildContentDocument filtered by the content_id column
|
||||
* @method ChildContentDocument findOneByFile(string $file) Return the first ChildContentDocument filtered by the file column
|
||||
* @method ChildContentDocument findOneByPosition(int $position) Return the first ChildContentDocument filtered by the position column
|
||||
* @method ChildContentDocument findOneByCreatedAt(string $created_at) Return the first ChildContentDocument filtered by the created_at column
|
||||
* @method ChildContentDocument findOneByUpdatedAt(string $updated_at) Return the first ChildContentDocument filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildContentDocument objects filtered by the id column
|
||||
* @method array findByContentId(int $content_id) Return ChildContentDocument objects filtered by the content_id column
|
||||
* @method array findByFile(string $file) Return ChildContentDocument objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildContentDocument objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildContentDocument objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildContentDocument objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class ContentDocumentQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentDocumentQuery 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\\ContentDocument', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildContentDocumentQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildContentDocumentQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ContentDocumentQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ContentDocumentQuery();
|
||||
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 ChildContentDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ContentDocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentDocumentTableMap::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 ChildContentDocument A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CONTENT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM content_document 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 ChildContentDocument();
|
||||
$obj->hydrate($row);
|
||||
ContentDocumentTableMap::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 ChildContentDocument|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 ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::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 ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::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 ChildContentDocumentQuery 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(ContentDocumentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::ID, $id, $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 ChildContentDocumentQuery 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(ContentDocumentTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($contentId['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::CONTENT_ID, $contentId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::FILE, $file, $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 ChildContentDocumentQuery 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(ContentDocumentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::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 ChildContentDocumentQuery 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(ContentDocumentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::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 ChildContentDocumentQuery 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(ContentDocumentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContent($content, $comparison = null)
|
||||
{
|
||||
if ($content instanceof \Thelia\Model\Content) {
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentTableMap::CONTENT_ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentTableMap::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 ChildContentDocumentQuery 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');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentDocumentI18n object
|
||||
*
|
||||
* @param \Thelia\Model\ContentDocumentI18n|ObjectCollection $contentDocumentI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentDocumentI18n($contentDocumentI18n, $comparison = null)
|
||||
{
|
||||
if ($contentDocumentI18n instanceof \Thelia\Model\ContentDocumentI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentTableMap::ID, $contentDocumentI18n->getId(), $comparison);
|
||||
} elseif ($contentDocumentI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useContentDocumentI18nQuery()
|
||||
->filterByPrimaryKeys($contentDocumentI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByContentDocumentI18n() only accepts arguments of type \Thelia\Model\ContentDocumentI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentDocumentI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentDocumentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentDocumentI18n');
|
||||
|
||||
// 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, 'ContentDocumentI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentDocumentI18n relation ContentDocumentI18n 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\ContentDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentDocumentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinContentDocumentI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentDocumentI18n', '\Thelia\Model\ContentDocumentI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildContentDocument $contentDocument Object to remove from the list of results
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentDocument = null)
|
||||
{
|
||||
if ($contentDocument) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::ID, $contentDocument->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_document 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(ContentDocumentTableMap::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).
|
||||
ContentDocumentTableMap::clearInstancePool();
|
||||
ContentDocumentTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildContentDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildContentDocument 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(ContentDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ContentDocumentTableMap::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();
|
||||
|
||||
|
||||
ContentDocumentTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ContentDocumentTableMap::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 ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ContentDocumentI18n';
|
||||
|
||||
return $this
|
||||
->joinContentDocumentI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('ContentDocumentI18n');
|
||||
$this->with['ContentDocumentI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentDocumentI18n', '\Thelia\Model\ContentDocumentI18nQuery');
|
||||
}
|
||||
|
||||
} // ContentDocumentQuery
|
||||
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/ContentImageI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/ContentImageI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/ContentImageI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/ContentImageI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?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\ContentImageI18n as ChildContentImageI18n;
|
||||
use Thelia\Model\ContentImageI18nQuery as ChildContentImageI18nQuery;
|
||||
use Thelia\Model\Map\ContentImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'content_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildContentImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildContentImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildContentImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildContentImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildContentImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildContentImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildContentImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildContentImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildContentImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildContentImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildContentImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildContentImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildContentImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildContentImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildContentImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildContentImageI18nQuery leftJoinContentImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentImage relation
|
||||
* @method ChildContentImageI18nQuery rightJoinContentImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentImage relation
|
||||
* @method ChildContentImageI18nQuery innerJoinContentImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentImage relation
|
||||
*
|
||||
* @method ChildContentImageI18n findOne(ConnectionInterface $con = null) Return the first ChildContentImageI18n matching the query
|
||||
* @method ChildContentImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentImageI18n matching the query, or a new ChildContentImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildContentImageI18n findOneById(int $id) Return the first ChildContentImageI18n filtered by the id column
|
||||
* @method ChildContentImageI18n findOneByLocale(string $locale) Return the first ChildContentImageI18n filtered by the locale column
|
||||
* @method ChildContentImageI18n findOneByTitle(string $title) Return the first ChildContentImageI18n filtered by the title column
|
||||
* @method ChildContentImageI18n findOneByDescription(string $description) Return the first ChildContentImageI18n filtered by the description column
|
||||
* @method ChildContentImageI18n findOneByChapo(string $chapo) Return the first ChildContentImageI18n filtered by the chapo column
|
||||
* @method ChildContentImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildContentImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildContentImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildContentImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildContentImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildContentImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildContentImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildContentImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class ContentImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentImageI18nQuery 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\\ContentImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildContentImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildContentImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ContentImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ContentImageI18nQuery();
|
||||
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 ChildContentImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ContentImageI18nTableMap::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(ContentImageI18nTableMap::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 ChildContentImageI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM content_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildContentImageI18n();
|
||||
$obj->hydrate($row);
|
||||
ContentImageI18nTableMap::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 ChildContentImageI18n|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 ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ContentImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentImageI18nTableMap::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 ChildContentImageI18nQuery 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(ContentImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ContentImageI18nTableMap::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 filterByContentImage()
|
||||
*
|
||||
* @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 ChildContentImageI18nQuery 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(ContentImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::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 ChildContentImageI18nQuery 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(ContentImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentImage object
|
||||
*
|
||||
* @param \Thelia\Model\ContentImage|ObjectCollection $contentImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentImage($contentImage, $comparison = null)
|
||||
{
|
||||
if ($contentImage instanceof \Thelia\Model\ContentImage) {
|
||||
return $this
|
||||
->addUsingAlias(ContentImageI18nTableMap::ID, $contentImage->getId(), $comparison);
|
||||
} elseif ($contentImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentImageI18nTableMap::ID, $contentImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContentImage() only accepts arguments of type \Thelia\Model\ContentImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentImage');
|
||||
|
||||
// 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, 'ContentImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentImage relation ContentImage 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\ContentImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinContentImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentImage', '\Thelia\Model\ContentImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildContentImageI18n $contentImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentImageI18n = null)
|
||||
{
|
||||
if ($contentImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ContentImageI18nTableMap::ID), $contentImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ContentImageI18nTableMap::LOCALE), $contentImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentImageI18nTableMap::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).
|
||||
ContentImageI18nTableMap::clearInstancePool();
|
||||
ContentImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildContentImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildContentImageI18n 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(ContentImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ContentImageI18nTableMap::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();
|
||||
|
||||
|
||||
ContentImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ContentImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ContentImageI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/ContentImageQuery.php
Normal file
846
core/lib/Thelia/Model/Base/ContentImageQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?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\ContentImage as ChildContentImage;
|
||||
use Thelia\Model\ContentImageI18nQuery as ChildContentImageI18nQuery;
|
||||
use Thelia\Model\ContentImageQuery as ChildContentImageQuery;
|
||||
use Thelia\Model\Map\ContentImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'content_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildContentImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildContentImageQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
|
||||
* @method ChildContentImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildContentImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildContentImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildContentImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildContentImageQuery groupById() Group by the id column
|
||||
* @method ChildContentImageQuery groupByContentId() Group by the content_id column
|
||||
* @method ChildContentImageQuery groupByFile() Group by the file column
|
||||
* @method ChildContentImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildContentImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildContentImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildContentImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildContentImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildContentImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildContentImageQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
|
||||
* @method ChildContentImageQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
|
||||
* @method ChildContentImageQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
|
||||
*
|
||||
* @method ChildContentImageQuery leftJoinContentImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentImageI18n relation
|
||||
* @method ChildContentImageQuery rightJoinContentImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentImageI18n relation
|
||||
* @method ChildContentImageQuery innerJoinContentImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentImageI18n relation
|
||||
*
|
||||
* @method ChildContentImage findOne(ConnectionInterface $con = null) Return the first ChildContentImage matching the query
|
||||
* @method ChildContentImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentImage matching the query, or a new ChildContentImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildContentImage findOneById(int $id) Return the first ChildContentImage filtered by the id column
|
||||
* @method ChildContentImage findOneByContentId(int $content_id) Return the first ChildContentImage filtered by the content_id column
|
||||
* @method ChildContentImage findOneByFile(string $file) Return the first ChildContentImage filtered by the file column
|
||||
* @method ChildContentImage findOneByPosition(int $position) Return the first ChildContentImage filtered by the position column
|
||||
* @method ChildContentImage findOneByCreatedAt(string $created_at) Return the first ChildContentImage filtered by the created_at column
|
||||
* @method ChildContentImage findOneByUpdatedAt(string $updated_at) Return the first ChildContentImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildContentImage objects filtered by the id column
|
||||
* @method array findByContentId(int $content_id) Return ChildContentImage objects filtered by the content_id column
|
||||
* @method array findByFile(string $file) Return ChildContentImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildContentImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildContentImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildContentImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class ContentImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentImageQuery 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\\ContentImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildContentImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildContentImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ContentImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ContentImageQuery();
|
||||
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 ChildContentImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ContentImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentImageTableMap::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 ChildContentImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CONTENT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM content_image 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 ChildContentImage();
|
||||
$obj->hydrate($row);
|
||||
ContentImageTableMap::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 ChildContentImage|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 ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::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 ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::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 ChildContentImageQuery 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(ContentImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::ID, $id, $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 ChildContentImageQuery 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(ContentImageTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($contentId['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::CONTENT_ID, $contentId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::FILE, $file, $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 ChildContentImageQuery 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(ContentImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::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 ChildContentImageQuery 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(ContentImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::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 ChildContentImageQuery 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(ContentImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContent($content, $comparison = null)
|
||||
{
|
||||
if ($content instanceof \Thelia\Model\Content) {
|
||||
return $this
|
||||
->addUsingAlias(ContentImageTableMap::CONTENT_ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentImageTableMap::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 ChildContentImageQuery 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');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\ContentImageI18n|ObjectCollection $contentImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentImageI18n($contentImageI18n, $comparison = null)
|
||||
{
|
||||
if ($contentImageI18n instanceof \Thelia\Model\ContentImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ContentImageTableMap::ID, $contentImageI18n->getId(), $comparison);
|
||||
} elseif ($contentImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useContentImageI18nQuery()
|
||||
->filterByPrimaryKeys($contentImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByContentImageI18n() only accepts arguments of type \Thelia\Model\ContentImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentImageI18n');
|
||||
|
||||
// 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, 'ContentImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentImageI18n relation ContentImageI18n 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\ContentImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinContentImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentImageI18n', '\Thelia\Model\ContentImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildContentImage $contentImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentImage = null)
|
||||
{
|
||||
if ($contentImage) {
|
||||
$this->addUsingAlias(ContentImageTableMap::ID, $contentImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_image 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(ContentImageTableMap::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).
|
||||
ContentImageTableMap::clearInstancePool();
|
||||
ContentImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildContentImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildContentImage 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(ContentImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ContentImageTableMap::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();
|
||||
|
||||
|
||||
ContentImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ContentImageTableMap::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 ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ContentImageI18n';
|
||||
|
||||
return $this
|
||||
->joinContentImageI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('ContentImageI18n');
|
||||
$this->with['ContentImageI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentImageI18n', '\Thelia\Model\ContentImageI18nQuery');
|
||||
}
|
||||
|
||||
} // ContentImageQuery
|
||||
@@ -48,14 +48,6 @@ use Thelia\Model\Map\ContentTableMap;
|
||||
* @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 leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildContentQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildContentQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @method ChildContentQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildContentQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildContentQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document 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 +56,14 @@ use Thelia\Model\Map\ContentTableMap;
|
||||
* @method ChildContentQuery rightJoinContentFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentFolder relation
|
||||
* @method ChildContentQuery innerJoinContentFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentFolder relation
|
||||
*
|
||||
* @method ChildContentQuery leftJoinContentImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentImage relation
|
||||
* @method ChildContentQuery rightJoinContentImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentImage relation
|
||||
* @method ChildContentQuery innerJoinContentImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentImage relation
|
||||
*
|
||||
* @method ChildContentQuery leftJoinContentDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentDocument relation
|
||||
* @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 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
|
||||
@@ -671,152 +671,6 @@ abstract class ContentQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentAssoc', '\Thelia\Model\ContentAssocQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image 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 filterByImage($image, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
return $this
|
||||
->addUsingAlias(ContentTableMap::ID, $image->getContentId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useImageQuery()
|
||||
->filterByPrimaryKeys($image->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image 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 joinImage($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
|
||||
// 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, 'Image');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image 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\ImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document 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 filterByDocument($document, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
return $this
|
||||
->addUsingAlias(ContentTableMap::ID, $document->getContentId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useDocumentQuery()
|
||||
->filterByPrimaryKeys($document->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document 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 joinDocument($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
|
||||
// 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, 'Document');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document 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\DocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Rewriting object
|
||||
*
|
||||
@@ -963,6 +817,152 @@ abstract class ContentQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentFolder', '\Thelia\Model\ContentFolderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentImage object
|
||||
*
|
||||
* @param \Thelia\Model\ContentImage|ObjectCollection $contentImage 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 filterByContentImage($contentImage, $comparison = null)
|
||||
{
|
||||
if ($contentImage instanceof \Thelia\Model\ContentImage) {
|
||||
return $this
|
||||
->addUsingAlias(ContentTableMap::ID, $contentImage->getContentId(), $comparison);
|
||||
} elseif ($contentImage instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useContentImageQuery()
|
||||
->filterByPrimaryKeys($contentImage->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByContentImage() only accepts arguments of type \Thelia\Model\ContentImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentImage 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 joinContentImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentImage');
|
||||
|
||||
// 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, 'ContentImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentImage relation ContentImage 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\ContentImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinContentImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentImage', '\Thelia\Model\ContentImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentDocument object
|
||||
*
|
||||
* @param \Thelia\Model\ContentDocument|ObjectCollection $contentDocument 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 filterByContentDocument($contentDocument, $comparison = null)
|
||||
{
|
||||
if ($contentDocument instanceof \Thelia\Model\ContentDocument) {
|
||||
return $this
|
||||
->addUsingAlias(ContentTableMap::ID, $contentDocument->getContentId(), $comparison);
|
||||
} elseif ($contentDocument instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useContentDocumentQuery()
|
||||
->filterByPrimaryKeys($contentDocument->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByContentDocument() only accepts arguments of type \Thelia\Model\ContentDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentDocument 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 joinContentDocument($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentDocument');
|
||||
|
||||
// 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, 'ContentDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentDocument relation ContentDocument 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\ContentDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentDocumentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinContentDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentDocument', '\Thelia\Model\ContentDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentI18n object
|
||||
*
|
||||
|
||||
@@ -93,12 +93,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
*/
|
||||
protected $by_default;
|
||||
|
||||
/**
|
||||
* The value for the position field.
|
||||
* @var int
|
||||
*/
|
||||
protected $position;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -490,17 +484,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
return $this->by_default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [position] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -646,27 +629,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setByDefault()
|
||||
|
||||
/**
|
||||
* Set the value of [position] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\Currency The current object (for fluent API support)
|
||||
*/
|
||||
public function setPosition($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->position !== $v) {
|
||||
$this->position = $v;
|
||||
$this->modifiedColumns[] = CurrencyTableMap::POSITION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setPosition()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -761,16 +723,13 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CurrencyTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->by_default = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CurrencyTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->position = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CurrencyTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CurrencyTableMap::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 ? 7 + $startcol : CurrencyTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CurrencyTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -783,7 +742,7 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 8; // 8 = CurrencyTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 7; // 7 = CurrencyTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\Currency object", 0, $e);
|
||||
@@ -1096,9 +1055,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CurrencyTableMap::BY_DEFAULT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'BY_DEFAULT';
|
||||
}
|
||||
if ($this->isColumnModified(CurrencyTableMap::POSITION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'POSITION';
|
||||
}
|
||||
if ($this->isColumnModified(CurrencyTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
|
||||
}
|
||||
@@ -1131,9 +1087,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
case 'BY_DEFAULT':
|
||||
$stmt->bindValue($identifier, $this->by_default, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'POSITION':
|
||||
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'CREATED_AT':
|
||||
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1218,12 +1171,9 @@ abstract class Currency implements ActiveRecordInterface
|
||||
return $this->getByDefault();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getPosition();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 7:
|
||||
case 6:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1260,9 +1210,8 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$keys[2] => $this->getSymbol(),
|
||||
$keys[3] => $this->getRate(),
|
||||
$keys[4] => $this->getByDefault(),
|
||||
$keys[5] => $this->getPosition(),
|
||||
$keys[6] => $this->getCreatedAt(),
|
||||
$keys[7] => $this->getUpdatedAt(),
|
||||
$keys[5] => $this->getCreatedAt(),
|
||||
$keys[6] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1333,12 +1282,9 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$this->setByDefault($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setPosition($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 7:
|
||||
case 6:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1370,9 +1316,8 @@ abstract class Currency implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[2], $arr)) $this->setSymbol($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setRate($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setByDefault($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setPosition($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1389,7 +1334,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CurrencyTableMap::SYMBOL)) $criteria->add(CurrencyTableMap::SYMBOL, $this->symbol);
|
||||
if ($this->isColumnModified(CurrencyTableMap::RATE)) $criteria->add(CurrencyTableMap::RATE, $this->rate);
|
||||
if ($this->isColumnModified(CurrencyTableMap::BY_DEFAULT)) $criteria->add(CurrencyTableMap::BY_DEFAULT, $this->by_default);
|
||||
if ($this->isColumnModified(CurrencyTableMap::POSITION)) $criteria->add(CurrencyTableMap::POSITION, $this->position);
|
||||
if ($this->isColumnModified(CurrencyTableMap::CREATED_AT)) $criteria->add(CurrencyTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(CurrencyTableMap::UPDATED_AT)) $criteria->add(CurrencyTableMap::UPDATED_AT, $this->updated_at);
|
||||
|
||||
@@ -1459,7 +1403,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$copyObj->setSymbol($this->getSymbol());
|
||||
$copyObj->setRate($this->getRate());
|
||||
$copyObj->setByDefault($this->getByDefault());
|
||||
$copyObj->setPosition($this->getPosition());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
|
||||
@@ -2636,7 +2579,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$this->symbol = null;
|
||||
$this->rate = null;
|
||||
$this->by_default = null;
|
||||
$this->position = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->alreadyInSave = false;
|
||||
|
||||
@@ -27,7 +27,6 @@ use Thelia\Model\Map\CurrencyTableMap;
|
||||
* @method ChildCurrencyQuery orderBySymbol($order = Criteria::ASC) Order by the symbol column
|
||||
* @method ChildCurrencyQuery orderByRate($order = Criteria::ASC) Order by the rate column
|
||||
* @method ChildCurrencyQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
|
||||
* @method ChildCurrencyQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildCurrencyQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCurrencyQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
@@ -36,7 +35,6 @@ use Thelia\Model\Map\CurrencyTableMap;
|
||||
* @method ChildCurrencyQuery groupBySymbol() Group by the symbol column
|
||||
* @method ChildCurrencyQuery groupByRate() Group by the rate column
|
||||
* @method ChildCurrencyQuery groupByByDefault() Group by the by_default column
|
||||
* @method ChildCurrencyQuery groupByPosition() Group by the position column
|
||||
* @method ChildCurrencyQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCurrencyQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
@@ -68,7 +66,6 @@ use Thelia\Model\Map\CurrencyTableMap;
|
||||
* @method ChildCurrency findOneBySymbol(string $symbol) Return the first ChildCurrency filtered by the symbol column
|
||||
* @method ChildCurrency findOneByRate(double $rate) Return the first ChildCurrency filtered by the rate column
|
||||
* @method ChildCurrency findOneByByDefault(int $by_default) Return the first ChildCurrency filtered by the by_default column
|
||||
* @method ChildCurrency findOneByPosition(int $position) Return the first ChildCurrency filtered by the position column
|
||||
* @method ChildCurrency findOneByCreatedAt(string $created_at) Return the first ChildCurrency filtered by the created_at column
|
||||
* @method ChildCurrency findOneByUpdatedAt(string $updated_at) Return the first ChildCurrency filtered by the updated_at column
|
||||
*
|
||||
@@ -77,7 +74,6 @@ use Thelia\Model\Map\CurrencyTableMap;
|
||||
* @method array findBySymbol(string $symbol) Return ChildCurrency objects filtered by the symbol column
|
||||
* @method array findByRate(double $rate) Return ChildCurrency objects filtered by the rate column
|
||||
* @method array findByByDefault(int $by_default) Return ChildCurrency objects filtered by the by_default column
|
||||
* @method array findByPosition(int $position) Return ChildCurrency objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCurrency objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCurrency objects filtered by the updated_at column
|
||||
*
|
||||
@@ -168,7 +164,7 @@ abstract class CurrencyQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CODE, SYMBOL, RATE, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM currency WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, CODE, SYMBOL, RATE, BY_DEFAULT, CREATED_AT, UPDATED_AT FROM currency WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -438,47 +434,6 @@ abstract class CurrencyQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CurrencyTableMap::BY_DEFAULT, $byDefault, $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 ChildCurrencyQuery 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(CurrencyTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(CurrencyTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CurrencyTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1990
core/lib/Thelia/Model/Base/FolderDocument.php
Normal file
1990
core/lib/Thelia/Model/Base/FolderDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/FolderDocumentI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/FolderDocumentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/FolderDocumentI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/FolderDocumentI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?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\FolderDocumentI18n as ChildFolderDocumentI18n;
|
||||
use Thelia\Model\FolderDocumentI18nQuery as ChildFolderDocumentI18nQuery;
|
||||
use Thelia\Model\Map\FolderDocumentI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'folder_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildFolderDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildFolderDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildFolderDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildFolderDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildFolderDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildFolderDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildFolderDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildFolderDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildFolderDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildFolderDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildFolderDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildFolderDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildFolderDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildFolderDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildFolderDocumentI18nQuery leftJoinFolderDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderDocument relation
|
||||
* @method ChildFolderDocumentI18nQuery rightJoinFolderDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderDocument relation
|
||||
* @method ChildFolderDocumentI18nQuery innerJoinFolderDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderDocument relation
|
||||
*
|
||||
* @method ChildFolderDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildFolderDocumentI18n matching the query
|
||||
* @method ChildFolderDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderDocumentI18n matching the query, or a new ChildFolderDocumentI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildFolderDocumentI18n findOneById(int $id) Return the first ChildFolderDocumentI18n filtered by the id column
|
||||
* @method ChildFolderDocumentI18n findOneByLocale(string $locale) Return the first ChildFolderDocumentI18n filtered by the locale column
|
||||
* @method ChildFolderDocumentI18n findOneByTitle(string $title) Return the first ChildFolderDocumentI18n filtered by the title column
|
||||
* @method ChildFolderDocumentI18n findOneByDescription(string $description) Return the first ChildFolderDocumentI18n filtered by the description column
|
||||
* @method ChildFolderDocumentI18n findOneByChapo(string $chapo) Return the first ChildFolderDocumentI18n filtered by the chapo column
|
||||
* @method ChildFolderDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildFolderDocumentI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildFolderDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildFolderDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildFolderDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildFolderDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildFolderDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildFolderDocumentI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class FolderDocumentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\FolderDocumentI18nQuery 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\\FolderDocumentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildFolderDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\FolderDocumentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\FolderDocumentI18nQuery();
|
||||
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 ChildFolderDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = FolderDocumentI18nTableMap::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(FolderDocumentI18nTableMap::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 ChildFolderDocumentI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM folder_document_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 ChildFolderDocumentI18n();
|
||||
$obj->hydrate($row);
|
||||
FolderDocumentI18nTableMap::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 ChildFolderDocumentI18n|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 ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(FolderDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(FolderDocumentI18nTableMap::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 ChildFolderDocumentI18nQuery 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(FolderDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(FolderDocumentI18nTableMap::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 filterByFolderDocument()
|
||||
*
|
||||
* @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 ChildFolderDocumentI18nQuery 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(FolderDocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::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 ChildFolderDocumentI18nQuery 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(FolderDocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderDocument object
|
||||
*
|
||||
* @param \Thelia\Model\FolderDocument|ObjectCollection $folderDocument The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderDocument($folderDocument, $comparison = null)
|
||||
{
|
||||
if ($folderDocument instanceof \Thelia\Model\FolderDocument) {
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentI18nTableMap::ID, $folderDocument->getId(), $comparison);
|
||||
} elseif ($folderDocument instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentI18nTableMap::ID, $folderDocument->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByFolderDocument() only accepts arguments of type \Thelia\Model\FolderDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderDocument');
|
||||
|
||||
// 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, 'FolderDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderDocument relation FolderDocument 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\FolderDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinFolderDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderDocument', '\Thelia\Model\FolderDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildFolderDocumentI18n $folderDocumentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($folderDocumentI18n = null)
|
||||
{
|
||||
if ($folderDocumentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(FolderDocumentI18nTableMap::ID), $folderDocumentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(FolderDocumentI18nTableMap::LOCALE), $folderDocumentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the folder_document_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(FolderDocumentI18nTableMap::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).
|
||||
FolderDocumentI18nTableMap::clearInstancePool();
|
||||
FolderDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildFolderDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildFolderDocumentI18n 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(FolderDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(FolderDocumentI18nTableMap::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();
|
||||
|
||||
|
||||
FolderDocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
FolderDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // FolderDocumentI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/FolderDocumentQuery.php
Normal file
846
core/lib/Thelia/Model/Base/FolderDocumentQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?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\FolderDocument as ChildFolderDocument;
|
||||
use Thelia\Model\FolderDocumentI18nQuery as ChildFolderDocumentI18nQuery;
|
||||
use Thelia\Model\FolderDocumentQuery as ChildFolderDocumentQuery;
|
||||
use Thelia\Model\Map\FolderDocumentTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'folder_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildFolderDocumentQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildFolderDocumentQuery orderByFolderId($order = Criteria::ASC) Order by the folder_id column
|
||||
* @method ChildFolderDocumentQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildFolderDocumentQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildFolderDocumentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildFolderDocumentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildFolderDocumentQuery groupById() Group by the id column
|
||||
* @method ChildFolderDocumentQuery groupByFolderId() Group by the folder_id column
|
||||
* @method ChildFolderDocumentQuery groupByFile() Group by the file column
|
||||
* @method ChildFolderDocumentQuery groupByPosition() Group by the position column
|
||||
* @method ChildFolderDocumentQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildFolderDocumentQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildFolderDocumentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildFolderDocumentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderDocumentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildFolderDocumentQuery leftJoinFolder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Folder relation
|
||||
* @method ChildFolderDocumentQuery rightJoinFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Folder relation
|
||||
* @method ChildFolderDocumentQuery innerJoinFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the Folder relation
|
||||
*
|
||||
* @method ChildFolderDocumentQuery leftJoinFolderDocumentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderDocumentI18n relation
|
||||
* @method ChildFolderDocumentQuery rightJoinFolderDocumentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderDocumentI18n relation
|
||||
* @method ChildFolderDocumentQuery innerJoinFolderDocumentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderDocumentI18n relation
|
||||
*
|
||||
* @method ChildFolderDocument findOne(ConnectionInterface $con = null) Return the first ChildFolderDocument matching the query
|
||||
* @method ChildFolderDocument findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderDocument matching the query, or a new ChildFolderDocument object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildFolderDocument findOneById(int $id) Return the first ChildFolderDocument filtered by the id column
|
||||
* @method ChildFolderDocument findOneByFolderId(int $folder_id) Return the first ChildFolderDocument filtered by the folder_id column
|
||||
* @method ChildFolderDocument findOneByFile(string $file) Return the first ChildFolderDocument filtered by the file column
|
||||
* @method ChildFolderDocument findOneByPosition(int $position) Return the first ChildFolderDocument filtered by the position column
|
||||
* @method ChildFolderDocument findOneByCreatedAt(string $created_at) Return the first ChildFolderDocument filtered by the created_at column
|
||||
* @method ChildFolderDocument findOneByUpdatedAt(string $updated_at) Return the first ChildFolderDocument filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildFolderDocument objects filtered by the id column
|
||||
* @method array findByFolderId(int $folder_id) Return ChildFolderDocument objects filtered by the folder_id column
|
||||
* @method array findByFile(string $file) Return ChildFolderDocument objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildFolderDocument objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildFolderDocument objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildFolderDocument objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class FolderDocumentQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\FolderDocumentQuery 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\\FolderDocument', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildFolderDocumentQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildFolderDocumentQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\FolderDocumentQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\FolderDocumentQuery();
|
||||
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 ChildFolderDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = FolderDocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(FolderDocumentTableMap::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 ChildFolderDocument A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, FOLDER_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM folder_document 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 ChildFolderDocument();
|
||||
$obj->hydrate($row);
|
||||
FolderDocumentTableMap::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 ChildFolderDocument|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 ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::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 ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::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 ChildFolderDocumentQuery 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(FolderDocumentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the folder_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFolderId(1234); // WHERE folder_id = 1234
|
||||
* $query->filterByFolderId(array(12, 34)); // WHERE folder_id IN (12, 34)
|
||||
* $query->filterByFolderId(array('min' => 12)); // WHERE folder_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByFolder()
|
||||
*
|
||||
* @param mixed $folderId 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 ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderId($folderId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($folderId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($folderId['min'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folderId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($folderId['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folderId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folderId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::FILE, $file, $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 ChildFolderDocumentQuery 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(FolderDocumentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::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 ChildFolderDocumentQuery 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(FolderDocumentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::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 ChildFolderDocumentQuery 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(FolderDocumentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Folder object
|
||||
*
|
||||
* @param \Thelia\Model\Folder|ObjectCollection $folder The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolder($folder, $comparison = null)
|
||||
{
|
||||
if ($folder instanceof \Thelia\Model\Folder) {
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folder->getId(), $comparison);
|
||||
} elseif ($folder instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folder->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByFolder() only accepts arguments of type \Thelia\Model\Folder or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Folder relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Folder');
|
||||
|
||||
// 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, 'Folder');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Folder relation Folder 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\FolderQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinFolder($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Folder', '\Thelia\Model\FolderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderDocumentI18n object
|
||||
*
|
||||
* @param \Thelia\Model\FolderDocumentI18n|ObjectCollection $folderDocumentI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderDocumentI18n($folderDocumentI18n, $comparison = null)
|
||||
{
|
||||
if ($folderDocumentI18n instanceof \Thelia\Model\FolderDocumentI18n) {
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentTableMap::ID, $folderDocumentI18n->getId(), $comparison);
|
||||
} elseif ($folderDocumentI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useFolderDocumentI18nQuery()
|
||||
->filterByPrimaryKeys($folderDocumentI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByFolderDocumentI18n() only accepts arguments of type \Thelia\Model\FolderDocumentI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderDocumentI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderDocumentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderDocumentI18n');
|
||||
|
||||
// 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, 'FolderDocumentI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderDocumentI18n relation FolderDocumentI18n 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\FolderDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderDocumentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinFolderDocumentI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderDocumentI18n', '\Thelia\Model\FolderDocumentI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildFolderDocument $folderDocument Object to remove from the list of results
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($folderDocument = null)
|
||||
{
|
||||
if ($folderDocument) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::ID, $folderDocument->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the folder_document 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(FolderDocumentTableMap::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).
|
||||
FolderDocumentTableMap::clearInstancePool();
|
||||
FolderDocumentTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildFolderDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildFolderDocument 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(FolderDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(FolderDocumentTableMap::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();
|
||||
|
||||
|
||||
FolderDocumentTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
FolderDocumentTableMap::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 ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(FolderDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(FolderDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(FolderDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(FolderDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'FolderDocumentI18n';
|
||||
|
||||
return $this
|
||||
->joinFolderDocumentI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('FolderDocumentI18n');
|
||||
$this->with['FolderDocumentI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderDocumentI18n', '\Thelia\Model\FolderDocumentI18nQuery');
|
||||
}
|
||||
|
||||
} // FolderDocumentQuery
|
||||
1990
core/lib/Thelia/Model/Base/FolderImage.php
Normal file
1990
core/lib/Thelia/Model/Base/FolderImage.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -14,17 +14,17 @@ use Propel\Runtime\Exception\BadMethodCallException;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Parser\AbstractParser;
|
||||
use Thelia\Model\Image as ChildImage;
|
||||
use Thelia\Model\ImageI18nQuery as ChildImageI18nQuery;
|
||||
use Thelia\Model\ImageQuery as ChildImageQuery;
|
||||
use Thelia\Model\Map\ImageI18nTableMap;
|
||||
use Thelia\Model\FolderImage as ChildFolderImage;
|
||||
use Thelia\Model\FolderImageI18nQuery as ChildFolderImageI18nQuery;
|
||||
use Thelia\Model\FolderImageQuery as ChildFolderImageQuery;
|
||||
use Thelia\Model\Map\FolderImageI18nTableMap;
|
||||
|
||||
abstract class ImageI18n implements ActiveRecordInterface
|
||||
abstract class FolderImageI18n implements ActiveRecordInterface
|
||||
{
|
||||
/**
|
||||
* TableMap class name
|
||||
*/
|
||||
const TABLE_MAP = '\\Thelia\\Model\\Map\\ImageI18nTableMap';
|
||||
const TABLE_MAP = '\\Thelia\\Model\\Map\\FolderImageI18nTableMap';
|
||||
|
||||
|
||||
/**
|
||||
@@ -91,9 +91,9 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
protected $postscriptum;
|
||||
|
||||
/**
|
||||
* @var Image
|
||||
* @var FolderImage
|
||||
*/
|
||||
protected $aImage;
|
||||
protected $aFolderImage;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
@@ -115,7 +115,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes internal state of Thelia\Model\Base\ImageI18n object.
|
||||
* Initializes internal state of Thelia\Model\Base\FolderImageI18n object.
|
||||
* @see applyDefaults()
|
||||
*/
|
||||
public function __construct()
|
||||
@@ -212,9 +212,9 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares this with another <code>ImageI18n</code> instance. If
|
||||
* <code>obj</code> is an instance of <code>ImageI18n</code>, delegates to
|
||||
* <code>equals(ImageI18n)</code>. Otherwise, returns <code>false</code>.
|
||||
* Compares this with another <code>FolderImageI18n</code> instance. If
|
||||
* <code>obj</code> is an instance of <code>FolderImageI18n</code>, delegates to
|
||||
* <code>equals(FolderImageI18n)</code>. Otherwise, returns <code>false</code>.
|
||||
*
|
||||
* @param obj The object to compare to.
|
||||
* @return Whether equal to the object specified.
|
||||
@@ -295,7 +295,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* @param string $name The virtual column name
|
||||
* @param mixed $value The value to give to the virtual column
|
||||
*
|
||||
* @return ImageI18n The current object, for fluid interface
|
||||
* @return FolderImageI18n The current object, for fluid interface
|
||||
*/
|
||||
public function setVirtualColumn($name, $value)
|
||||
{
|
||||
@@ -327,7 +327,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
|
||||
* @param string $data The source data to import from
|
||||
*
|
||||
* @return ImageI18n The current object, for fluid interface
|
||||
* @return FolderImageI18n The current object, for fluid interface
|
||||
*/
|
||||
public function importFrom($parser, $data)
|
||||
{
|
||||
@@ -440,7 +440,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setId($v)
|
||||
{
|
||||
@@ -450,11 +450,11 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->id !== $v) {
|
||||
$this->id = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::ID;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::ID;
|
||||
}
|
||||
|
||||
if ($this->aImage !== null && $this->aImage->getId() !== $v) {
|
||||
$this->aImage = null;
|
||||
if ($this->aFolderImage !== null && $this->aFolderImage->getId() !== $v) {
|
||||
$this->aFolderImage = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [locale] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setLocale($v)
|
||||
{
|
||||
@@ -475,7 +475,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->locale !== $v) {
|
||||
$this->locale = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::LOCALE;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::LOCALE;
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [title] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setTitle($v)
|
||||
{
|
||||
@@ -496,7 +496,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->title !== $v) {
|
||||
$this->title = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::TITLE;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::TITLE;
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setDescription($v)
|
||||
{
|
||||
@@ -517,7 +517,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->description !== $v) {
|
||||
$this->description = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::DESCRIPTION;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
@@ -528,7 +528,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [chapo] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setChapo($v)
|
||||
{
|
||||
@@ -538,7 +538,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->chapo !== $v) {
|
||||
$this->chapo = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::CHAPO;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::CHAPO;
|
||||
}
|
||||
|
||||
|
||||
@@ -549,7 +549,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [postscriptum] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setPostscriptum($v)
|
||||
{
|
||||
@@ -559,7 +559,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->postscriptum !== $v) {
|
||||
$this->postscriptum = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::POSTSCRIPTUM;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::POSTSCRIPTUM;
|
||||
}
|
||||
|
||||
|
||||
@@ -607,22 +607,22 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
try {
|
||||
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ImageI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : FolderImageI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ImageI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : FolderImageI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->locale = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ImageI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FolderImageI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->title = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ImageI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FolderImageI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->description = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ImageI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : FolderImageI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->chapo = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ImageI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : FolderImageI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->postscriptum = (null !== $col) ? (string) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
@@ -632,10 +632,10 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 6; // 6 = ImageI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 6; // 6 = FolderImageI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\ImageI18n object", 0, $e);
|
||||
throw new PropelException("Error populating \Thelia\Model\FolderImageI18n object", 0, $e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,8 +654,8 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function ensureConsistency()
|
||||
{
|
||||
if ($this->aImage !== null && $this->id !== $this->aImage->getId()) {
|
||||
$this->aImage = null;
|
||||
if ($this->aFolderImage !== null && $this->id !== $this->aFolderImage->getId()) {
|
||||
$this->aFolderImage = null;
|
||||
}
|
||||
} // ensureConsistency
|
||||
|
||||
@@ -680,13 +680,13 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
// We don't need to alter the object instance pool; we're just modifying this instance
|
||||
// already in the pool.
|
||||
|
||||
$dataFetcher = ChildImageI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
|
||||
$dataFetcher = ChildFolderImageI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
|
||||
$row = $dataFetcher->fetch();
|
||||
$dataFetcher->close();
|
||||
if (!$row) {
|
||||
@@ -696,7 +696,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($deep) { // also de-associate any related objects?
|
||||
|
||||
$this->aImage = null;
|
||||
$this->aFolderImage = null;
|
||||
} // if (deep)
|
||||
}
|
||||
|
||||
@@ -706,8 +706,8 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* @param ConnectionInterface $con
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
* @see ImageI18n::setDeleted()
|
||||
* @see ImageI18n::isDeleted()
|
||||
* @see FolderImageI18n::setDeleted()
|
||||
* @see FolderImageI18n::isDeleted()
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
@@ -716,12 +716,12 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$con->beginTransaction();
|
||||
try {
|
||||
$deleteQuery = ChildImageI18nQuery::create()
|
||||
$deleteQuery = ChildFolderImageI18nQuery::create()
|
||||
->filterByPrimaryKey($this->getPrimaryKey());
|
||||
$ret = $this->preDelete($con);
|
||||
if ($ret) {
|
||||
@@ -758,7 +758,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$con->beginTransaction();
|
||||
@@ -778,7 +778,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
$this->postUpdate($con);
|
||||
}
|
||||
$this->postSave($con);
|
||||
ImageI18nTableMap::addInstanceToPool($this);
|
||||
FolderImageI18nTableMap::addInstanceToPool($this);
|
||||
} else {
|
||||
$affectedRows = 0;
|
||||
}
|
||||
@@ -813,11 +813,11 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
// method. This object relates to these object(s) by a
|
||||
// foreign key reference.
|
||||
|
||||
if ($this->aImage !== null) {
|
||||
if ($this->aImage->isModified() || $this->aImage->isNew()) {
|
||||
$affectedRows += $this->aImage->save($con);
|
||||
if ($this->aFolderImage !== null) {
|
||||
if ($this->aFolderImage->isModified() || $this->aFolderImage->isNew()) {
|
||||
$affectedRows += $this->aFolderImage->save($con);
|
||||
}
|
||||
$this->setImage($this->aImage);
|
||||
$this->setFolderImage($this->aFolderImage);
|
||||
}
|
||||
|
||||
if ($this->isNew() || $this->isModified()) {
|
||||
@@ -853,27 +853,27 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
|
||||
// check the columns in natural order for more readable SQL queries
|
||||
if ($this->isColumnModified(ImageI18nTableMap::ID)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'ID';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::LOCALE)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::LOCALE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'LOCALE';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::TITLE)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::TITLE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'TITLE';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::DESCRIPTION)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::CHAPO)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::CHAPO)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CHAPO';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::POSTSCRIPTUM)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::POSTSCRIPTUM)) {
|
||||
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'INSERT INTO image_i18n (%s) VALUES (%s)',
|
||||
'INSERT INTO folder_image_i18n (%s) VALUES (%s)',
|
||||
implode(', ', $modifiedColumns),
|
||||
implode(', ', array_keys($modifiedColumns))
|
||||
);
|
||||
@@ -939,7 +939,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = ImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$pos = FolderImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$field = $this->getByPosition($pos);
|
||||
|
||||
return $field;
|
||||
@@ -996,11 +996,11 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
|
||||
{
|
||||
if (isset($alreadyDumpedObjects['ImageI18n'][serialize($this->getPrimaryKey())])) {
|
||||
if (isset($alreadyDumpedObjects['FolderImageI18n'][serialize($this->getPrimaryKey())])) {
|
||||
return '*RECURSION*';
|
||||
}
|
||||
$alreadyDumpedObjects['ImageI18n'][serialize($this->getPrimaryKey())] = true;
|
||||
$keys = ImageI18nTableMap::getFieldNames($keyType);
|
||||
$alreadyDumpedObjects['FolderImageI18n'][serialize($this->getPrimaryKey())] = true;
|
||||
$keys = FolderImageI18nTableMap::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getLocale(),
|
||||
@@ -1016,8 +1016,8 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aImage) {
|
||||
$result['Image'] = $this->aImage->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
if (null !== $this->aFolderImage) {
|
||||
$result['FolderImage'] = $this->aFolderImage->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1037,7 +1037,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = ImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$pos = FolderImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
|
||||
return $this->setByPosition($pos, $value);
|
||||
}
|
||||
@@ -1093,7 +1093,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = ImageI18nTableMap::getFieldNames($keyType);
|
||||
$keys = FolderImageI18nTableMap::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setLocale($arr[$keys[1]]);
|
||||
@@ -1110,14 +1110,14 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function buildCriteria()
|
||||
{
|
||||
$criteria = new Criteria(ImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria = new Criteria(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(ImageI18nTableMap::ID)) $criteria->add(ImageI18nTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::LOCALE)) $criteria->add(ImageI18nTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::TITLE)) $criteria->add(ImageI18nTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::DESCRIPTION)) $criteria->add(ImageI18nTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::CHAPO)) $criteria->add(ImageI18nTableMap::CHAPO, $this->chapo);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::POSTSCRIPTUM)) $criteria->add(ImageI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::ID)) $criteria->add(FolderImageI18nTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::LOCALE)) $criteria->add(FolderImageI18nTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::TITLE)) $criteria->add(FolderImageI18nTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::DESCRIPTION)) $criteria->add(FolderImageI18nTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::CHAPO)) $criteria->add(FolderImageI18nTableMap::CHAPO, $this->chapo);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::POSTSCRIPTUM)) $criteria->add(FolderImageI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1132,9 +1132,9 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function buildPkeyCriteria()
|
||||
{
|
||||
$criteria = new Criteria(ImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria->add(ImageI18nTableMap::ID, $this->id);
|
||||
$criteria->add(ImageI18nTableMap::LOCALE, $this->locale);
|
||||
$criteria = new Criteria(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria->add(FolderImageI18nTableMap::ID, $this->id);
|
||||
$criteria->add(FolderImageI18nTableMap::LOCALE, $this->locale);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1181,7 +1181,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param object $copyObj An object of \Thelia\Model\ImageI18n (or compatible) type.
|
||||
* @param object $copyObj An object of \Thelia\Model\FolderImageI18n (or compatible) type.
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
|
||||
* @throws PropelException
|
||||
@@ -1208,7 +1208,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* objects.
|
||||
*
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @return \Thelia\Model\ImageI18n Clone of current object.
|
||||
* @return \Thelia\Model\FolderImageI18n Clone of current object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copy($deepCopy = false)
|
||||
@@ -1222,13 +1222,13 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a ChildImage object.
|
||||
* Declares an association between this object and a ChildFolderImage object.
|
||||
*
|
||||
* @param ChildImage $v
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @param ChildFolderImage $v
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setImage(ChildImage $v = null)
|
||||
public function setFolderImage(ChildFolderImage $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setId(NULL);
|
||||
@@ -1236,12 +1236,12 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
$this->setId($v->getId());
|
||||
}
|
||||
|
||||
$this->aImage = $v;
|
||||
$this->aFolderImage = $v;
|
||||
|
||||
// Add binding for other direction of this n:n relationship.
|
||||
// If this object has already been added to the ChildImage object, it will not be re-added.
|
||||
// If this object has already been added to the ChildFolderImage object, it will not be re-added.
|
||||
if ($v !== null) {
|
||||
$v->addImageI18n($this);
|
||||
$v->addFolderImageI18n($this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1250,26 +1250,26 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
|
||||
/**
|
||||
* Get the associated ChildImage object
|
||||
* Get the associated ChildFolderImage object
|
||||
*
|
||||
* @param ConnectionInterface $con Optional Connection object.
|
||||
* @return ChildImage The associated ChildImage object.
|
||||
* @return ChildFolderImage The associated ChildFolderImage object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getImage(ConnectionInterface $con = null)
|
||||
public function getFolderImage(ConnectionInterface $con = null)
|
||||
{
|
||||
if ($this->aImage === null && ($this->id !== null)) {
|
||||
$this->aImage = ChildImageQuery::create()->findPk($this->id, $con);
|
||||
if ($this->aFolderImage === null && ($this->id !== null)) {
|
||||
$this->aFolderImage = ChildFolderImageQuery::create()->findPk($this->id, $con);
|
||||
/* The following can be used additionally to
|
||||
guarantee the related object contains a reference
|
||||
to this object. This level of coupling may, however, be
|
||||
undesirable since it could result in an only partially populated collection
|
||||
in the referenced object.
|
||||
$this->aImage->addImageI18ns($this);
|
||||
$this->aFolderImage->addFolderImageI18ns($this);
|
||||
*/
|
||||
}
|
||||
|
||||
return $this->aImage;
|
||||
return $this->aFolderImage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1305,7 +1305,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
if ($deep) {
|
||||
} // if ($deep)
|
||||
|
||||
$this->aImage = null;
|
||||
$this->aFolderImage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1315,7 +1315,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->exportTo(ImageI18nTableMap::DEFAULT_STRING_FORMAT);
|
||||
return (string) $this->exportTo(FolderImageI18nTableMap::DEFAULT_STRING_FORMAT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -12,84 +12,84 @@ use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ImageI18n as ChildImageI18n;
|
||||
use Thelia\Model\ImageI18nQuery as ChildImageI18nQuery;
|
||||
use Thelia\Model\Map\ImageI18nTableMap;
|
||||
use Thelia\Model\FolderImageI18n as ChildFolderImageI18n;
|
||||
use Thelia\Model\FolderImageI18nQuery as ChildFolderImageI18nQuery;
|
||||
use Thelia\Model\Map\FolderImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'image_i18n' table.
|
||||
* Base class that represents a query for the 'folder_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
* @method ChildFolderImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildFolderImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildFolderImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildFolderImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildFolderImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildFolderImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
* @method ChildFolderImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildFolderImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildFolderImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildFolderImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildFolderImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildFolderImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @method ChildFolderImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildFolderImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildImageI18nQuery leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildImageI18nQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildImageI18nQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
* @method ChildFolderImageI18nQuery leftJoinFolderImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderImage relation
|
||||
* @method ChildFolderImageI18nQuery rightJoinFolderImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderImage relation
|
||||
* @method ChildFolderImageI18nQuery innerJoinFolderImage($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderImage relation
|
||||
*
|
||||
* @method ChildImageI18n findOne(ConnectionInterface $con = null) Return the first ChildImageI18n matching the query
|
||||
* @method ChildImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildImageI18n matching the query, or a new ChildImageI18n object populated from the query conditions when no match is found
|
||||
* @method ChildFolderImageI18n findOne(ConnectionInterface $con = null) Return the first ChildFolderImageI18n matching the query
|
||||
* @method ChildFolderImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderImageI18n matching the query, or a new ChildFolderImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildImageI18n findOneById(int $id) Return the first ChildImageI18n filtered by the id column
|
||||
* @method ChildImageI18n findOneByLocale(string $locale) Return the first ChildImageI18n filtered by the locale column
|
||||
* @method ChildImageI18n findOneByTitle(string $title) Return the first ChildImageI18n filtered by the title column
|
||||
* @method ChildImageI18n findOneByDescription(string $description) Return the first ChildImageI18n filtered by the description column
|
||||
* @method ChildImageI18n findOneByChapo(string $chapo) Return the first ChildImageI18n filtered by the chapo column
|
||||
* @method ChildImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildImageI18n filtered by the postscriptum column
|
||||
* @method ChildFolderImageI18n findOneById(int $id) Return the first ChildFolderImageI18n filtered by the id column
|
||||
* @method ChildFolderImageI18n findOneByLocale(string $locale) Return the first ChildFolderImageI18n filtered by the locale column
|
||||
* @method ChildFolderImageI18n findOneByTitle(string $title) Return the first ChildFolderImageI18n filtered by the title column
|
||||
* @method ChildFolderImageI18n findOneByDescription(string $description) Return the first ChildFolderImageI18n filtered by the description column
|
||||
* @method ChildFolderImageI18n findOneByChapo(string $chapo) Return the first ChildFolderImageI18n filtered by the chapo column
|
||||
* @method ChildFolderImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildFolderImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildImageI18n objects filtered by the postscriptum column
|
||||
* @method array findById(int $id) Return ChildFolderImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildFolderImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildFolderImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildFolderImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildFolderImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildFolderImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class ImageI18nQuery extends ModelCriteria
|
||||
abstract class FolderImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ImageI18nQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\FolderImageI18nQuery 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\\ImageI18n', $modelAlias = null)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\FolderImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildImageI18nQuery object.
|
||||
* Returns a new ChildFolderImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildImageI18nQuery
|
||||
* @return ChildFolderImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ImageI18nQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\FolderImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ImageI18nQuery();
|
||||
$query = new \Thelia\Model\FolderImageI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -112,19 +112,19 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildImageI18n|array|mixed the result, formatted by the current formatter
|
||||
* @return ChildFolderImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ImageI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
if ((null !== ($obj = FolderImageI18nTableMap::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(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -143,11 +143,11 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildImageI18n A model object, or null if the key is not found
|
||||
* @return ChildFolderImageI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM folder_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
@@ -159,9 +159,9 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildImageI18n();
|
||||
$obj = new ChildFolderImageI18n();
|
||||
$obj->hydrate($row);
|
||||
ImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
FolderImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -174,7 +174,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildImageI18n|array|mixed the result, formatted by the current formatter
|
||||
* @return ChildFolderImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
@@ -216,12 +216,12 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(FolderImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(FolderImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -239,8 +239,8 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(FolderImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(FolderImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByImage()
|
||||
* @see filterByFolderImage()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
@@ -266,18 +266,18 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery 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(ImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(FolderImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(FolderImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -288,7 +288,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
@@ -317,7 +317,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -333,7 +333,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
@@ -346,7 +346,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::TITLE, $title, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +362,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
@@ -375,7 +375,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -391,7 +391,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
@@ -404,7 +404,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -420,7 +420,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
@@ -433,46 +433,46 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
* Filter the query by a related \Thelia\Model\FolderImage object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image The related object(s) to use as filter
|
||||
* @param \Thelia\Model\FolderImage|ObjectCollection $folderImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByImage($image, $comparison = null)
|
||||
public function filterByFolderImage($folderImage, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
if ($folderImage instanceof \Thelia\Model\FolderImage) {
|
||||
return $this
|
||||
->addUsingAlias(ImageI18nTableMap::ID, $image->getId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
->addUsingAlias(FolderImageI18nTableMap::ID, $folderImage->getId(), $comparison);
|
||||
} elseif ($folderImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ImageI18nTableMap::ID, $image->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(FolderImageI18nTableMap::ID, $folderImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
throw new PropelException('filterByFolderImage() only accepts arguments of type \Thelia\Model\FolderImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image relation
|
||||
* Adds a JOIN clause to the query using the FolderImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
public function joinFolderImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
$relationMap = $tableMap->getRelation('FolderImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
@@ -487,14 +487,14 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Image');
|
||||
$this->addJoinObject($join, 'FolderImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image object
|
||||
* Use the FolderImage relation FolderImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
@@ -502,27 +502,27 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ImageQuery A secondary query class using the current class as primary query
|
||||
* @return \Thelia\Model\FolderImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
public function useFolderImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
->joinFolderImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderImage', '\Thelia\Model\FolderImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildImageI18n $imageI18n Object to remove from the list of results
|
||||
* @param ChildFolderImageI18n $folderImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($imageI18n = null)
|
||||
public function prune($folderImageI18n = null)
|
||||
{
|
||||
if ($imageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ImageI18nTableMap::ID), $imageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ImageI18nTableMap::LOCALE), $imageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
if ($folderImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(FolderImageI18nTableMap::ID), $folderImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(FolderImageI18nTableMap::LOCALE), $folderImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the image_i18n table.
|
||||
* Deletes all rows from the folder_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
@@ -538,7 +538,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
@@ -549,8 +549,8 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ImageI18nTableMap::clearInstancePool();
|
||||
ImageI18nTableMap::clearRelatedInstancePool();
|
||||
FolderImageI18nTableMap::clearInstancePool();
|
||||
FolderImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
@@ -562,9 +562,9 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildImageI18n or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ChildFolderImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildImageI18n object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ChildFolderImageI18n 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
|
||||
@@ -575,13 +575,13 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria->setDbName(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
@@ -591,10 +591,10 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
FolderImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ImageI18nTableMap::clearRelatedInstancePool();
|
||||
FolderImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
@@ -604,4 +604,4 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
} // ImageI18nQuery
|
||||
} // FolderImageI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/FolderImageQuery.php
Normal file
846
core/lib/Thelia/Model/Base/FolderImageQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?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\FolderImage as ChildFolderImage;
|
||||
use Thelia\Model\FolderImageI18nQuery as ChildFolderImageI18nQuery;
|
||||
use Thelia\Model\FolderImageQuery as ChildFolderImageQuery;
|
||||
use Thelia\Model\Map\FolderImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'folder_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildFolderImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildFolderImageQuery orderByFolderId($order = Criteria::ASC) Order by the folder_id column
|
||||
* @method ChildFolderImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildFolderImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildFolderImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildFolderImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildFolderImageQuery groupById() Group by the id column
|
||||
* @method ChildFolderImageQuery groupByFolderId() Group by the folder_id column
|
||||
* @method ChildFolderImageQuery groupByFile() Group by the file column
|
||||
* @method ChildFolderImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildFolderImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildFolderImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildFolderImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildFolderImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildFolderImageQuery leftJoinFolder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Folder relation
|
||||
* @method ChildFolderImageQuery rightJoinFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Folder relation
|
||||
* @method ChildFolderImageQuery innerJoinFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the Folder relation
|
||||
*
|
||||
* @method ChildFolderImageQuery leftJoinFolderImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderImageI18n relation
|
||||
* @method ChildFolderImageQuery rightJoinFolderImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderImageI18n relation
|
||||
* @method ChildFolderImageQuery innerJoinFolderImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderImageI18n relation
|
||||
*
|
||||
* @method ChildFolderImage findOne(ConnectionInterface $con = null) Return the first ChildFolderImage matching the query
|
||||
* @method ChildFolderImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderImage matching the query, or a new ChildFolderImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildFolderImage findOneById(int $id) Return the first ChildFolderImage filtered by the id column
|
||||
* @method ChildFolderImage findOneByFolderId(int $folder_id) Return the first ChildFolderImage filtered by the folder_id column
|
||||
* @method ChildFolderImage findOneByFile(string $file) Return the first ChildFolderImage filtered by the file column
|
||||
* @method ChildFolderImage findOneByPosition(int $position) Return the first ChildFolderImage filtered by the position column
|
||||
* @method ChildFolderImage findOneByCreatedAt(string $created_at) Return the first ChildFolderImage filtered by the created_at column
|
||||
* @method ChildFolderImage findOneByUpdatedAt(string $updated_at) Return the first ChildFolderImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildFolderImage objects filtered by the id column
|
||||
* @method array findByFolderId(int $folder_id) Return ChildFolderImage objects filtered by the folder_id column
|
||||
* @method array findByFile(string $file) Return ChildFolderImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildFolderImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildFolderImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildFolderImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class FolderImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\FolderImageQuery 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\\FolderImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildFolderImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildFolderImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\FolderImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\FolderImageQuery();
|
||||
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 ChildFolderImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = FolderImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(FolderImageTableMap::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 ChildFolderImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, FOLDER_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM folder_image 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 ChildFolderImage();
|
||||
$obj->hydrate($row);
|
||||
FolderImageTableMap::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 ChildFolderImage|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 ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::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 ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::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 ChildFolderImageQuery 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(FolderImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the folder_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFolderId(1234); // WHERE folder_id = 1234
|
||||
* $query->filterByFolderId(array(12, 34)); // WHERE folder_id IN (12, 34)
|
||||
* $query->filterByFolderId(array('min' => 12)); // WHERE folder_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByFolder()
|
||||
*
|
||||
* @param mixed $folderId 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 ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderId($folderId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($folderId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($folderId['min'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folderId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($folderId['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folderId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folderId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::FILE, $file, $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 ChildFolderImageQuery 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(FolderImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::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 ChildFolderImageQuery 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(FolderImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::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 ChildFolderImageQuery 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(FolderImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Folder object
|
||||
*
|
||||
* @param \Thelia\Model\Folder|ObjectCollection $folder The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolder($folder, $comparison = null)
|
||||
{
|
||||
if ($folder instanceof \Thelia\Model\Folder) {
|
||||
return $this
|
||||
->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folder->getId(), $comparison);
|
||||
} elseif ($folder instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folder->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByFolder() only accepts arguments of type \Thelia\Model\Folder or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Folder relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Folder');
|
||||
|
||||
// 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, 'Folder');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Folder relation Folder 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\FolderQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinFolder($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Folder', '\Thelia\Model\FolderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\FolderImageI18n|ObjectCollection $folderImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderImageI18n($folderImageI18n, $comparison = null)
|
||||
{
|
||||
if ($folderImageI18n instanceof \Thelia\Model\FolderImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(FolderImageTableMap::ID, $folderImageI18n->getId(), $comparison);
|
||||
} elseif ($folderImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useFolderImageI18nQuery()
|
||||
->filterByPrimaryKeys($folderImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByFolderImageI18n() only accepts arguments of type \Thelia\Model\FolderImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderImageI18n');
|
||||
|
||||
// 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, 'FolderImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderImageI18n relation FolderImageI18n 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\FolderImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinFolderImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderImageI18n', '\Thelia\Model\FolderImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildFolderImage $folderImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($folderImage = null)
|
||||
{
|
||||
if ($folderImage) {
|
||||
$this->addUsingAlias(FolderImageTableMap::ID, $folderImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the folder_image 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(FolderImageTableMap::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).
|
||||
FolderImageTableMap::clearInstancePool();
|
||||
FolderImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildFolderImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildFolderImage 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(FolderImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(FolderImageTableMap::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();
|
||||
|
||||
|
||||
FolderImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
FolderImageTableMap::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 ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(FolderImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(FolderImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(FolderImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(FolderImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(FolderImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(FolderImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'FolderImageI18n';
|
||||
|
||||
return $this
|
||||
->joinFolderImageI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('FolderImageI18n');
|
||||
$this->with['FolderImageI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderImageI18n', '\Thelia\Model\FolderImageI18nQuery');
|
||||
}
|
||||
|
||||
} // FolderImageQuery
|
||||
@@ -46,14 +46,6 @@ use Thelia\Model\Map\FolderTableMap;
|
||||
* @method ChildFolderQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildFolderQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildFolderQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildFolderQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildFolderQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinRewriting($relationAlias = null) Adds a LEFT JOIN clause to the query using the Rewriting relation
|
||||
* @method ChildFolderQuery rightJoinRewriting($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Rewriting relation
|
||||
* @method ChildFolderQuery innerJoinRewriting($relationAlias = null) Adds a INNER JOIN clause to the query using the Rewriting relation
|
||||
@@ -62,6 +54,14 @@ use Thelia\Model\Map\FolderTableMap;
|
||||
* @method ChildFolderQuery rightJoinContentFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentFolder relation
|
||||
* @method ChildFolderQuery innerJoinContentFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentFolder relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinFolderImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderImage relation
|
||||
* @method ChildFolderQuery rightJoinFolderImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderImage relation
|
||||
* @method ChildFolderQuery innerJoinFolderImage($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderImage relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinFolderDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderDocument relation
|
||||
* @method ChildFolderQuery rightJoinFolderDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderDocument relation
|
||||
* @method ChildFolderQuery innerJoinFolderDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderDocument relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinFolderI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderI18n relation
|
||||
* @method ChildFolderQuery rightJoinFolderI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderI18n relation
|
||||
* @method ChildFolderQuery innerJoinFolderI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderI18n relation
|
||||
@@ -639,152 +639,6 @@ abstract class FolderQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(FolderTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByImage($image, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
return $this
|
||||
->addUsingAlias(FolderTableMap::ID, $image->getFolderId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useImageQuery()
|
||||
->filterByPrimaryKeys($image->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinImage($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
|
||||
// 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, 'Image');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image 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\ImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDocument($document, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
return $this
|
||||
->addUsingAlias(FolderTableMap::ID, $document->getFolderId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useDocumentQuery()
|
||||
->filterByPrimaryKeys($document->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinDocument($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
|
||||
// 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, 'Document');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document 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\DocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Rewriting object
|
||||
*
|
||||
@@ -931,6 +785,152 @@ abstract class FolderQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentFolder', '\Thelia\Model\ContentFolderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderImage object
|
||||
*
|
||||
* @param \Thelia\Model\FolderImage|ObjectCollection $folderImage the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderImage($folderImage, $comparison = null)
|
||||
{
|
||||
if ($folderImage instanceof \Thelia\Model\FolderImage) {
|
||||
return $this
|
||||
->addUsingAlias(FolderTableMap::ID, $folderImage->getFolderId(), $comparison);
|
||||
} elseif ($folderImage instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useFolderImageQuery()
|
||||
->filterByPrimaryKeys($folderImage->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByFolderImage() only accepts arguments of type \Thelia\Model\FolderImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderImage');
|
||||
|
||||
// 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, 'FolderImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderImage relation FolderImage 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\FolderImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinFolderImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderImage', '\Thelia\Model\FolderImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderDocument object
|
||||
*
|
||||
* @param \Thelia\Model\FolderDocument|ObjectCollection $folderDocument the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderDocument($folderDocument, $comparison = null)
|
||||
{
|
||||
if ($folderDocument instanceof \Thelia\Model\FolderDocument) {
|
||||
return $this
|
||||
->addUsingAlias(FolderTableMap::ID, $folderDocument->getFolderId(), $comparison);
|
||||
} elseif ($folderDocument instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useFolderDocumentQuery()
|
||||
->filterByPrimaryKeys($folderDocument->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByFolderDocument() only accepts arguments of type \Thelia\Model\FolderDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderDocument($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderDocument');
|
||||
|
||||
// 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, 'FolderDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderDocument relation FolderDocument 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\FolderDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderDocumentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinFolderDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderDocument', '\Thelia\Model\FolderDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderI18n object
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -90,12 +90,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
*/
|
||||
protected $by_default;
|
||||
|
||||
/**
|
||||
* The value for the position field.
|
||||
* @var int
|
||||
*/
|
||||
protected $position;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -436,17 +430,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
return $this->by_default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [position] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -613,27 +596,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setByDefault()
|
||||
|
||||
/**
|
||||
* Set the value of [position] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\Lang The current object (for fluent API support)
|
||||
*/
|
||||
public function setPosition($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->position !== $v) {
|
||||
$this->position = $v;
|
||||
$this->modifiedColumns[] = LangTableMap::POSITION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setPosition()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -731,16 +693,13 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : LangTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->by_default = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : LangTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->position = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : LangTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : LangTableMap::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 ? 8 + $startcol : LangTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : LangTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -753,7 +712,7 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 9; // 9 = LangTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 8; // 8 = LangTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\Lang object", 0, $e);
|
||||
@@ -991,9 +950,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(LangTableMap::BY_DEFAULT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'BY_DEFAULT';
|
||||
}
|
||||
if ($this->isColumnModified(LangTableMap::POSITION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'POSITION';
|
||||
}
|
||||
if ($this->isColumnModified(LangTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
|
||||
}
|
||||
@@ -1029,9 +985,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
case 'BY_DEFAULT':
|
||||
$stmt->bindValue($identifier, $this->by_default, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'POSITION':
|
||||
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'CREATED_AT':
|
||||
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1119,12 +1072,9 @@ abstract class Lang implements ActiveRecordInterface
|
||||
return $this->getByDefault();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getPosition();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 8:
|
||||
case 7:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1161,9 +1111,8 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$keys[3] => $this->getLocale(),
|
||||
$keys[4] => $this->getUrl(),
|
||||
$keys[5] => $this->getByDefault(),
|
||||
$keys[6] => $this->getPosition(),
|
||||
$keys[7] => $this->getCreatedAt(),
|
||||
$keys[8] => $this->getUpdatedAt(),
|
||||
$keys[6] => $this->getCreatedAt(),
|
||||
$keys[7] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1223,12 +1172,9 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$this->setByDefault($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setPosition($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 8:
|
||||
case 7:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1261,9 +1207,8 @@ abstract class Lang implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[3], $arr)) $this->setLocale($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setUrl($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setByDefault($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setPosition($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setCreatedAt($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setUpdatedAt($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1281,7 +1226,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(LangTableMap::LOCALE)) $criteria->add(LangTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(LangTableMap::URL)) $criteria->add(LangTableMap::URL, $this->url);
|
||||
if ($this->isColumnModified(LangTableMap::BY_DEFAULT)) $criteria->add(LangTableMap::BY_DEFAULT, $this->by_default);
|
||||
if ($this->isColumnModified(LangTableMap::POSITION)) $criteria->add(LangTableMap::POSITION, $this->position);
|
||||
if ($this->isColumnModified(LangTableMap::CREATED_AT)) $criteria->add(LangTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(LangTableMap::UPDATED_AT)) $criteria->add(LangTableMap::UPDATED_AT, $this->updated_at);
|
||||
|
||||
@@ -1352,7 +1296,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$copyObj->setLocale($this->getLocale());
|
||||
$copyObj->setUrl($this->getUrl());
|
||||
$copyObj->setByDefault($this->getByDefault());
|
||||
$copyObj->setPosition($this->getPosition());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
if ($makeNew) {
|
||||
@@ -1394,7 +1337,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$this->locale = null;
|
||||
$this->url = null;
|
||||
$this->by_default = null;
|
||||
$this->position = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->alreadyInSave = false;
|
||||
|
||||
@@ -24,7 +24,6 @@ use Thelia\Model\Map\LangTableMap;
|
||||
* @method ChildLangQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildLangQuery orderByUrl($order = Criteria::ASC) Order by the url column
|
||||
* @method ChildLangQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
|
||||
* @method ChildLangQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildLangQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildLangQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
@@ -34,7 +33,6 @@ use Thelia\Model\Map\LangTableMap;
|
||||
* @method ChildLangQuery groupByLocale() Group by the locale column
|
||||
* @method ChildLangQuery groupByUrl() Group by the url column
|
||||
* @method ChildLangQuery groupByByDefault() Group by the by_default column
|
||||
* @method ChildLangQuery groupByPosition() Group by the position column
|
||||
* @method ChildLangQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildLangQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
@@ -51,7 +49,6 @@ use Thelia\Model\Map\LangTableMap;
|
||||
* @method ChildLang findOneByLocale(string $locale) Return the first ChildLang filtered by the locale column
|
||||
* @method ChildLang findOneByUrl(string $url) Return the first ChildLang filtered by the url column
|
||||
* @method ChildLang findOneByByDefault(int $by_default) Return the first ChildLang filtered by the by_default column
|
||||
* @method ChildLang findOneByPosition(int $position) Return the first ChildLang filtered by the position column
|
||||
* @method ChildLang findOneByCreatedAt(string $created_at) Return the first ChildLang filtered by the created_at column
|
||||
* @method ChildLang findOneByUpdatedAt(string $updated_at) Return the first ChildLang filtered by the updated_at column
|
||||
*
|
||||
@@ -61,7 +58,6 @@ use Thelia\Model\Map\LangTableMap;
|
||||
* @method array findByLocale(string $locale) Return ChildLang objects filtered by the locale column
|
||||
* @method array findByUrl(string $url) Return ChildLang objects filtered by the url column
|
||||
* @method array findByByDefault(int $by_default) Return ChildLang objects filtered by the by_default column
|
||||
* @method array findByPosition(int $position) Return ChildLang objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildLang objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildLang objects filtered by the updated_at column
|
||||
*
|
||||
@@ -152,7 +148,7 @@ abstract class LangQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, TITLE, CODE, LOCALE, URL, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM lang WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, TITLE, CODE, LOCALE, URL, BY_DEFAULT, CREATED_AT, UPDATED_AT FROM lang WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -439,47 +435,6 @@ abstract class LangQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(LangTableMap::BY_DEFAULT, $byDefault, $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 ChildLangQuery 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(LangTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(LangTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(LangTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
|
||||
@@ -25,15 +25,13 @@ 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\Document as ChildDocument;
|
||||
use Thelia\Model\DocumentQuery as ChildDocumentQuery;
|
||||
use Thelia\Model\FeatureProduct as ChildFeatureProduct;
|
||||
use Thelia\Model\FeatureProductQuery as ChildFeatureProductQuery;
|
||||
use Thelia\Model\Image as ChildImage;
|
||||
use Thelia\Model\ImageQuery as ChildImageQuery;
|
||||
use Thelia\Model\Product as ChildProduct;
|
||||
use Thelia\Model\ProductCategory as ChildProductCategory;
|
||||
use Thelia\Model\ProductCategoryQuery as ChildProductCategoryQuery;
|
||||
use Thelia\Model\ProductDocument as ChildProductDocument;
|
||||
use Thelia\Model\ProductDocumentQuery as ChildProductDocumentQuery;
|
||||
use Thelia\Model\ProductI18n as ChildProductI18n;
|
||||
use Thelia\Model\ProductI18nQuery as ChildProductI18nQuery;
|
||||
use Thelia\Model\ProductQuery as ChildProductQuery;
|
||||
@@ -41,6 +39,8 @@ use Thelia\Model\ProductSaleElements as ChildProductSaleElements;
|
||||
use Thelia\Model\ProductSaleElementsQuery as ChildProductSaleElementsQuery;
|
||||
use Thelia\Model\ProductVersion as ChildProductVersion;
|
||||
use Thelia\Model\ProductVersionQuery as ChildProductVersionQuery;
|
||||
use Thelia\Model\ProdutImage as ChildProdutImage;
|
||||
use Thelia\Model\ProdutImageQuery as ChildProdutImageQuery;
|
||||
use Thelia\Model\Rewriting as ChildRewriting;
|
||||
use Thelia\Model\RewritingQuery as ChildRewritingQuery;
|
||||
use Thelia\Model\TaxRule as ChildTaxRule;
|
||||
@@ -174,16 +174,16 @@ abstract class Product implements ActiveRecordInterface
|
||||
protected $collContentAssocsPartial;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildImage[] Collection to store aggregation of ChildImage objects.
|
||||
* @var ObjectCollection|ChildProdutImage[] Collection to store aggregation of ChildProdutImage objects.
|
||||
*/
|
||||
protected $collImages;
|
||||
protected $collImagesPartial;
|
||||
protected $collProdutImages;
|
||||
protected $collProdutImagesPartial;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildDocument[] Collection to store aggregation of ChildDocument objects.
|
||||
* @var ObjectCollection|ChildProductDocument[] Collection to store aggregation of ChildProductDocument objects.
|
||||
*/
|
||||
protected $collDocuments;
|
||||
protected $collDocumentsPartial;
|
||||
protected $collProductDocuments;
|
||||
protected $collProductDocumentsPartial;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildAccessory[] Collection to store aggregation of ChildAccessory objects.
|
||||
@@ -312,13 +312,13 @@ abstract class Product implements ActiveRecordInterface
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var ObjectCollection
|
||||
*/
|
||||
protected $imagesScheduledForDeletion = null;
|
||||
protected $produtImagesScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var ObjectCollection
|
||||
*/
|
||||
protected $documentsScheduledForDeletion = null;
|
||||
protected $productDocumentsScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
@@ -1139,9 +1139,9 @@ abstract class Product implements ActiveRecordInterface
|
||||
|
||||
$this->collContentAssocs = null;
|
||||
|
||||
$this->collImages = null;
|
||||
$this->collProdutImages = null;
|
||||
|
||||
$this->collDocuments = null;
|
||||
$this->collProductDocuments = null;
|
||||
|
||||
$this->collAccessoriesRelatedByProductId = null;
|
||||
|
||||
@@ -1464,34 +1464,34 @@ abstract class Product implements ActiveRecordInterface
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->imagesScheduledForDeletion !== null) {
|
||||
if (!$this->imagesScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\ImageQuery::create()
|
||||
->filterByPrimaryKeys($this->imagesScheduledForDeletion->getPrimaryKeys(false))
|
||||
if ($this->produtImagesScheduledForDeletion !== null) {
|
||||
if (!$this->produtImagesScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\ProdutImageQuery::create()
|
||||
->filterByPrimaryKeys($this->produtImagesScheduledForDeletion->getPrimaryKeys(false))
|
||||
->delete($con);
|
||||
$this->imagesScheduledForDeletion = null;
|
||||
$this->produtImagesScheduledForDeletion = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collImages !== null) {
|
||||
foreach ($this->collImages as $referrerFK) {
|
||||
if ($this->collProdutImages !== null) {
|
||||
foreach ($this->collProdutImages as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->documentsScheduledForDeletion !== null) {
|
||||
if (!$this->documentsScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\DocumentQuery::create()
|
||||
->filterByPrimaryKeys($this->documentsScheduledForDeletion->getPrimaryKeys(false))
|
||||
if ($this->productDocumentsScheduledForDeletion !== null) {
|
||||
if (!$this->productDocumentsScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\ProductDocumentQuery::create()
|
||||
->filterByPrimaryKeys($this->productDocumentsScheduledForDeletion->getPrimaryKeys(false))
|
||||
->delete($con);
|
||||
$this->documentsScheduledForDeletion = null;
|
||||
$this->productDocumentsScheduledForDeletion = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collDocuments !== null) {
|
||||
foreach ($this->collDocuments as $referrerFK) {
|
||||
if ($this->collProductDocuments !== null) {
|
||||
foreach ($this->collProductDocuments as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
@@ -1851,11 +1851,11 @@ abstract class Product implements ActiveRecordInterface
|
||||
if (null !== $this->collContentAssocs) {
|
||||
$result['ContentAssocs'] = $this->collContentAssocs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collImages) {
|
||||
$result['Images'] = $this->collImages->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
if (null !== $this->collProdutImages) {
|
||||
$result['ProdutImages'] = $this->collProdutImages->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collDocuments) {
|
||||
$result['Documents'] = $this->collDocuments->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
if (null !== $this->collProductDocuments) {
|
||||
$result['ProductDocuments'] = $this->collProductDocuments->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collAccessoriesRelatedByProductId) {
|
||||
$result['AccessoriesRelatedByProductId'] = $this->collAccessoriesRelatedByProductId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
@@ -2096,15 +2096,15 @@ abstract class Product implements ActiveRecordInterface
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getImages() as $relObj) {
|
||||
foreach ($this->getProdutImages() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addImage($relObj->copy($deepCopy));
|
||||
$copyObj->addProdutImage($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getDocuments() as $relObj) {
|
||||
foreach ($this->getProductDocuments() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addDocument($relObj->copy($deepCopy));
|
||||
$copyObj->addProductDocument($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2248,11 +2248,11 @@ abstract class Product implements ActiveRecordInterface
|
||||
if ('ContentAssoc' == $relationName) {
|
||||
return $this->initContentAssocs();
|
||||
}
|
||||
if ('Image' == $relationName) {
|
||||
return $this->initImages();
|
||||
if ('ProdutImage' == $relationName) {
|
||||
return $this->initProdutImages();
|
||||
}
|
||||
if ('Document' == $relationName) {
|
||||
return $this->initDocuments();
|
||||
if ('ProductDocument' == $relationName) {
|
||||
return $this->initProductDocuments();
|
||||
}
|
||||
if ('AccessoryRelatedByProductId' == $relationName) {
|
||||
return $this->initAccessoriesRelatedByProductId();
|
||||
@@ -3275,31 +3275,31 @@ abstract class Product implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collImages collection
|
||||
* Clears out the collProdutImages 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 addImages()
|
||||
* @see addProdutImages()
|
||||
*/
|
||||
public function clearImages()
|
||||
public function clearProdutImages()
|
||||
{
|
||||
$this->collImages = null; // important to set this to NULL since that means it is uninitialized
|
||||
$this->collProdutImages = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset is the collImages collection loaded partially.
|
||||
* Reset is the collProdutImages collection loaded partially.
|
||||
*/
|
||||
public function resetPartialImages($v = true)
|
||||
public function resetPartialProdutImages($v = true)
|
||||
{
|
||||
$this->collImagesPartial = $v;
|
||||
$this->collProdutImagesPartial = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collImages collection.
|
||||
* Initializes the collProdutImages collection.
|
||||
*
|
||||
* By default this just sets the collImages collection to an empty array (like clearcollImages());
|
||||
* By default this just sets the collProdutImages collection to an empty array (like clearcollProdutImages());
|
||||
* 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.
|
||||
*
|
||||
@@ -3308,17 +3308,17 @@ abstract class Product implements ActiveRecordInterface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initImages($overrideExisting = true)
|
||||
public function initProdutImages($overrideExisting = true)
|
||||
{
|
||||
if (null !== $this->collImages && !$overrideExisting) {
|
||||
if (null !== $this->collProdutImages && !$overrideExisting) {
|
||||
return;
|
||||
}
|
||||
$this->collImages = new ObjectCollection();
|
||||
$this->collImages->setModel('\Thelia\Model\Image');
|
||||
$this->collProdutImages = new ObjectCollection();
|
||||
$this->collProdutImages->setModel('\Thelia\Model\ProdutImage');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of ChildImage objects which contain a foreign key that references this object.
|
||||
* Gets an array of ChildProdutImage 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.
|
||||
@@ -3328,109 +3328,109 @@ abstract class Product implements ActiveRecordInterface
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @return Collection|ChildImage[] List of ChildImage objects
|
||||
* @return Collection|ChildProdutImage[] List of ChildProdutImage objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getImages($criteria = null, ConnectionInterface $con = null)
|
||||
public function getProdutImages($criteria = null, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collImagesPartial && !$this->isNew();
|
||||
if (null === $this->collImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collImages) {
|
||||
$partial = $this->collProdutImagesPartial && !$this->isNew();
|
||||
if (null === $this->collProdutImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collProdutImages) {
|
||||
// return empty collection
|
||||
$this->initImages();
|
||||
$this->initProdutImages();
|
||||
} else {
|
||||
$collImages = ChildImageQuery::create(null, $criteria)
|
||||
$collProdutImages = ChildProdutImageQuery::create(null, $criteria)
|
||||
->filterByProduct($this)
|
||||
->find($con);
|
||||
|
||||
if (null !== $criteria) {
|
||||
if (false !== $this->collImagesPartial && count($collImages)) {
|
||||
$this->initImages(false);
|
||||
if (false !== $this->collProdutImagesPartial && count($collProdutImages)) {
|
||||
$this->initProdutImages(false);
|
||||
|
||||
foreach ($collImages as $obj) {
|
||||
if (false == $this->collImages->contains($obj)) {
|
||||
$this->collImages->append($obj);
|
||||
foreach ($collProdutImages as $obj) {
|
||||
if (false == $this->collProdutImages->contains($obj)) {
|
||||
$this->collProdutImages->append($obj);
|
||||
}
|
||||
}
|
||||
|
||||
$this->collImagesPartial = true;
|
||||
$this->collProdutImagesPartial = true;
|
||||
}
|
||||
|
||||
$collImages->getInternalIterator()->rewind();
|
||||
$collProdutImages->getInternalIterator()->rewind();
|
||||
|
||||
return $collImages;
|
||||
return $collProdutImages;
|
||||
}
|
||||
|
||||
if ($partial && $this->collImages) {
|
||||
foreach ($this->collImages as $obj) {
|
||||
if ($partial && $this->collProdutImages) {
|
||||
foreach ($this->collProdutImages as $obj) {
|
||||
if ($obj->isNew()) {
|
||||
$collImages[] = $obj;
|
||||
$collProdutImages[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->collImages = $collImages;
|
||||
$this->collImagesPartial = false;
|
||||
$this->collProdutImages = $collProdutImages;
|
||||
$this->collProdutImagesPartial = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->collImages;
|
||||
return $this->collProdutImages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a collection of Image objects related by a one-to-many relationship
|
||||
* Sets a collection of ProdutImage 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 $images A Propel collection.
|
||||
* @param Collection $produtImages A Propel collection.
|
||||
* @param ConnectionInterface $con Optional connection object
|
||||
* @return ChildProduct The current object (for fluent API support)
|
||||
*/
|
||||
public function setImages(Collection $images, ConnectionInterface $con = null)
|
||||
public function setProdutImages(Collection $produtImages, ConnectionInterface $con = null)
|
||||
{
|
||||
$imagesToDelete = $this->getImages(new Criteria(), $con)->diff($images);
|
||||
$produtImagesToDelete = $this->getProdutImages(new Criteria(), $con)->diff($produtImages);
|
||||
|
||||
|
||||
$this->imagesScheduledForDeletion = $imagesToDelete;
|
||||
$this->produtImagesScheduledForDeletion = $produtImagesToDelete;
|
||||
|
||||
foreach ($imagesToDelete as $imageRemoved) {
|
||||
$imageRemoved->setProduct(null);
|
||||
foreach ($produtImagesToDelete as $produtImageRemoved) {
|
||||
$produtImageRemoved->setProduct(null);
|
||||
}
|
||||
|
||||
$this->collImages = null;
|
||||
foreach ($images as $image) {
|
||||
$this->addImage($image);
|
||||
$this->collProdutImages = null;
|
||||
foreach ($produtImages as $produtImage) {
|
||||
$this->addProdutImage($produtImage);
|
||||
}
|
||||
|
||||
$this->collImages = $images;
|
||||
$this->collImagesPartial = false;
|
||||
$this->collProdutImages = $produtImages;
|
||||
$this->collProdutImagesPartial = false;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related Image objects.
|
||||
* Returns the number of related ProdutImage objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param ConnectionInterface $con
|
||||
* @return int Count of related Image objects.
|
||||
* @return int Count of related ProdutImage objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countImages(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
public function countProdutImages(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collImagesPartial && !$this->isNew();
|
||||
if (null === $this->collImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collImages) {
|
||||
$partial = $this->collProdutImagesPartial && !$this->isNew();
|
||||
if (null === $this->collProdutImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collProdutImages) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($partial && !$criteria) {
|
||||
return count($this->getImages());
|
||||
return count($this->getProdutImages());
|
||||
}
|
||||
|
||||
$query = ChildImageQuery::create(null, $criteria);
|
||||
$query = ChildProdutImageQuery::create(null, $criteria);
|
||||
if ($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
@@ -3440,159 +3440,84 @@ abstract class Product implements ActiveRecordInterface
|
||||
->count($con);
|
||||
}
|
||||
|
||||
return count($this->collImages);
|
||||
return count($this->collProdutImages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a ChildImage object to this object
|
||||
* through the ChildImage foreign key attribute.
|
||||
* Method called to associate a ChildProdutImage object to this object
|
||||
* through the ChildProdutImage foreign key attribute.
|
||||
*
|
||||
* @param ChildImage $l ChildImage
|
||||
* @param ChildProdutImage $l ChildProdutImage
|
||||
* @return \Thelia\Model\Product The current object (for fluent API support)
|
||||
*/
|
||||
public function addImage(ChildImage $l)
|
||||
public function addProdutImage(ChildProdutImage $l)
|
||||
{
|
||||
if ($this->collImages === null) {
|
||||
$this->initImages();
|
||||
$this->collImagesPartial = true;
|
||||
if ($this->collProdutImages === null) {
|
||||
$this->initProdutImages();
|
||||
$this->collProdutImagesPartial = true;
|
||||
}
|
||||
|
||||
if (!in_array($l, $this->collImages->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddImage($l);
|
||||
if (!in_array($l, $this->collProdutImages->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddProdutImage($l);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Image $image The image object to add.
|
||||
* @param ProdutImage $produtImage The produtImage object to add.
|
||||
*/
|
||||
protected function doAddImage($image)
|
||||
protected function doAddProdutImage($produtImage)
|
||||
{
|
||||
$this->collImages[]= $image;
|
||||
$image->setProduct($this);
|
||||
$this->collProdutImages[]= $produtImage;
|
||||
$produtImage->setProduct($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Image $image The image object to remove.
|
||||
* @param ProdutImage $produtImage The produtImage object to remove.
|
||||
* @return ChildProduct The current object (for fluent API support)
|
||||
*/
|
||||
public function removeImage($image)
|
||||
public function removeProdutImage($produtImage)
|
||||
{
|
||||
if ($this->getImages()->contains($image)) {
|
||||
$this->collImages->remove($this->collImages->search($image));
|
||||
if (null === $this->imagesScheduledForDeletion) {
|
||||
$this->imagesScheduledForDeletion = clone $this->collImages;
|
||||
$this->imagesScheduledForDeletion->clear();
|
||||
if ($this->getProdutImages()->contains($produtImage)) {
|
||||
$this->collProdutImages->remove($this->collProdutImages->search($produtImage));
|
||||
if (null === $this->produtImagesScheduledForDeletion) {
|
||||
$this->produtImagesScheduledForDeletion = clone $this->collProdutImages;
|
||||
$this->produtImagesScheduledForDeletion->clear();
|
||||
}
|
||||
$this->imagesScheduledForDeletion[]= $image;
|
||||
$image->setProduct(null);
|
||||
$this->produtImagesScheduledForDeletion[]= clone $produtImage;
|
||||
$produtImage->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 Images 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|ChildImage[] List of ChildImage objects
|
||||
*/
|
||||
public function getImagesJoinCategory($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildImageQuery::create(null, $criteria);
|
||||
$query->joinWith('Category', $joinBehavior);
|
||||
|
||||
return $this->getImages($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 Images 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|ChildImage[] List of ChildImage objects
|
||||
*/
|
||||
public function getImagesJoinContent($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildImageQuery::create(null, $criteria);
|
||||
$query->joinWith('Content', $joinBehavior);
|
||||
|
||||
return $this->getImages($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 Images 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|ChildImage[] List of ChildImage objects
|
||||
*/
|
||||
public function getImagesJoinFolder($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildImageQuery::create(null, $criteria);
|
||||
$query->joinWith('Folder', $joinBehavior);
|
||||
|
||||
return $this->getImages($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collDocuments collection
|
||||
* Clears out the collProductDocuments 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 addDocuments()
|
||||
* @see addProductDocuments()
|
||||
*/
|
||||
public function clearDocuments()
|
||||
public function clearProductDocuments()
|
||||
{
|
||||
$this->collDocuments = null; // important to set this to NULL since that means it is uninitialized
|
||||
$this->collProductDocuments = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset is the collDocuments collection loaded partially.
|
||||
* Reset is the collProductDocuments collection loaded partially.
|
||||
*/
|
||||
public function resetPartialDocuments($v = true)
|
||||
public function resetPartialProductDocuments($v = true)
|
||||
{
|
||||
$this->collDocumentsPartial = $v;
|
||||
$this->collProductDocumentsPartial = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collDocuments collection.
|
||||
* Initializes the collProductDocuments collection.
|
||||
*
|
||||
* By default this just sets the collDocuments collection to an empty array (like clearcollDocuments());
|
||||
* By default this just sets the collProductDocuments collection to an empty array (like clearcollProductDocuments());
|
||||
* 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.
|
||||
*
|
||||
@@ -3601,17 +3526,17 @@ abstract class Product implements ActiveRecordInterface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initDocuments($overrideExisting = true)
|
||||
public function initProductDocuments($overrideExisting = true)
|
||||
{
|
||||
if (null !== $this->collDocuments && !$overrideExisting) {
|
||||
if (null !== $this->collProductDocuments && !$overrideExisting) {
|
||||
return;
|
||||
}
|
||||
$this->collDocuments = new ObjectCollection();
|
||||
$this->collDocuments->setModel('\Thelia\Model\Document');
|
||||
$this->collProductDocuments = new ObjectCollection();
|
||||
$this->collProductDocuments->setModel('\Thelia\Model\ProductDocument');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of ChildDocument objects which contain a foreign key that references this object.
|
||||
* Gets an array of ChildProductDocument 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.
|
||||
@@ -3621,109 +3546,109 @@ abstract class Product implements ActiveRecordInterface
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @return Collection|ChildDocument[] List of ChildDocument objects
|
||||
* @return Collection|ChildProductDocument[] List of ChildProductDocument objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getDocuments($criteria = null, ConnectionInterface $con = null)
|
||||
public function getProductDocuments($criteria = null, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collDocumentsPartial && !$this->isNew();
|
||||
if (null === $this->collDocuments || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collDocuments) {
|
||||
$partial = $this->collProductDocumentsPartial && !$this->isNew();
|
||||
if (null === $this->collProductDocuments || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collProductDocuments) {
|
||||
// return empty collection
|
||||
$this->initDocuments();
|
||||
$this->initProductDocuments();
|
||||
} else {
|
||||
$collDocuments = ChildDocumentQuery::create(null, $criteria)
|
||||
$collProductDocuments = ChildProductDocumentQuery::create(null, $criteria)
|
||||
->filterByProduct($this)
|
||||
->find($con);
|
||||
|
||||
if (null !== $criteria) {
|
||||
if (false !== $this->collDocumentsPartial && count($collDocuments)) {
|
||||
$this->initDocuments(false);
|
||||
if (false !== $this->collProductDocumentsPartial && count($collProductDocuments)) {
|
||||
$this->initProductDocuments(false);
|
||||
|
||||
foreach ($collDocuments as $obj) {
|
||||
if (false == $this->collDocuments->contains($obj)) {
|
||||
$this->collDocuments->append($obj);
|
||||
foreach ($collProductDocuments as $obj) {
|
||||
if (false == $this->collProductDocuments->contains($obj)) {
|
||||
$this->collProductDocuments->append($obj);
|
||||
}
|
||||
}
|
||||
|
||||
$this->collDocumentsPartial = true;
|
||||
$this->collProductDocumentsPartial = true;
|
||||
}
|
||||
|
||||
$collDocuments->getInternalIterator()->rewind();
|
||||
$collProductDocuments->getInternalIterator()->rewind();
|
||||
|
||||
return $collDocuments;
|
||||
return $collProductDocuments;
|
||||
}
|
||||
|
||||
if ($partial && $this->collDocuments) {
|
||||
foreach ($this->collDocuments as $obj) {
|
||||
if ($partial && $this->collProductDocuments) {
|
||||
foreach ($this->collProductDocuments as $obj) {
|
||||
if ($obj->isNew()) {
|
||||
$collDocuments[] = $obj;
|
||||
$collProductDocuments[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->collDocuments = $collDocuments;
|
||||
$this->collDocumentsPartial = false;
|
||||
$this->collProductDocuments = $collProductDocuments;
|
||||
$this->collProductDocumentsPartial = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->collDocuments;
|
||||
return $this->collProductDocuments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a collection of Document objects related by a one-to-many relationship
|
||||
* Sets a collection of ProductDocument 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 $documents A Propel collection.
|
||||
* @param Collection $productDocuments A Propel collection.
|
||||
* @param ConnectionInterface $con Optional connection object
|
||||
* @return ChildProduct The current object (for fluent API support)
|
||||
*/
|
||||
public function setDocuments(Collection $documents, ConnectionInterface $con = null)
|
||||
public function setProductDocuments(Collection $productDocuments, ConnectionInterface $con = null)
|
||||
{
|
||||
$documentsToDelete = $this->getDocuments(new Criteria(), $con)->diff($documents);
|
||||
$productDocumentsToDelete = $this->getProductDocuments(new Criteria(), $con)->diff($productDocuments);
|
||||
|
||||
|
||||
$this->documentsScheduledForDeletion = $documentsToDelete;
|
||||
$this->productDocumentsScheduledForDeletion = $productDocumentsToDelete;
|
||||
|
||||
foreach ($documentsToDelete as $documentRemoved) {
|
||||
$documentRemoved->setProduct(null);
|
||||
foreach ($productDocumentsToDelete as $productDocumentRemoved) {
|
||||
$productDocumentRemoved->setProduct(null);
|
||||
}
|
||||
|
||||
$this->collDocuments = null;
|
||||
foreach ($documents as $document) {
|
||||
$this->addDocument($document);
|
||||
$this->collProductDocuments = null;
|
||||
foreach ($productDocuments as $productDocument) {
|
||||
$this->addProductDocument($productDocument);
|
||||
}
|
||||
|
||||
$this->collDocuments = $documents;
|
||||
$this->collDocumentsPartial = false;
|
||||
$this->collProductDocuments = $productDocuments;
|
||||
$this->collProductDocumentsPartial = false;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related Document objects.
|
||||
* Returns the number of related ProductDocument objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param ConnectionInterface $con
|
||||
* @return int Count of related Document objects.
|
||||
* @return int Count of related ProductDocument objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countDocuments(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
public function countProductDocuments(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collDocumentsPartial && !$this->isNew();
|
||||
if (null === $this->collDocuments || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collDocuments) {
|
||||
$partial = $this->collProductDocumentsPartial && !$this->isNew();
|
||||
if (null === $this->collProductDocuments || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collProductDocuments) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($partial && !$criteria) {
|
||||
return count($this->getDocuments());
|
||||
return count($this->getProductDocuments());
|
||||
}
|
||||
|
||||
$query = ChildDocumentQuery::create(null, $criteria);
|
||||
$query = ChildProductDocumentQuery::create(null, $criteria);
|
||||
if ($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
@@ -3733,133 +3658,58 @@ abstract class Product implements ActiveRecordInterface
|
||||
->count($con);
|
||||
}
|
||||
|
||||
return count($this->collDocuments);
|
||||
return count($this->collProductDocuments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a ChildDocument object to this object
|
||||
* through the ChildDocument foreign key attribute.
|
||||
* Method called to associate a ChildProductDocument object to this object
|
||||
* through the ChildProductDocument foreign key attribute.
|
||||
*
|
||||
* @param ChildDocument $l ChildDocument
|
||||
* @param ChildProductDocument $l ChildProductDocument
|
||||
* @return \Thelia\Model\Product The current object (for fluent API support)
|
||||
*/
|
||||
public function addDocument(ChildDocument $l)
|
||||
public function addProductDocument(ChildProductDocument $l)
|
||||
{
|
||||
if ($this->collDocuments === null) {
|
||||
$this->initDocuments();
|
||||
$this->collDocumentsPartial = true;
|
||||
if ($this->collProductDocuments === null) {
|
||||
$this->initProductDocuments();
|
||||
$this->collProductDocumentsPartial = true;
|
||||
}
|
||||
|
||||
if (!in_array($l, $this->collDocuments->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddDocument($l);
|
||||
if (!in_array($l, $this->collProductDocuments->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddProductDocument($l);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Document $document The document object to add.
|
||||
* @param ProductDocument $productDocument The productDocument object to add.
|
||||
*/
|
||||
protected function doAddDocument($document)
|
||||
protected function doAddProductDocument($productDocument)
|
||||
{
|
||||
$this->collDocuments[]= $document;
|
||||
$document->setProduct($this);
|
||||
$this->collProductDocuments[]= $productDocument;
|
||||
$productDocument->setProduct($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Document $document The document object to remove.
|
||||
* @param ProductDocument $productDocument The productDocument object to remove.
|
||||
* @return ChildProduct The current object (for fluent API support)
|
||||
*/
|
||||
public function removeDocument($document)
|
||||
public function removeProductDocument($productDocument)
|
||||
{
|
||||
if ($this->getDocuments()->contains($document)) {
|
||||
$this->collDocuments->remove($this->collDocuments->search($document));
|
||||
if (null === $this->documentsScheduledForDeletion) {
|
||||
$this->documentsScheduledForDeletion = clone $this->collDocuments;
|
||||
$this->documentsScheduledForDeletion->clear();
|
||||
if ($this->getProductDocuments()->contains($productDocument)) {
|
||||
$this->collProductDocuments->remove($this->collProductDocuments->search($productDocument));
|
||||
if (null === $this->productDocumentsScheduledForDeletion) {
|
||||
$this->productDocumentsScheduledForDeletion = clone $this->collProductDocuments;
|
||||
$this->productDocumentsScheduledForDeletion->clear();
|
||||
}
|
||||
$this->documentsScheduledForDeletion[]= $document;
|
||||
$document->setProduct(null);
|
||||
$this->productDocumentsScheduledForDeletion[]= clone $productDocument;
|
||||
$productDocument->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 Documents 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|ChildDocument[] List of ChildDocument objects
|
||||
*/
|
||||
public function getDocumentsJoinCategory($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildDocumentQuery::create(null, $criteria);
|
||||
$query->joinWith('Category', $joinBehavior);
|
||||
|
||||
return $this->getDocuments($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 Documents 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|ChildDocument[] List of ChildDocument objects
|
||||
*/
|
||||
public function getDocumentsJoinContent($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildDocumentQuery::create(null, $criteria);
|
||||
$query->joinWith('Content', $joinBehavior);
|
||||
|
||||
return $this->getDocuments($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 Documents 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|ChildDocument[] List of ChildDocument objects
|
||||
*/
|
||||
public function getDocumentsJoinFolder($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildDocumentQuery::create(null, $criteria);
|
||||
$query->joinWith('Folder', $joinBehavior);
|
||||
|
||||
return $this->getDocuments($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collAccessoriesRelatedByProductId collection
|
||||
*
|
||||
@@ -5907,13 +5757,13 @@ abstract class Product implements ActiveRecordInterface
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collImages) {
|
||||
foreach ($this->collImages as $o) {
|
||||
if ($this->collProdutImages) {
|
||||
foreach ($this->collProdutImages as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collDocuments) {
|
||||
foreach ($this->collDocuments as $o) {
|
||||
if ($this->collProductDocuments) {
|
||||
foreach ($this->collProductDocuments as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
@@ -5984,14 +5834,14 @@ abstract class Product implements ActiveRecordInterface
|
||||
$this->collContentAssocs->clearIterator();
|
||||
}
|
||||
$this->collContentAssocs = null;
|
||||
if ($this->collImages instanceof Collection) {
|
||||
$this->collImages->clearIterator();
|
||||
if ($this->collProdutImages instanceof Collection) {
|
||||
$this->collProdutImages->clearIterator();
|
||||
}
|
||||
$this->collImages = null;
|
||||
if ($this->collDocuments instanceof Collection) {
|
||||
$this->collDocuments->clearIterator();
|
||||
$this->collProdutImages = null;
|
||||
if ($this->collProductDocuments instanceof Collection) {
|
||||
$this->collProductDocuments->clearIterator();
|
||||
}
|
||||
$this->collDocuments = null;
|
||||
$this->collProductDocuments = null;
|
||||
if ($this->collAccessoriesRelatedByProductId instanceof Collection) {
|
||||
$this->collAccessoriesRelatedByProductId->clearIterator();
|
||||
}
|
||||
|
||||
1990
core/lib/Thelia/Model/Base/ProductDocument.php
Normal file
1990
core/lib/Thelia/Model/Base/ProductDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/ProductDocumentI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/ProductDocumentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/ProductDocumentI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/ProductDocumentI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?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\ProductDocumentI18n as ChildProductDocumentI18n;
|
||||
use Thelia\Model\ProductDocumentI18nQuery as ChildProductDocumentI18nQuery;
|
||||
use Thelia\Model\Map\ProductDocumentI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'product_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildProductDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildProductDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildProductDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildProductDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildProductDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildProductDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildProductDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildProductDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildProductDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildProductDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildProductDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildProductDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildProductDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildProductDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildProductDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildProductDocumentI18nQuery leftJoinProductDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductDocument relation
|
||||
* @method ChildProductDocumentI18nQuery rightJoinProductDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductDocument relation
|
||||
* @method ChildProductDocumentI18nQuery innerJoinProductDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductDocument relation
|
||||
*
|
||||
* @method ChildProductDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildProductDocumentI18n matching the query
|
||||
* @method ChildProductDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProductDocumentI18n matching the query, or a new ChildProductDocumentI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildProductDocumentI18n findOneById(int $id) Return the first ChildProductDocumentI18n filtered by the id column
|
||||
* @method ChildProductDocumentI18n findOneByLocale(string $locale) Return the first ChildProductDocumentI18n filtered by the locale column
|
||||
* @method ChildProductDocumentI18n findOneByTitle(string $title) Return the first ChildProductDocumentI18n filtered by the title column
|
||||
* @method ChildProductDocumentI18n findOneByDescription(string $description) Return the first ChildProductDocumentI18n filtered by the description column
|
||||
* @method ChildProductDocumentI18n findOneByChapo(string $chapo) Return the first ChildProductDocumentI18n filtered by the chapo column
|
||||
* @method ChildProductDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildProductDocumentI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildProductDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildProductDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildProductDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildProductDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildProductDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildProductDocumentI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class ProductDocumentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ProductDocumentI18nQuery 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\\ProductDocumentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildProductDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ProductDocumentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ProductDocumentI18nQuery();
|
||||
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 ChildProductDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ProductDocumentI18nTableMap::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(ProductDocumentI18nTableMap::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 ChildProductDocumentI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM product_document_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 ChildProductDocumentI18n();
|
||||
$obj->hydrate($row);
|
||||
ProductDocumentI18nTableMap::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 ChildProductDocumentI18n|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 ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ProductDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ProductDocumentI18nTableMap::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 ChildProductDocumentI18nQuery 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(ProductDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ProductDocumentI18nTableMap::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 filterByProductDocument()
|
||||
*
|
||||
* @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 ChildProductDocumentI18nQuery 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(ProductDocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::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 ChildProductDocumentI18nQuery 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(ProductDocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ProductDocument object
|
||||
*
|
||||
* @param \Thelia\Model\ProductDocument|ObjectCollection $productDocument The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProductDocument($productDocument, $comparison = null)
|
||||
{
|
||||
if ($productDocument instanceof \Thelia\Model\ProductDocument) {
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentI18nTableMap::ID, $productDocument->getId(), $comparison);
|
||||
} elseif ($productDocument instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentI18nTableMap::ID, $productDocument->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByProductDocument() only accepts arguments of type \Thelia\Model\ProductDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ProductDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProductDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ProductDocument');
|
||||
|
||||
// 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, 'ProductDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ProductDocument relation ProductDocument 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\ProductDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useProductDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinProductDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProductDocument', '\Thelia\Model\ProductDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildProductDocumentI18n $productDocumentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($productDocumentI18n = null)
|
||||
{
|
||||
if ($productDocumentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ProductDocumentI18nTableMap::ID), $productDocumentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ProductDocumentI18nTableMap::LOCALE), $productDocumentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the product_document_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(ProductDocumentI18nTableMap::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).
|
||||
ProductDocumentI18nTableMap::clearInstancePool();
|
||||
ProductDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildProductDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildProductDocumentI18n 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(ProductDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ProductDocumentI18nTableMap::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();
|
||||
|
||||
|
||||
ProductDocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ProductDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ProductDocumentI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/ProductDocumentQuery.php
Normal file
846
core/lib/Thelia/Model/Base/ProductDocumentQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?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\ProductDocument as ChildProductDocument;
|
||||
use Thelia\Model\ProductDocumentI18nQuery as ChildProductDocumentI18nQuery;
|
||||
use Thelia\Model\ProductDocumentQuery as ChildProductDocumentQuery;
|
||||
use Thelia\Model\Map\ProductDocumentTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'product_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildProductDocumentQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildProductDocumentQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
|
||||
* @method ChildProductDocumentQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildProductDocumentQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildProductDocumentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildProductDocumentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildProductDocumentQuery groupById() Group by the id column
|
||||
* @method ChildProductDocumentQuery groupByProductId() Group by the product_id column
|
||||
* @method ChildProductDocumentQuery groupByFile() Group by the file column
|
||||
* @method ChildProductDocumentQuery groupByPosition() Group by the position column
|
||||
* @method ChildProductDocumentQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildProductDocumentQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildProductDocumentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildProductDocumentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildProductDocumentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildProductDocumentQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
|
||||
* @method ChildProductDocumentQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
|
||||
* @method ChildProductDocumentQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
|
||||
*
|
||||
* @method ChildProductDocumentQuery leftJoinProductDocumentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductDocumentI18n relation
|
||||
* @method ChildProductDocumentQuery rightJoinProductDocumentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductDocumentI18n relation
|
||||
* @method ChildProductDocumentQuery innerJoinProductDocumentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductDocumentI18n relation
|
||||
*
|
||||
* @method ChildProductDocument findOne(ConnectionInterface $con = null) Return the first ChildProductDocument matching the query
|
||||
* @method ChildProductDocument findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProductDocument matching the query, or a new ChildProductDocument object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildProductDocument findOneById(int $id) Return the first ChildProductDocument filtered by the id column
|
||||
* @method ChildProductDocument findOneByProductId(int $product_id) Return the first ChildProductDocument filtered by the product_id column
|
||||
* @method ChildProductDocument findOneByFile(string $file) Return the first ChildProductDocument filtered by the file column
|
||||
* @method ChildProductDocument findOneByPosition(int $position) Return the first ChildProductDocument filtered by the position column
|
||||
* @method ChildProductDocument findOneByCreatedAt(string $created_at) Return the first ChildProductDocument filtered by the created_at column
|
||||
* @method ChildProductDocument findOneByUpdatedAt(string $updated_at) Return the first ChildProductDocument filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildProductDocument objects filtered by the id column
|
||||
* @method array findByProductId(int $product_id) Return ChildProductDocument objects filtered by the product_id column
|
||||
* @method array findByFile(string $file) Return ChildProductDocument objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildProductDocument objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildProductDocument objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildProductDocument objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class ProductDocumentQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ProductDocumentQuery 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\\ProductDocument', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildProductDocumentQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildProductDocumentQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ProductDocumentQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ProductDocumentQuery();
|
||||
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 ChildProductDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ProductDocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProductDocumentTableMap::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 ChildProductDocument A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, PRODUCT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM product_document 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 ChildProductDocument();
|
||||
$obj->hydrate($row);
|
||||
ProductDocumentTableMap::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 ChildProductDocument|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 ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::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 ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::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 ChildProductDocumentQuery 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(ProductDocumentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::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 ChildProductDocumentQuery 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(ProductDocumentTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($productId['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::PRODUCT_ID, $productId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::FILE, $file, $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 ChildProductDocumentQuery 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(ProductDocumentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::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 ChildProductDocumentQuery 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(ProductDocumentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::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 ChildProductDocumentQuery 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(ProductDocumentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::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 ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProduct($product, $comparison = null)
|
||||
{
|
||||
if ($product instanceof \Thelia\Model\Product) {
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentTableMap::PRODUCT_ID, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentTableMap::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 ChildProductDocumentQuery 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\ProductDocumentI18n object
|
||||
*
|
||||
* @param \Thelia\Model\ProductDocumentI18n|ObjectCollection $productDocumentI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProductDocumentI18n($productDocumentI18n, $comparison = null)
|
||||
{
|
||||
if ($productDocumentI18n instanceof \Thelia\Model\ProductDocumentI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentTableMap::ID, $productDocumentI18n->getId(), $comparison);
|
||||
} elseif ($productDocumentI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useProductDocumentI18nQuery()
|
||||
->filterByPrimaryKeys($productDocumentI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByProductDocumentI18n() only accepts arguments of type \Thelia\Model\ProductDocumentI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ProductDocumentI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProductDocumentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ProductDocumentI18n');
|
||||
|
||||
// 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, 'ProductDocumentI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ProductDocumentI18n relation ProductDocumentI18n 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\ProductDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useProductDocumentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinProductDocumentI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProductDocumentI18n', '\Thelia\Model\ProductDocumentI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildProductDocument $productDocument Object to remove from the list of results
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($productDocument = null)
|
||||
{
|
||||
if ($productDocument) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::ID, $productDocument->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the product_document 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(ProductDocumentTableMap::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).
|
||||
ProductDocumentTableMap::clearInstancePool();
|
||||
ProductDocumentTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildProductDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildProductDocument 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(ProductDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ProductDocumentTableMap::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();
|
||||
|
||||
|
||||
ProductDocumentTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ProductDocumentTableMap::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 ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProductDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProductDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProductDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProductDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ProductDocumentI18n';
|
||||
|
||||
return $this
|
||||
->joinProductDocumentI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('ProductDocumentI18n');
|
||||
$this->with['ProductDocumentI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProductDocumentI18n', '\Thelia\Model\ProductDocumentI18nQuery');
|
||||
}
|
||||
|
||||
} // ProductDocumentQuery
|
||||
@@ -68,13 +68,13 @@ use Thelia\Model\Map\ProductTableMap;
|
||||
* @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 leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildProductQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildProductQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
* @method ChildProductQuery leftJoinProdutImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProdutImage relation
|
||||
* @method ChildProductQuery rightJoinProdutImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProdutImage relation
|
||||
* @method ChildProductQuery innerJoinProdutImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ProdutImage relation
|
||||
*
|
||||
* @method ChildProductQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildProductQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildProductQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document relation
|
||||
* @method ChildProductQuery leftJoinProductDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductDocument relation
|
||||
* @method ChildProductQuery rightJoinProductDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductDocument relation
|
||||
* @method ChildProductQuery innerJoinProductDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductDocument relation
|
||||
*
|
||||
* @method ChildProductQuery leftJoinAccessoryRelatedByProductId($relationAlias = null) Adds a LEFT JOIN clause to the query using the AccessoryRelatedByProductId relation
|
||||
* @method ChildProductQuery rightJoinAccessoryRelatedByProductId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AccessoryRelatedByProductId relation
|
||||
@@ -1070,40 +1070,40 @@ abstract class ProductQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
* Filter the query by a related \Thelia\Model\ProdutImage object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image the related object to use as filter
|
||||
* @param \Thelia\Model\ProdutImage|ObjectCollection $produtImage 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 filterByImage($image, $comparison = null)
|
||||
public function filterByProdutImage($produtImage, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
if ($produtImage instanceof \Thelia\Model\ProdutImage) {
|
||||
return $this
|
||||
->addUsingAlias(ProductTableMap::ID, $image->getProductId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
->addUsingAlias(ProductTableMap::ID, $produtImage->getProductId(), $comparison);
|
||||
} elseif ($produtImage instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useImageQuery()
|
||||
->filterByPrimaryKeys($image->getPrimaryKeys())
|
||||
->useProdutImageQuery()
|
||||
->filterByPrimaryKeys($produtImage->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
throw new PropelException('filterByProdutImage() only accepts arguments of type \Thelia\Model\ProdutImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image relation
|
||||
* Adds a JOIN clause to the query using the ProdutImage 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 joinImage($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinProdutImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
$relationMap = $tableMap->getRelation('ProdutImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
@@ -1118,14 +1118,14 @@ abstract class ProductQuery extends ModelCriteria
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Image');
|
||||
$this->addJoinObject($join, 'ProdutImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image object
|
||||
* Use the ProdutImage relation ProdutImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
@@ -1133,50 +1133,50 @@ abstract class ProductQuery extends ModelCriteria
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ImageQuery A secondary query class using the current class as primary query
|
||||
* @return \Thelia\Model\ProdutImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function useProdutImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
->joinProdutImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProdutImage', '\Thelia\Model\ProdutImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
* Filter the query by a related \Thelia\Model\ProductDocument object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document the related object to use as filter
|
||||
* @param \Thelia\Model\ProductDocument|ObjectCollection $productDocument 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 filterByDocument($document, $comparison = null)
|
||||
public function filterByProductDocument($productDocument, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
if ($productDocument instanceof \Thelia\Model\ProductDocument) {
|
||||
return $this
|
||||
->addUsingAlias(ProductTableMap::ID, $document->getProductId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
->addUsingAlias(ProductTableMap::ID, $productDocument->getProductId(), $comparison);
|
||||
} elseif ($productDocument instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useDocumentQuery()
|
||||
->filterByPrimaryKeys($document->getPrimaryKeys())
|
||||
->useProductDocumentQuery()
|
||||
->filterByPrimaryKeys($productDocument->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
throw new PropelException('filterByProductDocument() only accepts arguments of type \Thelia\Model\ProductDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document relation
|
||||
* Adds a JOIN clause to the query using the ProductDocument 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 joinDocument($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinProductDocument($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
$relationMap = $tableMap->getRelation('ProductDocument');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
@@ -1191,14 +1191,14 @@ abstract class ProductQuery extends ModelCriteria
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Document');
|
||||
$this->addJoinObject($join, 'ProductDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document object
|
||||
* Use the ProductDocument relation ProductDocument object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
@@ -1206,13 +1206,13 @@ abstract class ProductQuery extends ModelCriteria
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\DocumentQuery A secondary query class using the current class as primary query
|
||||
* @return \Thelia\Model\ProductDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function useProductDocumentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
->joinProductDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProductDocument', '\Thelia\Model\ProductDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,17 +14,17 @@ use Propel\Runtime\Exception\BadMethodCallException;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Parser\AbstractParser;
|
||||
use Thelia\Model\Document as ChildDocument;
|
||||
use Thelia\Model\DocumentI18nQuery as ChildDocumentI18nQuery;
|
||||
use Thelia\Model\DocumentQuery as ChildDocumentQuery;
|
||||
use Thelia\Model\Map\DocumentI18nTableMap;
|
||||
use Thelia\Model\ProdutImage as ChildProdutImage;
|
||||
use Thelia\Model\ProdutImageI18nQuery as ChildProdutImageI18nQuery;
|
||||
use Thelia\Model\ProdutImageQuery as ChildProdutImageQuery;
|
||||
use Thelia\Model\Map\ProdutImageI18nTableMap;
|
||||
|
||||
abstract class DocumentI18n implements ActiveRecordInterface
|
||||
abstract class ProdutImageI18n implements ActiveRecordInterface
|
||||
{
|
||||
/**
|
||||
* TableMap class name
|
||||
*/
|
||||
const TABLE_MAP = '\\Thelia\\Model\\Map\\DocumentI18nTableMap';
|
||||
const TABLE_MAP = '\\Thelia\\Model\\Map\\ProdutImageI18nTableMap';
|
||||
|
||||
|
||||
/**
|
||||
@@ -91,9 +91,9 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
protected $postscriptum;
|
||||
|
||||
/**
|
||||
* @var Document
|
||||
* @var ProdutImage
|
||||
*/
|
||||
protected $aDocument;
|
||||
protected $aProdutImage;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
@@ -115,7 +115,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes internal state of Thelia\Model\Base\DocumentI18n object.
|
||||
* Initializes internal state of Thelia\Model\Base\ProdutImageI18n object.
|
||||
* @see applyDefaults()
|
||||
*/
|
||||
public function __construct()
|
||||
@@ -212,9 +212,9 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares this with another <code>DocumentI18n</code> instance. If
|
||||
* <code>obj</code> is an instance of <code>DocumentI18n</code>, delegates to
|
||||
* <code>equals(DocumentI18n)</code>. Otherwise, returns <code>false</code>.
|
||||
* Compares this with another <code>ProdutImageI18n</code> instance. If
|
||||
* <code>obj</code> is an instance of <code>ProdutImageI18n</code>, delegates to
|
||||
* <code>equals(ProdutImageI18n)</code>. Otherwise, returns <code>false</code>.
|
||||
*
|
||||
* @param obj The object to compare to.
|
||||
* @return Whether equal to the object specified.
|
||||
@@ -295,7 +295,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* @param string $name The virtual column name
|
||||
* @param mixed $value The value to give to the virtual column
|
||||
*
|
||||
* @return DocumentI18n The current object, for fluid interface
|
||||
* @return ProdutImageI18n The current object, for fluid interface
|
||||
*/
|
||||
public function setVirtualColumn($name, $value)
|
||||
{
|
||||
@@ -327,7 +327,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
|
||||
* @param string $data The source data to import from
|
||||
*
|
||||
* @return DocumentI18n The current object, for fluid interface
|
||||
* @return ProdutImageI18n The current object, for fluid interface
|
||||
*/
|
||||
public function importFrom($parser, $data)
|
||||
{
|
||||
@@ -440,7 +440,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setId($v)
|
||||
{
|
||||
@@ -450,11 +450,11 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->id !== $v) {
|
||||
$this->id = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::ID;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::ID;
|
||||
}
|
||||
|
||||
if ($this->aDocument !== null && $this->aDocument->getId() !== $v) {
|
||||
$this->aDocument = null;
|
||||
if ($this->aProdutImage !== null && $this->aProdutImage->getId() !== $v) {
|
||||
$this->aProdutImage = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [locale] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setLocale($v)
|
||||
{
|
||||
@@ -475,7 +475,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->locale !== $v) {
|
||||
$this->locale = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::LOCALE;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::LOCALE;
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [title] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setTitle($v)
|
||||
{
|
||||
@@ -496,7 +496,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->title !== $v) {
|
||||
$this->title = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::TITLE;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::TITLE;
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setDescription($v)
|
||||
{
|
||||
@@ -517,7 +517,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->description !== $v) {
|
||||
$this->description = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::DESCRIPTION;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
@@ -528,7 +528,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [chapo] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setChapo($v)
|
||||
{
|
||||
@@ -538,7 +538,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->chapo !== $v) {
|
||||
$this->chapo = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::CHAPO;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::CHAPO;
|
||||
}
|
||||
|
||||
|
||||
@@ -549,7 +549,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [postscriptum] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setPostscriptum($v)
|
||||
{
|
||||
@@ -559,7 +559,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->postscriptum !== $v) {
|
||||
$this->postscriptum = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::POSTSCRIPTUM;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::POSTSCRIPTUM;
|
||||
}
|
||||
|
||||
|
||||
@@ -607,22 +607,22 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
try {
|
||||
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : DocumentI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ProdutImageI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : DocumentI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ProdutImageI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->locale = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : DocumentI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProdutImageI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->title = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : DocumentI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProdutImageI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->description = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : DocumentI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProdutImageI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->chapo = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : DocumentI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProdutImageI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->postscriptum = (null !== $col) ? (string) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
@@ -632,10 +632,10 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 6; // 6 = DocumentI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 6; // 6 = ProdutImageI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\DocumentI18n object", 0, $e);
|
||||
throw new PropelException("Error populating \Thelia\Model\ProdutImageI18n object", 0, $e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,8 +654,8 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function ensureConsistency()
|
||||
{
|
||||
if ($this->aDocument !== null && $this->id !== $this->aDocument->getId()) {
|
||||
$this->aDocument = null;
|
||||
if ($this->aProdutImage !== null && $this->id !== $this->aProdutImage->getId()) {
|
||||
$this->aProdutImage = null;
|
||||
}
|
||||
} // ensureConsistency
|
||||
|
||||
@@ -680,13 +680,13 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
// We don't need to alter the object instance pool; we're just modifying this instance
|
||||
// already in the pool.
|
||||
|
||||
$dataFetcher = ChildDocumentI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
|
||||
$dataFetcher = ChildProdutImageI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
|
||||
$row = $dataFetcher->fetch();
|
||||
$dataFetcher->close();
|
||||
if (!$row) {
|
||||
@@ -696,7 +696,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($deep) { // also de-associate any related objects?
|
||||
|
||||
$this->aDocument = null;
|
||||
$this->aProdutImage = null;
|
||||
} // if (deep)
|
||||
}
|
||||
|
||||
@@ -706,8 +706,8 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* @param ConnectionInterface $con
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
* @see DocumentI18n::setDeleted()
|
||||
* @see DocumentI18n::isDeleted()
|
||||
* @see ProdutImageI18n::setDeleted()
|
||||
* @see ProdutImageI18n::isDeleted()
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
@@ -716,12 +716,12 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$con->beginTransaction();
|
||||
try {
|
||||
$deleteQuery = ChildDocumentI18nQuery::create()
|
||||
$deleteQuery = ChildProdutImageI18nQuery::create()
|
||||
->filterByPrimaryKey($this->getPrimaryKey());
|
||||
$ret = $this->preDelete($con);
|
||||
if ($ret) {
|
||||
@@ -758,7 +758,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$con->beginTransaction();
|
||||
@@ -778,7 +778,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
$this->postUpdate($con);
|
||||
}
|
||||
$this->postSave($con);
|
||||
DocumentI18nTableMap::addInstanceToPool($this);
|
||||
ProdutImageI18nTableMap::addInstanceToPool($this);
|
||||
} else {
|
||||
$affectedRows = 0;
|
||||
}
|
||||
@@ -813,11 +813,11 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
// method. This object relates to these object(s) by a
|
||||
// foreign key reference.
|
||||
|
||||
if ($this->aDocument !== null) {
|
||||
if ($this->aDocument->isModified() || $this->aDocument->isNew()) {
|
||||
$affectedRows += $this->aDocument->save($con);
|
||||
if ($this->aProdutImage !== null) {
|
||||
if ($this->aProdutImage->isModified() || $this->aProdutImage->isNew()) {
|
||||
$affectedRows += $this->aProdutImage->save($con);
|
||||
}
|
||||
$this->setDocument($this->aDocument);
|
||||
$this->setProdutImage($this->aProdutImage);
|
||||
}
|
||||
|
||||
if ($this->isNew() || $this->isModified()) {
|
||||
@@ -853,27 +853,27 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
|
||||
// check the columns in natural order for more readable SQL queries
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::ID)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'ID';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::LOCALE)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::LOCALE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'LOCALE';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::TITLE)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::TITLE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'TITLE';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::DESCRIPTION)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::CHAPO)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::CHAPO)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CHAPO';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::POSTSCRIPTUM)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::POSTSCRIPTUM)) {
|
||||
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'INSERT INTO document_i18n (%s) VALUES (%s)',
|
||||
'INSERT INTO produt_image_i18n (%s) VALUES (%s)',
|
||||
implode(', ', $modifiedColumns),
|
||||
implode(', ', array_keys($modifiedColumns))
|
||||
);
|
||||
@@ -939,7 +939,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = DocumentI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$pos = ProdutImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$field = $this->getByPosition($pos);
|
||||
|
||||
return $field;
|
||||
@@ -996,11 +996,11 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
|
||||
{
|
||||
if (isset($alreadyDumpedObjects['DocumentI18n'][serialize($this->getPrimaryKey())])) {
|
||||
if (isset($alreadyDumpedObjects['ProdutImageI18n'][serialize($this->getPrimaryKey())])) {
|
||||
return '*RECURSION*';
|
||||
}
|
||||
$alreadyDumpedObjects['DocumentI18n'][serialize($this->getPrimaryKey())] = true;
|
||||
$keys = DocumentI18nTableMap::getFieldNames($keyType);
|
||||
$alreadyDumpedObjects['ProdutImageI18n'][serialize($this->getPrimaryKey())] = true;
|
||||
$keys = ProdutImageI18nTableMap::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getLocale(),
|
||||
@@ -1016,8 +1016,8 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aDocument) {
|
||||
$result['Document'] = $this->aDocument->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
if (null !== $this->aProdutImage) {
|
||||
$result['ProdutImage'] = $this->aProdutImage->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1037,7 +1037,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = DocumentI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$pos = ProdutImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
|
||||
return $this->setByPosition($pos, $value);
|
||||
}
|
||||
@@ -1093,7 +1093,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = DocumentI18nTableMap::getFieldNames($keyType);
|
||||
$keys = ProdutImageI18nTableMap::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setLocale($arr[$keys[1]]);
|
||||
@@ -1110,14 +1110,14 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function buildCriteria()
|
||||
{
|
||||
$criteria = new Criteria(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$criteria = new Criteria(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::ID)) $criteria->add(DocumentI18nTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::LOCALE)) $criteria->add(DocumentI18nTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::TITLE)) $criteria->add(DocumentI18nTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::DESCRIPTION)) $criteria->add(DocumentI18nTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::CHAPO)) $criteria->add(DocumentI18nTableMap::CHAPO, $this->chapo);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::POSTSCRIPTUM)) $criteria->add(DocumentI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::ID)) $criteria->add(ProdutImageI18nTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::LOCALE)) $criteria->add(ProdutImageI18nTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::TITLE)) $criteria->add(ProdutImageI18nTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::DESCRIPTION)) $criteria->add(ProdutImageI18nTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::CHAPO)) $criteria->add(ProdutImageI18nTableMap::CHAPO, $this->chapo);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::POSTSCRIPTUM)) $criteria->add(ProdutImageI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1132,9 +1132,9 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function buildPkeyCriteria()
|
||||
{
|
||||
$criteria = new Criteria(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$criteria->add(DocumentI18nTableMap::ID, $this->id);
|
||||
$criteria->add(DocumentI18nTableMap::LOCALE, $this->locale);
|
||||
$criteria = new Criteria(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria->add(ProdutImageI18nTableMap::ID, $this->id);
|
||||
$criteria->add(ProdutImageI18nTableMap::LOCALE, $this->locale);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1181,7 +1181,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param object $copyObj An object of \Thelia\Model\DocumentI18n (or compatible) type.
|
||||
* @param object $copyObj An object of \Thelia\Model\ProdutImageI18n (or compatible) type.
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
|
||||
* @throws PropelException
|
||||
@@ -1208,7 +1208,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* objects.
|
||||
*
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @return \Thelia\Model\DocumentI18n Clone of current object.
|
||||
* @return \Thelia\Model\ProdutImageI18n Clone of current object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copy($deepCopy = false)
|
||||
@@ -1222,13 +1222,13 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a ChildDocument object.
|
||||
* Declares an association between this object and a ChildProdutImage object.
|
||||
*
|
||||
* @param ChildDocument $v
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @param ChildProdutImage $v
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setDocument(ChildDocument $v = null)
|
||||
public function setProdutImage(ChildProdutImage $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setId(NULL);
|
||||
@@ -1236,12 +1236,12 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
$this->setId($v->getId());
|
||||
}
|
||||
|
||||
$this->aDocument = $v;
|
||||
$this->aProdutImage = $v;
|
||||
|
||||
// Add binding for other direction of this n:n relationship.
|
||||
// If this object has already been added to the ChildDocument object, it will not be re-added.
|
||||
// If this object has already been added to the ChildProdutImage object, it will not be re-added.
|
||||
if ($v !== null) {
|
||||
$v->addDocumentI18n($this);
|
||||
$v->addProdutImageI18n($this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1250,26 +1250,26 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
|
||||
/**
|
||||
* Get the associated ChildDocument object
|
||||
* Get the associated ChildProdutImage object
|
||||
*
|
||||
* @param ConnectionInterface $con Optional Connection object.
|
||||
* @return ChildDocument The associated ChildDocument object.
|
||||
* @return ChildProdutImage The associated ChildProdutImage object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getDocument(ConnectionInterface $con = null)
|
||||
public function getProdutImage(ConnectionInterface $con = null)
|
||||
{
|
||||
if ($this->aDocument === null && ($this->id !== null)) {
|
||||
$this->aDocument = ChildDocumentQuery::create()->findPk($this->id, $con);
|
||||
if ($this->aProdutImage === null && ($this->id !== null)) {
|
||||
$this->aProdutImage = ChildProdutImageQuery::create()->findPk($this->id, $con);
|
||||
/* The following can be used additionally to
|
||||
guarantee the related object contains a reference
|
||||
to this object. This level of coupling may, however, be
|
||||
undesirable since it could result in an only partially populated collection
|
||||
in the referenced object.
|
||||
$this->aDocument->addDocumentI18ns($this);
|
||||
$this->aProdutImage->addProdutImageI18ns($this);
|
||||
*/
|
||||
}
|
||||
|
||||
return $this->aDocument;
|
||||
return $this->aProdutImage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1305,7 +1305,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
if ($deep) {
|
||||
} // if ($deep)
|
||||
|
||||
$this->aDocument = null;
|
||||
$this->aProdutImage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1315,7 +1315,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->exportTo(DocumentI18nTableMap::DEFAULT_STRING_FORMAT);
|
||||
return (string) $this->exportTo(ProdutImageI18nTableMap::DEFAULT_STRING_FORMAT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -12,84 +12,84 @@ use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\DocumentI18n as ChildDocumentI18n;
|
||||
use Thelia\Model\DocumentI18nQuery as ChildDocumentI18nQuery;
|
||||
use Thelia\Model\Map\DocumentI18nTableMap;
|
||||
use Thelia\Model\ProdutImageI18n as ChildProdutImageI18n;
|
||||
use Thelia\Model\ProdutImageI18nQuery as ChildProdutImageI18nQuery;
|
||||
use Thelia\Model\Map\ProdutImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'document_i18n' table.
|
||||
* Base class that represents a query for the 'produt_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
* @method ChildProdutImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildProdutImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildProdutImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildProdutImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildProdutImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildProdutImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
* @method ChildProdutImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildProdutImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildProdutImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildProdutImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildProdutImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildProdutImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @method ChildProdutImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildProdutImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildProdutImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildDocumentI18nQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildDocumentI18nQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildDocumentI18nQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document relation
|
||||
* @method ChildProdutImageI18nQuery leftJoinProdutImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProdutImage relation
|
||||
* @method ChildProdutImageI18nQuery rightJoinProdutImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProdutImage relation
|
||||
* @method ChildProdutImageI18nQuery innerJoinProdutImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ProdutImage relation
|
||||
*
|
||||
* @method ChildDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildDocumentI18n matching the query
|
||||
* @method ChildDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildDocumentI18n matching the query, or a new ChildDocumentI18n object populated from the query conditions when no match is found
|
||||
* @method ChildProdutImageI18n findOne(ConnectionInterface $con = null) Return the first ChildProdutImageI18n matching the query
|
||||
* @method ChildProdutImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProdutImageI18n matching the query, or a new ChildProdutImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildDocumentI18n findOneById(int $id) Return the first ChildDocumentI18n filtered by the id column
|
||||
* @method ChildDocumentI18n findOneByLocale(string $locale) Return the first ChildDocumentI18n filtered by the locale column
|
||||
* @method ChildDocumentI18n findOneByTitle(string $title) Return the first ChildDocumentI18n filtered by the title column
|
||||
* @method ChildDocumentI18n findOneByDescription(string $description) Return the first ChildDocumentI18n filtered by the description column
|
||||
* @method ChildDocumentI18n findOneByChapo(string $chapo) Return the first ChildDocumentI18n filtered by the chapo column
|
||||
* @method ChildDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildDocumentI18n filtered by the postscriptum column
|
||||
* @method ChildProdutImageI18n findOneById(int $id) Return the first ChildProdutImageI18n filtered by the id column
|
||||
* @method ChildProdutImageI18n findOneByLocale(string $locale) Return the first ChildProdutImageI18n filtered by the locale column
|
||||
* @method ChildProdutImageI18n findOneByTitle(string $title) Return the first ChildProdutImageI18n filtered by the title column
|
||||
* @method ChildProdutImageI18n findOneByDescription(string $description) Return the first ChildProdutImageI18n filtered by the description column
|
||||
* @method ChildProdutImageI18n findOneByChapo(string $chapo) Return the first ChildProdutImageI18n filtered by the chapo column
|
||||
* @method ChildProdutImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildProdutImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildDocumentI18n objects filtered by the postscriptum column
|
||||
* @method array findById(int $id) Return ChildProdutImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildProdutImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildProdutImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildProdutImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildProdutImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildProdutImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class DocumentI18nQuery extends ModelCriteria
|
||||
abstract class ProdutImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\DocumentI18nQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\ProdutImageI18nQuery 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\\DocumentI18n', $modelAlias = null)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ProdutImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildDocumentI18nQuery object.
|
||||
* Returns a new ChildProdutImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildDocumentI18nQuery
|
||||
* @return ChildProdutImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\DocumentI18nQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\ProdutImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\DocumentI18nQuery();
|
||||
$query = new \Thelia\Model\ProdutImageI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -112,19 +112,19 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
* @return ChildProdutImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = DocumentI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
if ((null !== ($obj = ProdutImageI18nTableMap::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(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -143,11 +143,11 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildDocumentI18n A model object, or null if the key is not found
|
||||
* @return ChildProdutImageI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM document_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM produt_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
@@ -159,9 +159,9 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildDocumentI18n();
|
||||
$obj = new ChildProdutImageI18n();
|
||||
$obj->hydrate($row);
|
||||
DocumentI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
ProdutImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -174,7 +174,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
* @return ChildProdutImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
@@ -216,12 +216,12 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(DocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(DocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ProdutImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ProdutImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -239,8 +239,8 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(DocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(DocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(ProdutImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ProdutImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByDocument()
|
||||
* @see filterByProdutImage()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
@@ -266,18 +266,18 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery 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(DocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ProdutImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(DocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ProdutImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -288,7 +288,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
@@ -317,7 +317,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -333,7 +333,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
@@ -346,7 +346,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +362,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
@@ -375,7 +375,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -391,7 +391,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
@@ -404,7 +404,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -420,7 +420,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
@@ -433,46 +433,46 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
* Filter the query by a related \Thelia\Model\ProdutImage object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document The related object(s) to use as filter
|
||||
* @param \Thelia\Model\ProdutImage|ObjectCollection $produtImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDocument($document, $comparison = null)
|
||||
public function filterByProdutImage($produtImage, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
if ($produtImage instanceof \Thelia\Model\ProdutImage) {
|
||||
return $this
|
||||
->addUsingAlias(DocumentI18nTableMap::ID, $document->getId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
->addUsingAlias(ProdutImageI18nTableMap::ID, $produtImage->getId(), $comparison);
|
||||
} elseif ($produtImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(DocumentI18nTableMap::ID, $document->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ProdutImageI18nTableMap::ID, $produtImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
throw new PropelException('filterByProdutImage() only accepts arguments of type \Thelia\Model\ProdutImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document relation
|
||||
* Adds a JOIN clause to the query using the ProdutImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
public function joinProdutImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
$relationMap = $tableMap->getRelation('ProdutImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
@@ -487,14 +487,14 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Document');
|
||||
$this->addJoinObject($join, 'ProdutImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document object
|
||||
* Use the ProdutImage relation ProdutImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
@@ -502,27 +502,27 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\DocumentQuery A secondary query class using the current class as primary query
|
||||
* @return \Thelia\Model\ProdutImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
public function useProdutImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
->joinProdutImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProdutImage', '\Thelia\Model\ProdutImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildDocumentI18n $documentI18n Object to remove from the list of results
|
||||
* @param ChildProdutImageI18n $produtImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($documentI18n = null)
|
||||
public function prune($produtImageI18n = null)
|
||||
{
|
||||
if ($documentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(DocumentI18nTableMap::ID), $documentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(DocumentI18nTableMap::LOCALE), $documentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
if ($produtImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ProdutImageI18nTableMap::ID), $produtImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ProdutImageI18nTableMap::LOCALE), $produtImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the document_i18n table.
|
||||
* Deletes all rows from the produt_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
@@ -538,7 +538,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
@@ -549,8 +549,8 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
DocumentI18nTableMap::clearInstancePool();
|
||||
DocumentI18nTableMap::clearRelatedInstancePool();
|
||||
ProdutImageI18nTableMap::clearInstancePool();
|
||||
ProdutImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
@@ -562,9 +562,9 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildDocumentI18n or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ChildProdutImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildDocumentI18n object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ChildProdutImageI18n 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
|
||||
@@ -575,13 +575,13 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$criteria->setDbName(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
@@ -591,10 +591,10 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
DocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
ProdutImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
DocumentI18nTableMap::clearRelatedInstancePool();
|
||||
ProdutImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
@@ -604,4 +604,4 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
} // DocumentI18nQuery
|
||||
} // ProdutImageI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/ProdutImageQuery.php
Normal file
846
core/lib/Thelia/Model/Base/ProdutImageQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?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\ProdutImage as ChildProdutImage;
|
||||
use Thelia\Model\ProdutImageI18nQuery as ChildProdutImageI18nQuery;
|
||||
use Thelia\Model\ProdutImageQuery as ChildProdutImageQuery;
|
||||
use Thelia\Model\Map\ProdutImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'produt_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildProdutImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildProdutImageQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
|
||||
* @method ChildProdutImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildProdutImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildProdutImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildProdutImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildProdutImageQuery groupById() Group by the id column
|
||||
* @method ChildProdutImageQuery groupByProductId() Group by the product_id column
|
||||
* @method ChildProdutImageQuery groupByFile() Group by the file column
|
||||
* @method ChildProdutImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildProdutImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildProdutImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildProdutImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildProdutImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildProdutImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildProdutImageQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
|
||||
* @method ChildProdutImageQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
|
||||
* @method ChildProdutImageQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
|
||||
*
|
||||
* @method ChildProdutImageQuery leftJoinProdutImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProdutImageI18n relation
|
||||
* @method ChildProdutImageQuery rightJoinProdutImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProdutImageI18n relation
|
||||
* @method ChildProdutImageQuery innerJoinProdutImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ProdutImageI18n relation
|
||||
*
|
||||
* @method ChildProdutImage findOne(ConnectionInterface $con = null) Return the first ChildProdutImage matching the query
|
||||
* @method ChildProdutImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProdutImage matching the query, or a new ChildProdutImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildProdutImage findOneById(int $id) Return the first ChildProdutImage filtered by the id column
|
||||
* @method ChildProdutImage findOneByProductId(int $product_id) Return the first ChildProdutImage filtered by the product_id column
|
||||
* @method ChildProdutImage findOneByFile(string $file) Return the first ChildProdutImage filtered by the file column
|
||||
* @method ChildProdutImage findOneByPosition(int $position) Return the first ChildProdutImage filtered by the position column
|
||||
* @method ChildProdutImage findOneByCreatedAt(string $created_at) Return the first ChildProdutImage filtered by the created_at column
|
||||
* @method ChildProdutImage findOneByUpdatedAt(string $updated_at) Return the first ChildProdutImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildProdutImage objects filtered by the id column
|
||||
* @method array findByProductId(int $product_id) Return ChildProdutImage objects filtered by the product_id column
|
||||
* @method array findByFile(string $file) Return ChildProdutImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildProdutImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildProdutImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildProdutImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class ProdutImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ProdutImageQuery 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\\ProdutImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildProdutImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildProdutImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ProdutImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ProdutImageQuery();
|
||||
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 ChildProdutImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ProdutImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProdutImageTableMap::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 ChildProdutImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, PRODUCT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM produt_image 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 ChildProdutImage();
|
||||
$obj->hydrate($row);
|
||||
ProdutImageTableMap::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 ChildProdutImage|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 ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::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 ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::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 ChildProdutImageQuery 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(ProdutImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::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 ChildProdutImageQuery 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(ProdutImageTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($productId['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::PRODUCT_ID, $productId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::FILE, $file, $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 ChildProdutImageQuery 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(ProdutImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::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 ChildProdutImageQuery 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(ProdutImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::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 ChildProdutImageQuery 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(ProdutImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::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 ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProduct($product, $comparison = null)
|
||||
{
|
||||
if ($product instanceof \Thelia\Model\Product) {
|
||||
return $this
|
||||
->addUsingAlias(ProdutImageTableMap::PRODUCT_ID, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ProdutImageTableMap::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 ChildProdutImageQuery 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\ProdutImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\ProdutImageI18n|ObjectCollection $produtImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProdutImageI18n($produtImageI18n, $comparison = null)
|
||||
{
|
||||
if ($produtImageI18n instanceof \Thelia\Model\ProdutImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ProdutImageTableMap::ID, $produtImageI18n->getId(), $comparison);
|
||||
} elseif ($produtImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useProdutImageI18nQuery()
|
||||
->filterByPrimaryKeys($produtImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByProdutImageI18n() only accepts arguments of type \Thelia\Model\ProdutImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ProdutImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProdutImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ProdutImageI18n');
|
||||
|
||||
// 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, 'ProdutImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ProdutImageI18n relation ProdutImageI18n 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\ProdutImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useProdutImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinProdutImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProdutImageI18n', '\Thelia\Model\ProdutImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildProdutImage $produtImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($produtImage = null)
|
||||
{
|
||||
if ($produtImage) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::ID, $produtImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the produt_image 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(ProdutImageTableMap::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).
|
||||
ProdutImageTableMap::clearInstancePool();
|
||||
ProdutImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildProdutImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildProdutImage 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(ProdutImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ProdutImageTableMap::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();
|
||||
|
||||
|
||||
ProdutImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ProdutImageTableMap::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 ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProdutImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProdutImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProdutImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProdutImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProdutImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProdutImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ProdutImageI18n';
|
||||
|
||||
return $this
|
||||
->joinProdutImageI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('ProdutImageI18n');
|
||||
$this->with['ProdutImageI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProdutImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProdutImageI18n', '\Thelia\Model\ProdutImageI18nQuery');
|
||||
}
|
||||
|
||||
} // ProdutImageQuery
|
||||
Reference in New Issue
Block a user