On continue à adapter le template...

This commit is contained in:
2021-04-16 19:23:51 +02:00
parent 1e2e612349
commit c160eb2141
127 changed files with 42260 additions and 36 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,759 @@
<?php
namespace Selection\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 Selection\Model\SelectionContainerAssociatedSelection as ChildSelectionContainerAssociatedSelection;
use Selection\Model\SelectionContainerAssociatedSelectionQuery as ChildSelectionContainerAssociatedSelectionQuery;
use Selection\Model\Map\SelectionContainerAssociatedSelectionTableMap;
/**
* Base class that represents a query for the 'selection_container_associated_selection' table.
*
*
*
* @method ChildSelectionContainerAssociatedSelectionQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSelectionContainerAssociatedSelectionQuery orderBySelectionContainerId($order = Criteria::ASC) Order by the selection_container_id column
* @method ChildSelectionContainerAssociatedSelectionQuery orderBySelectionId($order = Criteria::ASC) Order by the selection_id column
* @method ChildSelectionContainerAssociatedSelectionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildSelectionContainerAssociatedSelectionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildSelectionContainerAssociatedSelectionQuery groupById() Group by the id column
* @method ChildSelectionContainerAssociatedSelectionQuery groupBySelectionContainerId() Group by the selection_container_id column
* @method ChildSelectionContainerAssociatedSelectionQuery groupBySelectionId() Group by the selection_id column
* @method ChildSelectionContainerAssociatedSelectionQuery groupByCreatedAt() Group by the created_at column
* @method ChildSelectionContainerAssociatedSelectionQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildSelectionContainerAssociatedSelectionQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionContainerAssociatedSelectionQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionContainerAssociatedSelectionQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionContainerAssociatedSelectionQuery leftJoinSelectionContainer($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionContainer relation
* @method ChildSelectionContainerAssociatedSelectionQuery rightJoinSelectionContainer($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionContainer relation
* @method ChildSelectionContainerAssociatedSelectionQuery innerJoinSelectionContainer($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionContainer relation
*
* @method ChildSelectionContainerAssociatedSelectionQuery leftJoinSelection($relationAlias = null) Adds a LEFT JOIN clause to the query using the Selection relation
* @method ChildSelectionContainerAssociatedSelectionQuery rightJoinSelection($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Selection relation
* @method ChildSelectionContainerAssociatedSelectionQuery innerJoinSelection($relationAlias = null) Adds a INNER JOIN clause to the query using the Selection relation
*
* @method ChildSelectionContainerAssociatedSelection findOne(ConnectionInterface $con = null) Return the first ChildSelectionContainerAssociatedSelection matching the query
* @method ChildSelectionContainerAssociatedSelection findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionContainerAssociatedSelection matching the query, or a new ChildSelectionContainerAssociatedSelection object populated from the query conditions when no match is found
*
* @method ChildSelectionContainerAssociatedSelection findOneById(int $id) Return the first ChildSelectionContainerAssociatedSelection filtered by the id column
* @method ChildSelectionContainerAssociatedSelection findOneBySelectionContainerId(int $selection_container_id) Return the first ChildSelectionContainerAssociatedSelection filtered by the selection_container_id column
* @method ChildSelectionContainerAssociatedSelection findOneBySelectionId(int $selection_id) Return the first ChildSelectionContainerAssociatedSelection filtered by the selection_id column
* @method ChildSelectionContainerAssociatedSelection findOneByCreatedAt(string $created_at) Return the first ChildSelectionContainerAssociatedSelection filtered by the created_at column
* @method ChildSelectionContainerAssociatedSelection findOneByUpdatedAt(string $updated_at) Return the first ChildSelectionContainerAssociatedSelection filtered by the updated_at column
*
* @method array findById(int $id) Return ChildSelectionContainerAssociatedSelection objects filtered by the id column
* @method array findBySelectionContainerId(int $selection_container_id) Return ChildSelectionContainerAssociatedSelection objects filtered by the selection_container_id column
* @method array findBySelectionId(int $selection_id) Return ChildSelectionContainerAssociatedSelection objects filtered by the selection_id column
* @method array findByCreatedAt(string $created_at) Return ChildSelectionContainerAssociatedSelection objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildSelectionContainerAssociatedSelection objects filtered by the updated_at column
*
*/
abstract class SelectionContainerAssociatedSelectionQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionContainerAssociatedSelectionQuery 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 = '\\Selection\\Model\\SelectionContainerAssociatedSelection', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionContainerAssociatedSelectionQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionContainerAssociatedSelectionQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionContainerAssociatedSelectionQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionContainerAssociatedSelectionQuery();
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 ChildSelectionContainerAssociatedSelection|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionContainerAssociatedSelectionTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SelectionContainerAssociatedSelectionTableMap::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 ChildSelectionContainerAssociatedSelection A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, SELECTION_CONTAINER_ID, SELECTION_ID, CREATED_AT, UPDATED_AT FROM selection_container_associated_selection 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 ChildSelectionContainerAssociatedSelection();
$obj->hydrate($row);
SelectionContainerAssociatedSelectionTableMap::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 ChildSelectionContainerAssociatedSelection|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 ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::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 ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::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 ChildSelectionContainerAssociatedSelectionQuery 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(SelectionContainerAssociatedSelectionTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the selection_container_id column
*
* Example usage:
* <code>
* $query->filterBySelectionContainerId(1234); // WHERE selection_container_id = 1234
* $query->filterBySelectionContainerId(array(12, 34)); // WHERE selection_container_id IN (12, 34)
* $query->filterBySelectionContainerId(array('min' => 12)); // WHERE selection_container_id > 12
* </code>
*
* @see filterBySelectionContainer()
*
* @param mixed $selectionContainerId 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 ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function filterBySelectionContainerId($selectionContainerId = null, $comparison = null)
{
if (is_array($selectionContainerId)) {
$useMinMax = false;
if (isset($selectionContainerId['min'])) {
$this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_CONTAINER_ID, $selectionContainerId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($selectionContainerId['max'])) {
$this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_CONTAINER_ID, $selectionContainerId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_CONTAINER_ID, $selectionContainerId, $comparison);
}
/**
* Filter the query on the selection_id column
*
* Example usage:
* <code>
* $query->filterBySelectionId(1234); // WHERE selection_id = 1234
* $query->filterBySelectionId(array(12, 34)); // WHERE selection_id IN (12, 34)
* $query->filterBySelectionId(array('min' => 12)); // WHERE selection_id > 12
* </code>
*
* @see filterBySelection()
*
* @param mixed $selectionId 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 ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function filterBySelectionId($selectionId = null, $comparison = null)
{
if (is_array($selectionId)) {
$useMinMax = false;
if (isset($selectionId['min'])) {
$this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_ID, $selectionId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($selectionId['max'])) {
$this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_ID, $selectionId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_ID, $selectionId, $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 ChildSelectionContainerAssociatedSelectionQuery 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(SelectionContainerAssociatedSelectionTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::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 ChildSelectionContainerAssociatedSelectionQuery 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(SelectionContainerAssociatedSelectionTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Selection\Model\SelectionContainer object
*
* @param \Selection\Model\SelectionContainer|ObjectCollection $selectionContainer The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function filterBySelectionContainer($selectionContainer, $comparison = null)
{
if ($selectionContainer instanceof \Selection\Model\SelectionContainer) {
return $this
->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_CONTAINER_ID, $selectionContainer->getId(), $comparison);
} elseif ($selectionContainer instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_CONTAINER_ID, $selectionContainer->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelectionContainer() only accepts arguments of type \Selection\Model\SelectionContainer or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionContainer relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function joinSelectionContainer($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionContainer');
// 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, 'SelectionContainer');
}
return $this;
}
/**
* Use the SelectionContainer relation SelectionContainer 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 \Selection\Model\SelectionContainerQuery A secondary query class using the current class as primary query
*/
public function useSelectionContainerQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSelectionContainer($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionContainer', '\Selection\Model\SelectionContainerQuery');
}
/**
* Filter the query by a related \Selection\Model\Selection object
*
* @param \Selection\Model\Selection|ObjectCollection $selection The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function filterBySelection($selection, $comparison = null)
{
if ($selection instanceof \Selection\Model\Selection) {
return $this
->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_ID, $selection->getId(), $comparison);
} elseif ($selection instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::SELECTION_ID, $selection->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelection() only accepts arguments of type \Selection\Model\Selection or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Selection relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function joinSelection($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Selection');
// 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, 'Selection');
}
return $this;
}
/**
* Use the Selection relation Selection 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 \Selection\Model\SelectionQuery A secondary query class using the current class as primary query
*/
public function useSelectionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSelection($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Selection', '\Selection\Model\SelectionQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionContainerAssociatedSelection $selectionContainerAssociatedSelection Object to remove from the list of results
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function prune($selectionContainerAssociatedSelection = null)
{
if ($selectionContainerAssociatedSelection) {
$this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::ID, $selectionContainerAssociatedSelection->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the selection_container_associated_selection 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(SelectionContainerAssociatedSelectionTableMap::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).
SelectionContainerAssociatedSelectionTableMap::clearInstancePool();
SelectionContainerAssociatedSelectionTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionContainerAssociatedSelection or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionContainerAssociatedSelection 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(SelectionContainerAssociatedSelectionTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionContainerAssociatedSelectionTableMap::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();
SelectionContainerAssociatedSelectionTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionContainerAssociatedSelectionTableMap::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 ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(SelectionContainerAssociatedSelectionTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionContainerAssociatedSelectionTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionContainerAssociatedSelectionTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionContainerAssociatedSelectionTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildSelectionContainerAssociatedSelectionQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionContainerAssociatedSelectionTableMap::CREATED_AT);
}
} // SelectionContainerAssociatedSelectionQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,706 @@
<?php
namespace Selection\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 Selection\Model\SelectionContainerI18n as ChildSelectionContainerI18n;
use Selection\Model\SelectionContainerI18nQuery as ChildSelectionContainerI18nQuery;
use Selection\Model\Map\SelectionContainerI18nTableMap;
/**
* Base class that represents a query for the 'selection_container_i18n' table.
*
*
*
* @method ChildSelectionContainerI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSelectionContainerI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildSelectionContainerI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildSelectionContainerI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildSelectionContainerI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildSelectionContainerI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
* @method ChildSelectionContainerI18nQuery orderByMetaTitle($order = Criteria::ASC) Order by the meta_title column
* @method ChildSelectionContainerI18nQuery orderByMetaDescription($order = Criteria::ASC) Order by the meta_description column
* @method ChildSelectionContainerI18nQuery orderByMetaKeywords($order = Criteria::ASC) Order by the meta_keywords column
*
* @method ChildSelectionContainerI18nQuery groupById() Group by the id column
* @method ChildSelectionContainerI18nQuery groupByLocale() Group by the locale column
* @method ChildSelectionContainerI18nQuery groupByTitle() Group by the title column
* @method ChildSelectionContainerI18nQuery groupByDescription() Group by the description column
* @method ChildSelectionContainerI18nQuery groupByChapo() Group by the chapo column
* @method ChildSelectionContainerI18nQuery groupByPostscriptum() Group by the postscriptum column
* @method ChildSelectionContainerI18nQuery groupByMetaTitle() Group by the meta_title column
* @method ChildSelectionContainerI18nQuery groupByMetaDescription() Group by the meta_description column
* @method ChildSelectionContainerI18nQuery groupByMetaKeywords() Group by the meta_keywords column
*
* @method ChildSelectionContainerI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionContainerI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionContainerI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionContainerI18nQuery leftJoinSelectionContainer($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionContainer relation
* @method ChildSelectionContainerI18nQuery rightJoinSelectionContainer($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionContainer relation
* @method ChildSelectionContainerI18nQuery innerJoinSelectionContainer($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionContainer relation
*
* @method ChildSelectionContainerI18n findOne(ConnectionInterface $con = null) Return the first ChildSelectionContainerI18n matching the query
* @method ChildSelectionContainerI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionContainerI18n matching the query, or a new ChildSelectionContainerI18n object populated from the query conditions when no match is found
*
* @method ChildSelectionContainerI18n findOneById(int $id) Return the first ChildSelectionContainerI18n filtered by the id column
* @method ChildSelectionContainerI18n findOneByLocale(string $locale) Return the first ChildSelectionContainerI18n filtered by the locale column
* @method ChildSelectionContainerI18n findOneByTitle(string $title) Return the first ChildSelectionContainerI18n filtered by the title column
* @method ChildSelectionContainerI18n findOneByDescription(string $description) Return the first ChildSelectionContainerI18n filtered by the description column
* @method ChildSelectionContainerI18n findOneByChapo(string $chapo) Return the first ChildSelectionContainerI18n filtered by the chapo column
* @method ChildSelectionContainerI18n findOneByPostscriptum(string $postscriptum) Return the first ChildSelectionContainerI18n filtered by the postscriptum column
* @method ChildSelectionContainerI18n findOneByMetaTitle(string $meta_title) Return the first ChildSelectionContainerI18n filtered by the meta_title column
* @method ChildSelectionContainerI18n findOneByMetaDescription(string $meta_description) Return the first ChildSelectionContainerI18n filtered by the meta_description column
* @method ChildSelectionContainerI18n findOneByMetaKeywords(string $meta_keywords) Return the first ChildSelectionContainerI18n filtered by the meta_keywords column
*
* @method array findById(int $id) Return ChildSelectionContainerI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildSelectionContainerI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildSelectionContainerI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildSelectionContainerI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildSelectionContainerI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildSelectionContainerI18n objects filtered by the postscriptum column
* @method array findByMetaTitle(string $meta_title) Return ChildSelectionContainerI18n objects filtered by the meta_title column
* @method array findByMetaDescription(string $meta_description) Return ChildSelectionContainerI18n objects filtered by the meta_description column
* @method array findByMetaKeywords(string $meta_keywords) Return ChildSelectionContainerI18n objects filtered by the meta_keywords column
*
*/
abstract class SelectionContainerI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionContainerI18nQuery 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 = '\\Selection\\Model\\SelectionContainerI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionContainerI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionContainerI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionContainerI18nQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionContainerI18nQuery();
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 ChildSelectionContainerI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionContainerI18nTableMap::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(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18n 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 selection_container_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 ChildSelectionContainerI18n();
$obj->hydrate($row);
SelectionContainerI18nTableMap::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 ChildSelectionContainerI18n|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 ChildSelectionContainerI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(SelectionContainerI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(SelectionContainerI18nTableMap::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 filterBySelectionContainer()
*
* @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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SelectionContainerI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::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 ChildSelectionContainerI18nQuery 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(SelectionContainerI18nTableMap::META_KEYWORDS, $metaKeywords, $comparison);
}
/**
* Filter the query by a related \Selection\Model\SelectionContainer object
*
* @param \Selection\Model\SelectionContainer|ObjectCollection $selectionContainer The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContainerI18nQuery The current query, for fluid interface
*/
public function filterBySelectionContainer($selectionContainer, $comparison = null)
{
if ($selectionContainer instanceof \Selection\Model\SelectionContainer) {
return $this
->addUsingAlias(SelectionContainerI18nTableMap::ID, $selectionContainer->getId(), $comparison);
} elseif ($selectionContainer instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionContainerI18nTableMap::ID, $selectionContainer->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelectionContainer() only accepts arguments of type \Selection\Model\SelectionContainer or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionContainer relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContainerI18nQuery The current query, for fluid interface
*/
public function joinSelectionContainer($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionContainer');
// 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, 'SelectionContainer');
}
return $this;
}
/**
* Use the SelectionContainer relation SelectionContainer 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 \Selection\Model\SelectionContainerQuery A secondary query class using the current class as primary query
*/
public function useSelectionContainerQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinSelectionContainer($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionContainer', '\Selection\Model\SelectionContainerQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionContainerI18n $selectionContainerI18n Object to remove from the list of results
*
* @return ChildSelectionContainerI18nQuery The current query, for fluid interface
*/
public function prune($selectionContainerI18n = null)
{
if ($selectionContainerI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(SelectionContainerI18nTableMap::ID), $selectionContainerI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(SelectionContainerI18nTableMap::LOCALE), $selectionContainerI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the selection_container_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(SelectionContainerI18nTableMap::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).
SelectionContainerI18nTableMap::clearInstancePool();
SelectionContainerI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionContainerI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionContainerI18n 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(SelectionContainerI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionContainerI18nTableMap::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();
SelectionContainerI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionContainerI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // SelectionContainerI18nQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,607 @@
<?php
namespace Selection\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 Selection\Model\SelectionContainerImageI18n as ChildSelectionContainerImageI18n;
use Selection\Model\SelectionContainerImageI18nQuery as ChildSelectionContainerImageI18nQuery;
use Selection\Model\Map\SelectionContainerImageI18nTableMap;
/**
* Base class that represents a query for the 'selection_container_image_i18n' table.
*
*
*
* @method ChildSelectionContainerImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSelectionContainerImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildSelectionContainerImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildSelectionContainerImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildSelectionContainerImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildSelectionContainerImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
*
* @method ChildSelectionContainerImageI18nQuery groupById() Group by the id column
* @method ChildSelectionContainerImageI18nQuery groupByLocale() Group by the locale column
* @method ChildSelectionContainerImageI18nQuery groupByTitle() Group by the title column
* @method ChildSelectionContainerImageI18nQuery groupByDescription() Group by the description column
* @method ChildSelectionContainerImageI18nQuery groupByChapo() Group by the chapo column
* @method ChildSelectionContainerImageI18nQuery groupByPostscriptum() Group by the postscriptum column
*
* @method ChildSelectionContainerImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionContainerImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionContainerImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionContainerImageI18nQuery leftJoinSelectionContainerImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionContainerImage relation
* @method ChildSelectionContainerImageI18nQuery rightJoinSelectionContainerImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionContainerImage relation
* @method ChildSelectionContainerImageI18nQuery innerJoinSelectionContainerImage($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionContainerImage relation
*
* @method ChildSelectionContainerImageI18n findOne(ConnectionInterface $con = null) Return the first ChildSelectionContainerImageI18n matching the query
* @method ChildSelectionContainerImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionContainerImageI18n matching the query, or a new ChildSelectionContainerImageI18n object populated from the query conditions when no match is found
*
* @method ChildSelectionContainerImageI18n findOneById(int $id) Return the first ChildSelectionContainerImageI18n filtered by the id column
* @method ChildSelectionContainerImageI18n findOneByLocale(string $locale) Return the first ChildSelectionContainerImageI18n filtered by the locale column
* @method ChildSelectionContainerImageI18n findOneByTitle(string $title) Return the first ChildSelectionContainerImageI18n filtered by the title column
* @method ChildSelectionContainerImageI18n findOneByDescription(string $description) Return the first ChildSelectionContainerImageI18n filtered by the description column
* @method ChildSelectionContainerImageI18n findOneByChapo(string $chapo) Return the first ChildSelectionContainerImageI18n filtered by the chapo column
* @method ChildSelectionContainerImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildSelectionContainerImageI18n filtered by the postscriptum column
*
* @method array findById(int $id) Return ChildSelectionContainerImageI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildSelectionContainerImageI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildSelectionContainerImageI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildSelectionContainerImageI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildSelectionContainerImageI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildSelectionContainerImageI18n objects filtered by the postscriptum column
*
*/
abstract class SelectionContainerImageI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionContainerImageI18nQuery 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 = '\\Selection\\Model\\SelectionContainerImageI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionContainerImageI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionContainerImageI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionContainerImageI18nQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionContainerImageI18nQuery();
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 ChildSelectionContainerImageI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionContainerImageI18nTableMap::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(SelectionContainerImageI18nTableMap::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 ChildSelectionContainerImageI18n 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 selection_container_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 ChildSelectionContainerImageI18n();
$obj->hydrate($row);
SelectionContainerImageI18nTableMap::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 ChildSelectionContainerImageI18n|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 ChildSelectionContainerImageI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(SelectionContainerImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(SelectionContainerImageI18nTableMap::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 ChildSelectionContainerImageI18nQuery 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(SelectionContainerImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(SelectionContainerImageI18nTableMap::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 filterBySelectionContainerImage()
*
* @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 ChildSelectionContainerImageI18nQuery 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(SelectionContainerImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SelectionContainerImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerImageI18nTableMap::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 ChildSelectionContainerImageI18nQuery 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(SelectionContainerImageI18nTableMap::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 ChildSelectionContainerImageI18nQuery 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(SelectionContainerImageI18nTableMap::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 ChildSelectionContainerImageI18nQuery 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(SelectionContainerImageI18nTableMap::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 ChildSelectionContainerImageI18nQuery 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(SelectionContainerImageI18nTableMap::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 ChildSelectionContainerImageI18nQuery 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(SelectionContainerImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
}
/**
* Filter the query by a related \Selection\Model\SelectionContainerImage object
*
* @param \Selection\Model\SelectionContainerImage|ObjectCollection $selectionContainerImage The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContainerImageI18nQuery The current query, for fluid interface
*/
public function filterBySelectionContainerImage($selectionContainerImage, $comparison = null)
{
if ($selectionContainerImage instanceof \Selection\Model\SelectionContainerImage) {
return $this
->addUsingAlias(SelectionContainerImageI18nTableMap::ID, $selectionContainerImage->getId(), $comparison);
} elseif ($selectionContainerImage instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionContainerImageI18nTableMap::ID, $selectionContainerImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelectionContainerImage() only accepts arguments of type \Selection\Model\SelectionContainerImage or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionContainerImage relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContainerImageI18nQuery The current query, for fluid interface
*/
public function joinSelectionContainerImage($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionContainerImage');
// 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, 'SelectionContainerImage');
}
return $this;
}
/**
* Use the SelectionContainerImage relation SelectionContainerImage 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 \Selection\Model\SelectionContainerImageQuery A secondary query class using the current class as primary query
*/
public function useSelectionContainerImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinSelectionContainerImage($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionContainerImage', '\Selection\Model\SelectionContainerImageQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionContainerImageI18n $selectionContainerImageI18n Object to remove from the list of results
*
* @return ChildSelectionContainerImageI18nQuery The current query, for fluid interface
*/
public function prune($selectionContainerImageI18n = null)
{
if ($selectionContainerImageI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(SelectionContainerImageI18nTableMap::ID), $selectionContainerImageI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(SelectionContainerImageI18nTableMap::LOCALE), $selectionContainerImageI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the selection_container_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(SelectionContainerImageI18nTableMap::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).
SelectionContainerImageI18nTableMap::clearInstancePool();
SelectionContainerImageI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionContainerImageI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionContainerImageI18n 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(SelectionContainerImageI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionContainerImageI18nTableMap::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();
SelectionContainerImageI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionContainerImageI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // SelectionContainerImageI18nQuery

View File

@@ -0,0 +1,891 @@
<?php
namespace Selection\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 Selection\Model\SelectionContainerImage as ChildSelectionContainerImage;
use Selection\Model\SelectionContainerImageI18nQuery as ChildSelectionContainerImageI18nQuery;
use Selection\Model\SelectionContainerImageQuery as ChildSelectionContainerImageQuery;
use Selection\Model\Map\SelectionContainerImageTableMap;
/**
* Base class that represents a query for the 'selection_container_image' table.
*
*
*
* @method ChildSelectionContainerImageQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSelectionContainerImageQuery orderBySelectionContainerId($order = Criteria::ASC) Order by the selection_container_id column
* @method ChildSelectionContainerImageQuery orderByFile($order = Criteria::ASC) Order by the file column
* @method ChildSelectionContainerImageQuery orderByVisible($order = Criteria::ASC) Order by the visible column
* @method ChildSelectionContainerImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildSelectionContainerImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildSelectionContainerImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildSelectionContainerImageQuery groupById() Group by the id column
* @method ChildSelectionContainerImageQuery groupBySelectionContainerId() Group by the selection_container_id column
* @method ChildSelectionContainerImageQuery groupByFile() Group by the file column
* @method ChildSelectionContainerImageQuery groupByVisible() Group by the visible column
* @method ChildSelectionContainerImageQuery groupByPosition() Group by the position column
* @method ChildSelectionContainerImageQuery groupByCreatedAt() Group by the created_at column
* @method ChildSelectionContainerImageQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildSelectionContainerImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionContainerImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionContainerImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionContainerImageQuery leftJoinSelectionContainer($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionContainer relation
* @method ChildSelectionContainerImageQuery rightJoinSelectionContainer($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionContainer relation
* @method ChildSelectionContainerImageQuery innerJoinSelectionContainer($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionContainer relation
*
* @method ChildSelectionContainerImageQuery leftJoinSelectionContainerImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionContainerImageI18n relation
* @method ChildSelectionContainerImageQuery rightJoinSelectionContainerImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionContainerImageI18n relation
* @method ChildSelectionContainerImageQuery innerJoinSelectionContainerImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionContainerImageI18n relation
*
* @method ChildSelectionContainerImage findOne(ConnectionInterface $con = null) Return the first ChildSelectionContainerImage matching the query
* @method ChildSelectionContainerImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionContainerImage matching the query, or a new ChildSelectionContainerImage object populated from the query conditions when no match is found
*
* @method ChildSelectionContainerImage findOneById(int $id) Return the first ChildSelectionContainerImage filtered by the id column
* @method ChildSelectionContainerImage findOneBySelectionContainerId(int $selection_container_id) Return the first ChildSelectionContainerImage filtered by the selection_container_id column
* @method ChildSelectionContainerImage findOneByFile(string $file) Return the first ChildSelectionContainerImage filtered by the file column
* @method ChildSelectionContainerImage findOneByVisible(int $visible) Return the first ChildSelectionContainerImage filtered by the visible column
* @method ChildSelectionContainerImage findOneByPosition(int $position) Return the first ChildSelectionContainerImage filtered by the position column
* @method ChildSelectionContainerImage findOneByCreatedAt(string $created_at) Return the first ChildSelectionContainerImage filtered by the created_at column
* @method ChildSelectionContainerImage findOneByUpdatedAt(string $updated_at) Return the first ChildSelectionContainerImage filtered by the updated_at column
*
* @method array findById(int $id) Return ChildSelectionContainerImage objects filtered by the id column
* @method array findBySelectionContainerId(int $selection_container_id) Return ChildSelectionContainerImage objects filtered by the selection_container_id column
* @method array findByFile(string $file) Return ChildSelectionContainerImage objects filtered by the file column
* @method array findByVisible(int $visible) Return ChildSelectionContainerImage objects filtered by the visible column
* @method array findByPosition(int $position) Return ChildSelectionContainerImage objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildSelectionContainerImage objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildSelectionContainerImage objects filtered by the updated_at column
*
*/
abstract class SelectionContainerImageQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionContainerImageQuery 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 = '\\Selection\\Model\\SelectionContainerImage', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionContainerImageQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionContainerImageQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionContainerImageQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionContainerImageQuery();
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 ChildSelectionContainerImage|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionContainerImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SelectionContainerImageTableMap::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 ChildSelectionContainerImage A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, SELECTION_CONTAINER_ID, FILE, VISIBLE, POSITION, CREATED_AT, UPDATED_AT FROM selection_container_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 ChildSelectionContainerImage();
$obj->hydrate($row);
SelectionContainerImageTableMap::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 ChildSelectionContainerImage|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 ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SelectionContainerImageTableMap::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 ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SelectionContainerImageTableMap::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 ChildSelectionContainerImageQuery 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(SelectionContainerImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SelectionContainerImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerImageTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the selection_container_id column
*
* Example usage:
* <code>
* $query->filterBySelectionContainerId(1234); // WHERE selection_container_id = 1234
* $query->filterBySelectionContainerId(array(12, 34)); // WHERE selection_container_id IN (12, 34)
* $query->filterBySelectionContainerId(array('min' => 12)); // WHERE selection_container_id > 12
* </code>
*
* @see filterBySelectionContainer()
*
* @param mixed $selectionContainerId 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 ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function filterBySelectionContainerId($selectionContainerId = null, $comparison = null)
{
if (is_array($selectionContainerId)) {
$useMinMax = false;
if (isset($selectionContainerId['min'])) {
$this->addUsingAlias(SelectionContainerImageTableMap::SELECTION_CONTAINER_ID, $selectionContainerId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($selectionContainerId['max'])) {
$this->addUsingAlias(SelectionContainerImageTableMap::SELECTION_CONTAINER_ID, $selectionContainerId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerImageTableMap::SELECTION_CONTAINER_ID, $selectionContainerId, $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 ChildSelectionContainerImageQuery 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(SelectionContainerImageTableMap::FILE, $file, $comparison);
}
/**
* Filter the query on the visible column
*
* Example usage:
* <code>
* $query->filterByVisible(1234); // WHERE visible = 1234
* $query->filterByVisible(array(12, 34)); // WHERE visible IN (12, 34)
* $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
* </code>
*
* @param mixed $visible 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 ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function filterByVisible($visible = null, $comparison = null)
{
if (is_array($visible)) {
$useMinMax = false;
if (isset($visible['min'])) {
$this->addUsingAlias(SelectionContainerImageTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($visible['max'])) {
$this->addUsingAlias(SelectionContainerImageTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerImageTableMap::VISIBLE, $visible, $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 ChildSelectionContainerImageQuery 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(SelectionContainerImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(SelectionContainerImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerImageTableMap::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 ChildSelectionContainerImageQuery 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(SelectionContainerImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(SelectionContainerImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerImageTableMap::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 ChildSelectionContainerImageQuery 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(SelectionContainerImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(SelectionContainerImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerImageTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Selection\Model\SelectionContainer object
*
* @param \Selection\Model\SelectionContainer|ObjectCollection $selectionContainer The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function filterBySelectionContainer($selectionContainer, $comparison = null)
{
if ($selectionContainer instanceof \Selection\Model\SelectionContainer) {
return $this
->addUsingAlias(SelectionContainerImageTableMap::SELECTION_CONTAINER_ID, $selectionContainer->getId(), $comparison);
} elseif ($selectionContainer instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionContainerImageTableMap::SELECTION_CONTAINER_ID, $selectionContainer->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelectionContainer() only accepts arguments of type \Selection\Model\SelectionContainer or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionContainer relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function joinSelectionContainer($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionContainer');
// 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, 'SelectionContainer');
}
return $this;
}
/**
* Use the SelectionContainer relation SelectionContainer 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 \Selection\Model\SelectionContainerQuery A secondary query class using the current class as primary query
*/
public function useSelectionContainerQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSelectionContainer($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionContainer', '\Selection\Model\SelectionContainerQuery');
}
/**
* Filter the query by a related \Selection\Model\SelectionContainerImageI18n object
*
* @param \Selection\Model\SelectionContainerImageI18n|ObjectCollection $selectionContainerImageI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function filterBySelectionContainerImageI18n($selectionContainerImageI18n, $comparison = null)
{
if ($selectionContainerImageI18n instanceof \Selection\Model\SelectionContainerImageI18n) {
return $this
->addUsingAlias(SelectionContainerImageTableMap::ID, $selectionContainerImageI18n->getId(), $comparison);
} elseif ($selectionContainerImageI18n instanceof ObjectCollection) {
return $this
->useSelectionContainerImageI18nQuery()
->filterByPrimaryKeys($selectionContainerImageI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySelectionContainerImageI18n() only accepts arguments of type \Selection\Model\SelectionContainerImageI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionContainerImageI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function joinSelectionContainerImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionContainerImageI18n');
// 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, 'SelectionContainerImageI18n');
}
return $this;
}
/**
* Use the SelectionContainerImageI18n relation SelectionContainerImageI18n 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 \Selection\Model\SelectionContainerImageI18nQuery A secondary query class using the current class as primary query
*/
public function useSelectionContainerImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinSelectionContainerImageI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionContainerImageI18n', '\Selection\Model\SelectionContainerImageI18nQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionContainerImage $selectionContainerImage Object to remove from the list of results
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function prune($selectionContainerImage = null)
{
if ($selectionContainerImage) {
$this->addUsingAlias(SelectionContainerImageTableMap::ID, $selectionContainerImage->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the selection_container_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(SelectionContainerImageTableMap::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).
SelectionContainerImageTableMap::clearInstancePool();
SelectionContainerImageTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionContainerImage or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionContainerImage 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(SelectionContainerImageTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionContainerImageTableMap::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();
SelectionContainerImageTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionContainerImageTableMap::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 ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(SelectionContainerImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(SelectionContainerImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionContainerImageTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionContainerImageTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionContainerImageTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionContainerImageTableMap::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 ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'SelectionContainerImageI18n';
return $this
->joinSelectionContainerImageI18n($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 ChildSelectionContainerImageQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('SelectionContainerImageI18n');
$this->with['SelectionContainerImageI18n']->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 ChildSelectionContainerImageI18nQuery 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 : 'SelectionContainerImageI18n', '\Selection\Model\SelectionContainerImageI18nQuery');
}
} // SelectionContainerImageQuery

View File

@@ -0,0 +1,886 @@
<?php
namespace Selection\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 Selection\Model\SelectionContainer as ChildSelectionContainer;
use Selection\Model\SelectionContainerI18nQuery as ChildSelectionContainerI18nQuery;
use Selection\Model\SelectionContainerQuery as ChildSelectionContainerQuery;
use Selection\Model\Map\SelectionContainerTableMap;
/**
* Base class that represents a query for the 'selection_container' table.
*
*
*
* @method ChildSelectionContainerQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSelectionContainerQuery orderByVisible($order = Criteria::ASC) Order by the visible column
* @method ChildSelectionContainerQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildSelectionContainerQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildSelectionContainerQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildSelectionContainerQuery groupById() Group by the id column
* @method ChildSelectionContainerQuery groupByVisible() Group by the visible column
* @method ChildSelectionContainerQuery groupByPosition() Group by the position column
* @method ChildSelectionContainerQuery groupByCreatedAt() Group by the created_at column
* @method ChildSelectionContainerQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildSelectionContainerQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionContainerQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionContainerQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionContainerQuery leftJoinSelectionContainerAssociatedSelection($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionContainerAssociatedSelection relation
* @method ChildSelectionContainerQuery rightJoinSelectionContainerAssociatedSelection($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionContainerAssociatedSelection relation
* @method ChildSelectionContainerQuery innerJoinSelectionContainerAssociatedSelection($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionContainerAssociatedSelection relation
*
* @method ChildSelectionContainerQuery leftJoinSelectionContainerImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionContainerImage relation
* @method ChildSelectionContainerQuery rightJoinSelectionContainerImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionContainerImage relation
* @method ChildSelectionContainerQuery innerJoinSelectionContainerImage($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionContainerImage relation
*
* @method ChildSelectionContainerQuery leftJoinSelectionContainerI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionContainerI18n relation
* @method ChildSelectionContainerQuery rightJoinSelectionContainerI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionContainerI18n relation
* @method ChildSelectionContainerQuery innerJoinSelectionContainerI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionContainerI18n relation
*
* @method ChildSelectionContainer findOne(ConnectionInterface $con = null) Return the first ChildSelectionContainer matching the query
* @method ChildSelectionContainer findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionContainer matching the query, or a new ChildSelectionContainer object populated from the query conditions when no match is found
*
* @method ChildSelectionContainer findOneById(int $id) Return the first ChildSelectionContainer filtered by the id column
* @method ChildSelectionContainer findOneByVisible(int $visible) Return the first ChildSelectionContainer filtered by the visible column
* @method ChildSelectionContainer findOneByPosition(int $position) Return the first ChildSelectionContainer filtered by the position column
* @method ChildSelectionContainer findOneByCreatedAt(string $created_at) Return the first ChildSelectionContainer filtered by the created_at column
* @method ChildSelectionContainer findOneByUpdatedAt(string $updated_at) Return the first ChildSelectionContainer filtered by the updated_at column
*
* @method array findById(int $id) Return ChildSelectionContainer objects filtered by the id column
* @method array findByVisible(int $visible) Return ChildSelectionContainer objects filtered by the visible column
* @method array findByPosition(int $position) Return ChildSelectionContainer objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildSelectionContainer objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildSelectionContainer objects filtered by the updated_at column
*
*/
abstract class SelectionContainerQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionContainerQuery 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 = '\\Selection\\Model\\SelectionContainer', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionContainerQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionContainerQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionContainerQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionContainerQuery();
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 ChildSelectionContainer|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionContainerTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SelectionContainerTableMap::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 ChildSelectionContainer A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, VISIBLE, POSITION, CREATED_AT, UPDATED_AT FROM selection_container 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 ChildSelectionContainer();
$obj->hydrate($row);
SelectionContainerTableMap::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 ChildSelectionContainer|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 ChildSelectionContainerQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SelectionContainerTableMap::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 ChildSelectionContainerQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SelectionContainerTableMap::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 ChildSelectionContainerQuery 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(SelectionContainerTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SelectionContainerTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the visible column
*
* Example usage:
* <code>
* $query->filterByVisible(1234); // WHERE visible = 1234
* $query->filterByVisible(array(12, 34)); // WHERE visible IN (12, 34)
* $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
* </code>
*
* @param mixed $visible 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 ChildSelectionContainerQuery The current query, for fluid interface
*/
public function filterByVisible($visible = null, $comparison = null)
{
if (is_array($visible)) {
$useMinMax = false;
if (isset($visible['min'])) {
$this->addUsingAlias(SelectionContainerTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($visible['max'])) {
$this->addUsingAlias(SelectionContainerTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerTableMap::VISIBLE, $visible, $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 ChildSelectionContainerQuery 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(SelectionContainerTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(SelectionContainerTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerTableMap::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 ChildSelectionContainerQuery 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(SelectionContainerTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(SelectionContainerTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerTableMap::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 ChildSelectionContainerQuery 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(SelectionContainerTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(SelectionContainerTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContainerTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Selection\Model\SelectionContainerAssociatedSelection object
*
* @param \Selection\Model\SelectionContainerAssociatedSelection|ObjectCollection $selectionContainerAssociatedSelection the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function filterBySelectionContainerAssociatedSelection($selectionContainerAssociatedSelection, $comparison = null)
{
if ($selectionContainerAssociatedSelection instanceof \Selection\Model\SelectionContainerAssociatedSelection) {
return $this
->addUsingAlias(SelectionContainerTableMap::ID, $selectionContainerAssociatedSelection->getSelectionContainerId(), $comparison);
} elseif ($selectionContainerAssociatedSelection instanceof ObjectCollection) {
return $this
->useSelectionContainerAssociatedSelectionQuery()
->filterByPrimaryKeys($selectionContainerAssociatedSelection->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySelectionContainerAssociatedSelection() only accepts arguments of type \Selection\Model\SelectionContainerAssociatedSelection or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionContainerAssociatedSelection relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function joinSelectionContainerAssociatedSelection($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionContainerAssociatedSelection');
// 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, 'SelectionContainerAssociatedSelection');
}
return $this;
}
/**
* Use the SelectionContainerAssociatedSelection relation SelectionContainerAssociatedSelection 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 \Selection\Model\SelectionContainerAssociatedSelectionQuery A secondary query class using the current class as primary query
*/
public function useSelectionContainerAssociatedSelectionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSelectionContainerAssociatedSelection($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionContainerAssociatedSelection', '\Selection\Model\SelectionContainerAssociatedSelectionQuery');
}
/**
* Filter the query by a related \Selection\Model\SelectionContainerImage object
*
* @param \Selection\Model\SelectionContainerImage|ObjectCollection $selectionContainerImage the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function filterBySelectionContainerImage($selectionContainerImage, $comparison = null)
{
if ($selectionContainerImage instanceof \Selection\Model\SelectionContainerImage) {
return $this
->addUsingAlias(SelectionContainerTableMap::ID, $selectionContainerImage->getSelectionContainerId(), $comparison);
} elseif ($selectionContainerImage instanceof ObjectCollection) {
return $this
->useSelectionContainerImageQuery()
->filterByPrimaryKeys($selectionContainerImage->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySelectionContainerImage() only accepts arguments of type \Selection\Model\SelectionContainerImage or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionContainerImage relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function joinSelectionContainerImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionContainerImage');
// 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, 'SelectionContainerImage');
}
return $this;
}
/**
* Use the SelectionContainerImage relation SelectionContainerImage 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 \Selection\Model\SelectionContainerImageQuery A secondary query class using the current class as primary query
*/
public function useSelectionContainerImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSelectionContainerImage($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionContainerImage', '\Selection\Model\SelectionContainerImageQuery');
}
/**
* Filter the query by a related \Selection\Model\SelectionContainerI18n object
*
* @param \Selection\Model\SelectionContainerI18n|ObjectCollection $selectionContainerI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function filterBySelectionContainerI18n($selectionContainerI18n, $comparison = null)
{
if ($selectionContainerI18n instanceof \Selection\Model\SelectionContainerI18n) {
return $this
->addUsingAlias(SelectionContainerTableMap::ID, $selectionContainerI18n->getId(), $comparison);
} elseif ($selectionContainerI18n instanceof ObjectCollection) {
return $this
->useSelectionContainerI18nQuery()
->filterByPrimaryKeys($selectionContainerI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySelectionContainerI18n() only accepts arguments of type \Selection\Model\SelectionContainerI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionContainerI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function joinSelectionContainerI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionContainerI18n');
// 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, 'SelectionContainerI18n');
}
return $this;
}
/**
* Use the SelectionContainerI18n relation SelectionContainerI18n 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 \Selection\Model\SelectionContainerI18nQuery A secondary query class using the current class as primary query
*/
public function useSelectionContainerI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinSelectionContainerI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionContainerI18n', '\Selection\Model\SelectionContainerI18nQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionContainer $selectionContainer Object to remove from the list of results
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function prune($selectionContainer = null)
{
if ($selectionContainer) {
$this->addUsingAlias(SelectionContainerTableMap::ID, $selectionContainer->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the selection_container 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(SelectionContainerTableMap::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).
SelectionContainerTableMap::clearInstancePool();
SelectionContainerTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionContainer or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionContainer 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(SelectionContainerTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionContainerTableMap::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();
SelectionContainerTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionContainerTableMap::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 ChildSelectionContainerQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(SelectionContainerTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(SelectionContainerTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionContainerTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionContainerTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionContainerTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildSelectionContainerQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionContainerTableMap::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 ChildSelectionContainerQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'SelectionContainerI18n';
return $this
->joinSelectionContainerI18n($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 ChildSelectionContainerQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('SelectionContainerI18n');
$this->with['SelectionContainerI18n']->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 ChildSelectionContainerI18nQuery 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 : 'SelectionContainerI18n', '\Selection\Model\SelectionContainerI18nQuery');
}
} // SelectionContainerQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,774 @@
<?php
namespace Selection\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 Selection\Model\SelectionContent as ChildSelectionContent;
use Selection\Model\SelectionContentQuery as ChildSelectionContentQuery;
use Selection\Model\Map\SelectionContentTableMap;
use Thelia\Model\Content;
/**
* Base class that represents a query for the 'selection_content' table.
*
*
*
* @method ChildSelectionContentQuery orderBySelectionId($order = Criteria::ASC) Order by the selection_id column
* @method ChildSelectionContentQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
* @method ChildSelectionContentQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildSelectionContentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildSelectionContentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildSelectionContentQuery groupBySelectionId() Group by the selection_id column
* @method ChildSelectionContentQuery groupByContentId() Group by the content_id column
* @method ChildSelectionContentQuery groupByPosition() Group by the position column
* @method ChildSelectionContentQuery groupByCreatedAt() Group by the created_at column
* @method ChildSelectionContentQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildSelectionContentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionContentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionContentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionContentQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
* @method ChildSelectionContentQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
* @method ChildSelectionContentQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
*
* @method ChildSelectionContentQuery leftJoinSelection($relationAlias = null) Adds a LEFT JOIN clause to the query using the Selection relation
* @method ChildSelectionContentQuery rightJoinSelection($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Selection relation
* @method ChildSelectionContentQuery innerJoinSelection($relationAlias = null) Adds a INNER JOIN clause to the query using the Selection relation
*
* @method ChildSelectionContent findOne(ConnectionInterface $con = null) Return the first ChildSelectionContent matching the query
* @method ChildSelectionContent findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionContent matching the query, or a new ChildSelectionContent object populated from the query conditions when no match is found
*
* @method ChildSelectionContent findOneBySelectionId(int $selection_id) Return the first ChildSelectionContent filtered by the selection_id column
* @method ChildSelectionContent findOneByContentId(int $content_id) Return the first ChildSelectionContent filtered by the content_id column
* @method ChildSelectionContent findOneByPosition(int $position) Return the first ChildSelectionContent filtered by the position column
* @method ChildSelectionContent findOneByCreatedAt(string $created_at) Return the first ChildSelectionContent filtered by the created_at column
* @method ChildSelectionContent findOneByUpdatedAt(string $updated_at) Return the first ChildSelectionContent filtered by the updated_at column
*
* @method array findBySelectionId(int $selection_id) Return ChildSelectionContent objects filtered by the selection_id column
* @method array findByContentId(int $content_id) Return ChildSelectionContent objects filtered by the content_id column
* @method array findByPosition(int $position) Return ChildSelectionContent objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildSelectionContent objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildSelectionContent objects filtered by the updated_at column
*
*/
abstract class SelectionContentQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionContentQuery 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 = '\\Selection\\Model\\SelectionContent', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionContentQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionContentQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionContentQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionContentQuery();
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[$selection_id, $content_id] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildSelectionContent|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionContentTableMap::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(SelectionContentTableMap::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 ChildSelectionContent A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT SELECTION_ID, CONTENT_ID, POSITION, CREATED_AT, UPDATED_AT FROM selection_content WHERE SELECTION_ID = :p0 AND CONTENT_ID = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], 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 ChildSelectionContent();
$obj->hydrate($row);
SelectionContentTableMap::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 ChildSelectionContent|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 ChildSelectionContentQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(SelectionContentTableMap::SELECTION_ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(SelectionContentTableMap::CONTENT_ID, $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 ChildSelectionContentQuery 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(SelectionContentTableMap::SELECTION_ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(SelectionContentTableMap::CONTENT_ID, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$this->addOr($cton0);
}
return $this;
}
/**
* Filter the query on the selection_id column
*
* Example usage:
* <code>
* $query->filterBySelectionId(1234); // WHERE selection_id = 1234
* $query->filterBySelectionId(array(12, 34)); // WHERE selection_id IN (12, 34)
* $query->filterBySelectionId(array('min' => 12)); // WHERE selection_id > 12
* </code>
*
* @see filterBySelection()
*
* @param mixed $selectionId 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 ChildSelectionContentQuery The current query, for fluid interface
*/
public function filterBySelectionId($selectionId = null, $comparison = null)
{
if (is_array($selectionId)) {
$useMinMax = false;
if (isset($selectionId['min'])) {
$this->addUsingAlias(SelectionContentTableMap::SELECTION_ID, $selectionId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($selectionId['max'])) {
$this->addUsingAlias(SelectionContentTableMap::SELECTION_ID, $selectionId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContentTableMap::SELECTION_ID, $selectionId, $comparison);
}
/**
* Filter the query on the content_id column
*
* Example usage:
* <code>
* $query->filterByContentId(1234); // WHERE content_id = 1234
* $query->filterByContentId(array(12, 34)); // WHERE content_id IN (12, 34)
* $query->filterByContentId(array('min' => 12)); // WHERE content_id > 12
* </code>
*
* @see filterByContent()
*
* @param mixed $contentId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function filterByContentId($contentId = null, $comparison = null)
{
if (is_array($contentId)) {
$useMinMax = false;
if (isset($contentId['min'])) {
$this->addUsingAlias(SelectionContentTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($contentId['max'])) {
$this->addUsingAlias(SelectionContentTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContentTableMap::CONTENT_ID, $contentId, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContentQuery 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(SelectionContentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(SelectionContentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContentTableMap::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 ChildSelectionContentQuery 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(SelectionContentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(SelectionContentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContentTableMap::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 ChildSelectionContentQuery 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(SelectionContentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(SelectionContentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionContentTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Content object
*
* @param \Thelia\Model\Content|ObjectCollection $content The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function filterByContent($content, $comparison = null)
{
if ($content instanceof \Thelia\Model\Content) {
return $this
->addUsingAlias(SelectionContentTableMap::CONTENT_ID, $content->getId(), $comparison);
} elseif ($content instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionContentTableMap::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByContent() only accepts arguments of type \Thelia\Model\Content or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Content relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function joinContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Content');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Content');
}
return $this;
}
/**
* Use the Content relation Content object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\ContentQuery A secondary query class using the current class as primary query
*/
public function useContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Content', '\Thelia\Model\ContentQuery');
}
/**
* Filter the query by a related \Selection\Model\Selection object
*
* @param \Selection\Model\Selection|ObjectCollection $selection The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function filterBySelection($selection, $comparison = null)
{
if ($selection instanceof \Selection\Model\Selection) {
return $this
->addUsingAlias(SelectionContentTableMap::SELECTION_ID, $selection->getId(), $comparison);
} elseif ($selection instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionContentTableMap::SELECTION_ID, $selection->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelection() only accepts arguments of type \Selection\Model\Selection or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Selection relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function joinSelection($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Selection');
// 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, 'Selection');
}
return $this;
}
/**
* Use the Selection relation Selection 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 \Selection\Model\SelectionQuery A secondary query class using the current class as primary query
*/
public function useSelectionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSelection($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Selection', '\Selection\Model\SelectionQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionContent $selectionContent Object to remove from the list of results
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function prune($selectionContent = null)
{
if ($selectionContent) {
$this->addCond('pruneCond0', $this->getAliasedColName(SelectionContentTableMap::SELECTION_ID), $selectionContent->getSelectionId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(SelectionContentTableMap::CONTENT_ID), $selectionContent->getContentId(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the selection_content table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(SelectionContentTableMap::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).
SelectionContentTableMap::clearInstancePool();
SelectionContentTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionContent or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionContent 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(SelectionContentTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionContentTableMap::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();
SelectionContentTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionContentTableMap::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 ChildSelectionContentQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(SelectionContentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(SelectionContentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionContentTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionContentTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionContentTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildSelectionContentQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionContentTableMap::CREATED_AT);
}
} // SelectionContentQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,706 @@
<?php
namespace Selection\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 Selection\Model\SelectionI18n as ChildSelectionI18n;
use Selection\Model\SelectionI18nQuery as ChildSelectionI18nQuery;
use Selection\Model\Map\SelectionI18nTableMap;
/**
* Base class that represents a query for the 'selection_i18n' table.
*
*
*
* @method ChildSelectionI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSelectionI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildSelectionI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildSelectionI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildSelectionI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildSelectionI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
* @method ChildSelectionI18nQuery orderByMetaTitle($order = Criteria::ASC) Order by the meta_title column
* @method ChildSelectionI18nQuery orderByMetaDescription($order = Criteria::ASC) Order by the meta_description column
* @method ChildSelectionI18nQuery orderByMetaKeywords($order = Criteria::ASC) Order by the meta_keywords column
*
* @method ChildSelectionI18nQuery groupById() Group by the id column
* @method ChildSelectionI18nQuery groupByLocale() Group by the locale column
* @method ChildSelectionI18nQuery groupByTitle() Group by the title column
* @method ChildSelectionI18nQuery groupByDescription() Group by the description column
* @method ChildSelectionI18nQuery groupByChapo() Group by the chapo column
* @method ChildSelectionI18nQuery groupByPostscriptum() Group by the postscriptum column
* @method ChildSelectionI18nQuery groupByMetaTitle() Group by the meta_title column
* @method ChildSelectionI18nQuery groupByMetaDescription() Group by the meta_description column
* @method ChildSelectionI18nQuery groupByMetaKeywords() Group by the meta_keywords column
*
* @method ChildSelectionI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionI18nQuery leftJoinSelection($relationAlias = null) Adds a LEFT JOIN clause to the query using the Selection relation
* @method ChildSelectionI18nQuery rightJoinSelection($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Selection relation
* @method ChildSelectionI18nQuery innerJoinSelection($relationAlias = null) Adds a INNER JOIN clause to the query using the Selection relation
*
* @method ChildSelectionI18n findOne(ConnectionInterface $con = null) Return the first ChildSelectionI18n matching the query
* @method ChildSelectionI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionI18n matching the query, or a new ChildSelectionI18n object populated from the query conditions when no match is found
*
* @method ChildSelectionI18n findOneById(int $id) Return the first ChildSelectionI18n filtered by the id column
* @method ChildSelectionI18n findOneByLocale(string $locale) Return the first ChildSelectionI18n filtered by the locale column
* @method ChildSelectionI18n findOneByTitle(string $title) Return the first ChildSelectionI18n filtered by the title column
* @method ChildSelectionI18n findOneByDescription(string $description) Return the first ChildSelectionI18n filtered by the description column
* @method ChildSelectionI18n findOneByChapo(string $chapo) Return the first ChildSelectionI18n filtered by the chapo column
* @method ChildSelectionI18n findOneByPostscriptum(string $postscriptum) Return the first ChildSelectionI18n filtered by the postscriptum column
* @method ChildSelectionI18n findOneByMetaTitle(string $meta_title) Return the first ChildSelectionI18n filtered by the meta_title column
* @method ChildSelectionI18n findOneByMetaDescription(string $meta_description) Return the first ChildSelectionI18n filtered by the meta_description column
* @method ChildSelectionI18n findOneByMetaKeywords(string $meta_keywords) Return the first ChildSelectionI18n filtered by the meta_keywords column
*
* @method array findById(int $id) Return ChildSelectionI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildSelectionI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildSelectionI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildSelectionI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildSelectionI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildSelectionI18n objects filtered by the postscriptum column
* @method array findByMetaTitle(string $meta_title) Return ChildSelectionI18n objects filtered by the meta_title column
* @method array findByMetaDescription(string $meta_description) Return ChildSelectionI18n objects filtered by the meta_description column
* @method array findByMetaKeywords(string $meta_keywords) Return ChildSelectionI18n objects filtered by the meta_keywords column
*
*/
abstract class SelectionI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionI18nQuery 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 = '\\Selection\\Model\\SelectionI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionI18nQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionI18nQuery();
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 ChildSelectionI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionI18nTableMap::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(SelectionI18nTableMap::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 ChildSelectionI18n 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 selection_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 ChildSelectionI18n();
$obj->hydrate($row);
SelectionI18nTableMap::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 ChildSelectionI18n|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 ChildSelectionI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(SelectionI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(SelectionI18nTableMap::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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(SelectionI18nTableMap::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 filterBySelection()
*
* @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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SelectionI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionI18nTableMap::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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::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 ChildSelectionI18nQuery 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(SelectionI18nTableMap::META_KEYWORDS, $metaKeywords, $comparison);
}
/**
* Filter the query by a related \Selection\Model\Selection object
*
* @param \Selection\Model\Selection|ObjectCollection $selection The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionI18nQuery The current query, for fluid interface
*/
public function filterBySelection($selection, $comparison = null)
{
if ($selection instanceof \Selection\Model\Selection) {
return $this
->addUsingAlias(SelectionI18nTableMap::ID, $selection->getId(), $comparison);
} elseif ($selection instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionI18nTableMap::ID, $selection->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelection() only accepts arguments of type \Selection\Model\Selection or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Selection relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionI18nQuery The current query, for fluid interface
*/
public function joinSelection($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Selection');
// 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, 'Selection');
}
return $this;
}
/**
* Use the Selection relation Selection 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 \Selection\Model\SelectionQuery A secondary query class using the current class as primary query
*/
public function useSelectionQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinSelection($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Selection', '\Selection\Model\SelectionQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionI18n $selectionI18n Object to remove from the list of results
*
* @return ChildSelectionI18nQuery The current query, for fluid interface
*/
public function prune($selectionI18n = null)
{
if ($selectionI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(SelectionI18nTableMap::ID), $selectionI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(SelectionI18nTableMap::LOCALE), $selectionI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the selection_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(SelectionI18nTableMap::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).
SelectionI18nTableMap::clearInstancePool();
SelectionI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionI18n 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(SelectionI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionI18nTableMap::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();
SelectionI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // SelectionI18nQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,607 @@
<?php
namespace Selection\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 Selection\Model\SelectionImageI18n as ChildSelectionImageI18n;
use Selection\Model\SelectionImageI18nQuery as ChildSelectionImageI18nQuery;
use Selection\Model\Map\SelectionImageI18nTableMap;
/**
* Base class that represents a query for the 'selection_image_i18n' table.
*
*
*
* @method ChildSelectionImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSelectionImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildSelectionImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildSelectionImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildSelectionImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildSelectionImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
*
* @method ChildSelectionImageI18nQuery groupById() Group by the id column
* @method ChildSelectionImageI18nQuery groupByLocale() Group by the locale column
* @method ChildSelectionImageI18nQuery groupByTitle() Group by the title column
* @method ChildSelectionImageI18nQuery groupByDescription() Group by the description column
* @method ChildSelectionImageI18nQuery groupByChapo() Group by the chapo column
* @method ChildSelectionImageI18nQuery groupByPostscriptum() Group by the postscriptum column
*
* @method ChildSelectionImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionImageI18nQuery leftJoinSelectionImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionImage relation
* @method ChildSelectionImageI18nQuery rightJoinSelectionImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionImage relation
* @method ChildSelectionImageI18nQuery innerJoinSelectionImage($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionImage relation
*
* @method ChildSelectionImageI18n findOne(ConnectionInterface $con = null) Return the first ChildSelectionImageI18n matching the query
* @method ChildSelectionImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionImageI18n matching the query, or a new ChildSelectionImageI18n object populated from the query conditions when no match is found
*
* @method ChildSelectionImageI18n findOneById(int $id) Return the first ChildSelectionImageI18n filtered by the id column
* @method ChildSelectionImageI18n findOneByLocale(string $locale) Return the first ChildSelectionImageI18n filtered by the locale column
* @method ChildSelectionImageI18n findOneByTitle(string $title) Return the first ChildSelectionImageI18n filtered by the title column
* @method ChildSelectionImageI18n findOneByDescription(string $description) Return the first ChildSelectionImageI18n filtered by the description column
* @method ChildSelectionImageI18n findOneByChapo(string $chapo) Return the first ChildSelectionImageI18n filtered by the chapo column
* @method ChildSelectionImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildSelectionImageI18n filtered by the postscriptum column
*
* @method array findById(int $id) Return ChildSelectionImageI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildSelectionImageI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildSelectionImageI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildSelectionImageI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildSelectionImageI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildSelectionImageI18n objects filtered by the postscriptum column
*
*/
abstract class SelectionImageI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionImageI18nQuery 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 = '\\Selection\\Model\\SelectionImageI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionImageI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionImageI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionImageI18nQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionImageI18nQuery();
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 ChildSelectionImageI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionImageI18nTableMap::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(SelectionImageI18nTableMap::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 ChildSelectionImageI18n 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 selection_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 ChildSelectionImageI18n();
$obj->hydrate($row);
SelectionImageI18nTableMap::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 ChildSelectionImageI18n|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 ChildSelectionImageI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(SelectionImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(SelectionImageI18nTableMap::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 ChildSelectionImageI18nQuery 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(SelectionImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(SelectionImageI18nTableMap::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 filterBySelectionImage()
*
* @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 ChildSelectionImageI18nQuery 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(SelectionImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SelectionImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionImageI18nTableMap::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 ChildSelectionImageI18nQuery 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(SelectionImageI18nTableMap::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 ChildSelectionImageI18nQuery 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(SelectionImageI18nTableMap::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 ChildSelectionImageI18nQuery 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(SelectionImageI18nTableMap::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 ChildSelectionImageI18nQuery 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(SelectionImageI18nTableMap::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 ChildSelectionImageI18nQuery 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(SelectionImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
}
/**
* Filter the query by a related \Selection\Model\SelectionImage object
*
* @param \Selection\Model\SelectionImage|ObjectCollection $selectionImage The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionImageI18nQuery The current query, for fluid interface
*/
public function filterBySelectionImage($selectionImage, $comparison = null)
{
if ($selectionImage instanceof \Selection\Model\SelectionImage) {
return $this
->addUsingAlias(SelectionImageI18nTableMap::ID, $selectionImage->getId(), $comparison);
} elseif ($selectionImage instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionImageI18nTableMap::ID, $selectionImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelectionImage() only accepts arguments of type \Selection\Model\SelectionImage or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionImage relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionImageI18nQuery The current query, for fluid interface
*/
public function joinSelectionImage($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionImage');
// 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, 'SelectionImage');
}
return $this;
}
/**
* Use the SelectionImage relation SelectionImage 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 \Selection\Model\SelectionImageQuery A secondary query class using the current class as primary query
*/
public function useSelectionImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinSelectionImage($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionImage', '\Selection\Model\SelectionImageQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionImageI18n $selectionImageI18n Object to remove from the list of results
*
* @return ChildSelectionImageI18nQuery The current query, for fluid interface
*/
public function prune($selectionImageI18n = null)
{
if ($selectionImageI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(SelectionImageI18nTableMap::ID), $selectionImageI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(SelectionImageI18nTableMap::LOCALE), $selectionImageI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the selection_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(SelectionImageI18nTableMap::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).
SelectionImageI18nTableMap::clearInstancePool();
SelectionImageI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionImageI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionImageI18n 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(SelectionImageI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionImageI18nTableMap::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();
SelectionImageI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionImageI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // SelectionImageI18nQuery

View File

@@ -0,0 +1,891 @@
<?php
namespace Selection\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 Selection\Model\SelectionImage as ChildSelectionImage;
use Selection\Model\SelectionImageI18nQuery as ChildSelectionImageI18nQuery;
use Selection\Model\SelectionImageQuery as ChildSelectionImageQuery;
use Selection\Model\Map\SelectionImageTableMap;
/**
* Base class that represents a query for the 'selection_image' table.
*
*
*
* @method ChildSelectionImageQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSelectionImageQuery orderBySelectionId($order = Criteria::ASC) Order by the selection_id column
* @method ChildSelectionImageQuery orderByFile($order = Criteria::ASC) Order by the file column
* @method ChildSelectionImageQuery orderByVisible($order = Criteria::ASC) Order by the visible column
* @method ChildSelectionImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildSelectionImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildSelectionImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildSelectionImageQuery groupById() Group by the id column
* @method ChildSelectionImageQuery groupBySelectionId() Group by the selection_id column
* @method ChildSelectionImageQuery groupByFile() Group by the file column
* @method ChildSelectionImageQuery groupByVisible() Group by the visible column
* @method ChildSelectionImageQuery groupByPosition() Group by the position column
* @method ChildSelectionImageQuery groupByCreatedAt() Group by the created_at column
* @method ChildSelectionImageQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildSelectionImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionImageQuery leftJoinSelection($relationAlias = null) Adds a LEFT JOIN clause to the query using the Selection relation
* @method ChildSelectionImageQuery rightJoinSelection($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Selection relation
* @method ChildSelectionImageQuery innerJoinSelection($relationAlias = null) Adds a INNER JOIN clause to the query using the Selection relation
*
* @method ChildSelectionImageQuery leftJoinSelectionImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the SelectionImageI18n relation
* @method ChildSelectionImageQuery rightJoinSelectionImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SelectionImageI18n relation
* @method ChildSelectionImageQuery innerJoinSelectionImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the SelectionImageI18n relation
*
* @method ChildSelectionImage findOne(ConnectionInterface $con = null) Return the first ChildSelectionImage matching the query
* @method ChildSelectionImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionImage matching the query, or a new ChildSelectionImage object populated from the query conditions when no match is found
*
* @method ChildSelectionImage findOneById(int $id) Return the first ChildSelectionImage filtered by the id column
* @method ChildSelectionImage findOneBySelectionId(int $selection_id) Return the first ChildSelectionImage filtered by the selection_id column
* @method ChildSelectionImage findOneByFile(string $file) Return the first ChildSelectionImage filtered by the file column
* @method ChildSelectionImage findOneByVisible(int $visible) Return the first ChildSelectionImage filtered by the visible column
* @method ChildSelectionImage findOneByPosition(int $position) Return the first ChildSelectionImage filtered by the position column
* @method ChildSelectionImage findOneByCreatedAt(string $created_at) Return the first ChildSelectionImage filtered by the created_at column
* @method ChildSelectionImage findOneByUpdatedAt(string $updated_at) Return the first ChildSelectionImage filtered by the updated_at column
*
* @method array findById(int $id) Return ChildSelectionImage objects filtered by the id column
* @method array findBySelectionId(int $selection_id) Return ChildSelectionImage objects filtered by the selection_id column
* @method array findByFile(string $file) Return ChildSelectionImage objects filtered by the file column
* @method array findByVisible(int $visible) Return ChildSelectionImage objects filtered by the visible column
* @method array findByPosition(int $position) Return ChildSelectionImage objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildSelectionImage objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildSelectionImage objects filtered by the updated_at column
*
*/
abstract class SelectionImageQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionImageQuery 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 = '\\Selection\\Model\\SelectionImage', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionImageQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionImageQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionImageQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionImageQuery();
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 ChildSelectionImage|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SelectionImageTableMap::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 ChildSelectionImage A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, SELECTION_ID, FILE, VISIBLE, POSITION, CREATED_AT, UPDATED_AT FROM selection_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 ChildSelectionImage();
$obj->hydrate($row);
SelectionImageTableMap::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 ChildSelectionImage|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 ChildSelectionImageQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SelectionImageTableMap::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 ChildSelectionImageQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SelectionImageTableMap::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 ChildSelectionImageQuery 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(SelectionImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SelectionImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionImageTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the selection_id column
*
* Example usage:
* <code>
* $query->filterBySelectionId(1234); // WHERE selection_id = 1234
* $query->filterBySelectionId(array(12, 34)); // WHERE selection_id IN (12, 34)
* $query->filterBySelectionId(array('min' => 12)); // WHERE selection_id > 12
* </code>
*
* @see filterBySelection()
*
* @param mixed $selectionId 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 ChildSelectionImageQuery The current query, for fluid interface
*/
public function filterBySelectionId($selectionId = null, $comparison = null)
{
if (is_array($selectionId)) {
$useMinMax = false;
if (isset($selectionId['min'])) {
$this->addUsingAlias(SelectionImageTableMap::SELECTION_ID, $selectionId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($selectionId['max'])) {
$this->addUsingAlias(SelectionImageTableMap::SELECTION_ID, $selectionId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionImageTableMap::SELECTION_ID, $selectionId, $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 ChildSelectionImageQuery 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(SelectionImageTableMap::FILE, $file, $comparison);
}
/**
* Filter the query on the visible column
*
* Example usage:
* <code>
* $query->filterByVisible(1234); // WHERE visible = 1234
* $query->filterByVisible(array(12, 34)); // WHERE visible IN (12, 34)
* $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
* </code>
*
* @param mixed $visible 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 ChildSelectionImageQuery The current query, for fluid interface
*/
public function filterByVisible($visible = null, $comparison = null)
{
if (is_array($visible)) {
$useMinMax = false;
if (isset($visible['min'])) {
$this->addUsingAlias(SelectionImageTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($visible['max'])) {
$this->addUsingAlias(SelectionImageTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionImageTableMap::VISIBLE, $visible, $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 ChildSelectionImageQuery 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(SelectionImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(SelectionImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionImageTableMap::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 ChildSelectionImageQuery 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(SelectionImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(SelectionImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionImageTableMap::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 ChildSelectionImageQuery 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(SelectionImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(SelectionImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionImageTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Selection\Model\Selection object
*
* @param \Selection\Model\Selection|ObjectCollection $selection The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function filterBySelection($selection, $comparison = null)
{
if ($selection instanceof \Selection\Model\Selection) {
return $this
->addUsingAlias(SelectionImageTableMap::SELECTION_ID, $selection->getId(), $comparison);
} elseif ($selection instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionImageTableMap::SELECTION_ID, $selection->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelection() only accepts arguments of type \Selection\Model\Selection or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Selection relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function joinSelection($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Selection');
// 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, 'Selection');
}
return $this;
}
/**
* Use the Selection relation Selection 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 \Selection\Model\SelectionQuery A secondary query class using the current class as primary query
*/
public function useSelectionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSelection($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Selection', '\Selection\Model\SelectionQuery');
}
/**
* Filter the query by a related \Selection\Model\SelectionImageI18n object
*
* @param \Selection\Model\SelectionImageI18n|ObjectCollection $selectionImageI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function filterBySelectionImageI18n($selectionImageI18n, $comparison = null)
{
if ($selectionImageI18n instanceof \Selection\Model\SelectionImageI18n) {
return $this
->addUsingAlias(SelectionImageTableMap::ID, $selectionImageI18n->getId(), $comparison);
} elseif ($selectionImageI18n instanceof ObjectCollection) {
return $this
->useSelectionImageI18nQuery()
->filterByPrimaryKeys($selectionImageI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySelectionImageI18n() only accepts arguments of type \Selection\Model\SelectionImageI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SelectionImageI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function joinSelectionImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SelectionImageI18n');
// 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, 'SelectionImageI18n');
}
return $this;
}
/**
* Use the SelectionImageI18n relation SelectionImageI18n 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 \Selection\Model\SelectionImageI18nQuery A secondary query class using the current class as primary query
*/
public function useSelectionImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinSelectionImageI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SelectionImageI18n', '\Selection\Model\SelectionImageI18nQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionImage $selectionImage Object to remove from the list of results
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function prune($selectionImage = null)
{
if ($selectionImage) {
$this->addUsingAlias(SelectionImageTableMap::ID, $selectionImage->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the selection_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(SelectionImageTableMap::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).
SelectionImageTableMap::clearInstancePool();
SelectionImageTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionImage or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionImage 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(SelectionImageTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionImageTableMap::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();
SelectionImageTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionImageTableMap::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 ChildSelectionImageQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(SelectionImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(SelectionImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionImageTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionImageTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionImageTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildSelectionImageQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionImageTableMap::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 ChildSelectionImageQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'SelectionImageI18n';
return $this
->joinSelectionImageI18n($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 ChildSelectionImageQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('SelectionImageI18n');
$this->with['SelectionImageI18n']->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 ChildSelectionImageI18nQuery 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 : 'SelectionImageI18n', '\Selection\Model\SelectionImageI18nQuery');
}
} // SelectionImageQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,774 @@
<?php
namespace Selection\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 Selection\Model\SelectionProduct as ChildSelectionProduct;
use Selection\Model\SelectionProductQuery as ChildSelectionProductQuery;
use Selection\Model\Map\SelectionProductTableMap;
use Thelia\Model\Product;
/**
* Base class that represents a query for the 'selection_product' table.
*
*
*
* @method ChildSelectionProductQuery orderBySelectionId($order = Criteria::ASC) Order by the selection_id column
* @method ChildSelectionProductQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
* @method ChildSelectionProductQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildSelectionProductQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildSelectionProductQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildSelectionProductQuery groupBySelectionId() Group by the selection_id column
* @method ChildSelectionProductQuery groupByProductId() Group by the product_id column
* @method ChildSelectionProductQuery groupByPosition() Group by the position column
* @method ChildSelectionProductQuery groupByCreatedAt() Group by the created_at column
* @method ChildSelectionProductQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildSelectionProductQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSelectionProductQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSelectionProductQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSelectionProductQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
* @method ChildSelectionProductQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
* @method ChildSelectionProductQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
*
* @method ChildSelectionProductQuery leftJoinSelection($relationAlias = null) Adds a LEFT JOIN clause to the query using the Selection relation
* @method ChildSelectionProductQuery rightJoinSelection($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Selection relation
* @method ChildSelectionProductQuery innerJoinSelection($relationAlias = null) Adds a INNER JOIN clause to the query using the Selection relation
*
* @method ChildSelectionProduct findOne(ConnectionInterface $con = null) Return the first ChildSelectionProduct matching the query
* @method ChildSelectionProduct findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSelectionProduct matching the query, or a new ChildSelectionProduct object populated from the query conditions when no match is found
*
* @method ChildSelectionProduct findOneBySelectionId(int $selection_id) Return the first ChildSelectionProduct filtered by the selection_id column
* @method ChildSelectionProduct findOneByProductId(int $product_id) Return the first ChildSelectionProduct filtered by the product_id column
* @method ChildSelectionProduct findOneByPosition(int $position) Return the first ChildSelectionProduct filtered by the position column
* @method ChildSelectionProduct findOneByCreatedAt(string $created_at) Return the first ChildSelectionProduct filtered by the created_at column
* @method ChildSelectionProduct findOneByUpdatedAt(string $updated_at) Return the first ChildSelectionProduct filtered by the updated_at column
*
* @method array findBySelectionId(int $selection_id) Return ChildSelectionProduct objects filtered by the selection_id column
* @method array findByProductId(int $product_id) Return ChildSelectionProduct objects filtered by the product_id column
* @method array findByPosition(int $position) Return ChildSelectionProduct objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildSelectionProduct objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildSelectionProduct objects filtered by the updated_at column
*
*/
abstract class SelectionProductQuery extends ModelCriteria
{
/**
* Initializes internal state of \Selection\Model\Base\SelectionProductQuery 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 = '\\Selection\\Model\\SelectionProduct', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSelectionProductQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSelectionProductQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Selection\Model\SelectionProductQuery) {
return $criteria;
}
$query = new \Selection\Model\SelectionProductQuery();
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[$selection_id, $product_id] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildSelectionProduct|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SelectionProductTableMap::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(SelectionProductTableMap::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 ChildSelectionProduct A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT SELECTION_ID, PRODUCT_ID, POSITION, CREATED_AT, UPDATED_AT FROM selection_product WHERE SELECTION_ID = :p0 AND PRODUCT_ID = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], 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 ChildSelectionProduct();
$obj->hydrate($row);
SelectionProductTableMap::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 ChildSelectionProduct|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 ChildSelectionProductQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(SelectionProductTableMap::SELECTION_ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(SelectionProductTableMap::PRODUCT_ID, $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 ChildSelectionProductQuery 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(SelectionProductTableMap::SELECTION_ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(SelectionProductTableMap::PRODUCT_ID, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$this->addOr($cton0);
}
return $this;
}
/**
* Filter the query on the selection_id column
*
* Example usage:
* <code>
* $query->filterBySelectionId(1234); // WHERE selection_id = 1234
* $query->filterBySelectionId(array(12, 34)); // WHERE selection_id IN (12, 34)
* $query->filterBySelectionId(array('min' => 12)); // WHERE selection_id > 12
* </code>
*
* @see filterBySelection()
*
* @param mixed $selectionId 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 ChildSelectionProductQuery The current query, for fluid interface
*/
public function filterBySelectionId($selectionId = null, $comparison = null)
{
if (is_array($selectionId)) {
$useMinMax = false;
if (isset($selectionId['min'])) {
$this->addUsingAlias(SelectionProductTableMap::SELECTION_ID, $selectionId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($selectionId['max'])) {
$this->addUsingAlias(SelectionProductTableMap::SELECTION_ID, $selectionId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionProductTableMap::SELECTION_ID, $selectionId, $comparison);
}
/**
* Filter the query on the product_id column
*
* Example usage:
* <code>
* $query->filterByProductId(1234); // WHERE product_id = 1234
* $query->filterByProductId(array(12, 34)); // WHERE product_id IN (12, 34)
* $query->filterByProductId(array('min' => 12)); // WHERE product_id > 12
* </code>
*
* @see filterByProduct()
*
* @param mixed $productId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function filterByProductId($productId = null, $comparison = null)
{
if (is_array($productId)) {
$useMinMax = false;
if (isset($productId['min'])) {
$this->addUsingAlias(SelectionProductTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($productId['max'])) {
$this->addUsingAlias(SelectionProductTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionProductTableMap::PRODUCT_ID, $productId, $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 ChildSelectionProductQuery 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(SelectionProductTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(SelectionProductTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionProductTableMap::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 ChildSelectionProductQuery 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(SelectionProductTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(SelectionProductTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionProductTableMap::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 ChildSelectionProductQuery 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(SelectionProductTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(SelectionProductTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SelectionProductTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Product object
*
* @param \Thelia\Model\Product|ObjectCollection $product The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function filterByProduct($product, $comparison = null)
{
if ($product instanceof \Thelia\Model\Product) {
return $this
->addUsingAlias(SelectionProductTableMap::PRODUCT_ID, $product->getId(), $comparison);
} elseif ($product instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionProductTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByProduct() only accepts arguments of type \Thelia\Model\Product or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Product relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function joinProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Product');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Product');
}
return $this;
}
/**
* Use the Product relation Product object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\ProductQuery A secondary query class using the current class as primary query
*/
public function useProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinProduct($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Product', '\Thelia\Model\ProductQuery');
}
/**
* Filter the query by a related \Selection\Model\Selection object
*
* @param \Selection\Model\Selection|ObjectCollection $selection The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function filterBySelection($selection, $comparison = null)
{
if ($selection instanceof \Selection\Model\Selection) {
return $this
->addUsingAlias(SelectionProductTableMap::SELECTION_ID, $selection->getId(), $comparison);
} elseif ($selection instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SelectionProductTableMap::SELECTION_ID, $selection->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySelection() only accepts arguments of type \Selection\Model\Selection or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Selection relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function joinSelection($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Selection');
// 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, 'Selection');
}
return $this;
}
/**
* Use the Selection relation Selection 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 \Selection\Model\SelectionQuery A secondary query class using the current class as primary query
*/
public function useSelectionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSelection($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Selection', '\Selection\Model\SelectionQuery');
}
/**
* Exclude object from result
*
* @param ChildSelectionProduct $selectionProduct Object to remove from the list of results
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function prune($selectionProduct = null)
{
if ($selectionProduct) {
$this->addCond('pruneCond0', $this->getAliasedColName(SelectionProductTableMap::SELECTION_ID), $selectionProduct->getSelectionId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(SelectionProductTableMap::PRODUCT_ID), $selectionProduct->getProductId(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the selection_product 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(SelectionProductTableMap::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).
SelectionProductTableMap::clearInstancePool();
SelectionProductTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSelectionProduct or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSelectionProduct 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(SelectionProductTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SelectionProductTableMap::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();
SelectionProductTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SelectionProductTableMap::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 ChildSelectionProductQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(SelectionProductTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(SelectionProductTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionProductTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionProductTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(SelectionProductTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildSelectionProductQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(SelectionProductTableMap::CREATED_AT);
}
} // SelectionProductQuery

File diff suppressed because it is too large Load Diff