Added brands management
This commit is contained in:
2918
core/lib/Thelia/Model/Base/Brand.php
Normal file
2918
core/lib/Thelia/Model/Base/Brand.php
Normal file
File diff suppressed because it is too large
Load Diff
1990
core/lib/Thelia/Model/Base/BrandDocument.php
Normal file
1990
core/lib/Thelia/Model/Base/BrandDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
1442
core/lib/Thelia/Model/Base/BrandDocumentI18n.php
Normal file
1442
core/lib/Thelia/Model/Base/BrandDocumentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/BrandDocumentI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/BrandDocumentI18nQuery.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\BrandDocumentI18n as ChildBrandDocumentI18n;
|
||||
use Thelia\Model\BrandDocumentI18nQuery as ChildBrandDocumentI18nQuery;
|
||||
use Thelia\Model\Map\BrandDocumentI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'brand_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildBrandDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildBrandDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildBrandDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildBrandDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildBrandDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildBrandDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildBrandDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildBrandDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildBrandDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildBrandDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildBrandDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildBrandDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildBrandDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildBrandDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildBrandDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildBrandDocumentI18nQuery leftJoinBrandDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the BrandDocument relation
|
||||
* @method ChildBrandDocumentI18nQuery rightJoinBrandDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BrandDocument relation
|
||||
* @method ChildBrandDocumentI18nQuery innerJoinBrandDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the BrandDocument relation
|
||||
*
|
||||
* @method ChildBrandDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildBrandDocumentI18n matching the query
|
||||
* @method ChildBrandDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildBrandDocumentI18n matching the query, or a new ChildBrandDocumentI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildBrandDocumentI18n findOneById(int $id) Return the first ChildBrandDocumentI18n filtered by the id column
|
||||
* @method ChildBrandDocumentI18n findOneByLocale(string $locale) Return the first ChildBrandDocumentI18n filtered by the locale column
|
||||
* @method ChildBrandDocumentI18n findOneByTitle(string $title) Return the first ChildBrandDocumentI18n filtered by the title column
|
||||
* @method ChildBrandDocumentI18n findOneByDescription(string $description) Return the first ChildBrandDocumentI18n filtered by the description column
|
||||
* @method ChildBrandDocumentI18n findOneByChapo(string $chapo) Return the first ChildBrandDocumentI18n filtered by the chapo column
|
||||
* @method ChildBrandDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildBrandDocumentI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildBrandDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildBrandDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildBrandDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildBrandDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildBrandDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildBrandDocumentI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class BrandDocumentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\BrandDocumentI18nQuery 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\\BrandDocumentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildBrandDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildBrandDocumentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\BrandDocumentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\BrandDocumentI18nQuery();
|
||||
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 ChildBrandDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = BrandDocumentI18nTableMap::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(BrandDocumentI18nTableMap::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 ChildBrandDocumentI18n 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 `brand_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 ChildBrandDocumentI18n();
|
||||
$obj->hydrate($row);
|
||||
BrandDocumentI18nTableMap::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 ChildBrandDocumentI18n|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 ChildBrandDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(BrandDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(BrandDocumentI18nTableMap::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 ChildBrandDocumentI18nQuery 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(BrandDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(BrandDocumentI18nTableMap::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 filterByBrandDocument()
|
||||
*
|
||||
* @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 ChildBrandDocumentI18nQuery 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(BrandDocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(BrandDocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandDocumentI18nTableMap::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 ChildBrandDocumentI18nQuery 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(BrandDocumentI18nTableMap::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 ChildBrandDocumentI18nQuery 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(BrandDocumentI18nTableMap::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 ChildBrandDocumentI18nQuery 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(BrandDocumentI18nTableMap::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 ChildBrandDocumentI18nQuery 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(BrandDocumentI18nTableMap::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 ChildBrandDocumentI18nQuery 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(BrandDocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\BrandDocument object
|
||||
*
|
||||
* @param \Thelia\Model\BrandDocument|ObjectCollection $brandDocument The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildBrandDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandDocument($brandDocument, $comparison = null)
|
||||
{
|
||||
if ($brandDocument instanceof \Thelia\Model\BrandDocument) {
|
||||
return $this
|
||||
->addUsingAlias(BrandDocumentI18nTableMap::ID, $brandDocument->getId(), $comparison);
|
||||
} elseif ($brandDocument instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(BrandDocumentI18nTableMap::ID, $brandDocument->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByBrandDocument() only accepts arguments of type \Thelia\Model\BrandDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the BrandDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildBrandDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinBrandDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('BrandDocument');
|
||||
|
||||
// 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, 'BrandDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the BrandDocument relation BrandDocument 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\BrandDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useBrandDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinBrandDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'BrandDocument', '\Thelia\Model\BrandDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildBrandDocumentI18n $brandDocumentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildBrandDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($brandDocumentI18n = null)
|
||||
{
|
||||
if ($brandDocumentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(BrandDocumentI18nTableMap::ID), $brandDocumentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(BrandDocumentI18nTableMap::LOCALE), $brandDocumentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the brand_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(BrandDocumentI18nTableMap::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).
|
||||
BrandDocumentI18nTableMap::clearInstancePool();
|
||||
BrandDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildBrandDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildBrandDocumentI18n 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(BrandDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(BrandDocumentI18nTableMap::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();
|
||||
|
||||
|
||||
BrandDocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
BrandDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // BrandDocumentI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/BrandDocumentQuery.php
Normal file
846
core/lib/Thelia/Model/Base/BrandDocumentQuery.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\BrandDocument as ChildBrandDocument;
|
||||
use Thelia\Model\BrandDocumentI18nQuery as ChildBrandDocumentI18nQuery;
|
||||
use Thelia\Model\BrandDocumentQuery as ChildBrandDocumentQuery;
|
||||
use Thelia\Model\Map\BrandDocumentTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'brand_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildBrandDocumentQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildBrandDocumentQuery orderByBrandId($order = Criteria::ASC) Order by the brand_id column
|
||||
* @method ChildBrandDocumentQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildBrandDocumentQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildBrandDocumentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildBrandDocumentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildBrandDocumentQuery groupById() Group by the id column
|
||||
* @method ChildBrandDocumentQuery groupByBrandId() Group by the brand_id column
|
||||
* @method ChildBrandDocumentQuery groupByFile() Group by the file column
|
||||
* @method ChildBrandDocumentQuery groupByPosition() Group by the position column
|
||||
* @method ChildBrandDocumentQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildBrandDocumentQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildBrandDocumentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildBrandDocumentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildBrandDocumentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildBrandDocumentQuery leftJoinBrand($relationAlias = null) Adds a LEFT JOIN clause to the query using the Brand relation
|
||||
* @method ChildBrandDocumentQuery rightJoinBrand($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Brand relation
|
||||
* @method ChildBrandDocumentQuery innerJoinBrand($relationAlias = null) Adds a INNER JOIN clause to the query using the Brand relation
|
||||
*
|
||||
* @method ChildBrandDocumentQuery leftJoinBrandDocumentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the BrandDocumentI18n relation
|
||||
* @method ChildBrandDocumentQuery rightJoinBrandDocumentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BrandDocumentI18n relation
|
||||
* @method ChildBrandDocumentQuery innerJoinBrandDocumentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the BrandDocumentI18n relation
|
||||
*
|
||||
* @method ChildBrandDocument findOne(ConnectionInterface $con = null) Return the first ChildBrandDocument matching the query
|
||||
* @method ChildBrandDocument findOneOrCreate(ConnectionInterface $con = null) Return the first ChildBrandDocument matching the query, or a new ChildBrandDocument object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildBrandDocument findOneById(int $id) Return the first ChildBrandDocument filtered by the id column
|
||||
* @method ChildBrandDocument findOneByBrandId(int $brand_id) Return the first ChildBrandDocument filtered by the brand_id column
|
||||
* @method ChildBrandDocument findOneByFile(string $file) Return the first ChildBrandDocument filtered by the file column
|
||||
* @method ChildBrandDocument findOneByPosition(int $position) Return the first ChildBrandDocument filtered by the position column
|
||||
* @method ChildBrandDocument findOneByCreatedAt(string $created_at) Return the first ChildBrandDocument filtered by the created_at column
|
||||
* @method ChildBrandDocument findOneByUpdatedAt(string $updated_at) Return the first ChildBrandDocument filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildBrandDocument objects filtered by the id column
|
||||
* @method array findByBrandId(int $brand_id) Return ChildBrandDocument objects filtered by the brand_id column
|
||||
* @method array findByFile(string $file) Return ChildBrandDocument objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildBrandDocument objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildBrandDocument objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildBrandDocument objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class BrandDocumentQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\BrandDocumentQuery 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\\BrandDocument', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildBrandDocumentQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildBrandDocumentQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\BrandDocumentQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\BrandDocumentQuery();
|
||||
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 ChildBrandDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = BrandDocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(BrandDocumentTableMap::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 ChildBrandDocument A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT `ID`, `BRAND_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `brand_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 ChildBrandDocument();
|
||||
$obj->hydrate($row);
|
||||
BrandDocumentTableMap::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 ChildBrandDocument|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 ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(BrandDocumentTableMap::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 ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(BrandDocumentTableMap::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 ChildBrandDocumentQuery 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(BrandDocumentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(BrandDocumentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandDocumentTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the brand_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByBrandId(1234); // WHERE brand_id = 1234
|
||||
* $query->filterByBrandId(array(12, 34)); // WHERE brand_id IN (12, 34)
|
||||
* $query->filterByBrandId(array('min' => 12)); // WHERE brand_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByBrand()
|
||||
*
|
||||
* @param mixed $brandId 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 ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandId($brandId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($brandId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($brandId['min'])) {
|
||||
$this->addUsingAlias(BrandDocumentTableMap::BRAND_ID, $brandId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($brandId['max'])) {
|
||||
$this->addUsingAlias(BrandDocumentTableMap::BRAND_ID, $brandId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandDocumentTableMap::BRAND_ID, $brandId, $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 ChildBrandDocumentQuery 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(BrandDocumentTableMap::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 ChildBrandDocumentQuery 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(BrandDocumentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(BrandDocumentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandDocumentTableMap::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 ChildBrandDocumentQuery 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(BrandDocumentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(BrandDocumentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandDocumentTableMap::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 ChildBrandDocumentQuery 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(BrandDocumentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(BrandDocumentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandDocumentTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Brand object
|
||||
*
|
||||
* @param \Thelia\Model\Brand|ObjectCollection $brand The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrand($brand, $comparison = null)
|
||||
{
|
||||
if ($brand instanceof \Thelia\Model\Brand) {
|
||||
return $this
|
||||
->addUsingAlias(BrandDocumentTableMap::BRAND_ID, $brand->getId(), $comparison);
|
||||
} elseif ($brand instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(BrandDocumentTableMap::BRAND_ID, $brand->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByBrand() only accepts arguments of type \Thelia\Model\Brand or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Brand relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinBrand($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Brand');
|
||||
|
||||
// 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, 'Brand');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Brand relation Brand 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\BrandQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useBrandQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinBrand($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Brand', '\Thelia\Model\BrandQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\BrandDocumentI18n object
|
||||
*
|
||||
* @param \Thelia\Model\BrandDocumentI18n|ObjectCollection $brandDocumentI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandDocumentI18n($brandDocumentI18n, $comparison = null)
|
||||
{
|
||||
if ($brandDocumentI18n instanceof \Thelia\Model\BrandDocumentI18n) {
|
||||
return $this
|
||||
->addUsingAlias(BrandDocumentTableMap::ID, $brandDocumentI18n->getId(), $comparison);
|
||||
} elseif ($brandDocumentI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useBrandDocumentI18nQuery()
|
||||
->filterByPrimaryKeys($brandDocumentI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByBrandDocumentI18n() only accepts arguments of type \Thelia\Model\BrandDocumentI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the BrandDocumentI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinBrandDocumentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('BrandDocumentI18n');
|
||||
|
||||
// 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, 'BrandDocumentI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the BrandDocumentI18n relation BrandDocumentI18n 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\BrandDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useBrandDocumentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinBrandDocumentI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'BrandDocumentI18n', '\Thelia\Model\BrandDocumentI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildBrandDocument $brandDocument Object to remove from the list of results
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($brandDocument = null)
|
||||
{
|
||||
if ($brandDocument) {
|
||||
$this->addUsingAlias(BrandDocumentTableMap::ID, $brandDocument->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the brand_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(BrandDocumentTableMap::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).
|
||||
BrandDocumentTableMap::clearInstancePool();
|
||||
BrandDocumentTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildBrandDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildBrandDocument 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(BrandDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(BrandDocumentTableMap::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();
|
||||
|
||||
|
||||
BrandDocumentTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
BrandDocumentTableMap::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 ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(BrandDocumentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(BrandDocumentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(BrandDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(BrandDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(BrandDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(BrandDocumentTableMap::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 ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'BrandDocumentI18n';
|
||||
|
||||
return $this
|
||||
->joinBrandDocumentI18n($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 ChildBrandDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('BrandDocumentI18n');
|
||||
$this->with['BrandDocumentI18n']->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 ChildBrandDocumentI18nQuery 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 : 'BrandDocumentI18n', '\Thelia\Model\BrandDocumentI18nQuery');
|
||||
}
|
||||
|
||||
} // BrandDocumentQuery
|
||||
1616
core/lib/Thelia/Model/Base/BrandI18n.php
Normal file
1616
core/lib/Thelia/Model/Base/BrandI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
706
core/lib/Thelia/Model/Base/BrandI18nQuery.php
Normal file
706
core/lib/Thelia/Model/Base/BrandI18nQuery.php
Normal file
@@ -0,0 +1,706 @@
|
||||
<?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\BrandI18n as ChildBrandI18n;
|
||||
use Thelia\Model\BrandI18nQuery as ChildBrandI18nQuery;
|
||||
use Thelia\Model\Map\BrandI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'brand_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildBrandI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildBrandI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildBrandI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildBrandI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildBrandI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildBrandI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
* @method ChildBrandI18nQuery orderByMetaTitle($order = Criteria::ASC) Order by the meta_title column
|
||||
* @method ChildBrandI18nQuery orderByMetaDescription($order = Criteria::ASC) Order by the meta_description column
|
||||
* @method ChildBrandI18nQuery orderByMetaKeywords($order = Criteria::ASC) Order by the meta_keywords column
|
||||
*
|
||||
* @method ChildBrandI18nQuery groupById() Group by the id column
|
||||
* @method ChildBrandI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildBrandI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildBrandI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildBrandI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildBrandI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
* @method ChildBrandI18nQuery groupByMetaTitle() Group by the meta_title column
|
||||
* @method ChildBrandI18nQuery groupByMetaDescription() Group by the meta_description column
|
||||
* @method ChildBrandI18nQuery groupByMetaKeywords() Group by the meta_keywords column
|
||||
*
|
||||
* @method ChildBrandI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildBrandI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildBrandI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildBrandI18nQuery leftJoinBrand($relationAlias = null) Adds a LEFT JOIN clause to the query using the Brand relation
|
||||
* @method ChildBrandI18nQuery rightJoinBrand($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Brand relation
|
||||
* @method ChildBrandI18nQuery innerJoinBrand($relationAlias = null) Adds a INNER JOIN clause to the query using the Brand relation
|
||||
*
|
||||
* @method ChildBrandI18n findOne(ConnectionInterface $con = null) Return the first ChildBrandI18n matching the query
|
||||
* @method ChildBrandI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildBrandI18n matching the query, or a new ChildBrandI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildBrandI18n findOneById(int $id) Return the first ChildBrandI18n filtered by the id column
|
||||
* @method ChildBrandI18n findOneByLocale(string $locale) Return the first ChildBrandI18n filtered by the locale column
|
||||
* @method ChildBrandI18n findOneByTitle(string $title) Return the first ChildBrandI18n filtered by the title column
|
||||
* @method ChildBrandI18n findOneByDescription(string $description) Return the first ChildBrandI18n filtered by the description column
|
||||
* @method ChildBrandI18n findOneByChapo(string $chapo) Return the first ChildBrandI18n filtered by the chapo column
|
||||
* @method ChildBrandI18n findOneByPostscriptum(string $postscriptum) Return the first ChildBrandI18n filtered by the postscriptum column
|
||||
* @method ChildBrandI18n findOneByMetaTitle(string $meta_title) Return the first ChildBrandI18n filtered by the meta_title column
|
||||
* @method ChildBrandI18n findOneByMetaDescription(string $meta_description) Return the first ChildBrandI18n filtered by the meta_description column
|
||||
* @method ChildBrandI18n findOneByMetaKeywords(string $meta_keywords) Return the first ChildBrandI18n filtered by the meta_keywords column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildBrandI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildBrandI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildBrandI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildBrandI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildBrandI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildBrandI18n objects filtered by the postscriptum column
|
||||
* @method array findByMetaTitle(string $meta_title) Return ChildBrandI18n objects filtered by the meta_title column
|
||||
* @method array findByMetaDescription(string $meta_description) Return ChildBrandI18n objects filtered by the meta_description column
|
||||
* @method array findByMetaKeywords(string $meta_keywords) Return ChildBrandI18n objects filtered by the meta_keywords column
|
||||
*
|
||||
*/
|
||||
abstract class BrandI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\BrandI18nQuery 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\\BrandI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildBrandI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildBrandI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\BrandI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\BrandI18nQuery();
|
||||
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 ChildBrandI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = BrandI18nTableMap::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(BrandI18nTableMap::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 ChildBrandI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM`, `META_TITLE`, `META_DESCRIPTION`, `META_KEYWORDS` FROM `brand_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 ChildBrandI18n();
|
||||
$obj->hydrate($row);
|
||||
BrandI18nTableMap::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 ChildBrandI18n|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 ChildBrandI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(BrandI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(BrandI18nTableMap::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 ChildBrandI18nQuery 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(BrandI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(BrandI18nTableMap::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 filterByBrand()
|
||||
*
|
||||
* @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 ChildBrandI18nQuery 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(BrandI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(BrandI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandI18nTableMap::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 ChildBrandI18nQuery 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(BrandI18nTableMap::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 ChildBrandI18nQuery 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(BrandI18nTableMap::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 ChildBrandI18nQuery 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(BrandI18nTableMap::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 ChildBrandI18nQuery 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(BrandI18nTableMap::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 ChildBrandI18nQuery 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(BrandI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the meta_title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByMetaTitle('fooValue'); // WHERE meta_title = 'fooValue'
|
||||
* $query->filterByMetaTitle('%fooValue%'); // WHERE meta_title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $metaTitle 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 ChildBrandI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByMetaTitle($metaTitle = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($metaTitle)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $metaTitle)) {
|
||||
$metaTitle = str_replace('*', '%', $metaTitle);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandI18nTableMap::META_TITLE, $metaTitle, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the meta_description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByMetaDescription('fooValue'); // WHERE meta_description = 'fooValue'
|
||||
* $query->filterByMetaDescription('%fooValue%'); // WHERE meta_description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $metaDescription 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 ChildBrandI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByMetaDescription($metaDescription = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($metaDescription)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $metaDescription)) {
|
||||
$metaDescription = str_replace('*', '%', $metaDescription);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandI18nTableMap::META_DESCRIPTION, $metaDescription, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the meta_keywords column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByMetaKeywords('fooValue'); // WHERE meta_keywords = 'fooValue'
|
||||
* $query->filterByMetaKeywords('%fooValue%'); // WHERE meta_keywords LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $metaKeywords 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 ChildBrandI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByMetaKeywords($metaKeywords = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($metaKeywords)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $metaKeywords)) {
|
||||
$metaKeywords = str_replace('*', '%', $metaKeywords);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandI18nTableMap::META_KEYWORDS, $metaKeywords, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Brand object
|
||||
*
|
||||
* @param \Thelia\Model\Brand|ObjectCollection $brand The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildBrandI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrand($brand, $comparison = null)
|
||||
{
|
||||
if ($brand instanceof \Thelia\Model\Brand) {
|
||||
return $this
|
||||
->addUsingAlias(BrandI18nTableMap::ID, $brand->getId(), $comparison);
|
||||
} elseif ($brand instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(BrandI18nTableMap::ID, $brand->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByBrand() only accepts arguments of type \Thelia\Model\Brand or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Brand relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildBrandI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinBrand($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Brand');
|
||||
|
||||
// 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, 'Brand');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Brand relation Brand 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\BrandQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useBrandQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinBrand($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Brand', '\Thelia\Model\BrandQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildBrandI18n $brandI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildBrandI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($brandI18n = null)
|
||||
{
|
||||
if ($brandI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(BrandI18nTableMap::ID), $brandI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(BrandI18nTableMap::LOCALE), $brandI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the brand_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(BrandI18nTableMap::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).
|
||||
BrandI18nTableMap::clearInstancePool();
|
||||
BrandI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildBrandI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildBrandI18n 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(BrandI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(BrandI18nTableMap::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();
|
||||
|
||||
|
||||
BrandI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
BrandI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // BrandI18nQuery
|
||||
2258
core/lib/Thelia/Model/Base/BrandImage.php
Normal file
2258
core/lib/Thelia/Model/Base/BrandImage.php
Normal file
File diff suppressed because it is too large
Load Diff
1442
core/lib/Thelia/Model/Base/BrandImageI18n.php
Normal file
1442
core/lib/Thelia/Model/Base/BrandImageI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/BrandImageI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/BrandImageI18nQuery.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\BrandImageI18n as ChildBrandImageI18n;
|
||||
use Thelia\Model\BrandImageI18nQuery as ChildBrandImageI18nQuery;
|
||||
use Thelia\Model\Map\BrandImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'brand_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildBrandImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildBrandImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildBrandImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildBrandImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildBrandImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildBrandImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildBrandImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildBrandImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildBrandImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildBrandImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildBrandImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildBrandImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildBrandImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildBrandImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildBrandImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildBrandImageI18nQuery leftJoinBrandImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the BrandImage relation
|
||||
* @method ChildBrandImageI18nQuery rightJoinBrandImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BrandImage relation
|
||||
* @method ChildBrandImageI18nQuery innerJoinBrandImage($relationAlias = null) Adds a INNER JOIN clause to the query using the BrandImage relation
|
||||
*
|
||||
* @method ChildBrandImageI18n findOne(ConnectionInterface $con = null) Return the first ChildBrandImageI18n matching the query
|
||||
* @method ChildBrandImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildBrandImageI18n matching the query, or a new ChildBrandImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildBrandImageI18n findOneById(int $id) Return the first ChildBrandImageI18n filtered by the id column
|
||||
* @method ChildBrandImageI18n findOneByLocale(string $locale) Return the first ChildBrandImageI18n filtered by the locale column
|
||||
* @method ChildBrandImageI18n findOneByTitle(string $title) Return the first ChildBrandImageI18n filtered by the title column
|
||||
* @method ChildBrandImageI18n findOneByDescription(string $description) Return the first ChildBrandImageI18n filtered by the description column
|
||||
* @method ChildBrandImageI18n findOneByChapo(string $chapo) Return the first ChildBrandImageI18n filtered by the chapo column
|
||||
* @method ChildBrandImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildBrandImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildBrandImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildBrandImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildBrandImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildBrandImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildBrandImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildBrandImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class BrandImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\BrandImageI18nQuery 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\\BrandImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildBrandImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildBrandImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\BrandImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\BrandImageI18nQuery();
|
||||
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 ChildBrandImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = BrandImageI18nTableMap::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(BrandImageI18nTableMap::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 ChildBrandImageI18n 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 `brand_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 ChildBrandImageI18n();
|
||||
$obj->hydrate($row);
|
||||
BrandImageI18nTableMap::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 ChildBrandImageI18n|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 ChildBrandImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(BrandImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(BrandImageI18nTableMap::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 ChildBrandImageI18nQuery 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(BrandImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(BrandImageI18nTableMap::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 filterByBrandImage()
|
||||
*
|
||||
* @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 ChildBrandImageI18nQuery 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(BrandImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(BrandImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandImageI18nTableMap::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 ChildBrandImageI18nQuery 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(BrandImageI18nTableMap::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 ChildBrandImageI18nQuery 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(BrandImageI18nTableMap::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 ChildBrandImageI18nQuery 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(BrandImageI18nTableMap::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 ChildBrandImageI18nQuery 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(BrandImageI18nTableMap::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 ChildBrandImageI18nQuery 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(BrandImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\BrandImage object
|
||||
*
|
||||
* @param \Thelia\Model\BrandImage|ObjectCollection $brandImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildBrandImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandImage($brandImage, $comparison = null)
|
||||
{
|
||||
if ($brandImage instanceof \Thelia\Model\BrandImage) {
|
||||
return $this
|
||||
->addUsingAlias(BrandImageI18nTableMap::ID, $brandImage->getId(), $comparison);
|
||||
} elseif ($brandImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(BrandImageI18nTableMap::ID, $brandImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByBrandImage() only accepts arguments of type \Thelia\Model\BrandImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the BrandImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildBrandImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinBrandImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('BrandImage');
|
||||
|
||||
// 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, 'BrandImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the BrandImage relation BrandImage 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\BrandImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useBrandImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinBrandImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'BrandImage', '\Thelia\Model\BrandImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildBrandImageI18n $brandImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildBrandImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($brandImageI18n = null)
|
||||
{
|
||||
if ($brandImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(BrandImageI18nTableMap::ID), $brandImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(BrandImageI18nTableMap::LOCALE), $brandImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the brand_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(BrandImageI18nTableMap::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).
|
||||
BrandImageI18nTableMap::clearInstancePool();
|
||||
BrandImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildBrandImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildBrandImageI18n 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(BrandImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(BrandImageI18nTableMap::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();
|
||||
|
||||
|
||||
BrandImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
BrandImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // BrandImageI18nQuery
|
||||
923
core/lib/Thelia/Model/Base/BrandImageQuery.php
Normal file
923
core/lib/Thelia/Model/Base/BrandImageQuery.php
Normal file
@@ -0,0 +1,923 @@
|
||||
<?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\BrandImage as ChildBrandImage;
|
||||
use Thelia\Model\BrandImageI18nQuery as ChildBrandImageI18nQuery;
|
||||
use Thelia\Model\BrandImageQuery as ChildBrandImageQuery;
|
||||
use Thelia\Model\Map\BrandImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'brand_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildBrandImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildBrandImageQuery orderByBrandId($order = Criteria::ASC) Order by the brand_id column
|
||||
* @method ChildBrandImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildBrandImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildBrandImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildBrandImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildBrandImageQuery groupById() Group by the id column
|
||||
* @method ChildBrandImageQuery groupByBrandId() Group by the brand_id column
|
||||
* @method ChildBrandImageQuery groupByFile() Group by the file column
|
||||
* @method ChildBrandImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildBrandImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildBrandImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildBrandImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildBrandImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildBrandImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildBrandImageQuery leftJoinBrandRelatedByBrandId($relationAlias = null) Adds a LEFT JOIN clause to the query using the BrandRelatedByBrandId relation
|
||||
* @method ChildBrandImageQuery rightJoinBrandRelatedByBrandId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BrandRelatedByBrandId relation
|
||||
* @method ChildBrandImageQuery innerJoinBrandRelatedByBrandId($relationAlias = null) Adds a INNER JOIN clause to the query using the BrandRelatedByBrandId relation
|
||||
*
|
||||
* @method ChildBrandImageQuery leftJoinBrandRelatedByLogoImageId($relationAlias = null) Adds a LEFT JOIN clause to the query using the BrandRelatedByLogoImageId relation
|
||||
* @method ChildBrandImageQuery rightJoinBrandRelatedByLogoImageId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BrandRelatedByLogoImageId relation
|
||||
* @method ChildBrandImageQuery innerJoinBrandRelatedByLogoImageId($relationAlias = null) Adds a INNER JOIN clause to the query using the BrandRelatedByLogoImageId relation
|
||||
*
|
||||
* @method ChildBrandImageQuery leftJoinBrandImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the BrandImageI18n relation
|
||||
* @method ChildBrandImageQuery rightJoinBrandImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BrandImageI18n relation
|
||||
* @method ChildBrandImageQuery innerJoinBrandImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the BrandImageI18n relation
|
||||
*
|
||||
* @method ChildBrandImage findOne(ConnectionInterface $con = null) Return the first ChildBrandImage matching the query
|
||||
* @method ChildBrandImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildBrandImage matching the query, or a new ChildBrandImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildBrandImage findOneById(int $id) Return the first ChildBrandImage filtered by the id column
|
||||
* @method ChildBrandImage findOneByBrandId(int $brand_id) Return the first ChildBrandImage filtered by the brand_id column
|
||||
* @method ChildBrandImage findOneByFile(string $file) Return the first ChildBrandImage filtered by the file column
|
||||
* @method ChildBrandImage findOneByPosition(int $position) Return the first ChildBrandImage filtered by the position column
|
||||
* @method ChildBrandImage findOneByCreatedAt(string $created_at) Return the first ChildBrandImage filtered by the created_at column
|
||||
* @method ChildBrandImage findOneByUpdatedAt(string $updated_at) Return the first ChildBrandImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildBrandImage objects filtered by the id column
|
||||
* @method array findByBrandId(int $brand_id) Return ChildBrandImage objects filtered by the brand_id column
|
||||
* @method array findByFile(string $file) Return ChildBrandImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildBrandImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildBrandImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildBrandImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class BrandImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\BrandImageQuery 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\\BrandImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildBrandImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildBrandImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\BrandImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\BrandImageQuery();
|
||||
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 ChildBrandImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = BrandImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(BrandImageTableMap::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 ChildBrandImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT `ID`, `BRAND_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `brand_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 ChildBrandImage();
|
||||
$obj->hydrate($row);
|
||||
BrandImageTableMap::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 ChildBrandImage|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 ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(BrandImageTableMap::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 ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(BrandImageTableMap::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 ChildBrandImageQuery 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(BrandImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(BrandImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandImageTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the brand_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByBrandId(1234); // WHERE brand_id = 1234
|
||||
* $query->filterByBrandId(array(12, 34)); // WHERE brand_id IN (12, 34)
|
||||
* $query->filterByBrandId(array('min' => 12)); // WHERE brand_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByBrandRelatedByBrandId()
|
||||
*
|
||||
* @param mixed $brandId 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 ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandId($brandId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($brandId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($brandId['min'])) {
|
||||
$this->addUsingAlias(BrandImageTableMap::BRAND_ID, $brandId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($brandId['max'])) {
|
||||
$this->addUsingAlias(BrandImageTableMap::BRAND_ID, $brandId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandImageTableMap::BRAND_ID, $brandId, $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 ChildBrandImageQuery 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(BrandImageTableMap::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 ChildBrandImageQuery 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(BrandImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(BrandImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandImageTableMap::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 ChildBrandImageQuery 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(BrandImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(BrandImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandImageTableMap::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 ChildBrandImageQuery 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(BrandImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(BrandImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(BrandImageTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Brand object
|
||||
*
|
||||
* @param \Thelia\Model\Brand|ObjectCollection $brand The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandRelatedByBrandId($brand, $comparison = null)
|
||||
{
|
||||
if ($brand instanceof \Thelia\Model\Brand) {
|
||||
return $this
|
||||
->addUsingAlias(BrandImageTableMap::BRAND_ID, $brand->getId(), $comparison);
|
||||
} elseif ($brand instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(BrandImageTableMap::BRAND_ID, $brand->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByBrandRelatedByBrandId() only accepts arguments of type \Thelia\Model\Brand or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the BrandRelatedByBrandId relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinBrandRelatedByBrandId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('BrandRelatedByBrandId');
|
||||
|
||||
// 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, 'BrandRelatedByBrandId');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the BrandRelatedByBrandId relation Brand 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\BrandQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useBrandRelatedByBrandIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinBrandRelatedByBrandId($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'BrandRelatedByBrandId', '\Thelia\Model\BrandQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Brand object
|
||||
*
|
||||
* @param \Thelia\Model\Brand|ObjectCollection $brand the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandRelatedByLogoImageId($brand, $comparison = null)
|
||||
{
|
||||
if ($brand instanceof \Thelia\Model\Brand) {
|
||||
return $this
|
||||
->addUsingAlias(BrandImageTableMap::ID, $brand->getLogoImageId(), $comparison);
|
||||
} elseif ($brand instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useBrandRelatedByLogoImageIdQuery()
|
||||
->filterByPrimaryKeys($brand->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByBrandRelatedByLogoImageId() only accepts arguments of type \Thelia\Model\Brand or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the BrandRelatedByLogoImageId relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinBrandRelatedByLogoImageId($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('BrandRelatedByLogoImageId');
|
||||
|
||||
// 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, 'BrandRelatedByLogoImageId');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the BrandRelatedByLogoImageId relation Brand 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\BrandQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useBrandRelatedByLogoImageIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinBrandRelatedByLogoImageId($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'BrandRelatedByLogoImageId', '\Thelia\Model\BrandQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\BrandImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\BrandImageI18n|ObjectCollection $brandImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandImageI18n($brandImageI18n, $comparison = null)
|
||||
{
|
||||
if ($brandImageI18n instanceof \Thelia\Model\BrandImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(BrandImageTableMap::ID, $brandImageI18n->getId(), $comparison);
|
||||
} elseif ($brandImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useBrandImageI18nQuery()
|
||||
->filterByPrimaryKeys($brandImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByBrandImageI18n() only accepts arguments of type \Thelia\Model\BrandImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the BrandImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinBrandImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('BrandImageI18n');
|
||||
|
||||
// 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, 'BrandImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the BrandImageI18n relation BrandImageI18n 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\BrandImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useBrandImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinBrandImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'BrandImageI18n', '\Thelia\Model\BrandImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildBrandImage $brandImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($brandImage = null)
|
||||
{
|
||||
if ($brandImage) {
|
||||
$this->addUsingAlias(BrandImageTableMap::ID, $brandImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the brand_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(BrandImageTableMap::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).
|
||||
BrandImageTableMap::clearInstancePool();
|
||||
BrandImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildBrandImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildBrandImage 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(BrandImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(BrandImageTableMap::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();
|
||||
|
||||
|
||||
BrandImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
BrandImageTableMap::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 ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(BrandImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(BrandImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(BrandImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(BrandImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(BrandImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(BrandImageTableMap::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 ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'BrandImageI18n';
|
||||
|
||||
return $this
|
||||
->joinBrandImageI18n($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 ChildBrandImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('BrandImageI18n');
|
||||
$this->with['BrandImageI18n']->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 ChildBrandImageI18nQuery 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 : 'BrandImageI18n', '\Thelia\Model\BrandImageI18nQuery');
|
||||
}
|
||||
|
||||
} // BrandImageQuery
|
||||
1089
core/lib/Thelia/Model/Base/BrandQuery.php
Normal file
1089
core/lib/Thelia/Model/Base/BrandQuery.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -169,6 +169,18 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
*/
|
||||
protected $version;
|
||||
|
||||
/**
|
||||
* The value for the version_created_at field.
|
||||
* @var string
|
||||
*/
|
||||
protected $version_created_at;
|
||||
|
||||
/**
|
||||
* The value for the version_created_by field.
|
||||
* @var string
|
||||
*/
|
||||
protected $version_created_by;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildCouponCountry[] Collection to store aggregation of ChildCouponCountry objects.
|
||||
*/
|
||||
@@ -766,6 +778,37 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [version_created_at] column value.
|
||||
*
|
||||
*
|
||||
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||
* If format is NULL, then the raw \DateTime object will be returned.
|
||||
*
|
||||
* @return mixed Formatted date/time value as string or \DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
|
||||
*
|
||||
* @throws PropelException - if unable to parse/validate the date/time value.
|
||||
*/
|
||||
public function getVersionCreatedAt($format = NULL)
|
||||
{
|
||||
if ($format === null) {
|
||||
return $this->version_created_at;
|
||||
} else {
|
||||
return $this->version_created_at instanceof \DateTime ? $this->version_created_at->format($format) : null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [version_created_by] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVersionCreatedBy()
|
||||
{
|
||||
|
||||
return $this->version_created_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
@@ -1150,6 +1193,48 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setVersion()
|
||||
|
||||
/**
|
||||
* Sets the value of [version_created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
* @param mixed $v string, integer (timestamp), or \DateTime value.
|
||||
* Empty strings are treated as NULL.
|
||||
* @return \Thelia\Model\Coupon The current object (for fluent API support)
|
||||
*/
|
||||
public function setVersionCreatedAt($v)
|
||||
{
|
||||
$dt = PropelDateTime::newInstance($v, null, '\DateTime');
|
||||
if ($this->version_created_at !== null || $dt !== null) {
|
||||
if ($dt !== $this->version_created_at) {
|
||||
$this->version_created_at = $dt;
|
||||
$this->modifiedColumns[CouponTableMap::VERSION_CREATED_AT] = true;
|
||||
}
|
||||
} // if either are not null
|
||||
|
||||
|
||||
return $this;
|
||||
} // setVersionCreatedAt()
|
||||
|
||||
/**
|
||||
* Set the value of [version_created_by] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\Coupon The current object (for fluent API support)
|
||||
*/
|
||||
public function setVersionCreatedBy($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->version_created_by !== $v) {
|
||||
$this->version_created_by = $v;
|
||||
$this->modifiedColumns[CouponTableMap::VERSION_CREATED_BY] = true;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setVersionCreatedBy()
|
||||
|
||||
/**
|
||||
* Indicates whether the columns in this object are only set to default values.
|
||||
*
|
||||
@@ -1247,6 +1332,15 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : CouponTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : CouponTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->version_created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : CouponTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version_created_by = (null !== $col) ? (string) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
@@ -1255,7 +1349,7 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 16; // 16 = CouponTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 18; // 18 = CouponTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\Coupon object", 0, $e);
|
||||
@@ -1400,6 +1494,9 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
// versionable behavior
|
||||
if ($this->isVersioningNecessary()) {
|
||||
$this->setVersion($this->isNew() ? 1 : $this->getLastVersionNumber($con) + 1);
|
||||
if (!$this->isColumnModified(CouponTableMap::VERSION_CREATED_AT)) {
|
||||
$this->setVersionCreatedAt(time());
|
||||
}
|
||||
$createVersion = true; // for postSave hook
|
||||
}
|
||||
if ($isInsert) {
|
||||
@@ -1711,6 +1808,12 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponTableMap::VERSION)) {
|
||||
$modifiedColumns[':p' . $index++] = '`VERSION`';
|
||||
}
|
||||
if ($this->isColumnModified(CouponTableMap::VERSION_CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`';
|
||||
}
|
||||
if ($this->isColumnModified(CouponTableMap::VERSION_CREATED_BY)) {
|
||||
$modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`';
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'INSERT INTO `coupon` (%s) VALUES (%s)',
|
||||
@@ -1770,6 +1873,12 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
case '`VERSION`':
|
||||
$stmt->bindValue($identifier, $this->version, PDO::PARAM_INT);
|
||||
break;
|
||||
case '`VERSION_CREATED_AT`':
|
||||
$stmt->bindValue($identifier, $this->version_created_at ? $this->version_created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
case '`VERSION_CREATED_BY`':
|
||||
$stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$stmt->execute();
|
||||
@@ -1880,6 +1989,12 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
case 15:
|
||||
return $this->getVersion();
|
||||
break;
|
||||
case 16:
|
||||
return $this->getVersionCreatedAt();
|
||||
break;
|
||||
case 17:
|
||||
return $this->getVersionCreatedBy();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -1925,6 +2040,8 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$keys[13] => $this->getCreatedAt(),
|
||||
$keys[14] => $this->getUpdatedAt(),
|
||||
$keys[15] => $this->getVersion(),
|
||||
$keys[16] => $this->getVersionCreatedAt(),
|
||||
$keys[17] => $this->getVersionCreatedBy(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach ($virtualColumns as $key => $virtualColumn) {
|
||||
@@ -2029,6 +2146,12 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
case 15:
|
||||
$this->setVersion($value);
|
||||
break;
|
||||
case 16:
|
||||
$this->setVersionCreatedAt($value);
|
||||
break;
|
||||
case 17:
|
||||
$this->setVersionCreatedBy($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -2069,6 +2192,8 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[13], $arr)) $this->setCreatedAt($arr[$keys[13]]);
|
||||
if (array_key_exists($keys[14], $arr)) $this->setUpdatedAt($arr[$keys[14]]);
|
||||
if (array_key_exists($keys[15], $arr)) $this->setVersion($arr[$keys[15]]);
|
||||
if (array_key_exists($keys[16], $arr)) $this->setVersionCreatedAt($arr[$keys[16]]);
|
||||
if (array_key_exists($keys[17], $arr)) $this->setVersionCreatedBy($arr[$keys[17]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2096,6 +2221,8 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponTableMap::CREATED_AT)) $criteria->add(CouponTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(CouponTableMap::UPDATED_AT)) $criteria->add(CouponTableMap::UPDATED_AT, $this->updated_at);
|
||||
if ($this->isColumnModified(CouponTableMap::VERSION)) $criteria->add(CouponTableMap::VERSION, $this->version);
|
||||
if ($this->isColumnModified(CouponTableMap::VERSION_CREATED_AT)) $criteria->add(CouponTableMap::VERSION_CREATED_AT, $this->version_created_at);
|
||||
if ($this->isColumnModified(CouponTableMap::VERSION_CREATED_BY)) $criteria->add(CouponTableMap::VERSION_CREATED_BY, $this->version_created_by);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -2174,6 +2301,8 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
$copyObj->setVersion($this->getVersion());
|
||||
$copyObj->setVersionCreatedAt($this->getVersionCreatedAt());
|
||||
$copyObj->setVersionCreatedBy($this->getVersionCreatedBy());
|
||||
|
||||
if ($deepCopy) {
|
||||
// important: temporarily setNew(false) because this affects the behavior of
|
||||
@@ -4019,6 +4148,8 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->version = null;
|
||||
$this->version_created_at = null;
|
||||
$this->version_created_by = null;
|
||||
$this->alreadyInSave = false;
|
||||
$this->clearAllReferences();
|
||||
$this->applyDefaultValues();
|
||||
@@ -4354,6 +4485,8 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$version->setCreatedAt($this->getCreatedAt());
|
||||
$version->setUpdatedAt($this->getUpdatedAt());
|
||||
$version->setVersion($this->getVersion());
|
||||
$version->setVersionCreatedAt($this->getVersionCreatedAt());
|
||||
$version->setVersionCreatedBy($this->getVersionCreatedBy());
|
||||
$version->setCoupon($this);
|
||||
$version->save($con);
|
||||
|
||||
@@ -4407,6 +4540,8 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$this->setCreatedAt($version->getCreatedAt());
|
||||
$this->setUpdatedAt($version->getUpdatedAt());
|
||||
$this->setVersion($version->getVersion());
|
||||
$this->setVersionCreatedAt($version->getVersionCreatedAt());
|
||||
$this->setVersionCreatedBy($version->getVersionCreatedBy());
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -4548,6 +4683,8 @@ abstract class Coupon implements ActiveRecordInterface
|
||||
$toVersionNumber = $toVersion['Version'];
|
||||
$ignoredColumns = array_merge(array(
|
||||
'Version',
|
||||
'VersionCreatedAt',
|
||||
'VersionCreatedBy',
|
||||
), $ignoredColumns);
|
||||
$diff = array();
|
||||
foreach ($fromVersion as $key => $value) {
|
||||
|
||||
@@ -38,6 +38,8 @@ use Thelia\Model\Map\CouponTableMap;
|
||||
* @method ChildCouponQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCouponQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @method ChildCouponQuery orderByVersion($order = Criteria::ASC) Order by the version column
|
||||
* @method ChildCouponQuery orderByVersionCreatedAt($order = Criteria::ASC) Order by the version_created_at column
|
||||
* @method ChildCouponQuery orderByVersionCreatedBy($order = Criteria::ASC) Order by the version_created_by column
|
||||
*
|
||||
* @method ChildCouponQuery groupById() Group by the id column
|
||||
* @method ChildCouponQuery groupByCode() Group by the code column
|
||||
@@ -55,6 +57,8 @@ use Thelia\Model\Map\CouponTableMap;
|
||||
* @method ChildCouponQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCouponQuery groupByUpdatedAt() Group by the updated_at column
|
||||
* @method ChildCouponQuery groupByVersion() Group by the version column
|
||||
* @method ChildCouponQuery groupByVersionCreatedAt() Group by the version_created_at column
|
||||
* @method ChildCouponQuery groupByVersionCreatedBy() Group by the version_created_by column
|
||||
*
|
||||
* @method ChildCouponQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCouponQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
@@ -99,6 +103,8 @@ use Thelia\Model\Map\CouponTableMap;
|
||||
* @method ChildCoupon findOneByCreatedAt(string $created_at) Return the first ChildCoupon filtered by the created_at column
|
||||
* @method ChildCoupon findOneByUpdatedAt(string $updated_at) Return the first ChildCoupon filtered by the updated_at column
|
||||
* @method ChildCoupon findOneByVersion(int $version) Return the first ChildCoupon filtered by the version column
|
||||
* @method ChildCoupon findOneByVersionCreatedAt(string $version_created_at) Return the first ChildCoupon filtered by the version_created_at column
|
||||
* @method ChildCoupon findOneByVersionCreatedBy(string $version_created_by) Return the first ChildCoupon filtered by the version_created_by column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCoupon objects filtered by the id column
|
||||
* @method array findByCode(string $code) Return ChildCoupon objects filtered by the code column
|
||||
@@ -116,6 +122,8 @@ use Thelia\Model\Map\CouponTableMap;
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCoupon objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCoupon objects filtered by the updated_at column
|
||||
* @method array findByVersion(int $version) Return ChildCoupon objects filtered by the version column
|
||||
* @method array findByVersionCreatedAt(string $version_created_at) Return ChildCoupon objects filtered by the version_created_at column
|
||||
* @method array findByVersionCreatedBy(string $version_created_by) Return ChildCoupon objects filtered by the version_created_by column
|
||||
*
|
||||
*/
|
||||
abstract class CouponQuery extends ModelCriteria
|
||||
@@ -211,7 +219,7 @@ abstract class CouponQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT `ID`, `CODE`, `TYPE`, `SERIALIZED_EFFECTS`, `IS_ENABLED`, `EXPIRATION_DATE`, `MAX_USAGE`, `IS_CUMULATIVE`, `IS_REMOVING_POSTAGE`, `IS_AVAILABLE_ON_SPECIAL_OFFERS`, `IS_USED`, `SERIALIZED_CONDITIONS`, `PER_CUSTOMER_USAGE_COUNT`, `CREATED_AT`, `UPDATED_AT`, `VERSION` FROM `coupon` WHERE `ID` = :p0';
|
||||
$sql = 'SELECT `ID`, `CODE`, `TYPE`, `SERIALIZED_EFFECTS`, `IS_ENABLED`, `EXPIRATION_DATE`, `MAX_USAGE`, `IS_CUMULATIVE`, `IS_REMOVING_POSTAGE`, `IS_AVAILABLE_ON_SPECIAL_OFFERS`, `IS_USED`, `SERIALIZED_CONDITIONS`, `PER_CUSTOMER_USAGE_COUNT`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `coupon` WHERE `ID` = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -830,6 +838,78 @@ abstract class CouponQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CouponTableMap::VERSION, $version, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the version_created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14'
|
||||
* $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14'
|
||||
* $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $versionCreatedAt 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 ChildCouponQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($versionCreatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($versionCreatedAt['min'])) {
|
||||
$this->addUsingAlias(CouponTableMap::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($versionCreatedAt['max'])) {
|
||||
$this->addUsingAlias(CouponTableMap::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CouponTableMap::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the version_created_by column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByVersionCreatedBy('fooValue'); // WHERE version_created_by = 'fooValue'
|
||||
* $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $versionCreatedBy The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCouponQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($versionCreatedBy)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $versionCreatedBy)) {
|
||||
$versionCreatedBy = str_replace('*', '%', $versionCreatedBy);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CouponTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CouponCountry object
|
||||
*
|
||||
|
||||
@@ -152,6 +152,18 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
*/
|
||||
protected $version;
|
||||
|
||||
/**
|
||||
* The value for the version_created_at field.
|
||||
* @var string
|
||||
*/
|
||||
protected $version_created_at;
|
||||
|
||||
/**
|
||||
* The value for the version_created_by field.
|
||||
* @var string
|
||||
*/
|
||||
protected $version_created_by;
|
||||
|
||||
/**
|
||||
* @var Coupon
|
||||
*/
|
||||
@@ -639,6 +651,37 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [version_created_at] column value.
|
||||
*
|
||||
*
|
||||
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||
* If format is NULL, then the raw \DateTime object will be returned.
|
||||
*
|
||||
* @return mixed Formatted date/time value as string or \DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
|
||||
*
|
||||
* @throws PropelException - if unable to parse/validate the date/time value.
|
||||
*/
|
||||
public function getVersionCreatedAt($format = NULL)
|
||||
{
|
||||
if ($format === null) {
|
||||
return $this->version_created_at;
|
||||
} else {
|
||||
return $this->version_created_at instanceof \DateTime ? $this->version_created_at->format($format) : null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [version_created_by] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVersionCreatedBy()
|
||||
{
|
||||
|
||||
return $this->version_created_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
@@ -1027,6 +1070,48 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setVersion()
|
||||
|
||||
/**
|
||||
* Sets the value of [version_created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
* @param mixed $v string, integer (timestamp), or \DateTime value.
|
||||
* Empty strings are treated as NULL.
|
||||
* @return \Thelia\Model\CouponVersion The current object (for fluent API support)
|
||||
*/
|
||||
public function setVersionCreatedAt($v)
|
||||
{
|
||||
$dt = PropelDateTime::newInstance($v, null, '\DateTime');
|
||||
if ($this->version_created_at !== null || $dt !== null) {
|
||||
if ($dt !== $this->version_created_at) {
|
||||
$this->version_created_at = $dt;
|
||||
$this->modifiedColumns[CouponVersionTableMap::VERSION_CREATED_AT] = true;
|
||||
}
|
||||
} // if either are not null
|
||||
|
||||
|
||||
return $this;
|
||||
} // setVersionCreatedAt()
|
||||
|
||||
/**
|
||||
* Set the value of [version_created_by] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\CouponVersion The current object (for fluent API support)
|
||||
*/
|
||||
public function setVersionCreatedBy($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->version_created_by !== $v) {
|
||||
$this->version_created_by = $v;
|
||||
$this->modifiedColumns[CouponVersionTableMap::VERSION_CREATED_BY] = true;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setVersionCreatedBy()
|
||||
|
||||
/**
|
||||
* Indicates whether the columns in this object are only set to default values.
|
||||
*
|
||||
@@ -1124,6 +1209,15 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : CouponVersionTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : CouponVersionTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->version_created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : CouponVersionTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version_created_by = (null !== $col) ? (string) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
@@ -1132,7 +1226,7 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 16; // 16 = CouponVersionTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 18; // 18 = CouponVersionTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\CouponVersion object", 0, $e);
|
||||
@@ -1401,6 +1495,12 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponVersionTableMap::VERSION)) {
|
||||
$modifiedColumns[':p' . $index++] = '`VERSION`';
|
||||
}
|
||||
if ($this->isColumnModified(CouponVersionTableMap::VERSION_CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`';
|
||||
}
|
||||
if ($this->isColumnModified(CouponVersionTableMap::VERSION_CREATED_BY)) {
|
||||
$modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`';
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'INSERT INTO `coupon_version` (%s) VALUES (%s)',
|
||||
@@ -1460,6 +1560,12 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
case '`VERSION`':
|
||||
$stmt->bindValue($identifier, $this->version, PDO::PARAM_INT);
|
||||
break;
|
||||
case '`VERSION_CREATED_AT`':
|
||||
$stmt->bindValue($identifier, $this->version_created_at ? $this->version_created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
case '`VERSION_CREATED_BY`':
|
||||
$stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$stmt->execute();
|
||||
@@ -1563,6 +1669,12 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
case 15:
|
||||
return $this->getVersion();
|
||||
break;
|
||||
case 16:
|
||||
return $this->getVersionCreatedAt();
|
||||
break;
|
||||
case 17:
|
||||
return $this->getVersionCreatedBy();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -1608,6 +1720,8 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$keys[13] => $this->getCreatedAt(),
|
||||
$keys[14] => $this->getUpdatedAt(),
|
||||
$keys[15] => $this->getVersion(),
|
||||
$keys[16] => $this->getVersionCreatedAt(),
|
||||
$keys[17] => $this->getVersionCreatedBy(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach ($virtualColumns as $key => $virtualColumn) {
|
||||
@@ -1700,6 +1814,12 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
case 15:
|
||||
$this->setVersion($value);
|
||||
break;
|
||||
case 16:
|
||||
$this->setVersionCreatedAt($value);
|
||||
break;
|
||||
case 17:
|
||||
$this->setVersionCreatedBy($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -1740,6 +1860,8 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[13], $arr)) $this->setCreatedAt($arr[$keys[13]]);
|
||||
if (array_key_exists($keys[14], $arr)) $this->setUpdatedAt($arr[$keys[14]]);
|
||||
if (array_key_exists($keys[15], $arr)) $this->setVersion($arr[$keys[15]]);
|
||||
if (array_key_exists($keys[16], $arr)) $this->setVersionCreatedAt($arr[$keys[16]]);
|
||||
if (array_key_exists($keys[17], $arr)) $this->setVersionCreatedBy($arr[$keys[17]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1767,6 +1889,8 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CouponVersionTableMap::CREATED_AT)) $criteria->add(CouponVersionTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::UPDATED_AT)) $criteria->add(CouponVersionTableMap::UPDATED_AT, $this->updated_at);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::VERSION)) $criteria->add(CouponVersionTableMap::VERSION, $this->version);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::VERSION_CREATED_AT)) $criteria->add(CouponVersionTableMap::VERSION_CREATED_AT, $this->version_created_at);
|
||||
if ($this->isColumnModified(CouponVersionTableMap::VERSION_CREATED_BY)) $criteria->add(CouponVersionTableMap::VERSION_CREATED_BY, $this->version_created_by);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1853,6 +1977,8 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
$copyObj->setVersion($this->getVersion());
|
||||
$copyObj->setVersionCreatedAt($this->getVersionCreatedAt());
|
||||
$copyObj->setVersionCreatedBy($this->getVersionCreatedBy());
|
||||
if ($makeNew) {
|
||||
$copyObj->setNew(true);
|
||||
}
|
||||
@@ -1952,6 +2078,8 @@ abstract class CouponVersion implements ActiveRecordInterface
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->version = null;
|
||||
$this->version_created_at = null;
|
||||
$this->version_created_by = null;
|
||||
$this->alreadyInSave = false;
|
||||
$this->clearAllReferences();
|
||||
$this->applyDefaultValues();
|
||||
|
||||
@@ -37,6 +37,8 @@ use Thelia\Model\Map\CouponVersionTableMap;
|
||||
* @method ChildCouponVersionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCouponVersionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @method ChildCouponVersionQuery orderByVersion($order = Criteria::ASC) Order by the version column
|
||||
* @method ChildCouponVersionQuery orderByVersionCreatedAt($order = Criteria::ASC) Order by the version_created_at column
|
||||
* @method ChildCouponVersionQuery orderByVersionCreatedBy($order = Criteria::ASC) Order by the version_created_by column
|
||||
*
|
||||
* @method ChildCouponVersionQuery groupById() Group by the id column
|
||||
* @method ChildCouponVersionQuery groupByCode() Group by the code column
|
||||
@@ -54,6 +56,8 @@ use Thelia\Model\Map\CouponVersionTableMap;
|
||||
* @method ChildCouponVersionQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCouponVersionQuery groupByUpdatedAt() Group by the updated_at column
|
||||
* @method ChildCouponVersionQuery groupByVersion() Group by the version column
|
||||
* @method ChildCouponVersionQuery groupByVersionCreatedAt() Group by the version_created_at column
|
||||
* @method ChildCouponVersionQuery groupByVersionCreatedBy() Group by the version_created_by column
|
||||
*
|
||||
* @method ChildCouponVersionQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCouponVersionQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
@@ -82,6 +86,8 @@ use Thelia\Model\Map\CouponVersionTableMap;
|
||||
* @method ChildCouponVersion findOneByCreatedAt(string $created_at) Return the first ChildCouponVersion filtered by the created_at column
|
||||
* @method ChildCouponVersion findOneByUpdatedAt(string $updated_at) Return the first ChildCouponVersion filtered by the updated_at column
|
||||
* @method ChildCouponVersion findOneByVersion(int $version) Return the first ChildCouponVersion filtered by the version column
|
||||
* @method ChildCouponVersion findOneByVersionCreatedAt(string $version_created_at) Return the first ChildCouponVersion filtered by the version_created_at column
|
||||
* @method ChildCouponVersion findOneByVersionCreatedBy(string $version_created_by) Return the first ChildCouponVersion filtered by the version_created_by column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCouponVersion objects filtered by the id column
|
||||
* @method array findByCode(string $code) Return ChildCouponVersion objects filtered by the code column
|
||||
@@ -99,6 +105,8 @@ use Thelia\Model\Map\CouponVersionTableMap;
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCouponVersion objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCouponVersion objects filtered by the updated_at column
|
||||
* @method array findByVersion(int $version) Return ChildCouponVersion objects filtered by the version column
|
||||
* @method array findByVersionCreatedAt(string $version_created_at) Return ChildCouponVersion objects filtered by the version_created_at column
|
||||
* @method array findByVersionCreatedBy(string $version_created_by) Return ChildCouponVersion objects filtered by the version_created_by column
|
||||
*
|
||||
*/
|
||||
abstract class CouponVersionQuery extends ModelCriteria
|
||||
@@ -187,7 +195,7 @@ abstract class CouponVersionQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT `ID`, `CODE`, `TYPE`, `SERIALIZED_EFFECTS`, `IS_ENABLED`, `EXPIRATION_DATE`, `MAX_USAGE`, `IS_CUMULATIVE`, `IS_REMOVING_POSTAGE`, `IS_AVAILABLE_ON_SPECIAL_OFFERS`, `IS_USED`, `SERIALIZED_CONDITIONS`, `PER_CUSTOMER_USAGE_COUNT`, `CREATED_AT`, `UPDATED_AT`, `VERSION` FROM `coupon_version` WHERE `ID` = :p0 AND `VERSION` = :p1';
|
||||
$sql = 'SELECT `ID`, `CODE`, `TYPE`, `SERIALIZED_EFFECTS`, `IS_ENABLED`, `EXPIRATION_DATE`, `MAX_USAGE`, `IS_CUMULATIVE`, `IS_REMOVING_POSTAGE`, `IS_AVAILABLE_ON_SPECIAL_OFFERS`, `IS_USED`, `SERIALIZED_CONDITIONS`, `PER_CUSTOMER_USAGE_COUNT`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `coupon_version` WHERE `ID` = :p0 AND `VERSION` = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
@@ -820,6 +828,78 @@ abstract class CouponVersionQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CouponVersionTableMap::VERSION, $version, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the version_created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14'
|
||||
* $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14'
|
||||
* $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $versionCreatedAt 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 ChildCouponVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($versionCreatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($versionCreatedAt['min'])) {
|
||||
$this->addUsingAlias(CouponVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($versionCreatedAt['max'])) {
|
||||
$this->addUsingAlias(CouponVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CouponVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the version_created_by column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByVersionCreatedBy('fooValue'); // WHERE version_created_by = 'fooValue'
|
||||
* $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $versionCreatedBy 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 ChildCouponVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($versionCreatedBy)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $versionCreatedBy)) {
|
||||
$versionCreatedBy = str_replace('*', '%', $versionCreatedBy);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CouponVersionTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Coupon object
|
||||
*
|
||||
|
||||
@@ -19,6 +19,8 @@ use Propel\Runtime\Parser\AbstractParser;
|
||||
use Propel\Runtime\Util\PropelDateTime;
|
||||
use Thelia\Model\Accessory as ChildAccessory;
|
||||
use Thelia\Model\AccessoryQuery as ChildAccessoryQuery;
|
||||
use Thelia\Model\Brand as ChildBrand;
|
||||
use Thelia\Model\BrandQuery as ChildBrandQuery;
|
||||
use Thelia\Model\CartItem as ChildCartItem;
|
||||
use Thelia\Model\CartItemQuery as ChildCartItemQuery;
|
||||
use Thelia\Model\Category as ChildCategory;
|
||||
@@ -120,6 +122,12 @@ abstract class Product implements ActiveRecordInterface
|
||||
*/
|
||||
protected $template_id;
|
||||
|
||||
/**
|
||||
* The value for the brand_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $brand_id;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -161,6 +169,11 @@ abstract class Product implements ActiveRecordInterface
|
||||
*/
|
||||
protected $aTemplate;
|
||||
|
||||
/**
|
||||
* @var Brand
|
||||
*/
|
||||
protected $aBrand;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildProductCategory[] Collection to store aggregation of ChildProductCategory objects.
|
||||
*/
|
||||
@@ -695,6 +708,17 @@ abstract class Product implements ActiveRecordInterface
|
||||
return $this->template_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [brand_id] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBrandId()
|
||||
{
|
||||
|
||||
return $this->brand_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -911,6 +935,31 @@ abstract class Product implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setTemplateId()
|
||||
|
||||
/**
|
||||
* Set the value of [brand_id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\Product The current object (for fluent API support)
|
||||
*/
|
||||
public function setBrandId($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->brand_id !== $v) {
|
||||
$this->brand_id = $v;
|
||||
$this->modifiedColumns[ProductTableMap::BRAND_ID] = true;
|
||||
}
|
||||
|
||||
if ($this->aBrand !== null && $this->aBrand->getId() !== $v) {
|
||||
$this->aBrand = null;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setBrandId()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -1083,28 +1132,31 @@ abstract class Product implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductTableMap::translateFieldName('TemplateId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->template_id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductTableMap::translateFieldName('BrandId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->brand_id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductTableMap::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 : ProductTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->updated_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : ProductTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->version_created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : ProductTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : ProductTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version_created_by = (null !== $col) ? (string) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
@@ -1114,7 +1166,7 @@ abstract class Product implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 11; // 11 = ProductTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 12; // 12 = ProductTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\Product object", 0, $e);
|
||||
@@ -1142,6 +1194,9 @@ abstract class Product implements ActiveRecordInterface
|
||||
if ($this->aTemplate !== null && $this->template_id !== $this->aTemplate->getId()) {
|
||||
$this->aTemplate = null;
|
||||
}
|
||||
if ($this->aBrand !== null && $this->brand_id !== $this->aBrand->getId()) {
|
||||
$this->aBrand = null;
|
||||
}
|
||||
} // ensureConsistency
|
||||
|
||||
/**
|
||||
@@ -1183,6 +1238,7 @@ abstract class Product implements ActiveRecordInterface
|
||||
|
||||
$this->aTaxRule = null;
|
||||
$this->aTemplate = null;
|
||||
$this->aBrand = null;
|
||||
$this->collProductCategories = null;
|
||||
|
||||
$this->collFeatureProducts = null;
|
||||
@@ -1361,6 +1417,13 @@ abstract class Product implements ActiveRecordInterface
|
||||
$this->setTemplate($this->aTemplate);
|
||||
}
|
||||
|
||||
if ($this->aBrand !== null) {
|
||||
if ($this->aBrand->isModified() || $this->aBrand->isNew()) {
|
||||
$affectedRows += $this->aBrand->save($con);
|
||||
}
|
||||
$this->setBrand($this->aBrand);
|
||||
}
|
||||
|
||||
if ($this->isNew() || $this->isModified()) {
|
||||
// persist changes
|
||||
if ($this->isNew()) {
|
||||
@@ -1684,6 +1747,9 @@ abstract class Product implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(ProductTableMap::TEMPLATE_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = '`TEMPLATE_ID`';
|
||||
}
|
||||
if ($this->isColumnModified(ProductTableMap::BRAND_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = '`BRAND_ID`';
|
||||
}
|
||||
if ($this->isColumnModified(ProductTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = '`CREATED_AT`';
|
||||
}
|
||||
@@ -1728,6 +1794,9 @@ abstract class Product implements ActiveRecordInterface
|
||||
case '`TEMPLATE_ID`':
|
||||
$stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT);
|
||||
break;
|
||||
case '`BRAND_ID`':
|
||||
$stmt->bindValue($identifier, $this->brand_id, PDO::PARAM_INT);
|
||||
break;
|
||||
case '`CREATED_AT`':
|
||||
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1824,18 +1893,21 @@ abstract class Product implements ActiveRecordInterface
|
||||
return $this->getTemplateId();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getCreatedAt();
|
||||
return $this->getBrandId();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getUpdatedAt();
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getVersion();
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getVersionCreatedAt();
|
||||
return $this->getVersion();
|
||||
break;
|
||||
case 10:
|
||||
return $this->getVersionCreatedAt();
|
||||
break;
|
||||
case 11:
|
||||
return $this->getVersionCreatedBy();
|
||||
break;
|
||||
default:
|
||||
@@ -1873,11 +1945,12 @@ abstract class Product implements ActiveRecordInterface
|
||||
$keys[3] => $this->getVisible(),
|
||||
$keys[4] => $this->getPosition(),
|
||||
$keys[5] => $this->getTemplateId(),
|
||||
$keys[6] => $this->getCreatedAt(),
|
||||
$keys[7] => $this->getUpdatedAt(),
|
||||
$keys[8] => $this->getVersion(),
|
||||
$keys[9] => $this->getVersionCreatedAt(),
|
||||
$keys[10] => $this->getVersionCreatedBy(),
|
||||
$keys[6] => $this->getBrandId(),
|
||||
$keys[7] => $this->getCreatedAt(),
|
||||
$keys[8] => $this->getUpdatedAt(),
|
||||
$keys[9] => $this->getVersion(),
|
||||
$keys[10] => $this->getVersionCreatedAt(),
|
||||
$keys[11] => $this->getVersionCreatedBy(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach ($virtualColumns as $key => $virtualColumn) {
|
||||
@@ -1891,6 +1964,9 @@ abstract class Product implements ActiveRecordInterface
|
||||
if (null !== $this->aTemplate) {
|
||||
$result['Template'] = $this->aTemplate->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
}
|
||||
if (null !== $this->aBrand) {
|
||||
$result['Brand'] = $this->aBrand->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
}
|
||||
if (null !== $this->collProductCategories) {
|
||||
$result['ProductCategories'] = $this->collProductCategories->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
@@ -1977,18 +2053,21 @@ abstract class Product implements ActiveRecordInterface
|
||||
$this->setTemplateId($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setCreatedAt($value);
|
||||
$this->setBrandId($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setUpdatedAt($value);
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setVersion($value);
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setVersionCreatedAt($value);
|
||||
$this->setVersion($value);
|
||||
break;
|
||||
case 10:
|
||||
$this->setVersionCreatedAt($value);
|
||||
break;
|
||||
case 11:
|
||||
$this->setVersionCreatedBy($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -2021,11 +2100,12 @@ abstract class Product implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[3], $arr)) $this->setVisible($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setPosition($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setTemplateId($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[8], $arr)) $this->setVersion($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setVersionCreatedAt($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setVersionCreatedBy($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setBrandId($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[9], $arr)) $this->setVersion($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setVersionCreatedAt($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setVersionCreatedBy($arr[$keys[11]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2043,6 +2123,7 @@ abstract class Product implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(ProductTableMap::VISIBLE)) $criteria->add(ProductTableMap::VISIBLE, $this->visible);
|
||||
if ($this->isColumnModified(ProductTableMap::POSITION)) $criteria->add(ProductTableMap::POSITION, $this->position);
|
||||
if ($this->isColumnModified(ProductTableMap::TEMPLATE_ID)) $criteria->add(ProductTableMap::TEMPLATE_ID, $this->template_id);
|
||||
if ($this->isColumnModified(ProductTableMap::BRAND_ID)) $criteria->add(ProductTableMap::BRAND_ID, $this->brand_id);
|
||||
if ($this->isColumnModified(ProductTableMap::CREATED_AT)) $criteria->add(ProductTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(ProductTableMap::UPDATED_AT)) $criteria->add(ProductTableMap::UPDATED_AT, $this->updated_at);
|
||||
if ($this->isColumnModified(ProductTableMap::VERSION)) $criteria->add(ProductTableMap::VERSION, $this->version);
|
||||
@@ -2116,6 +2197,7 @@ abstract class Product implements ActiveRecordInterface
|
||||
$copyObj->setVisible($this->getVisible());
|
||||
$copyObj->setPosition($this->getPosition());
|
||||
$copyObj->setTemplateId($this->getTemplateId());
|
||||
$copyObj->setBrandId($this->getBrandId());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
$copyObj->setVersion($this->getVersion());
|
||||
@@ -2325,6 +2407,57 @@ abstract class Product implements ActiveRecordInterface
|
||||
return $this->aTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a ChildBrand object.
|
||||
*
|
||||
* @param ChildBrand $v
|
||||
* @return \Thelia\Model\Product The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setBrand(ChildBrand $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setBrandId(NULL);
|
||||
} else {
|
||||
$this->setBrandId($v->getId());
|
||||
}
|
||||
|
||||
$this->aBrand = $v;
|
||||
|
||||
// Add binding for other direction of this n:n relationship.
|
||||
// If this object has already been added to the ChildBrand object, it will not be re-added.
|
||||
if ($v !== null) {
|
||||
$v->addProduct($this);
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the associated ChildBrand object
|
||||
*
|
||||
* @param ConnectionInterface $con Optional Connection object.
|
||||
* @return ChildBrand The associated ChildBrand object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getBrand(ConnectionInterface $con = null)
|
||||
{
|
||||
if ($this->aBrand === null && ($this->brand_id !== null)) {
|
||||
$this->aBrand = ChildBrandQuery::create()->findPk($this->brand_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->aBrand->addProducts($this);
|
||||
*/
|
||||
}
|
||||
|
||||
return $this->aBrand;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a collection based on the name of a relation.
|
||||
@@ -5492,6 +5625,7 @@ abstract class Product implements ActiveRecordInterface
|
||||
$this->visible = null;
|
||||
$this->position = null;
|
||||
$this->template_id = null;
|
||||
$this->brand_id = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->version = null;
|
||||
@@ -5609,6 +5743,7 @@ abstract class Product implements ActiveRecordInterface
|
||||
$this->collProductsRelatedByProductId = null;
|
||||
$this->aTaxRule = null;
|
||||
$this->aTemplate = null;
|
||||
$this->aBrand = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5956,6 +6091,7 @@ abstract class Product implements ActiveRecordInterface
|
||||
$version->setVisible($this->getVisible());
|
||||
$version->setPosition($this->getPosition());
|
||||
$version->setTemplateId($this->getTemplateId());
|
||||
$version->setBrandId($this->getBrandId());
|
||||
$version->setCreatedAt($this->getCreatedAt());
|
||||
$version->setUpdatedAt($this->getUpdatedAt());
|
||||
$version->setVersion($this->getVersion());
|
||||
@@ -6004,6 +6140,7 @@ abstract class Product implements ActiveRecordInterface
|
||||
$this->setVisible($version->getVisible());
|
||||
$this->setPosition($version->getPosition());
|
||||
$this->setTemplateId($version->getTemplateId());
|
||||
$this->setBrandId($version->getBrandId());
|
||||
$this->setCreatedAt($version->getCreatedAt());
|
||||
$this->setUpdatedAt($version->getUpdatedAt());
|
||||
$this->setVersion($version->getVersion());
|
||||
|
||||
@@ -28,6 +28,7 @@ use Thelia\Model\Map\ProductTableMap;
|
||||
* @method ChildProductQuery orderByVisible($order = Criteria::ASC) Order by the visible column
|
||||
* @method ChildProductQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildProductQuery orderByTemplateId($order = Criteria::ASC) Order by the template_id column
|
||||
* @method ChildProductQuery orderByBrandId($order = Criteria::ASC) Order by the brand_id column
|
||||
* @method ChildProductQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildProductQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @method ChildProductQuery orderByVersion($order = Criteria::ASC) Order by the version column
|
||||
@@ -40,6 +41,7 @@ use Thelia\Model\Map\ProductTableMap;
|
||||
* @method ChildProductQuery groupByVisible() Group by the visible column
|
||||
* @method ChildProductQuery groupByPosition() Group by the position column
|
||||
* @method ChildProductQuery groupByTemplateId() Group by the template_id column
|
||||
* @method ChildProductQuery groupByBrandId() Group by the brand_id column
|
||||
* @method ChildProductQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildProductQuery groupByUpdatedAt() Group by the updated_at column
|
||||
* @method ChildProductQuery groupByVersion() Group by the version column
|
||||
@@ -58,6 +60,10 @@ use Thelia\Model\Map\ProductTableMap;
|
||||
* @method ChildProductQuery rightJoinTemplate($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Template relation
|
||||
* @method ChildProductQuery innerJoinTemplate($relationAlias = null) Adds a INNER JOIN clause to the query using the Template relation
|
||||
*
|
||||
* @method ChildProductQuery leftJoinBrand($relationAlias = null) Adds a LEFT JOIN clause to the query using the Brand relation
|
||||
* @method ChildProductQuery rightJoinBrand($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Brand relation
|
||||
* @method ChildProductQuery innerJoinBrand($relationAlias = null) Adds a INNER JOIN clause to the query using the Brand relation
|
||||
*
|
||||
* @method ChildProductQuery leftJoinProductCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductCategory relation
|
||||
* @method ChildProductQuery rightJoinProductCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductCategory relation
|
||||
* @method ChildProductQuery innerJoinProductCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductCategory relation
|
||||
@@ -111,6 +117,7 @@ use Thelia\Model\Map\ProductTableMap;
|
||||
* @method ChildProduct findOneByVisible(int $visible) Return the first ChildProduct filtered by the visible column
|
||||
* @method ChildProduct findOneByPosition(int $position) Return the first ChildProduct filtered by the position column
|
||||
* @method ChildProduct findOneByTemplateId(int $template_id) Return the first ChildProduct filtered by the template_id column
|
||||
* @method ChildProduct findOneByBrandId(int $brand_id) Return the first ChildProduct filtered by the brand_id column
|
||||
* @method ChildProduct findOneByCreatedAt(string $created_at) Return the first ChildProduct filtered by the created_at column
|
||||
* @method ChildProduct findOneByUpdatedAt(string $updated_at) Return the first ChildProduct filtered by the updated_at column
|
||||
* @method ChildProduct findOneByVersion(int $version) Return the first ChildProduct filtered by the version column
|
||||
@@ -123,6 +130,7 @@ use Thelia\Model\Map\ProductTableMap;
|
||||
* @method array findByVisible(int $visible) Return ChildProduct objects filtered by the visible column
|
||||
* @method array findByPosition(int $position) Return ChildProduct objects filtered by the position column
|
||||
* @method array findByTemplateId(int $template_id) Return ChildProduct objects filtered by the template_id column
|
||||
* @method array findByBrandId(int $brand_id) Return ChildProduct objects filtered by the brand_id column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildProduct objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildProduct objects filtered by the updated_at column
|
||||
* @method array findByVersion(int $version) Return ChildProduct objects filtered by the version column
|
||||
@@ -223,7 +231,7 @@ abstract class ProductQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT `ID`, `TAX_RULE_ID`, `REF`, `VISIBLE`, `POSITION`, `TEMPLATE_ID`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `product` WHERE `ID` = :p0';
|
||||
$sql = 'SELECT `ID`, `TAX_RULE_ID`, `REF`, `VISIBLE`, `POSITION`, `TEMPLATE_ID`, `BRAND_ID`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `product` WHERE `ID` = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -550,6 +558,49 @@ abstract class ProductQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(ProductTableMap::TEMPLATE_ID, $templateId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the brand_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByBrandId(1234); // WHERE brand_id = 1234
|
||||
* $query->filterByBrandId(array(12, 34)); // WHERE brand_id IN (12, 34)
|
||||
* $query->filterByBrandId(array('min' => 12)); // WHERE brand_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByBrand()
|
||||
*
|
||||
* @param mixed $brandId 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 ChildProductQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandId($brandId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($brandId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($brandId['min'])) {
|
||||
$this->addUsingAlias(ProductTableMap::BRAND_ID, $brandId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($brandId['max'])) {
|
||||
$this->addUsingAlias(ProductTableMap::BRAND_ID, $brandId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductTableMap::BRAND_ID, $brandId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
@@ -899,6 +950,81 @@ abstract class ProductQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'Template', '\Thelia\Model\TemplateQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Brand object
|
||||
*
|
||||
* @param \Thelia\Model\Brand|ObjectCollection $brand The related object(s) 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 filterByBrand($brand, $comparison = null)
|
||||
{
|
||||
if ($brand instanceof \Thelia\Model\Brand) {
|
||||
return $this
|
||||
->addUsingAlias(ProductTableMap::BRAND_ID, $brand->getId(), $comparison);
|
||||
} elseif ($brand instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ProductTableMap::BRAND_ID, $brand->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByBrand() only accepts arguments of type \Thelia\Model\Brand or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Brand 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 joinBrand($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Brand');
|
||||
|
||||
// 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, 'Brand');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Brand relation Brand 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\BrandQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useBrandQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinBrand($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Brand', '\Thelia\Model\BrandQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ProductCategory object
|
||||
*
|
||||
|
||||
@@ -93,6 +93,12 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
*/
|
||||
protected $template_id;
|
||||
|
||||
/**
|
||||
* The value for the brand_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $brand_id;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -476,6 +482,17 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
return $this->template_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [brand_id] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBrandId()
|
||||
{
|
||||
|
||||
return $this->brand_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -688,6 +705,27 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setTemplateId()
|
||||
|
||||
/**
|
||||
* Set the value of [brand_id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\ProductVersion The current object (for fluent API support)
|
||||
*/
|
||||
public function setBrandId($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->brand_id !== $v) {
|
||||
$this->brand_id = $v;
|
||||
$this->modifiedColumns[ProductVersionTableMap::BRAND_ID] = true;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setBrandId()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -860,28 +898,31 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProductVersionTableMap::translateFieldName('TemplateId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->template_id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductVersionTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProductVersionTableMap::translateFieldName('BrandId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->brand_id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductVersionTableMap::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 : ProductVersionTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductVersionTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->updated_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductVersionTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductVersionTableMap::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductVersionTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : ProductVersionTableMap::translateFieldName('VersionCreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->version_created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : ProductVersionTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : ProductVersionTableMap::translateFieldName('VersionCreatedBy', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->version_created_by = (null !== $col) ? (string) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
@@ -891,7 +932,7 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 11; // 11 = ProductVersionTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 12; // 12 = ProductVersionTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\ProductVersion object", 0, $e);
|
||||
@@ -1130,6 +1171,9 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(ProductVersionTableMap::TEMPLATE_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = '`TEMPLATE_ID`';
|
||||
}
|
||||
if ($this->isColumnModified(ProductVersionTableMap::BRAND_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = '`BRAND_ID`';
|
||||
}
|
||||
if ($this->isColumnModified(ProductVersionTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = '`CREATED_AT`';
|
||||
}
|
||||
@@ -1174,6 +1218,9 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
case '`TEMPLATE_ID`':
|
||||
$stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT);
|
||||
break;
|
||||
case '`BRAND_ID`':
|
||||
$stmt->bindValue($identifier, $this->brand_id, PDO::PARAM_INT);
|
||||
break;
|
||||
case '`CREATED_AT`':
|
||||
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1263,18 +1310,21 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
return $this->getTemplateId();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getCreatedAt();
|
||||
return $this->getBrandId();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getUpdatedAt();
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getVersion();
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getVersionCreatedAt();
|
||||
return $this->getVersion();
|
||||
break;
|
||||
case 10:
|
||||
return $this->getVersionCreatedAt();
|
||||
break;
|
||||
case 11:
|
||||
return $this->getVersionCreatedBy();
|
||||
break;
|
||||
default:
|
||||
@@ -1312,11 +1362,12 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
$keys[3] => $this->getVisible(),
|
||||
$keys[4] => $this->getPosition(),
|
||||
$keys[5] => $this->getTemplateId(),
|
||||
$keys[6] => $this->getCreatedAt(),
|
||||
$keys[7] => $this->getUpdatedAt(),
|
||||
$keys[8] => $this->getVersion(),
|
||||
$keys[9] => $this->getVersionCreatedAt(),
|
||||
$keys[10] => $this->getVersionCreatedBy(),
|
||||
$keys[6] => $this->getBrandId(),
|
||||
$keys[7] => $this->getCreatedAt(),
|
||||
$keys[8] => $this->getUpdatedAt(),
|
||||
$keys[9] => $this->getVersion(),
|
||||
$keys[10] => $this->getVersionCreatedAt(),
|
||||
$keys[11] => $this->getVersionCreatedBy(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach ($virtualColumns as $key => $virtualColumn) {
|
||||
@@ -1380,18 +1431,21 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
$this->setTemplateId($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setCreatedAt($value);
|
||||
$this->setBrandId($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setUpdatedAt($value);
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setVersion($value);
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setVersionCreatedAt($value);
|
||||
$this->setVersion($value);
|
||||
break;
|
||||
case 10:
|
||||
$this->setVersionCreatedAt($value);
|
||||
break;
|
||||
case 11:
|
||||
$this->setVersionCreatedBy($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1424,11 +1478,12 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[3], $arr)) $this->setVisible($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setPosition($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setTemplateId($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[8], $arr)) $this->setVersion($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setVersionCreatedAt($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setVersionCreatedBy($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setBrandId($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[9], $arr)) $this->setVersion($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setVersionCreatedAt($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setVersionCreatedBy($arr[$keys[11]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1446,6 +1501,7 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(ProductVersionTableMap::VISIBLE)) $criteria->add(ProductVersionTableMap::VISIBLE, $this->visible);
|
||||
if ($this->isColumnModified(ProductVersionTableMap::POSITION)) $criteria->add(ProductVersionTableMap::POSITION, $this->position);
|
||||
if ($this->isColumnModified(ProductVersionTableMap::TEMPLATE_ID)) $criteria->add(ProductVersionTableMap::TEMPLATE_ID, $this->template_id);
|
||||
if ($this->isColumnModified(ProductVersionTableMap::BRAND_ID)) $criteria->add(ProductVersionTableMap::BRAND_ID, $this->brand_id);
|
||||
if ($this->isColumnModified(ProductVersionTableMap::CREATED_AT)) $criteria->add(ProductVersionTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(ProductVersionTableMap::UPDATED_AT)) $criteria->add(ProductVersionTableMap::UPDATED_AT, $this->updated_at);
|
||||
if ($this->isColumnModified(ProductVersionTableMap::VERSION)) $criteria->add(ProductVersionTableMap::VERSION, $this->version);
|
||||
@@ -1527,6 +1583,7 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
$copyObj->setVisible($this->getVisible());
|
||||
$copyObj->setPosition($this->getPosition());
|
||||
$copyObj->setTemplateId($this->getTemplateId());
|
||||
$copyObj->setBrandId($this->getBrandId());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
$copyObj->setVersion($this->getVersion());
|
||||
@@ -1621,6 +1678,7 @@ abstract class ProductVersion implements ActiveRecordInterface
|
||||
$this->visible = null;
|
||||
$this->position = null;
|
||||
$this->template_id = null;
|
||||
$this->brand_id = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->version = null;
|
||||
|
||||
@@ -27,6 +27,7 @@ use Thelia\Model\Map\ProductVersionTableMap;
|
||||
* @method ChildProductVersionQuery orderByVisible($order = Criteria::ASC) Order by the visible column
|
||||
* @method ChildProductVersionQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildProductVersionQuery orderByTemplateId($order = Criteria::ASC) Order by the template_id column
|
||||
* @method ChildProductVersionQuery orderByBrandId($order = Criteria::ASC) Order by the brand_id column
|
||||
* @method ChildProductVersionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildProductVersionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @method ChildProductVersionQuery orderByVersion($order = Criteria::ASC) Order by the version column
|
||||
@@ -39,6 +40,7 @@ use Thelia\Model\Map\ProductVersionTableMap;
|
||||
* @method ChildProductVersionQuery groupByVisible() Group by the visible column
|
||||
* @method ChildProductVersionQuery groupByPosition() Group by the position column
|
||||
* @method ChildProductVersionQuery groupByTemplateId() Group by the template_id column
|
||||
* @method ChildProductVersionQuery groupByBrandId() Group by the brand_id column
|
||||
* @method ChildProductVersionQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildProductVersionQuery groupByUpdatedAt() Group by the updated_at column
|
||||
* @method ChildProductVersionQuery groupByVersion() Group by the version column
|
||||
@@ -62,6 +64,7 @@ use Thelia\Model\Map\ProductVersionTableMap;
|
||||
* @method ChildProductVersion findOneByVisible(int $visible) Return the first ChildProductVersion filtered by the visible column
|
||||
* @method ChildProductVersion findOneByPosition(int $position) Return the first ChildProductVersion filtered by the position column
|
||||
* @method ChildProductVersion findOneByTemplateId(int $template_id) Return the first ChildProductVersion filtered by the template_id column
|
||||
* @method ChildProductVersion findOneByBrandId(int $brand_id) Return the first ChildProductVersion filtered by the brand_id column
|
||||
* @method ChildProductVersion findOneByCreatedAt(string $created_at) Return the first ChildProductVersion filtered by the created_at column
|
||||
* @method ChildProductVersion findOneByUpdatedAt(string $updated_at) Return the first ChildProductVersion filtered by the updated_at column
|
||||
* @method ChildProductVersion findOneByVersion(int $version) Return the first ChildProductVersion filtered by the version column
|
||||
@@ -74,6 +77,7 @@ use Thelia\Model\Map\ProductVersionTableMap;
|
||||
* @method array findByVisible(int $visible) Return ChildProductVersion objects filtered by the visible column
|
||||
* @method array findByPosition(int $position) Return ChildProductVersion objects filtered by the position column
|
||||
* @method array findByTemplateId(int $template_id) Return ChildProductVersion objects filtered by the template_id column
|
||||
* @method array findByBrandId(int $brand_id) Return ChildProductVersion objects filtered by the brand_id column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildProductVersion objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildProductVersion objects filtered by the updated_at column
|
||||
* @method array findByVersion(int $version) Return ChildProductVersion objects filtered by the version column
|
||||
@@ -167,7 +171,7 @@ abstract class ProductVersionQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT `ID`, `TAX_RULE_ID`, `REF`, `VISIBLE`, `POSITION`, `TEMPLATE_ID`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `product_version` WHERE `ID` = :p0 AND `VERSION` = :p1';
|
||||
$sql = 'SELECT `ID`, `TAX_RULE_ID`, `REF`, `VISIBLE`, `POSITION`, `TEMPLATE_ID`, `BRAND_ID`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `product_version` WHERE `ID` = :p0 AND `VERSION` = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
@@ -504,6 +508,47 @@ abstract class ProductVersionQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(ProductVersionTableMap::TEMPLATE_ID, $templateId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the brand_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByBrandId(1234); // WHERE brand_id = 1234
|
||||
* $query->filterByBrandId(array(12, 34)); // WHERE brand_id IN (12, 34)
|
||||
* $query->filterByBrandId(array('min' => 12)); // WHERE brand_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $brandId 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 ChildProductVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByBrandId($brandId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($brandId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($brandId['min'])) {
|
||||
$this->addUsingAlias(ProductVersionTableMap::BRAND_ID, $brandId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($brandId['max'])) {
|
||||
$this->addUsingAlias(ProductVersionTableMap::BRAND_ID, $brandId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductVersionTableMap::BRAND_ID, $brandId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
|
||||
@@ -1545,6 +1545,31 @@ abstract class TaxRule implements ActiveRecordInterface
|
||||
return $this->getProducts($query, $con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this TaxRule is new, it will return
|
||||
* an empty collection; or if this TaxRule has previously
|
||||
* been saved, it will retrieve related Products 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 TaxRule.
|
||||
*
|
||||
* @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|ChildProduct[] List of ChildProduct objects
|
||||
*/
|
||||
public function getProductsJoinBrand($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildProductQuery::create(null, $criteria);
|
||||
$query->joinWith('Brand', $joinBehavior);
|
||||
|
||||
return $this->getProducts($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collTaxRuleCountries collection
|
||||
*
|
||||
|
||||
@@ -1589,6 +1589,31 @@ abstract class Template implements ActiveRecordInterface
|
||||
return $this->getProducts($query, $con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this Template is new, it will return
|
||||
* an empty collection; or if this Template has previously
|
||||
* been saved, it will retrieve related Products 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 Template.
|
||||
*
|
||||
* @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|ChildProduct[] List of ChildProduct objects
|
||||
*/
|
||||
public function getProductsJoinBrand($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildProductQuery::create(null, $criteria);
|
||||
$query->joinWith('Brand', $joinBehavior);
|
||||
|
||||
return $this->getProducts($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collFeatureTemplates collection
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user