new image and document management
This commit is contained in:
File diff suppressed because it is too large
Load Diff
1990
core/lib/Thelia/Model/Base/CategoryDocument.php
Normal file
1990
core/lib/Thelia/Model/Base/CategoryDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/CategoryDocumentI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/CategoryDocumentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/CategoryDocumentI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/CategoryDocumentI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\CategoryDocumentI18n as ChildCategoryDocumentI18n;
|
||||
use Thelia\Model\CategoryDocumentI18nQuery as ChildCategoryDocumentI18nQuery;
|
||||
use Thelia\Model\Map\CategoryDocumentI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'category_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildCategoryDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildCategoryDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildCategoryDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildCategoryDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildCategoryDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCategoryDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildCategoryDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildCategoryDocumentI18nQuery leftJoinCategoryDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryDocument relation
|
||||
* @method ChildCategoryDocumentI18nQuery rightJoinCategoryDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryDocument relation
|
||||
* @method ChildCategoryDocumentI18nQuery innerJoinCategoryDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryDocument relation
|
||||
*
|
||||
* @method ChildCategoryDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildCategoryDocumentI18n matching the query
|
||||
* @method ChildCategoryDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryDocumentI18n matching the query, or a new ChildCategoryDocumentI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildCategoryDocumentI18n findOneById(int $id) Return the first ChildCategoryDocumentI18n filtered by the id column
|
||||
* @method ChildCategoryDocumentI18n findOneByLocale(string $locale) Return the first ChildCategoryDocumentI18n filtered by the locale column
|
||||
* @method ChildCategoryDocumentI18n findOneByTitle(string $title) Return the first ChildCategoryDocumentI18n filtered by the title column
|
||||
* @method ChildCategoryDocumentI18n findOneByDescription(string $description) Return the first ChildCategoryDocumentI18n filtered by the description column
|
||||
* @method ChildCategoryDocumentI18n findOneByChapo(string $chapo) Return the first ChildCategoryDocumentI18n filtered by the chapo column
|
||||
* @method ChildCategoryDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildCategoryDocumentI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCategoryDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildCategoryDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildCategoryDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildCategoryDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildCategoryDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildCategoryDocumentI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class CategoryDocumentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\CategoryDocumentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildCategoryDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\CategoryDocumentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\CategoryDocumentI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildCategoryDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = CategoryDocumentI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(CategoryDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildCategoryDocumentI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM category_document_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildCategoryDocumentI18n();
|
||||
$obj->hydrate($row);
|
||||
CategoryDocumentI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildCategoryDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(CategoryDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryDocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
if (empty($keys)) {
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(CategoryDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(CategoryDocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCategoryDocument()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(CategoryDocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the locale column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
|
||||
* $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $locale The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($locale)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $locale)) {
|
||||
$locale = str_replace('*', '%', $locale);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryDocument object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryDocument|ObjectCollection $categoryDocument The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryDocument($categoryDocument, $comparison = null)
|
||||
{
|
||||
if ($categoryDocument instanceof \Thelia\Model\CategoryDocument) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentI18nTableMap::ID, $categoryDocument->getId(), $comparison);
|
||||
} elseif ($categoryDocument instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentI18nTableMap::ID, $categoryDocument->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryDocument() only accepts arguments of type \Thelia\Model\CategoryDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryDocument');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CategoryDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryDocument relation CategoryDocument object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CategoryDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinCategoryDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryDocument', '\Thelia\Model\CategoryDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildCategoryDocumentI18n $categoryDocumentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryDocumentI18n = null)
|
||||
{
|
||||
if ($categoryDocumentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(CategoryDocumentI18nTableMap::ID), $categoryDocumentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(CategoryDocumentI18nTableMap::LOCALE), $categoryDocumentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_document_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
CategoryDocumentI18nTableMap::clearInstancePool();
|
||||
CategoryDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildCategoryDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildCategoryDocumentI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(CategoryDocumentI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
CategoryDocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
CategoryDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // CategoryDocumentI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/CategoryDocumentQuery.php
Normal file
846
core/lib/Thelia/Model/Base/CategoryDocumentQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\CategoryDocument as ChildCategoryDocument;
|
||||
use Thelia\Model\CategoryDocumentI18nQuery as ChildCategoryDocumentI18nQuery;
|
||||
use Thelia\Model\CategoryDocumentQuery as ChildCategoryDocumentQuery;
|
||||
use Thelia\Model\Map\CategoryDocumentTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'category_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCategoryDocumentQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
|
||||
* @method ChildCategoryDocumentQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildCategoryDocumentQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildCategoryDocumentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCategoryDocumentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery groupById() Group by the id column
|
||||
* @method ChildCategoryDocumentQuery groupByCategoryId() Group by the category_id column
|
||||
* @method ChildCategoryDocumentQuery groupByFile() Group by the file column
|
||||
* @method ChildCategoryDocumentQuery groupByPosition() Group by the position column
|
||||
* @method ChildCategoryDocumentQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCategoryDocumentQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCategoryDocumentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildCategoryDocumentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
|
||||
* @method ChildCategoryDocumentQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
|
||||
* @method ChildCategoryDocumentQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
|
||||
*
|
||||
* @method ChildCategoryDocumentQuery leftJoinCategoryDocumentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryDocumentI18n relation
|
||||
* @method ChildCategoryDocumentQuery rightJoinCategoryDocumentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryDocumentI18n relation
|
||||
* @method ChildCategoryDocumentQuery innerJoinCategoryDocumentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryDocumentI18n relation
|
||||
*
|
||||
* @method ChildCategoryDocument findOne(ConnectionInterface $con = null) Return the first ChildCategoryDocument matching the query
|
||||
* @method ChildCategoryDocument findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryDocument matching the query, or a new ChildCategoryDocument object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildCategoryDocument findOneById(int $id) Return the first ChildCategoryDocument filtered by the id column
|
||||
* @method ChildCategoryDocument findOneByCategoryId(int $category_id) Return the first ChildCategoryDocument filtered by the category_id column
|
||||
* @method ChildCategoryDocument findOneByFile(string $file) Return the first ChildCategoryDocument filtered by the file column
|
||||
* @method ChildCategoryDocument findOneByPosition(int $position) Return the first ChildCategoryDocument filtered by the position column
|
||||
* @method ChildCategoryDocument findOneByCreatedAt(string $created_at) Return the first ChildCategoryDocument filtered by the created_at column
|
||||
* @method ChildCategoryDocument findOneByUpdatedAt(string $updated_at) Return the first ChildCategoryDocument filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCategoryDocument objects filtered by the id column
|
||||
* @method array findByCategoryId(int $category_id) Return ChildCategoryDocument objects filtered by the category_id column
|
||||
* @method array findByFile(string $file) Return ChildCategoryDocument objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildCategoryDocument objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCategoryDocument objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCategoryDocument objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class CategoryDocumentQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryDocumentQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\CategoryDocument', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildCategoryDocumentQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\CategoryDocumentQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\CategoryDocumentQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildCategoryDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = CategoryDocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(CategoryDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildCategoryDocument A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CATEGORY_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM category_document WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildCategoryDocument();
|
||||
$obj->hydrate($row);
|
||||
CategoryDocumentTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildCategoryDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the category_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCategoryId(1234); // WHERE category_id = 1234
|
||||
* $query->filterByCategoryId(array(12, 34)); // WHERE category_id IN (12, 34)
|
||||
* $query->filterByCategoryId(array('min' => 12)); // WHERE category_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCategory()
|
||||
*
|
||||
* @param mixed $categoryId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryId($categoryId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($categoryId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($categoryId['min'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($categoryId['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::CATEGORY_ID, $categoryId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::FILE, $file, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $createdAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCreatedAt($createdAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($createdAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($createdAt['min'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $updatedAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($updatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($updatedAt['min'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Category object
|
||||
*
|
||||
* @param \Thelia\Model\Category|ObjectCollection $category The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategory($category, $comparison = null)
|
||||
{
|
||||
if ($category instanceof \Thelia\Model\Category) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentTableMap::CATEGORY_ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentTableMap::CATEGORY_ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type \Thelia\Model\Category or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Category relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Category');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Category');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Category relation Category object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CategoryQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCategory($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Category', '\Thelia\Model\CategoryQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryDocumentI18n object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryDocumentI18n|ObjectCollection $categoryDocumentI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryDocumentI18n($categoryDocumentI18n, $comparison = null)
|
||||
{
|
||||
if ($categoryDocumentI18n instanceof \Thelia\Model\CategoryDocumentI18n) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryDocumentTableMap::ID, $categoryDocumentI18n->getId(), $comparison);
|
||||
} elseif ($categoryDocumentI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useCategoryDocumentI18nQuery()
|
||||
->filterByPrimaryKeys($categoryDocumentI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryDocumentI18n() only accepts arguments of type \Thelia\Model\CategoryDocumentI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryDocumentI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryDocumentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryDocumentI18n');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CategoryDocumentI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryDocumentI18n relation CategoryDocumentI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CategoryDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryDocumentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinCategoryDocumentI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryDocumentI18n', '\Thelia\Model\CategoryDocumentI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildCategoryDocument $categoryDocument Object to remove from the list of results
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryDocument = null)
|
||||
{
|
||||
if ($categoryDocument) {
|
||||
$this->addUsingAlias(CategoryDocumentTableMap::ID, $categoryDocument->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_document table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
CategoryDocumentTableMap::clearInstancePool();
|
||||
CategoryDocumentTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildCategoryDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildCategoryDocument object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(CategoryDocumentTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
CategoryDocumentTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
CategoryDocumentTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// timestampable behavior
|
||||
|
||||
/**
|
||||
* Filter by the latest updated
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CategoryDocumentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CategoryDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CategoryDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CategoryDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CategoryDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'CategoryDocumentI18n';
|
||||
|
||||
return $this
|
||||
->joinCategoryDocumentI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('CategoryDocumentI18n');
|
||||
$this->with['CategoryDocumentI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryDocumentI18n', '\Thelia\Model\CategoryDocumentI18nQuery');
|
||||
}
|
||||
|
||||
} // CategoryDocumentQuery
|
||||
1990
core/lib/Thelia/Model/Base/CategoryImage.php
Normal file
1990
core/lib/Thelia/Model/Base/CategoryImage.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/CategoryImageI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/CategoryImageI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/CategoryImageI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/CategoryImageI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\CategoryImageI18n as ChildCategoryImageI18n;
|
||||
use Thelia\Model\CategoryImageI18nQuery as ChildCategoryImageI18nQuery;
|
||||
use Thelia\Model\Map\CategoryImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'category_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildCategoryImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCategoryImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildCategoryImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildCategoryImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildCategoryImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildCategoryImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildCategoryImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildCategoryImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildCategoryImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildCategoryImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildCategoryImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildCategoryImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildCategoryImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCategoryImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildCategoryImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildCategoryImageI18nQuery leftJoinCategoryImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryImage relation
|
||||
* @method ChildCategoryImageI18nQuery rightJoinCategoryImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryImage relation
|
||||
* @method ChildCategoryImageI18nQuery innerJoinCategoryImage($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryImage relation
|
||||
*
|
||||
* @method ChildCategoryImageI18n findOne(ConnectionInterface $con = null) Return the first ChildCategoryImageI18n matching the query
|
||||
* @method ChildCategoryImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryImageI18n matching the query, or a new ChildCategoryImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildCategoryImageI18n findOneById(int $id) Return the first ChildCategoryImageI18n filtered by the id column
|
||||
* @method ChildCategoryImageI18n findOneByLocale(string $locale) Return the first ChildCategoryImageI18n filtered by the locale column
|
||||
* @method ChildCategoryImageI18n findOneByTitle(string $title) Return the first ChildCategoryImageI18n filtered by the title column
|
||||
* @method ChildCategoryImageI18n findOneByDescription(string $description) Return the first ChildCategoryImageI18n filtered by the description column
|
||||
* @method ChildCategoryImageI18n findOneByChapo(string $chapo) Return the first ChildCategoryImageI18n filtered by the chapo column
|
||||
* @method ChildCategoryImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildCategoryImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCategoryImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildCategoryImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildCategoryImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildCategoryImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildCategoryImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildCategoryImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class CategoryImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryImageI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\CategoryImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildCategoryImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\CategoryImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\CategoryImageI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildCategoryImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = CategoryImageI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(CategoryImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildCategoryImageI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM category_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildCategoryImageI18n();
|
||||
$obj->hydrate($row);
|
||||
CategoryImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildCategoryImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(CategoryImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
if (empty($keys)) {
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(CategoryImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(CategoryImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCategoryImage()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(CategoryImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the locale column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
|
||||
* $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $locale The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($locale)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $locale)) {
|
||||
$locale = str_replace('*', '%', $locale);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryImage object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryImage|ObjectCollection $categoryImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryImage($categoryImage, $comparison = null)
|
||||
{
|
||||
if ($categoryImage instanceof \Thelia\Model\CategoryImage) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageI18nTableMap::ID, $categoryImage->getId(), $comparison);
|
||||
} elseif ($categoryImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageI18nTableMap::ID, $categoryImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryImage() only accepts arguments of type \Thelia\Model\CategoryImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CategoryImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryImage relation CategoryImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CategoryImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinCategoryImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryImage', '\Thelia\Model\CategoryImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildCategoryImageI18n $categoryImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryImageI18n = null)
|
||||
{
|
||||
if ($categoryImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(CategoryImageI18nTableMap::ID), $categoryImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(CategoryImageI18nTableMap::LOCALE), $categoryImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
CategoryImageI18nTableMap::clearInstancePool();
|
||||
CategoryImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildCategoryImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildCategoryImageI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(CategoryImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
CategoryImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
CategoryImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // CategoryImageI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/CategoryImageQuery.php
Normal file
846
core/lib/Thelia/Model/Base/CategoryImageQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\CategoryImage as ChildCategoryImage;
|
||||
use Thelia\Model\CategoryImageI18nQuery as ChildCategoryImageI18nQuery;
|
||||
use Thelia\Model\CategoryImageQuery as ChildCategoryImageQuery;
|
||||
use Thelia\Model\Map\CategoryImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'category_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildCategoryImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildCategoryImageQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
|
||||
* @method ChildCategoryImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildCategoryImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildCategoryImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCategoryImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildCategoryImageQuery groupById() Group by the id column
|
||||
* @method ChildCategoryImageQuery groupByCategoryId() Group by the category_id column
|
||||
* @method ChildCategoryImageQuery groupByFile() Group by the file column
|
||||
* @method ChildCategoryImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildCategoryImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCategoryImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildCategoryImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildCategoryImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildCategoryImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildCategoryImageQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
|
||||
* @method ChildCategoryImageQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
|
||||
* @method ChildCategoryImageQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
|
||||
*
|
||||
* @method ChildCategoryImageQuery leftJoinCategoryImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryImageI18n relation
|
||||
* @method ChildCategoryImageQuery rightJoinCategoryImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryImageI18n relation
|
||||
* @method ChildCategoryImageQuery innerJoinCategoryImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryImageI18n relation
|
||||
*
|
||||
* @method ChildCategoryImage findOne(ConnectionInterface $con = null) Return the first ChildCategoryImage matching the query
|
||||
* @method ChildCategoryImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryImage matching the query, or a new ChildCategoryImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildCategoryImage findOneById(int $id) Return the first ChildCategoryImage filtered by the id column
|
||||
* @method ChildCategoryImage findOneByCategoryId(int $category_id) Return the first ChildCategoryImage filtered by the category_id column
|
||||
* @method ChildCategoryImage findOneByFile(string $file) Return the first ChildCategoryImage filtered by the file column
|
||||
* @method ChildCategoryImage findOneByPosition(int $position) Return the first ChildCategoryImage filtered by the position column
|
||||
* @method ChildCategoryImage findOneByCreatedAt(string $created_at) Return the first ChildCategoryImage filtered by the created_at column
|
||||
* @method ChildCategoryImage findOneByUpdatedAt(string $updated_at) Return the first ChildCategoryImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildCategoryImage objects filtered by the id column
|
||||
* @method array findByCategoryId(int $category_id) Return ChildCategoryImage objects filtered by the category_id column
|
||||
* @method array findByFile(string $file) Return ChildCategoryImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildCategoryImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCategoryImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCategoryImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class CategoryImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryImageQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\CategoryImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildCategoryImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildCategoryImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\CategoryImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\CategoryImageQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildCategoryImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = CategoryImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(CategoryImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildCategoryImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CATEGORY_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM category_image WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildCategoryImage();
|
||||
$obj->hydrate($row);
|
||||
CategoryImageTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildCategoryImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the category_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCategoryId(1234); // WHERE category_id = 1234
|
||||
* $query->filterByCategoryId(array(12, 34)); // WHERE category_id IN (12, 34)
|
||||
* $query->filterByCategoryId(array('min' => 12)); // WHERE category_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCategory()
|
||||
*
|
||||
* @param mixed $categoryId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryId($categoryId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($categoryId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($categoryId['min'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($categoryId['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::CATEGORY_ID, $categoryId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::FILE, $file, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $createdAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCreatedAt($createdAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($createdAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($createdAt['min'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $updatedAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($updatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($updatedAt['min'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryImageTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Category object
|
||||
*
|
||||
* @param \Thelia\Model\Category|ObjectCollection $category The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategory($category, $comparison = null)
|
||||
{
|
||||
if ($category instanceof \Thelia\Model\Category) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageTableMap::CATEGORY_ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageTableMap::CATEGORY_ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type \Thelia\Model\Category or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Category relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Category');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Category');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Category relation Category object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CategoryQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCategory($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Category', '\Thelia\Model\CategoryQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryImageI18n|ObjectCollection $categoryImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryImageI18n($categoryImageI18n, $comparison = null)
|
||||
{
|
||||
if ($categoryImageI18n instanceof \Thelia\Model\CategoryImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryImageTableMap::ID, $categoryImageI18n->getId(), $comparison);
|
||||
} elseif ($categoryImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useCategoryImageI18nQuery()
|
||||
->filterByPrimaryKeys($categoryImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryImageI18n() only accepts arguments of type \Thelia\Model\CategoryImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryImageI18n');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CategoryImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryImageI18n relation CategoryImageI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CategoryImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinCategoryImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryImageI18n', '\Thelia\Model\CategoryImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildCategoryImage $categoryImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryImage = null)
|
||||
{
|
||||
if ($categoryImage) {
|
||||
$this->addUsingAlias(CategoryImageTableMap::ID, $categoryImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
CategoryImageTableMap::clearInstancePool();
|
||||
CategoryImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildCategoryImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildCategoryImage object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(CategoryImageTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
CategoryImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
CategoryImageTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// timestampable behavior
|
||||
|
||||
/**
|
||||
* Filter by the latest updated
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CategoryImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CategoryImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CategoryImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CategoryImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CategoryImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CategoryImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'CategoryImageI18n';
|
||||
|
||||
return $this
|
||||
->joinCategoryImageI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('CategoryImageI18n');
|
||||
$this->with['CategoryImageI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildCategoryImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryImageI18n', '\Thelia\Model\CategoryImageI18nQuery');
|
||||
}
|
||||
|
||||
} // CategoryImageQuery
|
||||
@@ -62,18 +62,18 @@ use Thelia\Model\Map\CategoryTableMap;
|
||||
* @method ChildCategoryQuery rightJoinContentAssoc($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentAssoc relation
|
||||
* @method ChildCategoryQuery innerJoinContentAssoc($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentAssoc relation
|
||||
*
|
||||
* @method ChildCategoryQuery leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildCategoryQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildCategoryQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @method ChildCategoryQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildCategoryQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildCategoryQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document relation
|
||||
*
|
||||
* @method ChildCategoryQuery leftJoinRewriting($relationAlias = null) Adds a LEFT JOIN clause to the query using the Rewriting relation
|
||||
* @method ChildCategoryQuery rightJoinRewriting($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Rewriting relation
|
||||
* @method ChildCategoryQuery innerJoinRewriting($relationAlias = null) Adds a INNER JOIN clause to the query using the Rewriting relation
|
||||
*
|
||||
* @method ChildCategoryQuery leftJoinCategoryImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryImage relation
|
||||
* @method ChildCategoryQuery rightJoinCategoryImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryImage relation
|
||||
* @method ChildCategoryQuery innerJoinCategoryImage($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryImage relation
|
||||
*
|
||||
* @method ChildCategoryQuery leftJoinCategoryDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryDocument relation
|
||||
* @method ChildCategoryQuery rightJoinCategoryDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryDocument relation
|
||||
* @method ChildCategoryQuery innerJoinCategoryDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryDocument relation
|
||||
*
|
||||
* @method ChildCategoryQuery leftJoinCategoryI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CategoryI18n relation
|
||||
* @method ChildCategoryQuery rightJoinCategoryI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CategoryI18n relation
|
||||
* @method ChildCategoryQuery innerJoinCategoryI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CategoryI18n relation
|
||||
@@ -943,152 +943,6 @@ abstract class CategoryQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentAssoc', '\Thelia\Model\ContentAssocQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByImage($image, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryTableMap::ID, $image->getCategoryId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useImageQuery()
|
||||
->filterByPrimaryKeys($image->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinImage($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Image');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDocument($document, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryTableMap::ID, $document->getCategoryId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useDocumentQuery()
|
||||
->filterByPrimaryKeys($document->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinDocument($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Document');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\DocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Rewriting object
|
||||
*
|
||||
@@ -1162,6 +1016,152 @@ abstract class CategoryQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'Rewriting', '\Thelia\Model\RewritingQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryImage object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryImage|ObjectCollection $categoryImage the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryImage($categoryImage, $comparison = null)
|
||||
{
|
||||
if ($categoryImage instanceof \Thelia\Model\CategoryImage) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryTableMap::ID, $categoryImage->getCategoryId(), $comparison);
|
||||
} elseif ($categoryImage instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useCategoryImageQuery()
|
||||
->filterByPrimaryKeys($categoryImage->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryImage() only accepts arguments of type \Thelia\Model\CategoryImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CategoryImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryImage relation CategoryImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CategoryImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCategoryImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryImage', '\Thelia\Model\CategoryImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryDocument object
|
||||
*
|
||||
* @param \Thelia\Model\CategoryDocument|ObjectCollection $categoryDocument the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategoryDocument($categoryDocument, $comparison = null)
|
||||
{
|
||||
if ($categoryDocument instanceof \Thelia\Model\CategoryDocument) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryTableMap::ID, $categoryDocument->getCategoryId(), $comparison);
|
||||
} elseif ($categoryDocument instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useCategoryDocumentQuery()
|
||||
->filterByPrimaryKeys($categoryDocument->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCategoryDocument() only accepts arguments of type \Thelia\Model\CategoryDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CategoryDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategoryDocument($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CategoryDocument');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CategoryDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CategoryDocument relation CategoryDocument object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\CategoryDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCategoryDocumentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCategoryDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CategoryDocument', '\Thelia\Model\CategoryDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\CategoryI18n object
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1990
core/lib/Thelia/Model/Base/ContentDocument.php
Normal file
1990
core/lib/Thelia/Model/Base/ContentDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/ContentDocumentI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/ContentDocumentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/ContentDocumentI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/ContentDocumentI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ContentDocumentI18n as ChildContentDocumentI18n;
|
||||
use Thelia\Model\ContentDocumentI18nQuery as ChildContentDocumentI18nQuery;
|
||||
use Thelia\Model\Map\ContentDocumentI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'content_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildContentDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildContentDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildContentDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildContentDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildContentDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildContentDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildContentDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildContentDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildContentDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildContentDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildContentDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildContentDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildContentDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildContentDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildContentDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildContentDocumentI18nQuery leftJoinContentDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentDocument relation
|
||||
* @method ChildContentDocumentI18nQuery rightJoinContentDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentDocument relation
|
||||
* @method ChildContentDocumentI18nQuery innerJoinContentDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentDocument relation
|
||||
*
|
||||
* @method ChildContentDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildContentDocumentI18n matching the query
|
||||
* @method ChildContentDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentDocumentI18n matching the query, or a new ChildContentDocumentI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildContentDocumentI18n findOneById(int $id) Return the first ChildContentDocumentI18n filtered by the id column
|
||||
* @method ChildContentDocumentI18n findOneByLocale(string $locale) Return the first ChildContentDocumentI18n filtered by the locale column
|
||||
* @method ChildContentDocumentI18n findOneByTitle(string $title) Return the first ChildContentDocumentI18n filtered by the title column
|
||||
* @method ChildContentDocumentI18n findOneByDescription(string $description) Return the first ChildContentDocumentI18n filtered by the description column
|
||||
* @method ChildContentDocumentI18n findOneByChapo(string $chapo) Return the first ChildContentDocumentI18n filtered by the chapo column
|
||||
* @method ChildContentDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildContentDocumentI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildContentDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildContentDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildContentDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildContentDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildContentDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildContentDocumentI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class ContentDocumentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ContentDocumentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildContentDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ContentDocumentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ContentDocumentI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildContentDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ContentDocumentI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildContentDocumentI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM content_document_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildContentDocumentI18n();
|
||||
$obj->hydrate($row);
|
||||
ContentDocumentI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildContentDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ContentDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentDocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
if (empty($keys)) {
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ContentDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ContentDocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByContentDocument()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ContentDocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the locale column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
|
||||
* $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $locale The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($locale)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $locale)) {
|
||||
$locale = str_replace('*', '%', $locale);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentDocument object
|
||||
*
|
||||
* @param \Thelia\Model\ContentDocument|ObjectCollection $contentDocument The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentDocument($contentDocument, $comparison = null)
|
||||
{
|
||||
if ($contentDocument instanceof \Thelia\Model\ContentDocument) {
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentI18nTableMap::ID, $contentDocument->getId(), $comparison);
|
||||
} elseif ($contentDocument instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentI18nTableMap::ID, $contentDocument->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContentDocument() only accepts arguments of type \Thelia\Model\ContentDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentDocument');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ContentDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentDocument relation ContentDocument object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ContentDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinContentDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentDocument', '\Thelia\Model\ContentDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildContentDocumentI18n $contentDocumentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentDocumentI18n = null)
|
||||
{
|
||||
if ($contentDocumentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ContentDocumentI18nTableMap::ID), $contentDocumentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ContentDocumentI18nTableMap::LOCALE), $contentDocumentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_document_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ContentDocumentI18nTableMap::clearInstancePool();
|
||||
ContentDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildContentDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildContentDocumentI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ContentDocumentI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ContentDocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ContentDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ContentDocumentI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/ContentDocumentQuery.php
Normal file
846
core/lib/Thelia/Model/Base/ContentDocumentQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ContentDocument as ChildContentDocument;
|
||||
use Thelia\Model\ContentDocumentI18nQuery as ChildContentDocumentI18nQuery;
|
||||
use Thelia\Model\ContentDocumentQuery as ChildContentDocumentQuery;
|
||||
use Thelia\Model\Map\ContentDocumentTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'content_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildContentDocumentQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildContentDocumentQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
|
||||
* @method ChildContentDocumentQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildContentDocumentQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildContentDocumentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildContentDocumentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildContentDocumentQuery groupById() Group by the id column
|
||||
* @method ChildContentDocumentQuery groupByContentId() Group by the content_id column
|
||||
* @method ChildContentDocumentQuery groupByFile() Group by the file column
|
||||
* @method ChildContentDocumentQuery groupByPosition() Group by the position column
|
||||
* @method ChildContentDocumentQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildContentDocumentQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildContentDocumentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildContentDocumentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildContentDocumentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildContentDocumentQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
|
||||
* @method ChildContentDocumentQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
|
||||
* @method ChildContentDocumentQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
|
||||
*
|
||||
* @method ChildContentDocumentQuery leftJoinContentDocumentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentDocumentI18n relation
|
||||
* @method ChildContentDocumentQuery rightJoinContentDocumentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentDocumentI18n relation
|
||||
* @method ChildContentDocumentQuery innerJoinContentDocumentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentDocumentI18n relation
|
||||
*
|
||||
* @method ChildContentDocument findOne(ConnectionInterface $con = null) Return the first ChildContentDocument matching the query
|
||||
* @method ChildContentDocument findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentDocument matching the query, or a new ChildContentDocument object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildContentDocument findOneById(int $id) Return the first ChildContentDocument filtered by the id column
|
||||
* @method ChildContentDocument findOneByContentId(int $content_id) Return the first ChildContentDocument filtered by the content_id column
|
||||
* @method ChildContentDocument findOneByFile(string $file) Return the first ChildContentDocument filtered by the file column
|
||||
* @method ChildContentDocument findOneByPosition(int $position) Return the first ChildContentDocument filtered by the position column
|
||||
* @method ChildContentDocument findOneByCreatedAt(string $created_at) Return the first ChildContentDocument filtered by the created_at column
|
||||
* @method ChildContentDocument findOneByUpdatedAt(string $updated_at) Return the first ChildContentDocument filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildContentDocument objects filtered by the id column
|
||||
* @method array findByContentId(int $content_id) Return ChildContentDocument objects filtered by the content_id column
|
||||
* @method array findByFile(string $file) Return ChildContentDocument objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildContentDocument objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildContentDocument objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildContentDocument objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class ContentDocumentQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentDocumentQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ContentDocument', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildContentDocumentQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildContentDocumentQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ContentDocumentQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ContentDocumentQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildContentDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ContentDocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildContentDocument A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CONTENT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM content_document WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildContentDocument();
|
||||
$obj->hydrate($row);
|
||||
ContentDocumentTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildContentDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the content_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByContentId(1234); // WHERE content_id = 1234
|
||||
* $query->filterByContentId(array(12, 34)); // WHERE content_id IN (12, 34)
|
||||
* $query->filterByContentId(array('min' => 12)); // WHERE content_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByContent()
|
||||
*
|
||||
* @param mixed $contentId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentId($contentId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($contentId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($contentId['min'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($contentId['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::CONTENT_ID, $contentId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::FILE, $file, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $createdAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCreatedAt($createdAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($createdAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($createdAt['min'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $updatedAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($updatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($updatedAt['min'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Content object
|
||||
*
|
||||
* @param \Thelia\Model\Content|ObjectCollection $content The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContent($content, $comparison = null)
|
||||
{
|
||||
if ($content instanceof \Thelia\Model\Content) {
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentTableMap::CONTENT_ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentTableMap::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContent() only accepts arguments of type \Thelia\Model\Content or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Content relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Content');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Content');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Content relation Content object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ContentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinContent($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Content', '\Thelia\Model\ContentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentDocumentI18n object
|
||||
*
|
||||
* @param \Thelia\Model\ContentDocumentI18n|ObjectCollection $contentDocumentI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentDocumentI18n($contentDocumentI18n, $comparison = null)
|
||||
{
|
||||
if ($contentDocumentI18n instanceof \Thelia\Model\ContentDocumentI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ContentDocumentTableMap::ID, $contentDocumentI18n->getId(), $comparison);
|
||||
} elseif ($contentDocumentI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useContentDocumentI18nQuery()
|
||||
->filterByPrimaryKeys($contentDocumentI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByContentDocumentI18n() only accepts arguments of type \Thelia\Model\ContentDocumentI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentDocumentI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentDocumentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentDocumentI18n');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ContentDocumentI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentDocumentI18n relation ContentDocumentI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ContentDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentDocumentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinContentDocumentI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentDocumentI18n', '\Thelia\Model\ContentDocumentI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildContentDocument $contentDocument Object to remove from the list of results
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentDocument = null)
|
||||
{
|
||||
if ($contentDocument) {
|
||||
$this->addUsingAlias(ContentDocumentTableMap::ID, $contentDocument->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_document table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ContentDocumentTableMap::clearInstancePool();
|
||||
ContentDocumentTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildContentDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildContentDocument object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ContentDocumentTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ContentDocumentTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ContentDocumentTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// timestampable behavior
|
||||
|
||||
/**
|
||||
* Filter by the latest updated
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentDocumentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ContentDocumentI18n';
|
||||
|
||||
return $this
|
||||
->joinContentDocumentI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('ContentDocumentI18n');
|
||||
$this->with['ContentDocumentI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentDocumentI18n', '\Thelia\Model\ContentDocumentI18nQuery');
|
||||
}
|
||||
|
||||
} // ContentDocumentQuery
|
||||
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/ContentImageI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/ContentImageI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/ContentImageI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/ContentImageI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ContentImageI18n as ChildContentImageI18n;
|
||||
use Thelia\Model\ContentImageI18nQuery as ChildContentImageI18nQuery;
|
||||
use Thelia\Model\Map\ContentImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'content_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildContentImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildContentImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildContentImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildContentImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildContentImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildContentImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildContentImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildContentImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildContentImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildContentImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildContentImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildContentImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildContentImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildContentImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildContentImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildContentImageI18nQuery leftJoinContentImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentImage relation
|
||||
* @method ChildContentImageI18nQuery rightJoinContentImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentImage relation
|
||||
* @method ChildContentImageI18nQuery innerJoinContentImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentImage relation
|
||||
*
|
||||
* @method ChildContentImageI18n findOne(ConnectionInterface $con = null) Return the first ChildContentImageI18n matching the query
|
||||
* @method ChildContentImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentImageI18n matching the query, or a new ChildContentImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildContentImageI18n findOneById(int $id) Return the first ChildContentImageI18n filtered by the id column
|
||||
* @method ChildContentImageI18n findOneByLocale(string $locale) Return the first ChildContentImageI18n filtered by the locale column
|
||||
* @method ChildContentImageI18n findOneByTitle(string $title) Return the first ChildContentImageI18n filtered by the title column
|
||||
* @method ChildContentImageI18n findOneByDescription(string $description) Return the first ChildContentImageI18n filtered by the description column
|
||||
* @method ChildContentImageI18n findOneByChapo(string $chapo) Return the first ChildContentImageI18n filtered by the chapo column
|
||||
* @method ChildContentImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildContentImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildContentImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildContentImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildContentImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildContentImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildContentImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildContentImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class ContentImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentImageI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ContentImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildContentImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildContentImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ContentImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ContentImageI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildContentImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ContentImageI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildContentImageI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM content_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildContentImageI18n();
|
||||
$obj->hydrate($row);
|
||||
ContentImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildContentImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ContentImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
if (empty($keys)) {
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ContentImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ContentImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByContentImage()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ContentImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the locale column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
|
||||
* $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $locale The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($locale)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $locale)) {
|
||||
$locale = str_replace('*', '%', $locale);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentImage object
|
||||
*
|
||||
* @param \Thelia\Model\ContentImage|ObjectCollection $contentImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentImage($contentImage, $comparison = null)
|
||||
{
|
||||
if ($contentImage instanceof \Thelia\Model\ContentImage) {
|
||||
return $this
|
||||
->addUsingAlias(ContentImageI18nTableMap::ID, $contentImage->getId(), $comparison);
|
||||
} elseif ($contentImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentImageI18nTableMap::ID, $contentImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContentImage() only accepts arguments of type \Thelia\Model\ContentImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ContentImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentImage relation ContentImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ContentImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinContentImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentImage', '\Thelia\Model\ContentImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildContentImageI18n $contentImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildContentImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentImageI18n = null)
|
||||
{
|
||||
if ($contentImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ContentImageI18nTableMap::ID), $contentImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ContentImageI18nTableMap::LOCALE), $contentImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ContentImageI18nTableMap::clearInstancePool();
|
||||
ContentImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildContentImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildContentImageI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ContentImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ContentImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ContentImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ContentImageI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/ContentImageQuery.php
Normal file
846
core/lib/Thelia/Model/Base/ContentImageQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ContentImage as ChildContentImage;
|
||||
use Thelia\Model\ContentImageI18nQuery as ChildContentImageI18nQuery;
|
||||
use Thelia\Model\ContentImageQuery as ChildContentImageQuery;
|
||||
use Thelia\Model\Map\ContentImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'content_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildContentImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildContentImageQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
|
||||
* @method ChildContentImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildContentImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildContentImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildContentImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildContentImageQuery groupById() Group by the id column
|
||||
* @method ChildContentImageQuery groupByContentId() Group by the content_id column
|
||||
* @method ChildContentImageQuery groupByFile() Group by the file column
|
||||
* @method ChildContentImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildContentImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildContentImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildContentImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildContentImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildContentImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildContentImageQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
|
||||
* @method ChildContentImageQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
|
||||
* @method ChildContentImageQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
|
||||
*
|
||||
* @method ChildContentImageQuery leftJoinContentImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentImageI18n relation
|
||||
* @method ChildContentImageQuery rightJoinContentImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentImageI18n relation
|
||||
* @method ChildContentImageQuery innerJoinContentImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentImageI18n relation
|
||||
*
|
||||
* @method ChildContentImage findOne(ConnectionInterface $con = null) Return the first ChildContentImage matching the query
|
||||
* @method ChildContentImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentImage matching the query, or a new ChildContentImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildContentImage findOneById(int $id) Return the first ChildContentImage filtered by the id column
|
||||
* @method ChildContentImage findOneByContentId(int $content_id) Return the first ChildContentImage filtered by the content_id column
|
||||
* @method ChildContentImage findOneByFile(string $file) Return the first ChildContentImage filtered by the file column
|
||||
* @method ChildContentImage findOneByPosition(int $position) Return the first ChildContentImage filtered by the position column
|
||||
* @method ChildContentImage findOneByCreatedAt(string $created_at) Return the first ChildContentImage filtered by the created_at column
|
||||
* @method ChildContentImage findOneByUpdatedAt(string $updated_at) Return the first ChildContentImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildContentImage objects filtered by the id column
|
||||
* @method array findByContentId(int $content_id) Return ChildContentImage objects filtered by the content_id column
|
||||
* @method array findByFile(string $file) Return ChildContentImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildContentImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildContentImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildContentImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class ContentImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentImageQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ContentImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildContentImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildContentImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ContentImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ContentImageQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildContentImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ContentImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildContentImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CONTENT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM content_image WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildContentImage();
|
||||
$obj->hydrate($row);
|
||||
ContentImageTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildContentImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the content_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByContentId(1234); // WHERE content_id = 1234
|
||||
* $query->filterByContentId(array(12, 34)); // WHERE content_id IN (12, 34)
|
||||
* $query->filterByContentId(array('min' => 12)); // WHERE content_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByContent()
|
||||
*
|
||||
* @param mixed $contentId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentId($contentId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($contentId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($contentId['min'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($contentId['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::CONTENT_ID, $contentId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::FILE, $file, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $createdAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCreatedAt($createdAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($createdAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($createdAt['min'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $updatedAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($updatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($updatedAt['min'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ContentImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentImageTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Content object
|
||||
*
|
||||
* @param \Thelia\Model\Content|ObjectCollection $content The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContent($content, $comparison = null)
|
||||
{
|
||||
if ($content instanceof \Thelia\Model\Content) {
|
||||
return $this
|
||||
->addUsingAlias(ContentImageTableMap::CONTENT_ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentImageTableMap::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContent() only accepts arguments of type \Thelia\Model\Content or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Content relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Content');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Content');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Content relation Content object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ContentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinContent($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Content', '\Thelia\Model\ContentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\ContentImageI18n|ObjectCollection $contentImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentImageI18n($contentImageI18n, $comparison = null)
|
||||
{
|
||||
if ($contentImageI18n instanceof \Thelia\Model\ContentImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ContentImageTableMap::ID, $contentImageI18n->getId(), $comparison);
|
||||
} elseif ($contentImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useContentImageI18nQuery()
|
||||
->filterByPrimaryKeys($contentImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByContentImageI18n() only accepts arguments of type \Thelia\Model\ContentImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentImageI18n');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ContentImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentImageI18n relation ContentImageI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ContentImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinContentImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentImageI18n', '\Thelia\Model\ContentImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildContentImage $contentImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentImage = null)
|
||||
{
|
||||
if ($contentImage) {
|
||||
$this->addUsingAlias(ContentImageTableMap::ID, $contentImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ContentImageTableMap::clearInstancePool();
|
||||
ContentImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildContentImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildContentImage object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ContentImageTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ContentImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ContentImageTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// timestampable behavior
|
||||
|
||||
/**
|
||||
* Filter by the latest updated
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ContentImageI18n';
|
||||
|
||||
return $this
|
||||
->joinContentImageI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('ContentImageI18n');
|
||||
$this->with['ContentImageI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildContentImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentImageI18n', '\Thelia\Model\ContentImageI18nQuery');
|
||||
}
|
||||
|
||||
} // ContentImageQuery
|
||||
@@ -48,14 +48,6 @@ use Thelia\Model\Map\ContentTableMap;
|
||||
* @method ChildContentQuery rightJoinContentAssoc($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentAssoc relation
|
||||
* @method ChildContentQuery innerJoinContentAssoc($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentAssoc relation
|
||||
*
|
||||
* @method ChildContentQuery leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildContentQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildContentQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @method ChildContentQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildContentQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildContentQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document relation
|
||||
*
|
||||
* @method ChildContentQuery leftJoinRewriting($relationAlias = null) Adds a LEFT JOIN clause to the query using the Rewriting relation
|
||||
* @method ChildContentQuery rightJoinRewriting($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Rewriting relation
|
||||
* @method ChildContentQuery innerJoinRewriting($relationAlias = null) Adds a INNER JOIN clause to the query using the Rewriting relation
|
||||
@@ -64,6 +56,14 @@ use Thelia\Model\Map\ContentTableMap;
|
||||
* @method ChildContentQuery rightJoinContentFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentFolder relation
|
||||
* @method ChildContentQuery innerJoinContentFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentFolder relation
|
||||
*
|
||||
* @method ChildContentQuery leftJoinContentImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentImage relation
|
||||
* @method ChildContentQuery rightJoinContentImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentImage relation
|
||||
* @method ChildContentQuery innerJoinContentImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentImage relation
|
||||
*
|
||||
* @method ChildContentQuery leftJoinContentDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentDocument relation
|
||||
* @method ChildContentQuery rightJoinContentDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentDocument relation
|
||||
* @method ChildContentQuery innerJoinContentDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentDocument relation
|
||||
*
|
||||
* @method ChildContentQuery leftJoinContentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ContentI18n relation
|
||||
* @method ChildContentQuery rightJoinContentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentI18n relation
|
||||
* @method ChildContentQuery innerJoinContentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentI18n relation
|
||||
@@ -671,152 +671,6 @@ abstract class ContentQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentAssoc', '\Thelia\Model\ContentAssocQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByImage($image, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
return $this
|
||||
->addUsingAlias(ContentTableMap::ID, $image->getContentId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useImageQuery()
|
||||
->filterByPrimaryKeys($image->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinImage($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Image');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDocument($document, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
return $this
|
||||
->addUsingAlias(ContentTableMap::ID, $document->getContentId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useDocumentQuery()
|
||||
->filterByPrimaryKeys($document->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinDocument($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Document');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\DocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Rewriting object
|
||||
*
|
||||
@@ -963,6 +817,152 @@ abstract class ContentQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentFolder', '\Thelia\Model\ContentFolderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentImage object
|
||||
*
|
||||
* @param \Thelia\Model\ContentImage|ObjectCollection $contentImage the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentImage($contentImage, $comparison = null)
|
||||
{
|
||||
if ($contentImage instanceof \Thelia\Model\ContentImage) {
|
||||
return $this
|
||||
->addUsingAlias(ContentTableMap::ID, $contentImage->getContentId(), $comparison);
|
||||
} elseif ($contentImage instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useContentImageQuery()
|
||||
->filterByPrimaryKeys($contentImage->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByContentImage() only accepts arguments of type \Thelia\Model\ContentImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ContentImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentImage relation ContentImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ContentImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinContentImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentImage', '\Thelia\Model\ContentImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentDocument object
|
||||
*
|
||||
* @param \Thelia\Model\ContentDocument|ObjectCollection $contentDocument the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildContentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContentDocument($contentDocument, $comparison = null)
|
||||
{
|
||||
if ($contentDocument instanceof \Thelia\Model\ContentDocument) {
|
||||
return $this
|
||||
->addUsingAlias(ContentTableMap::ID, $contentDocument->getContentId(), $comparison);
|
||||
} elseif ($contentDocument instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useContentDocumentQuery()
|
||||
->filterByPrimaryKeys($contentDocument->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByContentDocument() only accepts arguments of type \Thelia\Model\ContentDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ContentDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildContentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContentDocument($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ContentDocument');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ContentDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ContentDocument relation ContentDocument object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ContentDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useContentDocumentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinContentDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentDocument', '\Thelia\Model\ContentDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ContentI18n object
|
||||
*
|
||||
|
||||
@@ -93,12 +93,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
*/
|
||||
protected $by_default;
|
||||
|
||||
/**
|
||||
* The value for the position field.
|
||||
* @var int
|
||||
*/
|
||||
protected $position;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -490,17 +484,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
return $this->by_default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [position] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -646,27 +629,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setByDefault()
|
||||
|
||||
/**
|
||||
* Set the value of [position] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\Currency The current object (for fluent API support)
|
||||
*/
|
||||
public function setPosition($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->position !== $v) {
|
||||
$this->position = $v;
|
||||
$this->modifiedColumns[] = CurrencyTableMap::POSITION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setPosition()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -761,16 +723,13 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CurrencyTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->by_default = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CurrencyTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->position = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CurrencyTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CurrencyTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CurrencyTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CurrencyTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -783,7 +742,7 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 8; // 8 = CurrencyTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 7; // 7 = CurrencyTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\Currency object", 0, $e);
|
||||
@@ -1096,9 +1055,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CurrencyTableMap::BY_DEFAULT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'BY_DEFAULT';
|
||||
}
|
||||
if ($this->isColumnModified(CurrencyTableMap::POSITION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'POSITION';
|
||||
}
|
||||
if ($this->isColumnModified(CurrencyTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
|
||||
}
|
||||
@@ -1131,9 +1087,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
case 'BY_DEFAULT':
|
||||
$stmt->bindValue($identifier, $this->by_default, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'POSITION':
|
||||
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'CREATED_AT':
|
||||
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1218,12 +1171,9 @@ abstract class Currency implements ActiveRecordInterface
|
||||
return $this->getByDefault();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getPosition();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 7:
|
||||
case 6:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1260,9 +1210,8 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$keys[2] => $this->getSymbol(),
|
||||
$keys[3] => $this->getRate(),
|
||||
$keys[4] => $this->getByDefault(),
|
||||
$keys[5] => $this->getPosition(),
|
||||
$keys[6] => $this->getCreatedAt(),
|
||||
$keys[7] => $this->getUpdatedAt(),
|
||||
$keys[5] => $this->getCreatedAt(),
|
||||
$keys[6] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1333,12 +1282,9 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$this->setByDefault($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setPosition($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 7:
|
||||
case 6:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1370,9 +1316,8 @@ abstract class Currency implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[2], $arr)) $this->setSymbol($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setRate($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setByDefault($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setPosition($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1389,7 +1334,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(CurrencyTableMap::SYMBOL)) $criteria->add(CurrencyTableMap::SYMBOL, $this->symbol);
|
||||
if ($this->isColumnModified(CurrencyTableMap::RATE)) $criteria->add(CurrencyTableMap::RATE, $this->rate);
|
||||
if ($this->isColumnModified(CurrencyTableMap::BY_DEFAULT)) $criteria->add(CurrencyTableMap::BY_DEFAULT, $this->by_default);
|
||||
if ($this->isColumnModified(CurrencyTableMap::POSITION)) $criteria->add(CurrencyTableMap::POSITION, $this->position);
|
||||
if ($this->isColumnModified(CurrencyTableMap::CREATED_AT)) $criteria->add(CurrencyTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(CurrencyTableMap::UPDATED_AT)) $criteria->add(CurrencyTableMap::UPDATED_AT, $this->updated_at);
|
||||
|
||||
@@ -1459,7 +1403,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$copyObj->setSymbol($this->getSymbol());
|
||||
$copyObj->setRate($this->getRate());
|
||||
$copyObj->setByDefault($this->getByDefault());
|
||||
$copyObj->setPosition($this->getPosition());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
|
||||
@@ -2636,7 +2579,6 @@ abstract class Currency implements ActiveRecordInterface
|
||||
$this->symbol = null;
|
||||
$this->rate = null;
|
||||
$this->by_default = null;
|
||||
$this->position = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->alreadyInSave = false;
|
||||
|
||||
@@ -27,7 +27,6 @@ use Thelia\Model\Map\CurrencyTableMap;
|
||||
* @method ChildCurrencyQuery orderBySymbol($order = Criteria::ASC) Order by the symbol column
|
||||
* @method ChildCurrencyQuery orderByRate($order = Criteria::ASC) Order by the rate column
|
||||
* @method ChildCurrencyQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
|
||||
* @method ChildCurrencyQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildCurrencyQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildCurrencyQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
@@ -36,7 +35,6 @@ use Thelia\Model\Map\CurrencyTableMap;
|
||||
* @method ChildCurrencyQuery groupBySymbol() Group by the symbol column
|
||||
* @method ChildCurrencyQuery groupByRate() Group by the rate column
|
||||
* @method ChildCurrencyQuery groupByByDefault() Group by the by_default column
|
||||
* @method ChildCurrencyQuery groupByPosition() Group by the position column
|
||||
* @method ChildCurrencyQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildCurrencyQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
@@ -68,7 +66,6 @@ use Thelia\Model\Map\CurrencyTableMap;
|
||||
* @method ChildCurrency findOneBySymbol(string $symbol) Return the first ChildCurrency filtered by the symbol column
|
||||
* @method ChildCurrency findOneByRate(double $rate) Return the first ChildCurrency filtered by the rate column
|
||||
* @method ChildCurrency findOneByByDefault(int $by_default) Return the first ChildCurrency filtered by the by_default column
|
||||
* @method ChildCurrency findOneByPosition(int $position) Return the first ChildCurrency filtered by the position column
|
||||
* @method ChildCurrency findOneByCreatedAt(string $created_at) Return the first ChildCurrency filtered by the created_at column
|
||||
* @method ChildCurrency findOneByUpdatedAt(string $updated_at) Return the first ChildCurrency filtered by the updated_at column
|
||||
*
|
||||
@@ -77,7 +74,6 @@ use Thelia\Model\Map\CurrencyTableMap;
|
||||
* @method array findBySymbol(string $symbol) Return ChildCurrency objects filtered by the symbol column
|
||||
* @method array findByRate(double $rate) Return ChildCurrency objects filtered by the rate column
|
||||
* @method array findByByDefault(int $by_default) Return ChildCurrency objects filtered by the by_default column
|
||||
* @method array findByPosition(int $position) Return ChildCurrency objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildCurrency objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildCurrency objects filtered by the updated_at column
|
||||
*
|
||||
@@ -168,7 +164,7 @@ abstract class CurrencyQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, CODE, SYMBOL, RATE, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM currency WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, CODE, SYMBOL, RATE, BY_DEFAULT, CREATED_AT, UPDATED_AT FROM currency WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -438,47 +434,6 @@ abstract class CurrencyQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(CurrencyTableMap::BY_DEFAULT, $byDefault, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildCurrencyQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(CurrencyTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(CurrencyTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CurrencyTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1990
core/lib/Thelia/Model/Base/FolderDocument.php
Normal file
1990
core/lib/Thelia/Model/Base/FolderDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/FolderDocumentI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/FolderDocumentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/FolderDocumentI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/FolderDocumentI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\FolderDocumentI18n as ChildFolderDocumentI18n;
|
||||
use Thelia\Model\FolderDocumentI18nQuery as ChildFolderDocumentI18nQuery;
|
||||
use Thelia\Model\Map\FolderDocumentI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'folder_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildFolderDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildFolderDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildFolderDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildFolderDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildFolderDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildFolderDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildFolderDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildFolderDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildFolderDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildFolderDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildFolderDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildFolderDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildFolderDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildFolderDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildFolderDocumentI18nQuery leftJoinFolderDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderDocument relation
|
||||
* @method ChildFolderDocumentI18nQuery rightJoinFolderDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderDocument relation
|
||||
* @method ChildFolderDocumentI18nQuery innerJoinFolderDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderDocument relation
|
||||
*
|
||||
* @method ChildFolderDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildFolderDocumentI18n matching the query
|
||||
* @method ChildFolderDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderDocumentI18n matching the query, or a new ChildFolderDocumentI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildFolderDocumentI18n findOneById(int $id) Return the first ChildFolderDocumentI18n filtered by the id column
|
||||
* @method ChildFolderDocumentI18n findOneByLocale(string $locale) Return the first ChildFolderDocumentI18n filtered by the locale column
|
||||
* @method ChildFolderDocumentI18n findOneByTitle(string $title) Return the first ChildFolderDocumentI18n filtered by the title column
|
||||
* @method ChildFolderDocumentI18n findOneByDescription(string $description) Return the first ChildFolderDocumentI18n filtered by the description column
|
||||
* @method ChildFolderDocumentI18n findOneByChapo(string $chapo) Return the first ChildFolderDocumentI18n filtered by the chapo column
|
||||
* @method ChildFolderDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildFolderDocumentI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildFolderDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildFolderDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildFolderDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildFolderDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildFolderDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildFolderDocumentI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class FolderDocumentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\FolderDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\FolderDocumentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildFolderDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\FolderDocumentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\FolderDocumentI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildFolderDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = FolderDocumentI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(FolderDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildFolderDocumentI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM folder_document_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildFolderDocumentI18n();
|
||||
$obj->hydrate($row);
|
||||
FolderDocumentI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildFolderDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(FolderDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(FolderDocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
if (empty($keys)) {
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(FolderDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(FolderDocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByFolderDocument()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(FolderDocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the locale column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
|
||||
* $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $locale The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($locale)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $locale)) {
|
||||
$locale = str_replace('*', '%', $locale);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderDocument object
|
||||
*
|
||||
* @param \Thelia\Model\FolderDocument|ObjectCollection $folderDocument The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderDocument($folderDocument, $comparison = null)
|
||||
{
|
||||
if ($folderDocument instanceof \Thelia\Model\FolderDocument) {
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentI18nTableMap::ID, $folderDocument->getId(), $comparison);
|
||||
} elseif ($folderDocument instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentI18nTableMap::ID, $folderDocument->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByFolderDocument() only accepts arguments of type \Thelia\Model\FolderDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderDocument');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'FolderDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderDocument relation FolderDocument object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\FolderDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinFolderDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderDocument', '\Thelia\Model\FolderDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildFolderDocumentI18n $folderDocumentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($folderDocumentI18n = null)
|
||||
{
|
||||
if ($folderDocumentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(FolderDocumentI18nTableMap::ID), $folderDocumentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(FolderDocumentI18nTableMap::LOCALE), $folderDocumentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the folder_document_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
FolderDocumentI18nTableMap::clearInstancePool();
|
||||
FolderDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildFolderDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildFolderDocumentI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(FolderDocumentI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
FolderDocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
FolderDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // FolderDocumentI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/FolderDocumentQuery.php
Normal file
846
core/lib/Thelia/Model/Base/FolderDocumentQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\FolderDocument as ChildFolderDocument;
|
||||
use Thelia\Model\FolderDocumentI18nQuery as ChildFolderDocumentI18nQuery;
|
||||
use Thelia\Model\FolderDocumentQuery as ChildFolderDocumentQuery;
|
||||
use Thelia\Model\Map\FolderDocumentTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'folder_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildFolderDocumentQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildFolderDocumentQuery orderByFolderId($order = Criteria::ASC) Order by the folder_id column
|
||||
* @method ChildFolderDocumentQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildFolderDocumentQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildFolderDocumentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildFolderDocumentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildFolderDocumentQuery groupById() Group by the id column
|
||||
* @method ChildFolderDocumentQuery groupByFolderId() Group by the folder_id column
|
||||
* @method ChildFolderDocumentQuery groupByFile() Group by the file column
|
||||
* @method ChildFolderDocumentQuery groupByPosition() Group by the position column
|
||||
* @method ChildFolderDocumentQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildFolderDocumentQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildFolderDocumentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildFolderDocumentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderDocumentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildFolderDocumentQuery leftJoinFolder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Folder relation
|
||||
* @method ChildFolderDocumentQuery rightJoinFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Folder relation
|
||||
* @method ChildFolderDocumentQuery innerJoinFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the Folder relation
|
||||
*
|
||||
* @method ChildFolderDocumentQuery leftJoinFolderDocumentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderDocumentI18n relation
|
||||
* @method ChildFolderDocumentQuery rightJoinFolderDocumentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderDocumentI18n relation
|
||||
* @method ChildFolderDocumentQuery innerJoinFolderDocumentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderDocumentI18n relation
|
||||
*
|
||||
* @method ChildFolderDocument findOne(ConnectionInterface $con = null) Return the first ChildFolderDocument matching the query
|
||||
* @method ChildFolderDocument findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderDocument matching the query, or a new ChildFolderDocument object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildFolderDocument findOneById(int $id) Return the first ChildFolderDocument filtered by the id column
|
||||
* @method ChildFolderDocument findOneByFolderId(int $folder_id) Return the first ChildFolderDocument filtered by the folder_id column
|
||||
* @method ChildFolderDocument findOneByFile(string $file) Return the first ChildFolderDocument filtered by the file column
|
||||
* @method ChildFolderDocument findOneByPosition(int $position) Return the first ChildFolderDocument filtered by the position column
|
||||
* @method ChildFolderDocument findOneByCreatedAt(string $created_at) Return the first ChildFolderDocument filtered by the created_at column
|
||||
* @method ChildFolderDocument findOneByUpdatedAt(string $updated_at) Return the first ChildFolderDocument filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildFolderDocument objects filtered by the id column
|
||||
* @method array findByFolderId(int $folder_id) Return ChildFolderDocument objects filtered by the folder_id column
|
||||
* @method array findByFile(string $file) Return ChildFolderDocument objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildFolderDocument objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildFolderDocument objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildFolderDocument objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class FolderDocumentQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\FolderDocumentQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\FolderDocument', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildFolderDocumentQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildFolderDocumentQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\FolderDocumentQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\FolderDocumentQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildFolderDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = FolderDocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(FolderDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildFolderDocument A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, FOLDER_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM folder_document WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildFolderDocument();
|
||||
$obj->hydrate($row);
|
||||
FolderDocumentTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildFolderDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the folder_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFolderId(1234); // WHERE folder_id = 1234
|
||||
* $query->filterByFolderId(array(12, 34)); // WHERE folder_id IN (12, 34)
|
||||
* $query->filterByFolderId(array('min' => 12)); // WHERE folder_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByFolder()
|
||||
*
|
||||
* @param mixed $folderId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderId($folderId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($folderId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($folderId['min'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folderId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($folderId['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folderId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folderId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::FILE, $file, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $createdAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCreatedAt($createdAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($createdAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($createdAt['min'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $updatedAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($updatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($updatedAt['min'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Folder object
|
||||
*
|
||||
* @param \Thelia\Model\Folder|ObjectCollection $folder The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolder($folder, $comparison = null)
|
||||
{
|
||||
if ($folder instanceof \Thelia\Model\Folder) {
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folder->getId(), $comparison);
|
||||
} elseif ($folder instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentTableMap::FOLDER_ID, $folder->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByFolder() only accepts arguments of type \Thelia\Model\Folder or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Folder relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Folder');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Folder');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Folder relation Folder object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\FolderQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinFolder($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Folder', '\Thelia\Model\FolderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderDocumentI18n object
|
||||
*
|
||||
* @param \Thelia\Model\FolderDocumentI18n|ObjectCollection $folderDocumentI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderDocumentI18n($folderDocumentI18n, $comparison = null)
|
||||
{
|
||||
if ($folderDocumentI18n instanceof \Thelia\Model\FolderDocumentI18n) {
|
||||
return $this
|
||||
->addUsingAlias(FolderDocumentTableMap::ID, $folderDocumentI18n->getId(), $comparison);
|
||||
} elseif ($folderDocumentI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useFolderDocumentI18nQuery()
|
||||
->filterByPrimaryKeys($folderDocumentI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByFolderDocumentI18n() only accepts arguments of type \Thelia\Model\FolderDocumentI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderDocumentI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderDocumentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderDocumentI18n');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'FolderDocumentI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderDocumentI18n relation FolderDocumentI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\FolderDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderDocumentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinFolderDocumentI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderDocumentI18n', '\Thelia\Model\FolderDocumentI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildFolderDocument $folderDocument Object to remove from the list of results
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($folderDocument = null)
|
||||
{
|
||||
if ($folderDocument) {
|
||||
$this->addUsingAlias(FolderDocumentTableMap::ID, $folderDocument->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the folder_document table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
FolderDocumentTableMap::clearInstancePool();
|
||||
FolderDocumentTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildFolderDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildFolderDocument object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(FolderDocumentTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
FolderDocumentTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
FolderDocumentTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// timestampable behavior
|
||||
|
||||
/**
|
||||
* Filter by the latest updated
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(FolderDocumentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(FolderDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(FolderDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(FolderDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(FolderDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'FolderDocumentI18n';
|
||||
|
||||
return $this
|
||||
->joinFolderDocumentI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('FolderDocumentI18n');
|
||||
$this->with['FolderDocumentI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderDocumentI18n', '\Thelia\Model\FolderDocumentI18nQuery');
|
||||
}
|
||||
|
||||
} // FolderDocumentQuery
|
||||
1990
core/lib/Thelia/Model/Base/FolderImage.php
Normal file
1990
core/lib/Thelia/Model/Base/FolderImage.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -14,17 +14,17 @@ use Propel\Runtime\Exception\BadMethodCallException;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Parser\AbstractParser;
|
||||
use Thelia\Model\Image as ChildImage;
|
||||
use Thelia\Model\ImageI18nQuery as ChildImageI18nQuery;
|
||||
use Thelia\Model\ImageQuery as ChildImageQuery;
|
||||
use Thelia\Model\Map\ImageI18nTableMap;
|
||||
use Thelia\Model\FolderImage as ChildFolderImage;
|
||||
use Thelia\Model\FolderImageI18nQuery as ChildFolderImageI18nQuery;
|
||||
use Thelia\Model\FolderImageQuery as ChildFolderImageQuery;
|
||||
use Thelia\Model\Map\FolderImageI18nTableMap;
|
||||
|
||||
abstract class ImageI18n implements ActiveRecordInterface
|
||||
abstract class FolderImageI18n implements ActiveRecordInterface
|
||||
{
|
||||
/**
|
||||
* TableMap class name
|
||||
*/
|
||||
const TABLE_MAP = '\\Thelia\\Model\\Map\\ImageI18nTableMap';
|
||||
const TABLE_MAP = '\\Thelia\\Model\\Map\\FolderImageI18nTableMap';
|
||||
|
||||
|
||||
/**
|
||||
@@ -91,9 +91,9 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
protected $postscriptum;
|
||||
|
||||
/**
|
||||
* @var Image
|
||||
* @var FolderImage
|
||||
*/
|
||||
protected $aImage;
|
||||
protected $aFolderImage;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
@@ -115,7 +115,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes internal state of Thelia\Model\Base\ImageI18n object.
|
||||
* Initializes internal state of Thelia\Model\Base\FolderImageI18n object.
|
||||
* @see applyDefaults()
|
||||
*/
|
||||
public function __construct()
|
||||
@@ -212,9 +212,9 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares this with another <code>ImageI18n</code> instance. If
|
||||
* <code>obj</code> is an instance of <code>ImageI18n</code>, delegates to
|
||||
* <code>equals(ImageI18n)</code>. Otherwise, returns <code>false</code>.
|
||||
* Compares this with another <code>FolderImageI18n</code> instance. If
|
||||
* <code>obj</code> is an instance of <code>FolderImageI18n</code>, delegates to
|
||||
* <code>equals(FolderImageI18n)</code>. Otherwise, returns <code>false</code>.
|
||||
*
|
||||
* @param obj The object to compare to.
|
||||
* @return Whether equal to the object specified.
|
||||
@@ -295,7 +295,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* @param string $name The virtual column name
|
||||
* @param mixed $value The value to give to the virtual column
|
||||
*
|
||||
* @return ImageI18n The current object, for fluid interface
|
||||
* @return FolderImageI18n The current object, for fluid interface
|
||||
*/
|
||||
public function setVirtualColumn($name, $value)
|
||||
{
|
||||
@@ -327,7 +327,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
|
||||
* @param string $data The source data to import from
|
||||
*
|
||||
* @return ImageI18n The current object, for fluid interface
|
||||
* @return FolderImageI18n The current object, for fluid interface
|
||||
*/
|
||||
public function importFrom($parser, $data)
|
||||
{
|
||||
@@ -440,7 +440,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setId($v)
|
||||
{
|
||||
@@ -450,11 +450,11 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->id !== $v) {
|
||||
$this->id = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::ID;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::ID;
|
||||
}
|
||||
|
||||
if ($this->aImage !== null && $this->aImage->getId() !== $v) {
|
||||
$this->aImage = null;
|
||||
if ($this->aFolderImage !== null && $this->aFolderImage->getId() !== $v) {
|
||||
$this->aFolderImage = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [locale] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setLocale($v)
|
||||
{
|
||||
@@ -475,7 +475,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->locale !== $v) {
|
||||
$this->locale = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::LOCALE;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::LOCALE;
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [title] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setTitle($v)
|
||||
{
|
||||
@@ -496,7 +496,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->title !== $v) {
|
||||
$this->title = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::TITLE;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::TITLE;
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setDescription($v)
|
||||
{
|
||||
@@ -517,7 +517,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->description !== $v) {
|
||||
$this->description = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::DESCRIPTION;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
@@ -528,7 +528,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [chapo] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setChapo($v)
|
||||
{
|
||||
@@ -538,7 +538,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->chapo !== $v) {
|
||||
$this->chapo = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::CHAPO;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::CHAPO;
|
||||
}
|
||||
|
||||
|
||||
@@ -549,7 +549,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* Set the value of [postscriptum] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setPostscriptum($v)
|
||||
{
|
||||
@@ -559,7 +559,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->postscriptum !== $v) {
|
||||
$this->postscriptum = $v;
|
||||
$this->modifiedColumns[] = ImageI18nTableMap::POSTSCRIPTUM;
|
||||
$this->modifiedColumns[] = FolderImageI18nTableMap::POSTSCRIPTUM;
|
||||
}
|
||||
|
||||
|
||||
@@ -607,22 +607,22 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
try {
|
||||
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ImageI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : FolderImageI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ImageI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : FolderImageI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->locale = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ImageI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : FolderImageI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->title = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ImageI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : FolderImageI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->description = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ImageI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : FolderImageI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->chapo = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ImageI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : FolderImageI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->postscriptum = (null !== $col) ? (string) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
@@ -632,10 +632,10 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 6; // 6 = ImageI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 6; // 6 = FolderImageI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\ImageI18n object", 0, $e);
|
||||
throw new PropelException("Error populating \Thelia\Model\FolderImageI18n object", 0, $e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,8 +654,8 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function ensureConsistency()
|
||||
{
|
||||
if ($this->aImage !== null && $this->id !== $this->aImage->getId()) {
|
||||
$this->aImage = null;
|
||||
if ($this->aFolderImage !== null && $this->id !== $this->aFolderImage->getId()) {
|
||||
$this->aFolderImage = null;
|
||||
}
|
||||
} // ensureConsistency
|
||||
|
||||
@@ -680,13 +680,13 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
// We don't need to alter the object instance pool; we're just modifying this instance
|
||||
// already in the pool.
|
||||
|
||||
$dataFetcher = ChildImageI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
|
||||
$dataFetcher = ChildFolderImageI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
|
||||
$row = $dataFetcher->fetch();
|
||||
$dataFetcher->close();
|
||||
if (!$row) {
|
||||
@@ -696,7 +696,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
if ($deep) { // also de-associate any related objects?
|
||||
|
||||
$this->aImage = null;
|
||||
$this->aFolderImage = null;
|
||||
} // if (deep)
|
||||
}
|
||||
|
||||
@@ -706,8 +706,8 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* @param ConnectionInterface $con
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
* @see ImageI18n::setDeleted()
|
||||
* @see ImageI18n::isDeleted()
|
||||
* @see FolderImageI18n::setDeleted()
|
||||
* @see FolderImageI18n::isDeleted()
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
@@ -716,12 +716,12 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$con->beginTransaction();
|
||||
try {
|
||||
$deleteQuery = ChildImageI18nQuery::create()
|
||||
$deleteQuery = ChildFolderImageI18nQuery::create()
|
||||
->filterByPrimaryKey($this->getPrimaryKey());
|
||||
$ret = $this->preDelete($con);
|
||||
if ($ret) {
|
||||
@@ -758,7 +758,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$con->beginTransaction();
|
||||
@@ -778,7 +778,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
$this->postUpdate($con);
|
||||
}
|
||||
$this->postSave($con);
|
||||
ImageI18nTableMap::addInstanceToPool($this);
|
||||
FolderImageI18nTableMap::addInstanceToPool($this);
|
||||
} else {
|
||||
$affectedRows = 0;
|
||||
}
|
||||
@@ -813,11 +813,11 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
// method. This object relates to these object(s) by a
|
||||
// foreign key reference.
|
||||
|
||||
if ($this->aImage !== null) {
|
||||
if ($this->aImage->isModified() || $this->aImage->isNew()) {
|
||||
$affectedRows += $this->aImage->save($con);
|
||||
if ($this->aFolderImage !== null) {
|
||||
if ($this->aFolderImage->isModified() || $this->aFolderImage->isNew()) {
|
||||
$affectedRows += $this->aFolderImage->save($con);
|
||||
}
|
||||
$this->setImage($this->aImage);
|
||||
$this->setFolderImage($this->aFolderImage);
|
||||
}
|
||||
|
||||
if ($this->isNew() || $this->isModified()) {
|
||||
@@ -853,27 +853,27 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
|
||||
// check the columns in natural order for more readable SQL queries
|
||||
if ($this->isColumnModified(ImageI18nTableMap::ID)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'ID';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::LOCALE)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::LOCALE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'LOCALE';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::TITLE)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::TITLE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'TITLE';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::DESCRIPTION)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::CHAPO)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::CHAPO)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CHAPO';
|
||||
}
|
||||
if ($this->isColumnModified(ImageI18nTableMap::POSTSCRIPTUM)) {
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::POSTSCRIPTUM)) {
|
||||
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'INSERT INTO image_i18n (%s) VALUES (%s)',
|
||||
'INSERT INTO folder_image_i18n (%s) VALUES (%s)',
|
||||
implode(', ', $modifiedColumns),
|
||||
implode(', ', array_keys($modifiedColumns))
|
||||
);
|
||||
@@ -939,7 +939,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = ImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$pos = FolderImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$field = $this->getByPosition($pos);
|
||||
|
||||
return $field;
|
||||
@@ -996,11 +996,11 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
|
||||
{
|
||||
if (isset($alreadyDumpedObjects['ImageI18n'][serialize($this->getPrimaryKey())])) {
|
||||
if (isset($alreadyDumpedObjects['FolderImageI18n'][serialize($this->getPrimaryKey())])) {
|
||||
return '*RECURSION*';
|
||||
}
|
||||
$alreadyDumpedObjects['ImageI18n'][serialize($this->getPrimaryKey())] = true;
|
||||
$keys = ImageI18nTableMap::getFieldNames($keyType);
|
||||
$alreadyDumpedObjects['FolderImageI18n'][serialize($this->getPrimaryKey())] = true;
|
||||
$keys = FolderImageI18nTableMap::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getLocale(),
|
||||
@@ -1016,8 +1016,8 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aImage) {
|
||||
$result['Image'] = $this->aImage->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
if (null !== $this->aFolderImage) {
|
||||
$result['FolderImage'] = $this->aFolderImage->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1037,7 +1037,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = ImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$pos = FolderImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
|
||||
return $this->setByPosition($pos, $value);
|
||||
}
|
||||
@@ -1093,7 +1093,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = ImageI18nTableMap::getFieldNames($keyType);
|
||||
$keys = FolderImageI18nTableMap::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setLocale($arr[$keys[1]]);
|
||||
@@ -1110,14 +1110,14 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function buildCriteria()
|
||||
{
|
||||
$criteria = new Criteria(ImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria = new Criteria(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(ImageI18nTableMap::ID)) $criteria->add(ImageI18nTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::LOCALE)) $criteria->add(ImageI18nTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::TITLE)) $criteria->add(ImageI18nTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::DESCRIPTION)) $criteria->add(ImageI18nTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::CHAPO)) $criteria->add(ImageI18nTableMap::CHAPO, $this->chapo);
|
||||
if ($this->isColumnModified(ImageI18nTableMap::POSTSCRIPTUM)) $criteria->add(ImageI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::ID)) $criteria->add(FolderImageI18nTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::LOCALE)) $criteria->add(FolderImageI18nTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::TITLE)) $criteria->add(FolderImageI18nTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::DESCRIPTION)) $criteria->add(FolderImageI18nTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::CHAPO)) $criteria->add(FolderImageI18nTableMap::CHAPO, $this->chapo);
|
||||
if ($this->isColumnModified(FolderImageI18nTableMap::POSTSCRIPTUM)) $criteria->add(FolderImageI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1132,9 +1132,9 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function buildPkeyCriteria()
|
||||
{
|
||||
$criteria = new Criteria(ImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria->add(ImageI18nTableMap::ID, $this->id);
|
||||
$criteria->add(ImageI18nTableMap::LOCALE, $this->locale);
|
||||
$criteria = new Criteria(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria->add(FolderImageI18nTableMap::ID, $this->id);
|
||||
$criteria->add(FolderImageI18nTableMap::LOCALE, $this->locale);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1181,7 +1181,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param object $copyObj An object of \Thelia\Model\ImageI18n (or compatible) type.
|
||||
* @param object $copyObj An object of \Thelia\Model\FolderImageI18n (or compatible) type.
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
|
||||
* @throws PropelException
|
||||
@@ -1208,7 +1208,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
* objects.
|
||||
*
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @return \Thelia\Model\ImageI18n Clone of current object.
|
||||
* @return \Thelia\Model\FolderImageI18n Clone of current object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copy($deepCopy = false)
|
||||
@@ -1222,13 +1222,13 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a ChildImage object.
|
||||
* Declares an association between this object and a ChildFolderImage object.
|
||||
*
|
||||
* @param ChildImage $v
|
||||
* @return \Thelia\Model\ImageI18n The current object (for fluent API support)
|
||||
* @param ChildFolderImage $v
|
||||
* @return \Thelia\Model\FolderImageI18n The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setImage(ChildImage $v = null)
|
||||
public function setFolderImage(ChildFolderImage $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setId(NULL);
|
||||
@@ -1236,12 +1236,12 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
$this->setId($v->getId());
|
||||
}
|
||||
|
||||
$this->aImage = $v;
|
||||
$this->aFolderImage = $v;
|
||||
|
||||
// Add binding for other direction of this n:n relationship.
|
||||
// If this object has already been added to the ChildImage object, it will not be re-added.
|
||||
// If this object has already been added to the ChildFolderImage object, it will not be re-added.
|
||||
if ($v !== null) {
|
||||
$v->addImageI18n($this);
|
||||
$v->addFolderImageI18n($this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1250,26 +1250,26 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
|
||||
|
||||
/**
|
||||
* Get the associated ChildImage object
|
||||
* Get the associated ChildFolderImage object
|
||||
*
|
||||
* @param ConnectionInterface $con Optional Connection object.
|
||||
* @return ChildImage The associated ChildImage object.
|
||||
* @return ChildFolderImage The associated ChildFolderImage object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getImage(ConnectionInterface $con = null)
|
||||
public function getFolderImage(ConnectionInterface $con = null)
|
||||
{
|
||||
if ($this->aImage === null && ($this->id !== null)) {
|
||||
$this->aImage = ChildImageQuery::create()->findPk($this->id, $con);
|
||||
if ($this->aFolderImage === null && ($this->id !== null)) {
|
||||
$this->aFolderImage = ChildFolderImageQuery::create()->findPk($this->id, $con);
|
||||
/* The following can be used additionally to
|
||||
guarantee the related object contains a reference
|
||||
to this object. This level of coupling may, however, be
|
||||
undesirable since it could result in an only partially populated collection
|
||||
in the referenced object.
|
||||
$this->aImage->addImageI18ns($this);
|
||||
$this->aFolderImage->addFolderImageI18ns($this);
|
||||
*/
|
||||
}
|
||||
|
||||
return $this->aImage;
|
||||
return $this->aFolderImage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1305,7 +1305,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
if ($deep) {
|
||||
} // if ($deep)
|
||||
|
||||
$this->aImage = null;
|
||||
$this->aFolderImage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1315,7 +1315,7 @@ abstract class ImageI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->exportTo(ImageI18nTableMap::DEFAULT_STRING_FORMAT);
|
||||
return (string) $this->exportTo(FolderImageI18nTableMap::DEFAULT_STRING_FORMAT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -12,84 +12,84 @@ use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ImageI18n as ChildImageI18n;
|
||||
use Thelia\Model\ImageI18nQuery as ChildImageI18nQuery;
|
||||
use Thelia\Model\Map\ImageI18nTableMap;
|
||||
use Thelia\Model\FolderImageI18n as ChildFolderImageI18n;
|
||||
use Thelia\Model\FolderImageI18nQuery as ChildFolderImageI18nQuery;
|
||||
use Thelia\Model\Map\FolderImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'image_i18n' table.
|
||||
* Base class that represents a query for the 'folder_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
* @method ChildFolderImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildFolderImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildFolderImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildFolderImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildFolderImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildFolderImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
* @method ChildFolderImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildFolderImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildFolderImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildFolderImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildFolderImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildFolderImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @method ChildFolderImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildFolderImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildImageI18nQuery leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildImageI18nQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildImageI18nQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
* @method ChildFolderImageI18nQuery leftJoinFolderImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderImage relation
|
||||
* @method ChildFolderImageI18nQuery rightJoinFolderImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderImage relation
|
||||
* @method ChildFolderImageI18nQuery innerJoinFolderImage($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderImage relation
|
||||
*
|
||||
* @method ChildImageI18n findOne(ConnectionInterface $con = null) Return the first ChildImageI18n matching the query
|
||||
* @method ChildImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildImageI18n matching the query, or a new ChildImageI18n object populated from the query conditions when no match is found
|
||||
* @method ChildFolderImageI18n findOne(ConnectionInterface $con = null) Return the first ChildFolderImageI18n matching the query
|
||||
* @method ChildFolderImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderImageI18n matching the query, or a new ChildFolderImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildImageI18n findOneById(int $id) Return the first ChildImageI18n filtered by the id column
|
||||
* @method ChildImageI18n findOneByLocale(string $locale) Return the first ChildImageI18n filtered by the locale column
|
||||
* @method ChildImageI18n findOneByTitle(string $title) Return the first ChildImageI18n filtered by the title column
|
||||
* @method ChildImageI18n findOneByDescription(string $description) Return the first ChildImageI18n filtered by the description column
|
||||
* @method ChildImageI18n findOneByChapo(string $chapo) Return the first ChildImageI18n filtered by the chapo column
|
||||
* @method ChildImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildImageI18n filtered by the postscriptum column
|
||||
* @method ChildFolderImageI18n findOneById(int $id) Return the first ChildFolderImageI18n filtered by the id column
|
||||
* @method ChildFolderImageI18n findOneByLocale(string $locale) Return the first ChildFolderImageI18n filtered by the locale column
|
||||
* @method ChildFolderImageI18n findOneByTitle(string $title) Return the first ChildFolderImageI18n filtered by the title column
|
||||
* @method ChildFolderImageI18n findOneByDescription(string $description) Return the first ChildFolderImageI18n filtered by the description column
|
||||
* @method ChildFolderImageI18n findOneByChapo(string $chapo) Return the first ChildFolderImageI18n filtered by the chapo column
|
||||
* @method ChildFolderImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildFolderImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildImageI18n objects filtered by the postscriptum column
|
||||
* @method array findById(int $id) Return ChildFolderImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildFolderImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildFolderImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildFolderImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildFolderImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildFolderImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class ImageI18nQuery extends ModelCriteria
|
||||
abstract class FolderImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ImageI18nQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\FolderImageI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ImageI18n', $modelAlias = null)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\FolderImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildImageI18nQuery object.
|
||||
* Returns a new ChildFolderImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildImageI18nQuery
|
||||
* @return ChildFolderImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ImageI18nQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\FolderImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ImageI18nQuery();
|
||||
$query = new \Thelia\Model\FolderImageI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -112,19 +112,19 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildImageI18n|array|mixed the result, formatted by the current formatter
|
||||
* @return ChildFolderImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ImageI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
if ((null !== ($obj = FolderImageI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -143,11 +143,11 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildImageI18n A model object, or null if the key is not found
|
||||
* @return ChildFolderImageI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM folder_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
@@ -159,9 +159,9 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildImageI18n();
|
||||
$obj = new ChildFolderImageI18n();
|
||||
$obj->hydrate($row);
|
||||
ImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
FolderImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -174,7 +174,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildImageI18n|array|mixed the result, formatted by the current formatter
|
||||
* @return ChildFolderImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
@@ -216,12 +216,12 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(FolderImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(FolderImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -239,8 +239,8 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(FolderImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(FolderImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByImage()
|
||||
* @see filterByFolderImage()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
@@ -266,18 +266,18 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(FolderImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(FolderImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -288,7 +288,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
@@ -317,7 +317,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -333,7 +333,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
@@ -346,7 +346,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::TITLE, $title, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +362,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
@@ -375,7 +375,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -391,7 +391,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
@@ -404,7 +404,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -420,7 +420,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
@@ -433,46 +433,46 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
return $this->addUsingAlias(FolderImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
* Filter the query by a related \Thelia\Model\FolderImage object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image The related object(s) to use as filter
|
||||
* @param \Thelia\Model\FolderImage|ObjectCollection $folderImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByImage($image, $comparison = null)
|
||||
public function filterByFolderImage($folderImage, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
if ($folderImage instanceof \Thelia\Model\FolderImage) {
|
||||
return $this
|
||||
->addUsingAlias(ImageI18nTableMap::ID, $image->getId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
->addUsingAlias(FolderImageI18nTableMap::ID, $folderImage->getId(), $comparison);
|
||||
} elseif ($folderImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ImageI18nTableMap::ID, $image->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(FolderImageI18nTableMap::ID, $folderImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
throw new PropelException('filterByFolderImage() only accepts arguments of type \Thelia\Model\FolderImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image relation
|
||||
* Adds a JOIN clause to the query using the FolderImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
public function joinFolderImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
$relationMap = $tableMap->getRelation('FolderImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
@@ -487,14 +487,14 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Image');
|
||||
$this->addJoinObject($join, 'FolderImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image object
|
||||
* Use the FolderImage relation FolderImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
@@ -502,27 +502,27 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ImageQuery A secondary query class using the current class as primary query
|
||||
* @return \Thelia\Model\FolderImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
public function useFolderImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
->joinFolderImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderImage', '\Thelia\Model\FolderImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildImageI18n $imageI18n Object to remove from the list of results
|
||||
* @param ChildFolderImageI18n $folderImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildImageI18nQuery The current query, for fluid interface
|
||||
* @return ChildFolderImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($imageI18n = null)
|
||||
public function prune($folderImageI18n = null)
|
||||
{
|
||||
if ($imageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ImageI18nTableMap::ID), $imageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ImageI18nTableMap::LOCALE), $imageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
if ($folderImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(FolderImageI18nTableMap::ID), $folderImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(FolderImageI18nTableMap::LOCALE), $folderImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the image_i18n table.
|
||||
* Deletes all rows from the folder_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
@@ -538,7 +538,7 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
@@ -549,8 +549,8 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ImageI18nTableMap::clearInstancePool();
|
||||
ImageI18nTableMap::clearRelatedInstancePool();
|
||||
FolderImageI18nTableMap::clearInstancePool();
|
||||
FolderImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
@@ -562,9 +562,9 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildImageI18n or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ChildFolderImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildImageI18n object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ChildFolderImageI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
@@ -575,13 +575,13 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria->setDbName(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
@@ -591,10 +591,10 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
FolderImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ImageI18nTableMap::clearRelatedInstancePool();
|
||||
FolderImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
@@ -604,4 +604,4 @@ abstract class ImageI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
} // ImageI18nQuery
|
||||
} // FolderImageI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/FolderImageQuery.php
Normal file
846
core/lib/Thelia/Model/Base/FolderImageQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\FolderImage as ChildFolderImage;
|
||||
use Thelia\Model\FolderImageI18nQuery as ChildFolderImageI18nQuery;
|
||||
use Thelia\Model\FolderImageQuery as ChildFolderImageQuery;
|
||||
use Thelia\Model\Map\FolderImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'folder_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildFolderImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildFolderImageQuery orderByFolderId($order = Criteria::ASC) Order by the folder_id column
|
||||
* @method ChildFolderImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildFolderImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildFolderImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildFolderImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildFolderImageQuery groupById() Group by the id column
|
||||
* @method ChildFolderImageQuery groupByFolderId() Group by the folder_id column
|
||||
* @method ChildFolderImageQuery groupByFile() Group by the file column
|
||||
* @method ChildFolderImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildFolderImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildFolderImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildFolderImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildFolderImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildFolderImageQuery leftJoinFolder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Folder relation
|
||||
* @method ChildFolderImageQuery rightJoinFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Folder relation
|
||||
* @method ChildFolderImageQuery innerJoinFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the Folder relation
|
||||
*
|
||||
* @method ChildFolderImageQuery leftJoinFolderImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderImageI18n relation
|
||||
* @method ChildFolderImageQuery rightJoinFolderImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderImageI18n relation
|
||||
* @method ChildFolderImageQuery innerJoinFolderImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderImageI18n relation
|
||||
*
|
||||
* @method ChildFolderImage findOne(ConnectionInterface $con = null) Return the first ChildFolderImage matching the query
|
||||
* @method ChildFolderImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderImage matching the query, or a new ChildFolderImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildFolderImage findOneById(int $id) Return the first ChildFolderImage filtered by the id column
|
||||
* @method ChildFolderImage findOneByFolderId(int $folder_id) Return the first ChildFolderImage filtered by the folder_id column
|
||||
* @method ChildFolderImage findOneByFile(string $file) Return the first ChildFolderImage filtered by the file column
|
||||
* @method ChildFolderImage findOneByPosition(int $position) Return the first ChildFolderImage filtered by the position column
|
||||
* @method ChildFolderImage findOneByCreatedAt(string $created_at) Return the first ChildFolderImage filtered by the created_at column
|
||||
* @method ChildFolderImage findOneByUpdatedAt(string $updated_at) Return the first ChildFolderImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildFolderImage objects filtered by the id column
|
||||
* @method array findByFolderId(int $folder_id) Return ChildFolderImage objects filtered by the folder_id column
|
||||
* @method array findByFile(string $file) Return ChildFolderImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildFolderImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildFolderImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildFolderImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class FolderImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\FolderImageQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\FolderImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildFolderImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildFolderImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\FolderImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\FolderImageQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildFolderImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = FolderImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(FolderImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildFolderImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, FOLDER_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM folder_image WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildFolderImage();
|
||||
$obj->hydrate($row);
|
||||
FolderImageTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildFolderImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the folder_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFolderId(1234); // WHERE folder_id = 1234
|
||||
* $query->filterByFolderId(array(12, 34)); // WHERE folder_id IN (12, 34)
|
||||
* $query->filterByFolderId(array('min' => 12)); // WHERE folder_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByFolder()
|
||||
*
|
||||
* @param mixed $folderId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderId($folderId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($folderId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($folderId['min'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folderId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($folderId['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folderId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folderId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::FILE, $file, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $createdAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCreatedAt($createdAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($createdAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($createdAt['min'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $updatedAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($updatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($updatedAt['min'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(FolderImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(FolderImageTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Folder object
|
||||
*
|
||||
* @param \Thelia\Model\Folder|ObjectCollection $folder The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolder($folder, $comparison = null)
|
||||
{
|
||||
if ($folder instanceof \Thelia\Model\Folder) {
|
||||
return $this
|
||||
->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folder->getId(), $comparison);
|
||||
} elseif ($folder instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(FolderImageTableMap::FOLDER_ID, $folder->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByFolder() only accepts arguments of type \Thelia\Model\Folder or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Folder relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Folder');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Folder');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Folder relation Folder object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\FolderQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinFolder($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Folder', '\Thelia\Model\FolderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\FolderImageI18n|ObjectCollection $folderImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderImageI18n($folderImageI18n, $comparison = null)
|
||||
{
|
||||
if ($folderImageI18n instanceof \Thelia\Model\FolderImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(FolderImageTableMap::ID, $folderImageI18n->getId(), $comparison);
|
||||
} elseif ($folderImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useFolderImageI18nQuery()
|
||||
->filterByPrimaryKeys($folderImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByFolderImageI18n() only accepts arguments of type \Thelia\Model\FolderImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderImageI18n');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'FolderImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderImageI18n relation FolderImageI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\FolderImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinFolderImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderImageI18n', '\Thelia\Model\FolderImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildFolderImage $folderImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($folderImage = null)
|
||||
{
|
||||
if ($folderImage) {
|
||||
$this->addUsingAlias(FolderImageTableMap::ID, $folderImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the folder_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
FolderImageTableMap::clearInstancePool();
|
||||
FolderImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildFolderImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildFolderImage object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(FolderImageTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
FolderImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
FolderImageTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// timestampable behavior
|
||||
|
||||
/**
|
||||
* Filter by the latest updated
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(FolderImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(FolderImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(FolderImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(FolderImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(FolderImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(FolderImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'FolderImageI18n';
|
||||
|
||||
return $this
|
||||
->joinFolderImageI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('FolderImageI18n');
|
||||
$this->with['FolderImageI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildFolderImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderImageI18n', '\Thelia\Model\FolderImageI18nQuery');
|
||||
}
|
||||
|
||||
} // FolderImageQuery
|
||||
@@ -46,14 +46,6 @@ use Thelia\Model\Map\FolderTableMap;
|
||||
* @method ChildFolderQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildFolderQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildFolderQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildFolderQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildFolderQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildFolderQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinRewriting($relationAlias = null) Adds a LEFT JOIN clause to the query using the Rewriting relation
|
||||
* @method ChildFolderQuery rightJoinRewriting($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Rewriting relation
|
||||
* @method ChildFolderQuery innerJoinRewriting($relationAlias = null) Adds a INNER JOIN clause to the query using the Rewriting relation
|
||||
@@ -62,6 +54,14 @@ use Thelia\Model\Map\FolderTableMap;
|
||||
* @method ChildFolderQuery rightJoinContentFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentFolder relation
|
||||
* @method ChildFolderQuery innerJoinContentFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentFolder relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinFolderImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderImage relation
|
||||
* @method ChildFolderQuery rightJoinFolderImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderImage relation
|
||||
* @method ChildFolderQuery innerJoinFolderImage($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderImage relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinFolderDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderDocument relation
|
||||
* @method ChildFolderQuery rightJoinFolderDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderDocument relation
|
||||
* @method ChildFolderQuery innerJoinFolderDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderDocument relation
|
||||
*
|
||||
* @method ChildFolderQuery leftJoinFolderI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the FolderI18n relation
|
||||
* @method ChildFolderQuery rightJoinFolderI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FolderI18n relation
|
||||
* @method ChildFolderQuery innerJoinFolderI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the FolderI18n relation
|
||||
@@ -639,152 +639,6 @@ abstract class FolderQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(FolderTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByImage($image, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
return $this
|
||||
->addUsingAlias(FolderTableMap::ID, $image->getFolderId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useImageQuery()
|
||||
->filterByPrimaryKeys($image->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinImage($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Image');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDocument($document, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
return $this
|
||||
->addUsingAlias(FolderTableMap::ID, $document->getFolderId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useDocumentQuery()
|
||||
->filterByPrimaryKeys($document->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinDocument($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Document');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\DocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Rewriting object
|
||||
*
|
||||
@@ -931,6 +785,152 @@ abstract class FolderQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'ContentFolder', '\Thelia\Model\ContentFolderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderImage object
|
||||
*
|
||||
* @param \Thelia\Model\FolderImage|ObjectCollection $folderImage the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderImage($folderImage, $comparison = null)
|
||||
{
|
||||
if ($folderImage instanceof \Thelia\Model\FolderImage) {
|
||||
return $this
|
||||
->addUsingAlias(FolderTableMap::ID, $folderImage->getFolderId(), $comparison);
|
||||
} elseif ($folderImage instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useFolderImageQuery()
|
||||
->filterByPrimaryKeys($folderImage->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByFolderImage() only accepts arguments of type \Thelia\Model\FolderImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'FolderImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderImage relation FolderImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\FolderImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinFolderImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderImage', '\Thelia\Model\FolderImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderDocument object
|
||||
*
|
||||
* @param \Thelia\Model\FolderDocument|ObjectCollection $folderDocument the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolderDocument($folderDocument, $comparison = null)
|
||||
{
|
||||
if ($folderDocument instanceof \Thelia\Model\FolderDocument) {
|
||||
return $this
|
||||
->addUsingAlias(FolderTableMap::ID, $folderDocument->getFolderId(), $comparison);
|
||||
} elseif ($folderDocument instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useFolderDocumentQuery()
|
||||
->filterByPrimaryKeys($folderDocument->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByFolderDocument() only accepts arguments of type \Thelia\Model\FolderDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the FolderDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolderDocument($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('FolderDocument');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'FolderDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the FolderDocument relation FolderDocument object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\FolderDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useFolderDocumentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinFolderDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'FolderDocument', '\Thelia\Model\FolderDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\FolderI18n object
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -90,12 +90,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
*/
|
||||
protected $by_default;
|
||||
|
||||
/**
|
||||
* The value for the position field.
|
||||
* @var int
|
||||
*/
|
||||
protected $position;
|
||||
|
||||
/**
|
||||
* The value for the created_at field.
|
||||
* @var string
|
||||
@@ -436,17 +430,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
return $this->by_default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [position] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [created_at] column value.
|
||||
*
|
||||
@@ -613,27 +596,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setByDefault()
|
||||
|
||||
/**
|
||||
* Set the value of [position] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\Lang The current object (for fluent API support)
|
||||
*/
|
||||
public function setPosition($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->position !== $v) {
|
||||
$this->position = $v;
|
||||
$this->modifiedColumns[] = LangTableMap::POSITION;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setPosition()
|
||||
|
||||
/**
|
||||
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
|
||||
*
|
||||
@@ -731,16 +693,13 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : LangTableMap::translateFieldName('ByDefault', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->by_default = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : LangTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->position = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : LangTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : LangTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : LangTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : LangTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -753,7 +712,7 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 9; // 9 = LangTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 8; // 8 = LangTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\Lang object", 0, $e);
|
||||
@@ -991,9 +950,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(LangTableMap::BY_DEFAULT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'BY_DEFAULT';
|
||||
}
|
||||
if ($this->isColumnModified(LangTableMap::POSITION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'POSITION';
|
||||
}
|
||||
if ($this->isColumnModified(LangTableMap::CREATED_AT)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
|
||||
}
|
||||
@@ -1029,9 +985,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
case 'BY_DEFAULT':
|
||||
$stmt->bindValue($identifier, $this->by_default, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'POSITION':
|
||||
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'CREATED_AT':
|
||||
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1119,12 +1072,9 @@ abstract class Lang implements ActiveRecordInterface
|
||||
return $this->getByDefault();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getPosition();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 8:
|
||||
case 7:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1161,9 +1111,8 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$keys[3] => $this->getLocale(),
|
||||
$keys[4] => $this->getUrl(),
|
||||
$keys[5] => $this->getByDefault(),
|
||||
$keys[6] => $this->getPosition(),
|
||||
$keys[7] => $this->getCreatedAt(),
|
||||
$keys[8] => $this->getUpdatedAt(),
|
||||
$keys[6] => $this->getCreatedAt(),
|
||||
$keys[7] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach($virtualColumns as $key => $virtualColumn)
|
||||
@@ -1223,12 +1172,9 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$this->setByDefault($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setPosition($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 8:
|
||||
case 7:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1261,9 +1207,8 @@ abstract class Lang implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[3], $arr)) $this->setLocale($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setUrl($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setByDefault($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setPosition($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setCreatedAt($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setUpdatedAt($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1281,7 +1226,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(LangTableMap::LOCALE)) $criteria->add(LangTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(LangTableMap::URL)) $criteria->add(LangTableMap::URL, $this->url);
|
||||
if ($this->isColumnModified(LangTableMap::BY_DEFAULT)) $criteria->add(LangTableMap::BY_DEFAULT, $this->by_default);
|
||||
if ($this->isColumnModified(LangTableMap::POSITION)) $criteria->add(LangTableMap::POSITION, $this->position);
|
||||
if ($this->isColumnModified(LangTableMap::CREATED_AT)) $criteria->add(LangTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(LangTableMap::UPDATED_AT)) $criteria->add(LangTableMap::UPDATED_AT, $this->updated_at);
|
||||
|
||||
@@ -1352,7 +1296,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$copyObj->setLocale($this->getLocale());
|
||||
$copyObj->setUrl($this->getUrl());
|
||||
$copyObj->setByDefault($this->getByDefault());
|
||||
$copyObj->setPosition($this->getPosition());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
if ($makeNew) {
|
||||
@@ -1394,7 +1337,6 @@ abstract class Lang implements ActiveRecordInterface
|
||||
$this->locale = null;
|
||||
$this->url = null;
|
||||
$this->by_default = null;
|
||||
$this->position = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
$this->alreadyInSave = false;
|
||||
|
||||
@@ -24,7 +24,6 @@ use Thelia\Model\Map\LangTableMap;
|
||||
* @method ChildLangQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildLangQuery orderByUrl($order = Criteria::ASC) Order by the url column
|
||||
* @method ChildLangQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
|
||||
* @method ChildLangQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildLangQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildLangQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
@@ -34,7 +33,6 @@ use Thelia\Model\Map\LangTableMap;
|
||||
* @method ChildLangQuery groupByLocale() Group by the locale column
|
||||
* @method ChildLangQuery groupByUrl() Group by the url column
|
||||
* @method ChildLangQuery groupByByDefault() Group by the by_default column
|
||||
* @method ChildLangQuery groupByPosition() Group by the position column
|
||||
* @method ChildLangQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildLangQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
@@ -51,7 +49,6 @@ use Thelia\Model\Map\LangTableMap;
|
||||
* @method ChildLang findOneByLocale(string $locale) Return the first ChildLang filtered by the locale column
|
||||
* @method ChildLang findOneByUrl(string $url) Return the first ChildLang filtered by the url column
|
||||
* @method ChildLang findOneByByDefault(int $by_default) Return the first ChildLang filtered by the by_default column
|
||||
* @method ChildLang findOneByPosition(int $position) Return the first ChildLang filtered by the position column
|
||||
* @method ChildLang findOneByCreatedAt(string $created_at) Return the first ChildLang filtered by the created_at column
|
||||
* @method ChildLang findOneByUpdatedAt(string $updated_at) Return the first ChildLang filtered by the updated_at column
|
||||
*
|
||||
@@ -61,7 +58,6 @@ use Thelia\Model\Map\LangTableMap;
|
||||
* @method array findByLocale(string $locale) Return ChildLang objects filtered by the locale column
|
||||
* @method array findByUrl(string $url) Return ChildLang objects filtered by the url column
|
||||
* @method array findByByDefault(int $by_default) Return ChildLang objects filtered by the by_default column
|
||||
* @method array findByPosition(int $position) Return ChildLang objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildLang objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildLang objects filtered by the updated_at column
|
||||
*
|
||||
@@ -152,7 +148,7 @@ abstract class LangQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, TITLE, CODE, LOCALE, URL, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM lang WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, TITLE, CODE, LOCALE, URL, BY_DEFAULT, CREATED_AT, UPDATED_AT FROM lang WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -439,47 +435,6 @@ abstract class LangQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(LangTableMap::BY_DEFAULT, $byDefault, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildLangQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(LangTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(LangTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(LangTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
|
||||
@@ -25,15 +25,13 @@ use Thelia\Model\Category as ChildCategory;
|
||||
use Thelia\Model\CategoryQuery as ChildCategoryQuery;
|
||||
use Thelia\Model\ContentAssoc as ChildContentAssoc;
|
||||
use Thelia\Model\ContentAssocQuery as ChildContentAssocQuery;
|
||||
use Thelia\Model\Document as ChildDocument;
|
||||
use Thelia\Model\DocumentQuery as ChildDocumentQuery;
|
||||
use Thelia\Model\FeatureProduct as ChildFeatureProduct;
|
||||
use Thelia\Model\FeatureProductQuery as ChildFeatureProductQuery;
|
||||
use Thelia\Model\Image as ChildImage;
|
||||
use Thelia\Model\ImageQuery as ChildImageQuery;
|
||||
use Thelia\Model\Product as ChildProduct;
|
||||
use Thelia\Model\ProductCategory as ChildProductCategory;
|
||||
use Thelia\Model\ProductCategoryQuery as ChildProductCategoryQuery;
|
||||
use Thelia\Model\ProductDocument as ChildProductDocument;
|
||||
use Thelia\Model\ProductDocumentQuery as ChildProductDocumentQuery;
|
||||
use Thelia\Model\ProductI18n as ChildProductI18n;
|
||||
use Thelia\Model\ProductI18nQuery as ChildProductI18nQuery;
|
||||
use Thelia\Model\ProductQuery as ChildProductQuery;
|
||||
@@ -41,6 +39,8 @@ use Thelia\Model\ProductSaleElements as ChildProductSaleElements;
|
||||
use Thelia\Model\ProductSaleElementsQuery as ChildProductSaleElementsQuery;
|
||||
use Thelia\Model\ProductVersion as ChildProductVersion;
|
||||
use Thelia\Model\ProductVersionQuery as ChildProductVersionQuery;
|
||||
use Thelia\Model\ProdutImage as ChildProdutImage;
|
||||
use Thelia\Model\ProdutImageQuery as ChildProdutImageQuery;
|
||||
use Thelia\Model\Rewriting as ChildRewriting;
|
||||
use Thelia\Model\RewritingQuery as ChildRewritingQuery;
|
||||
use Thelia\Model\TaxRule as ChildTaxRule;
|
||||
@@ -174,16 +174,16 @@ abstract class Product implements ActiveRecordInterface
|
||||
protected $collContentAssocsPartial;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildImage[] Collection to store aggregation of ChildImage objects.
|
||||
* @var ObjectCollection|ChildProdutImage[] Collection to store aggregation of ChildProdutImage objects.
|
||||
*/
|
||||
protected $collImages;
|
||||
protected $collImagesPartial;
|
||||
protected $collProdutImages;
|
||||
protected $collProdutImagesPartial;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildDocument[] Collection to store aggregation of ChildDocument objects.
|
||||
* @var ObjectCollection|ChildProductDocument[] Collection to store aggregation of ChildProductDocument objects.
|
||||
*/
|
||||
protected $collDocuments;
|
||||
protected $collDocumentsPartial;
|
||||
protected $collProductDocuments;
|
||||
protected $collProductDocumentsPartial;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildAccessory[] Collection to store aggregation of ChildAccessory objects.
|
||||
@@ -312,13 +312,13 @@ abstract class Product implements ActiveRecordInterface
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var ObjectCollection
|
||||
*/
|
||||
protected $imagesScheduledForDeletion = null;
|
||||
protected $produtImagesScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var ObjectCollection
|
||||
*/
|
||||
protected $documentsScheduledForDeletion = null;
|
||||
protected $productDocumentsScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
@@ -1139,9 +1139,9 @@ abstract class Product implements ActiveRecordInterface
|
||||
|
||||
$this->collContentAssocs = null;
|
||||
|
||||
$this->collImages = null;
|
||||
$this->collProdutImages = null;
|
||||
|
||||
$this->collDocuments = null;
|
||||
$this->collProductDocuments = null;
|
||||
|
||||
$this->collAccessoriesRelatedByProductId = null;
|
||||
|
||||
@@ -1464,34 +1464,34 @@ abstract class Product implements ActiveRecordInterface
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->imagesScheduledForDeletion !== null) {
|
||||
if (!$this->imagesScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\ImageQuery::create()
|
||||
->filterByPrimaryKeys($this->imagesScheduledForDeletion->getPrimaryKeys(false))
|
||||
if ($this->produtImagesScheduledForDeletion !== null) {
|
||||
if (!$this->produtImagesScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\ProdutImageQuery::create()
|
||||
->filterByPrimaryKeys($this->produtImagesScheduledForDeletion->getPrimaryKeys(false))
|
||||
->delete($con);
|
||||
$this->imagesScheduledForDeletion = null;
|
||||
$this->produtImagesScheduledForDeletion = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collImages !== null) {
|
||||
foreach ($this->collImages as $referrerFK) {
|
||||
if ($this->collProdutImages !== null) {
|
||||
foreach ($this->collProdutImages as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->documentsScheduledForDeletion !== null) {
|
||||
if (!$this->documentsScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\DocumentQuery::create()
|
||||
->filterByPrimaryKeys($this->documentsScheduledForDeletion->getPrimaryKeys(false))
|
||||
if ($this->productDocumentsScheduledForDeletion !== null) {
|
||||
if (!$this->productDocumentsScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\ProductDocumentQuery::create()
|
||||
->filterByPrimaryKeys($this->productDocumentsScheduledForDeletion->getPrimaryKeys(false))
|
||||
->delete($con);
|
||||
$this->documentsScheduledForDeletion = null;
|
||||
$this->productDocumentsScheduledForDeletion = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collDocuments !== null) {
|
||||
foreach ($this->collDocuments as $referrerFK) {
|
||||
if ($this->collProductDocuments !== null) {
|
||||
foreach ($this->collProductDocuments as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
@@ -1851,11 +1851,11 @@ abstract class Product implements ActiveRecordInterface
|
||||
if (null !== $this->collContentAssocs) {
|
||||
$result['ContentAssocs'] = $this->collContentAssocs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collImages) {
|
||||
$result['Images'] = $this->collImages->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
if (null !== $this->collProdutImages) {
|
||||
$result['ProdutImages'] = $this->collProdutImages->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collDocuments) {
|
||||
$result['Documents'] = $this->collDocuments->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
if (null !== $this->collProductDocuments) {
|
||||
$result['ProductDocuments'] = $this->collProductDocuments->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collAccessoriesRelatedByProductId) {
|
||||
$result['AccessoriesRelatedByProductId'] = $this->collAccessoriesRelatedByProductId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
@@ -2096,15 +2096,15 @@ abstract class Product implements ActiveRecordInterface
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getImages() as $relObj) {
|
||||
foreach ($this->getProdutImages() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addImage($relObj->copy($deepCopy));
|
||||
$copyObj->addProdutImage($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getDocuments() as $relObj) {
|
||||
foreach ($this->getProductDocuments() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addDocument($relObj->copy($deepCopy));
|
||||
$copyObj->addProductDocument($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2248,11 +2248,11 @@ abstract class Product implements ActiveRecordInterface
|
||||
if ('ContentAssoc' == $relationName) {
|
||||
return $this->initContentAssocs();
|
||||
}
|
||||
if ('Image' == $relationName) {
|
||||
return $this->initImages();
|
||||
if ('ProdutImage' == $relationName) {
|
||||
return $this->initProdutImages();
|
||||
}
|
||||
if ('Document' == $relationName) {
|
||||
return $this->initDocuments();
|
||||
if ('ProductDocument' == $relationName) {
|
||||
return $this->initProductDocuments();
|
||||
}
|
||||
if ('AccessoryRelatedByProductId' == $relationName) {
|
||||
return $this->initAccessoriesRelatedByProductId();
|
||||
@@ -3275,31 +3275,31 @@ abstract class Product implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collImages collection
|
||||
* Clears out the collProdutImages collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return void
|
||||
* @see addImages()
|
||||
* @see addProdutImages()
|
||||
*/
|
||||
public function clearImages()
|
||||
public function clearProdutImages()
|
||||
{
|
||||
$this->collImages = null; // important to set this to NULL since that means it is uninitialized
|
||||
$this->collProdutImages = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset is the collImages collection loaded partially.
|
||||
* Reset is the collProdutImages collection loaded partially.
|
||||
*/
|
||||
public function resetPartialImages($v = true)
|
||||
public function resetPartialProdutImages($v = true)
|
||||
{
|
||||
$this->collImagesPartial = $v;
|
||||
$this->collProdutImagesPartial = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collImages collection.
|
||||
* Initializes the collProdutImages collection.
|
||||
*
|
||||
* By default this just sets the collImages collection to an empty array (like clearcollImages());
|
||||
* By default this just sets the collProdutImages collection to an empty array (like clearcollProdutImages());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
@@ -3308,17 +3308,17 @@ abstract class Product implements ActiveRecordInterface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initImages($overrideExisting = true)
|
||||
public function initProdutImages($overrideExisting = true)
|
||||
{
|
||||
if (null !== $this->collImages && !$overrideExisting) {
|
||||
if (null !== $this->collProdutImages && !$overrideExisting) {
|
||||
return;
|
||||
}
|
||||
$this->collImages = new ObjectCollection();
|
||||
$this->collImages->setModel('\Thelia\Model\Image');
|
||||
$this->collProdutImages = new ObjectCollection();
|
||||
$this->collProdutImages->setModel('\Thelia\Model\ProdutImage');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of ChildImage objects which contain a foreign key that references this object.
|
||||
* Gets an array of ChildProdutImage objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
@@ -3328,109 +3328,109 @@ abstract class Product implements ActiveRecordInterface
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @return Collection|ChildImage[] List of ChildImage objects
|
||||
* @return Collection|ChildProdutImage[] List of ChildProdutImage objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getImages($criteria = null, ConnectionInterface $con = null)
|
||||
public function getProdutImages($criteria = null, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collImagesPartial && !$this->isNew();
|
||||
if (null === $this->collImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collImages) {
|
||||
$partial = $this->collProdutImagesPartial && !$this->isNew();
|
||||
if (null === $this->collProdutImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collProdutImages) {
|
||||
// return empty collection
|
||||
$this->initImages();
|
||||
$this->initProdutImages();
|
||||
} else {
|
||||
$collImages = ChildImageQuery::create(null, $criteria)
|
||||
$collProdutImages = ChildProdutImageQuery::create(null, $criteria)
|
||||
->filterByProduct($this)
|
||||
->find($con);
|
||||
|
||||
if (null !== $criteria) {
|
||||
if (false !== $this->collImagesPartial && count($collImages)) {
|
||||
$this->initImages(false);
|
||||
if (false !== $this->collProdutImagesPartial && count($collProdutImages)) {
|
||||
$this->initProdutImages(false);
|
||||
|
||||
foreach ($collImages as $obj) {
|
||||
if (false == $this->collImages->contains($obj)) {
|
||||
$this->collImages->append($obj);
|
||||
foreach ($collProdutImages as $obj) {
|
||||
if (false == $this->collProdutImages->contains($obj)) {
|
||||
$this->collProdutImages->append($obj);
|
||||
}
|
||||
}
|
||||
|
||||
$this->collImagesPartial = true;
|
||||
$this->collProdutImagesPartial = true;
|
||||
}
|
||||
|
||||
$collImages->getInternalIterator()->rewind();
|
||||
$collProdutImages->getInternalIterator()->rewind();
|
||||
|
||||
return $collImages;
|
||||
return $collProdutImages;
|
||||
}
|
||||
|
||||
if ($partial && $this->collImages) {
|
||||
foreach ($this->collImages as $obj) {
|
||||
if ($partial && $this->collProdutImages) {
|
||||
foreach ($this->collProdutImages as $obj) {
|
||||
if ($obj->isNew()) {
|
||||
$collImages[] = $obj;
|
||||
$collProdutImages[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->collImages = $collImages;
|
||||
$this->collImagesPartial = false;
|
||||
$this->collProdutImages = $collProdutImages;
|
||||
$this->collProdutImagesPartial = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->collImages;
|
||||
return $this->collProdutImages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a collection of Image objects related by a one-to-many relationship
|
||||
* Sets a collection of ProdutImage objects related by a one-to-many relationship
|
||||
* to the current object.
|
||||
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
|
||||
* and new objects from the given Propel collection.
|
||||
*
|
||||
* @param Collection $images A Propel collection.
|
||||
* @param Collection $produtImages A Propel collection.
|
||||
* @param ConnectionInterface $con Optional connection object
|
||||
* @return ChildProduct The current object (for fluent API support)
|
||||
*/
|
||||
public function setImages(Collection $images, ConnectionInterface $con = null)
|
||||
public function setProdutImages(Collection $produtImages, ConnectionInterface $con = null)
|
||||
{
|
||||
$imagesToDelete = $this->getImages(new Criteria(), $con)->diff($images);
|
||||
$produtImagesToDelete = $this->getProdutImages(new Criteria(), $con)->diff($produtImages);
|
||||
|
||||
|
||||
$this->imagesScheduledForDeletion = $imagesToDelete;
|
||||
$this->produtImagesScheduledForDeletion = $produtImagesToDelete;
|
||||
|
||||
foreach ($imagesToDelete as $imageRemoved) {
|
||||
$imageRemoved->setProduct(null);
|
||||
foreach ($produtImagesToDelete as $produtImageRemoved) {
|
||||
$produtImageRemoved->setProduct(null);
|
||||
}
|
||||
|
||||
$this->collImages = null;
|
||||
foreach ($images as $image) {
|
||||
$this->addImage($image);
|
||||
$this->collProdutImages = null;
|
||||
foreach ($produtImages as $produtImage) {
|
||||
$this->addProdutImage($produtImage);
|
||||
}
|
||||
|
||||
$this->collImages = $images;
|
||||
$this->collImagesPartial = false;
|
||||
$this->collProdutImages = $produtImages;
|
||||
$this->collProdutImagesPartial = false;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related Image objects.
|
||||
* Returns the number of related ProdutImage objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param ConnectionInterface $con
|
||||
* @return int Count of related Image objects.
|
||||
* @return int Count of related ProdutImage objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countImages(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
public function countProdutImages(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collImagesPartial && !$this->isNew();
|
||||
if (null === $this->collImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collImages) {
|
||||
$partial = $this->collProdutImagesPartial && !$this->isNew();
|
||||
if (null === $this->collProdutImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collProdutImages) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($partial && !$criteria) {
|
||||
return count($this->getImages());
|
||||
return count($this->getProdutImages());
|
||||
}
|
||||
|
||||
$query = ChildImageQuery::create(null, $criteria);
|
||||
$query = ChildProdutImageQuery::create(null, $criteria);
|
||||
if ($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
@@ -3440,159 +3440,84 @@ abstract class Product implements ActiveRecordInterface
|
||||
->count($con);
|
||||
}
|
||||
|
||||
return count($this->collImages);
|
||||
return count($this->collProdutImages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a ChildImage object to this object
|
||||
* through the ChildImage foreign key attribute.
|
||||
* Method called to associate a ChildProdutImage object to this object
|
||||
* through the ChildProdutImage foreign key attribute.
|
||||
*
|
||||
* @param ChildImage $l ChildImage
|
||||
* @param ChildProdutImage $l ChildProdutImage
|
||||
* @return \Thelia\Model\Product The current object (for fluent API support)
|
||||
*/
|
||||
public function addImage(ChildImage $l)
|
||||
public function addProdutImage(ChildProdutImage $l)
|
||||
{
|
||||
if ($this->collImages === null) {
|
||||
$this->initImages();
|
||||
$this->collImagesPartial = true;
|
||||
if ($this->collProdutImages === null) {
|
||||
$this->initProdutImages();
|
||||
$this->collProdutImagesPartial = true;
|
||||
}
|
||||
|
||||
if (!in_array($l, $this->collImages->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddImage($l);
|
||||
if (!in_array($l, $this->collProdutImages->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddProdutImage($l);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Image $image The image object to add.
|
||||
* @param ProdutImage $produtImage The produtImage object to add.
|
||||
*/
|
||||
protected function doAddImage($image)
|
||||
protected function doAddProdutImage($produtImage)
|
||||
{
|
||||
$this->collImages[]= $image;
|
||||
$image->setProduct($this);
|
||||
$this->collProdutImages[]= $produtImage;
|
||||
$produtImage->setProduct($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Image $image The image object to remove.
|
||||
* @param ProdutImage $produtImage The produtImage object to remove.
|
||||
* @return ChildProduct The current object (for fluent API support)
|
||||
*/
|
||||
public function removeImage($image)
|
||||
public function removeProdutImage($produtImage)
|
||||
{
|
||||
if ($this->getImages()->contains($image)) {
|
||||
$this->collImages->remove($this->collImages->search($image));
|
||||
if (null === $this->imagesScheduledForDeletion) {
|
||||
$this->imagesScheduledForDeletion = clone $this->collImages;
|
||||
$this->imagesScheduledForDeletion->clear();
|
||||
if ($this->getProdutImages()->contains($produtImage)) {
|
||||
$this->collProdutImages->remove($this->collProdutImages->search($produtImage));
|
||||
if (null === $this->produtImagesScheduledForDeletion) {
|
||||
$this->produtImagesScheduledForDeletion = clone $this->collProdutImages;
|
||||
$this->produtImagesScheduledForDeletion->clear();
|
||||
}
|
||||
$this->imagesScheduledForDeletion[]= $image;
|
||||
$image->setProduct(null);
|
||||
$this->produtImagesScheduledForDeletion[]= clone $produtImage;
|
||||
$produtImage->setProduct(null);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this Product is new, it will return
|
||||
* an empty collection; or if this Product has previously
|
||||
* been saved, it will retrieve related Images from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in Product.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return Collection|ChildImage[] List of ChildImage objects
|
||||
*/
|
||||
public function getImagesJoinCategory($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildImageQuery::create(null, $criteria);
|
||||
$query->joinWith('Category', $joinBehavior);
|
||||
|
||||
return $this->getImages($query, $con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this Product is new, it will return
|
||||
* an empty collection; or if this Product has previously
|
||||
* been saved, it will retrieve related Images from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in Product.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return Collection|ChildImage[] List of ChildImage objects
|
||||
*/
|
||||
public function getImagesJoinContent($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildImageQuery::create(null, $criteria);
|
||||
$query->joinWith('Content', $joinBehavior);
|
||||
|
||||
return $this->getImages($query, $con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this Product is new, it will return
|
||||
* an empty collection; or if this Product has previously
|
||||
* been saved, it will retrieve related Images from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in Product.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return Collection|ChildImage[] List of ChildImage objects
|
||||
*/
|
||||
public function getImagesJoinFolder($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildImageQuery::create(null, $criteria);
|
||||
$query->joinWith('Folder', $joinBehavior);
|
||||
|
||||
return $this->getImages($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collDocuments collection
|
||||
* Clears out the collProductDocuments collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return void
|
||||
* @see addDocuments()
|
||||
* @see addProductDocuments()
|
||||
*/
|
||||
public function clearDocuments()
|
||||
public function clearProductDocuments()
|
||||
{
|
||||
$this->collDocuments = null; // important to set this to NULL since that means it is uninitialized
|
||||
$this->collProductDocuments = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset is the collDocuments collection loaded partially.
|
||||
* Reset is the collProductDocuments collection loaded partially.
|
||||
*/
|
||||
public function resetPartialDocuments($v = true)
|
||||
public function resetPartialProductDocuments($v = true)
|
||||
{
|
||||
$this->collDocumentsPartial = $v;
|
||||
$this->collProductDocumentsPartial = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collDocuments collection.
|
||||
* Initializes the collProductDocuments collection.
|
||||
*
|
||||
* By default this just sets the collDocuments collection to an empty array (like clearcollDocuments());
|
||||
* By default this just sets the collProductDocuments collection to an empty array (like clearcollProductDocuments());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
@@ -3601,17 +3526,17 @@ abstract class Product implements ActiveRecordInterface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initDocuments($overrideExisting = true)
|
||||
public function initProductDocuments($overrideExisting = true)
|
||||
{
|
||||
if (null !== $this->collDocuments && !$overrideExisting) {
|
||||
if (null !== $this->collProductDocuments && !$overrideExisting) {
|
||||
return;
|
||||
}
|
||||
$this->collDocuments = new ObjectCollection();
|
||||
$this->collDocuments->setModel('\Thelia\Model\Document');
|
||||
$this->collProductDocuments = new ObjectCollection();
|
||||
$this->collProductDocuments->setModel('\Thelia\Model\ProductDocument');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of ChildDocument objects which contain a foreign key that references this object.
|
||||
* Gets an array of ChildProductDocument objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
@@ -3621,109 +3546,109 @@ abstract class Product implements ActiveRecordInterface
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @return Collection|ChildDocument[] List of ChildDocument objects
|
||||
* @return Collection|ChildProductDocument[] List of ChildProductDocument objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getDocuments($criteria = null, ConnectionInterface $con = null)
|
||||
public function getProductDocuments($criteria = null, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collDocumentsPartial && !$this->isNew();
|
||||
if (null === $this->collDocuments || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collDocuments) {
|
||||
$partial = $this->collProductDocumentsPartial && !$this->isNew();
|
||||
if (null === $this->collProductDocuments || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collProductDocuments) {
|
||||
// return empty collection
|
||||
$this->initDocuments();
|
||||
$this->initProductDocuments();
|
||||
} else {
|
||||
$collDocuments = ChildDocumentQuery::create(null, $criteria)
|
||||
$collProductDocuments = ChildProductDocumentQuery::create(null, $criteria)
|
||||
->filterByProduct($this)
|
||||
->find($con);
|
||||
|
||||
if (null !== $criteria) {
|
||||
if (false !== $this->collDocumentsPartial && count($collDocuments)) {
|
||||
$this->initDocuments(false);
|
||||
if (false !== $this->collProductDocumentsPartial && count($collProductDocuments)) {
|
||||
$this->initProductDocuments(false);
|
||||
|
||||
foreach ($collDocuments as $obj) {
|
||||
if (false == $this->collDocuments->contains($obj)) {
|
||||
$this->collDocuments->append($obj);
|
||||
foreach ($collProductDocuments as $obj) {
|
||||
if (false == $this->collProductDocuments->contains($obj)) {
|
||||
$this->collProductDocuments->append($obj);
|
||||
}
|
||||
}
|
||||
|
||||
$this->collDocumentsPartial = true;
|
||||
$this->collProductDocumentsPartial = true;
|
||||
}
|
||||
|
||||
$collDocuments->getInternalIterator()->rewind();
|
||||
$collProductDocuments->getInternalIterator()->rewind();
|
||||
|
||||
return $collDocuments;
|
||||
return $collProductDocuments;
|
||||
}
|
||||
|
||||
if ($partial && $this->collDocuments) {
|
||||
foreach ($this->collDocuments as $obj) {
|
||||
if ($partial && $this->collProductDocuments) {
|
||||
foreach ($this->collProductDocuments as $obj) {
|
||||
if ($obj->isNew()) {
|
||||
$collDocuments[] = $obj;
|
||||
$collProductDocuments[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->collDocuments = $collDocuments;
|
||||
$this->collDocumentsPartial = false;
|
||||
$this->collProductDocuments = $collProductDocuments;
|
||||
$this->collProductDocumentsPartial = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->collDocuments;
|
||||
return $this->collProductDocuments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a collection of Document objects related by a one-to-many relationship
|
||||
* Sets a collection of ProductDocument objects related by a one-to-many relationship
|
||||
* to the current object.
|
||||
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
|
||||
* and new objects from the given Propel collection.
|
||||
*
|
||||
* @param Collection $documents A Propel collection.
|
||||
* @param Collection $productDocuments A Propel collection.
|
||||
* @param ConnectionInterface $con Optional connection object
|
||||
* @return ChildProduct The current object (for fluent API support)
|
||||
*/
|
||||
public function setDocuments(Collection $documents, ConnectionInterface $con = null)
|
||||
public function setProductDocuments(Collection $productDocuments, ConnectionInterface $con = null)
|
||||
{
|
||||
$documentsToDelete = $this->getDocuments(new Criteria(), $con)->diff($documents);
|
||||
$productDocumentsToDelete = $this->getProductDocuments(new Criteria(), $con)->diff($productDocuments);
|
||||
|
||||
|
||||
$this->documentsScheduledForDeletion = $documentsToDelete;
|
||||
$this->productDocumentsScheduledForDeletion = $productDocumentsToDelete;
|
||||
|
||||
foreach ($documentsToDelete as $documentRemoved) {
|
||||
$documentRemoved->setProduct(null);
|
||||
foreach ($productDocumentsToDelete as $productDocumentRemoved) {
|
||||
$productDocumentRemoved->setProduct(null);
|
||||
}
|
||||
|
||||
$this->collDocuments = null;
|
||||
foreach ($documents as $document) {
|
||||
$this->addDocument($document);
|
||||
$this->collProductDocuments = null;
|
||||
foreach ($productDocuments as $productDocument) {
|
||||
$this->addProductDocument($productDocument);
|
||||
}
|
||||
|
||||
$this->collDocuments = $documents;
|
||||
$this->collDocumentsPartial = false;
|
||||
$this->collProductDocuments = $productDocuments;
|
||||
$this->collProductDocumentsPartial = false;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related Document objects.
|
||||
* Returns the number of related ProductDocument objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param ConnectionInterface $con
|
||||
* @return int Count of related Document objects.
|
||||
* @return int Count of related ProductDocument objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countDocuments(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
public function countProductDocuments(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collDocumentsPartial && !$this->isNew();
|
||||
if (null === $this->collDocuments || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collDocuments) {
|
||||
$partial = $this->collProductDocumentsPartial && !$this->isNew();
|
||||
if (null === $this->collProductDocuments || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collProductDocuments) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($partial && !$criteria) {
|
||||
return count($this->getDocuments());
|
||||
return count($this->getProductDocuments());
|
||||
}
|
||||
|
||||
$query = ChildDocumentQuery::create(null, $criteria);
|
||||
$query = ChildProductDocumentQuery::create(null, $criteria);
|
||||
if ($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
@@ -3733,133 +3658,58 @@ abstract class Product implements ActiveRecordInterface
|
||||
->count($con);
|
||||
}
|
||||
|
||||
return count($this->collDocuments);
|
||||
return count($this->collProductDocuments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a ChildDocument object to this object
|
||||
* through the ChildDocument foreign key attribute.
|
||||
* Method called to associate a ChildProductDocument object to this object
|
||||
* through the ChildProductDocument foreign key attribute.
|
||||
*
|
||||
* @param ChildDocument $l ChildDocument
|
||||
* @param ChildProductDocument $l ChildProductDocument
|
||||
* @return \Thelia\Model\Product The current object (for fluent API support)
|
||||
*/
|
||||
public function addDocument(ChildDocument $l)
|
||||
public function addProductDocument(ChildProductDocument $l)
|
||||
{
|
||||
if ($this->collDocuments === null) {
|
||||
$this->initDocuments();
|
||||
$this->collDocumentsPartial = true;
|
||||
if ($this->collProductDocuments === null) {
|
||||
$this->initProductDocuments();
|
||||
$this->collProductDocumentsPartial = true;
|
||||
}
|
||||
|
||||
if (!in_array($l, $this->collDocuments->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddDocument($l);
|
||||
if (!in_array($l, $this->collProductDocuments->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddProductDocument($l);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Document $document The document object to add.
|
||||
* @param ProductDocument $productDocument The productDocument object to add.
|
||||
*/
|
||||
protected function doAddDocument($document)
|
||||
protected function doAddProductDocument($productDocument)
|
||||
{
|
||||
$this->collDocuments[]= $document;
|
||||
$document->setProduct($this);
|
||||
$this->collProductDocuments[]= $productDocument;
|
||||
$productDocument->setProduct($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Document $document The document object to remove.
|
||||
* @param ProductDocument $productDocument The productDocument object to remove.
|
||||
* @return ChildProduct The current object (for fluent API support)
|
||||
*/
|
||||
public function removeDocument($document)
|
||||
public function removeProductDocument($productDocument)
|
||||
{
|
||||
if ($this->getDocuments()->contains($document)) {
|
||||
$this->collDocuments->remove($this->collDocuments->search($document));
|
||||
if (null === $this->documentsScheduledForDeletion) {
|
||||
$this->documentsScheduledForDeletion = clone $this->collDocuments;
|
||||
$this->documentsScheduledForDeletion->clear();
|
||||
if ($this->getProductDocuments()->contains($productDocument)) {
|
||||
$this->collProductDocuments->remove($this->collProductDocuments->search($productDocument));
|
||||
if (null === $this->productDocumentsScheduledForDeletion) {
|
||||
$this->productDocumentsScheduledForDeletion = clone $this->collProductDocuments;
|
||||
$this->productDocumentsScheduledForDeletion->clear();
|
||||
}
|
||||
$this->documentsScheduledForDeletion[]= $document;
|
||||
$document->setProduct(null);
|
||||
$this->productDocumentsScheduledForDeletion[]= clone $productDocument;
|
||||
$productDocument->setProduct(null);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this Product is new, it will return
|
||||
* an empty collection; or if this Product has previously
|
||||
* been saved, it will retrieve related Documents from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in Product.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return Collection|ChildDocument[] List of ChildDocument objects
|
||||
*/
|
||||
public function getDocumentsJoinCategory($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildDocumentQuery::create(null, $criteria);
|
||||
$query->joinWith('Category', $joinBehavior);
|
||||
|
||||
return $this->getDocuments($query, $con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this Product is new, it will return
|
||||
* an empty collection; or if this Product has previously
|
||||
* been saved, it will retrieve related Documents from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in Product.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return Collection|ChildDocument[] List of ChildDocument objects
|
||||
*/
|
||||
public function getDocumentsJoinContent($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildDocumentQuery::create(null, $criteria);
|
||||
$query->joinWith('Content', $joinBehavior);
|
||||
|
||||
return $this->getDocuments($query, $con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this Product is new, it will return
|
||||
* an empty collection; or if this Product has previously
|
||||
* been saved, it will retrieve related Documents from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in Product.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return Collection|ChildDocument[] List of ChildDocument objects
|
||||
*/
|
||||
public function getDocumentsJoinFolder($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = ChildDocumentQuery::create(null, $criteria);
|
||||
$query->joinWith('Folder', $joinBehavior);
|
||||
|
||||
return $this->getDocuments($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collAccessoriesRelatedByProductId collection
|
||||
*
|
||||
@@ -5907,13 +5757,13 @@ abstract class Product implements ActiveRecordInterface
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collImages) {
|
||||
foreach ($this->collImages as $o) {
|
||||
if ($this->collProdutImages) {
|
||||
foreach ($this->collProdutImages as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collDocuments) {
|
||||
foreach ($this->collDocuments as $o) {
|
||||
if ($this->collProductDocuments) {
|
||||
foreach ($this->collProductDocuments as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
@@ -5984,14 +5834,14 @@ abstract class Product implements ActiveRecordInterface
|
||||
$this->collContentAssocs->clearIterator();
|
||||
}
|
||||
$this->collContentAssocs = null;
|
||||
if ($this->collImages instanceof Collection) {
|
||||
$this->collImages->clearIterator();
|
||||
if ($this->collProdutImages instanceof Collection) {
|
||||
$this->collProdutImages->clearIterator();
|
||||
}
|
||||
$this->collImages = null;
|
||||
if ($this->collDocuments instanceof Collection) {
|
||||
$this->collDocuments->clearIterator();
|
||||
$this->collProdutImages = null;
|
||||
if ($this->collProductDocuments instanceof Collection) {
|
||||
$this->collProductDocuments->clearIterator();
|
||||
}
|
||||
$this->collDocuments = null;
|
||||
$this->collProductDocuments = null;
|
||||
if ($this->collAccessoriesRelatedByProductId instanceof Collection) {
|
||||
$this->collAccessoriesRelatedByProductId->clearIterator();
|
||||
}
|
||||
|
||||
1990
core/lib/Thelia/Model/Base/ProductDocument.php
Normal file
1990
core/lib/Thelia/Model/Base/ProductDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/ProductDocumentI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/ProductDocumentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/ProductDocumentI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/ProductDocumentI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ProductDocumentI18n as ChildProductDocumentI18n;
|
||||
use Thelia\Model\ProductDocumentI18nQuery as ChildProductDocumentI18nQuery;
|
||||
use Thelia\Model\Map\ProductDocumentI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'product_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildProductDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildProductDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildProductDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildProductDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildProductDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildProductDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildProductDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildProductDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildProductDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildProductDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildProductDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildProductDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildProductDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildProductDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildProductDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildProductDocumentI18nQuery leftJoinProductDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductDocument relation
|
||||
* @method ChildProductDocumentI18nQuery rightJoinProductDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductDocument relation
|
||||
* @method ChildProductDocumentI18nQuery innerJoinProductDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductDocument relation
|
||||
*
|
||||
* @method ChildProductDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildProductDocumentI18n matching the query
|
||||
* @method ChildProductDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProductDocumentI18n matching the query, or a new ChildProductDocumentI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildProductDocumentI18n findOneById(int $id) Return the first ChildProductDocumentI18n filtered by the id column
|
||||
* @method ChildProductDocumentI18n findOneByLocale(string $locale) Return the first ChildProductDocumentI18n filtered by the locale column
|
||||
* @method ChildProductDocumentI18n findOneByTitle(string $title) Return the first ChildProductDocumentI18n filtered by the title column
|
||||
* @method ChildProductDocumentI18n findOneByDescription(string $description) Return the first ChildProductDocumentI18n filtered by the description column
|
||||
* @method ChildProductDocumentI18n findOneByChapo(string $chapo) Return the first ChildProductDocumentI18n filtered by the chapo column
|
||||
* @method ChildProductDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildProductDocumentI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildProductDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildProductDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildProductDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildProductDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildProductDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildProductDocumentI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class ProductDocumentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ProductDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ProductDocumentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildProductDocumentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ProductDocumentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ProductDocumentI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildProductDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ProductDocumentI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProductDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildProductDocumentI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM product_document_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildProductDocumentI18n();
|
||||
$obj->hydrate($row);
|
||||
ProductDocumentI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildProductDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ProductDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ProductDocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
if (empty($keys)) {
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ProductDocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ProductDocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByProductDocument()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ProductDocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the locale column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
|
||||
* $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $locale The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($locale)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $locale)) {
|
||||
$locale = str_replace('*', '%', $locale);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ProductDocument object
|
||||
*
|
||||
* @param \Thelia\Model\ProductDocument|ObjectCollection $productDocument The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProductDocument($productDocument, $comparison = null)
|
||||
{
|
||||
if ($productDocument instanceof \Thelia\Model\ProductDocument) {
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentI18nTableMap::ID, $productDocument->getId(), $comparison);
|
||||
} elseif ($productDocument instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentI18nTableMap::ID, $productDocument->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByProductDocument() only accepts arguments of type \Thelia\Model\ProductDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ProductDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProductDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ProductDocument');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ProductDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ProductDocument relation ProductDocument object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ProductDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useProductDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinProductDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProductDocument', '\Thelia\Model\ProductDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildProductDocumentI18n $productDocumentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($productDocumentI18n = null)
|
||||
{
|
||||
if ($productDocumentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ProductDocumentI18nTableMap::ID), $productDocumentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ProductDocumentI18nTableMap::LOCALE), $productDocumentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the product_document_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProductDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ProductDocumentI18nTableMap::clearInstancePool();
|
||||
ProductDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildProductDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildProductDocumentI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProductDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ProductDocumentI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ProductDocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ProductDocumentI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ProductDocumentI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/ProductDocumentQuery.php
Normal file
846
core/lib/Thelia/Model/Base/ProductDocumentQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ProductDocument as ChildProductDocument;
|
||||
use Thelia\Model\ProductDocumentI18nQuery as ChildProductDocumentI18nQuery;
|
||||
use Thelia\Model\ProductDocumentQuery as ChildProductDocumentQuery;
|
||||
use Thelia\Model\Map\ProductDocumentTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'product_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildProductDocumentQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildProductDocumentQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
|
||||
* @method ChildProductDocumentQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildProductDocumentQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildProductDocumentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildProductDocumentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildProductDocumentQuery groupById() Group by the id column
|
||||
* @method ChildProductDocumentQuery groupByProductId() Group by the product_id column
|
||||
* @method ChildProductDocumentQuery groupByFile() Group by the file column
|
||||
* @method ChildProductDocumentQuery groupByPosition() Group by the position column
|
||||
* @method ChildProductDocumentQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildProductDocumentQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildProductDocumentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildProductDocumentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildProductDocumentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildProductDocumentQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
|
||||
* @method ChildProductDocumentQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
|
||||
* @method ChildProductDocumentQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
|
||||
*
|
||||
* @method ChildProductDocumentQuery leftJoinProductDocumentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductDocumentI18n relation
|
||||
* @method ChildProductDocumentQuery rightJoinProductDocumentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductDocumentI18n relation
|
||||
* @method ChildProductDocumentQuery innerJoinProductDocumentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductDocumentI18n relation
|
||||
*
|
||||
* @method ChildProductDocument findOne(ConnectionInterface $con = null) Return the first ChildProductDocument matching the query
|
||||
* @method ChildProductDocument findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProductDocument matching the query, or a new ChildProductDocument object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildProductDocument findOneById(int $id) Return the first ChildProductDocument filtered by the id column
|
||||
* @method ChildProductDocument findOneByProductId(int $product_id) Return the first ChildProductDocument filtered by the product_id column
|
||||
* @method ChildProductDocument findOneByFile(string $file) Return the first ChildProductDocument filtered by the file column
|
||||
* @method ChildProductDocument findOneByPosition(int $position) Return the first ChildProductDocument filtered by the position column
|
||||
* @method ChildProductDocument findOneByCreatedAt(string $created_at) Return the first ChildProductDocument filtered by the created_at column
|
||||
* @method ChildProductDocument findOneByUpdatedAt(string $updated_at) Return the first ChildProductDocument filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildProductDocument objects filtered by the id column
|
||||
* @method array findByProductId(int $product_id) Return ChildProductDocument objects filtered by the product_id column
|
||||
* @method array findByFile(string $file) Return ChildProductDocument objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildProductDocument objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildProductDocument objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildProductDocument objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class ProductDocumentQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ProductDocumentQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ProductDocument', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildProductDocumentQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildProductDocumentQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ProductDocumentQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ProductDocumentQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildProductDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ProductDocumentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProductDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildProductDocument A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, PRODUCT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM product_document WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildProductDocument();
|
||||
$obj->hydrate($row);
|
||||
ProductDocumentTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildProductDocument|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the product_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByProductId(1234); // WHERE product_id = 1234
|
||||
* $query->filterByProductId(array(12, 34)); // WHERE product_id IN (12, 34)
|
||||
* $query->filterByProductId(array('min' => 12)); // WHERE product_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByProduct()
|
||||
*
|
||||
* @param mixed $productId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProductId($productId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($productId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($productId['min'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($productId['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::PRODUCT_ID, $productId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::FILE, $file, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $createdAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCreatedAt($createdAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($createdAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($createdAt['min'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $updatedAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($updatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($updatedAt['min'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Product object
|
||||
*
|
||||
* @param \Thelia\Model\Product|ObjectCollection $product The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProduct($product, $comparison = null)
|
||||
{
|
||||
if ($product instanceof \Thelia\Model\Product) {
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentTableMap::PRODUCT_ID, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByProduct() only accepts arguments of type \Thelia\Model\Product or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Product relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Product');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Product');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Product relation Product object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ProductQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinProduct($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Product', '\Thelia\Model\ProductQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ProductDocumentI18n object
|
||||
*
|
||||
* @param \Thelia\Model\ProductDocumentI18n|ObjectCollection $productDocumentI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProductDocumentI18n($productDocumentI18n, $comparison = null)
|
||||
{
|
||||
if ($productDocumentI18n instanceof \Thelia\Model\ProductDocumentI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ProductDocumentTableMap::ID, $productDocumentI18n->getId(), $comparison);
|
||||
} elseif ($productDocumentI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useProductDocumentI18nQuery()
|
||||
->filterByPrimaryKeys($productDocumentI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByProductDocumentI18n() only accepts arguments of type \Thelia\Model\ProductDocumentI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ProductDocumentI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProductDocumentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ProductDocumentI18n');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ProductDocumentI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ProductDocumentI18n relation ProductDocumentI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ProductDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useProductDocumentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinProductDocumentI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProductDocumentI18n', '\Thelia\Model\ProductDocumentI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildProductDocument $productDocument Object to remove from the list of results
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($productDocument = null)
|
||||
{
|
||||
if ($productDocument) {
|
||||
$this->addUsingAlias(ProductDocumentTableMap::ID, $productDocument->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the product_document table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProductDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ProductDocumentTableMap::clearInstancePool();
|
||||
ProductDocumentTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildProductDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildProductDocument object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProductDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ProductDocumentTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ProductDocumentTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ProductDocumentTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// timestampable behavior
|
||||
|
||||
/**
|
||||
* Filter by the latest updated
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProductDocumentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProductDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProductDocumentTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProductDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProductDocumentTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ProductDocumentI18n';
|
||||
|
||||
return $this
|
||||
->joinProductDocumentI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProductDocumentQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('ProductDocumentI18n');
|
||||
$this->with['ProductDocumentI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProductDocumentI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProductDocumentI18n', '\Thelia\Model\ProductDocumentI18nQuery');
|
||||
}
|
||||
|
||||
} // ProductDocumentQuery
|
||||
@@ -68,13 +68,13 @@ use Thelia\Model\Map\ProductTableMap;
|
||||
* @method ChildProductQuery rightJoinContentAssoc($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ContentAssoc relation
|
||||
* @method ChildProductQuery innerJoinContentAssoc($relationAlias = null) Adds a INNER JOIN clause to the query using the ContentAssoc relation
|
||||
*
|
||||
* @method ChildProductQuery leftJoinImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the Image relation
|
||||
* @method ChildProductQuery rightJoinImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Image relation
|
||||
* @method ChildProductQuery innerJoinImage($relationAlias = null) Adds a INNER JOIN clause to the query using the Image relation
|
||||
* @method ChildProductQuery leftJoinProdutImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProdutImage relation
|
||||
* @method ChildProductQuery rightJoinProdutImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProdutImage relation
|
||||
* @method ChildProductQuery innerJoinProdutImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ProdutImage relation
|
||||
*
|
||||
* @method ChildProductQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildProductQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildProductQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document relation
|
||||
* @method ChildProductQuery leftJoinProductDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductDocument relation
|
||||
* @method ChildProductQuery rightJoinProductDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductDocument relation
|
||||
* @method ChildProductQuery innerJoinProductDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductDocument relation
|
||||
*
|
||||
* @method ChildProductQuery leftJoinAccessoryRelatedByProductId($relationAlias = null) Adds a LEFT JOIN clause to the query using the AccessoryRelatedByProductId relation
|
||||
* @method ChildProductQuery rightJoinAccessoryRelatedByProductId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AccessoryRelatedByProductId relation
|
||||
@@ -1070,40 +1070,40 @@ abstract class ProductQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Image object
|
||||
* Filter the query by a related \Thelia\Model\ProdutImage object
|
||||
*
|
||||
* @param \Thelia\Model\Image|ObjectCollection $image the related object to use as filter
|
||||
* @param \Thelia\Model\ProdutImage|ObjectCollection $produtImage the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByImage($image, $comparison = null)
|
||||
public function filterByProdutImage($produtImage, $comparison = null)
|
||||
{
|
||||
if ($image instanceof \Thelia\Model\Image) {
|
||||
if ($produtImage instanceof \Thelia\Model\ProdutImage) {
|
||||
return $this
|
||||
->addUsingAlias(ProductTableMap::ID, $image->getProductId(), $comparison);
|
||||
} elseif ($image instanceof ObjectCollection) {
|
||||
->addUsingAlias(ProductTableMap::ID, $produtImage->getProductId(), $comparison);
|
||||
} elseif ($produtImage instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useImageQuery()
|
||||
->filterByPrimaryKeys($image->getPrimaryKeys())
|
||||
->useProdutImageQuery()
|
||||
->filterByPrimaryKeys($produtImage->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByImage() only accepts arguments of type \Thelia\Model\Image or Collection');
|
||||
throw new PropelException('filterByProdutImage() only accepts arguments of type \Thelia\Model\ProdutImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Image relation
|
||||
* Adds a JOIN clause to the query using the ProdutImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProductQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinImage($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinProdutImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Image');
|
||||
$relationMap = $tableMap->getRelation('ProdutImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
@@ -1118,14 +1118,14 @@ abstract class ProductQuery extends ModelCriteria
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Image');
|
||||
$this->addJoinObject($join, 'ProdutImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Image relation Image object
|
||||
* Use the ProdutImage relation ProdutImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
@@ -1133,50 +1133,50 @@ abstract class ProductQuery extends ModelCriteria
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ImageQuery A secondary query class using the current class as primary query
|
||||
* @return \Thelia\Model\ProdutImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useImageQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function useProdutImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Image', '\Thelia\Model\ImageQuery');
|
||||
->joinProdutImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProdutImage', '\Thelia\Model\ProdutImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
* Filter the query by a related \Thelia\Model\ProductDocument object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document the related object to use as filter
|
||||
* @param \Thelia\Model\ProductDocument|ObjectCollection $productDocument the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProductQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDocument($document, $comparison = null)
|
||||
public function filterByProductDocument($productDocument, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
if ($productDocument instanceof \Thelia\Model\ProductDocument) {
|
||||
return $this
|
||||
->addUsingAlias(ProductTableMap::ID, $document->getProductId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
->addUsingAlias(ProductTableMap::ID, $productDocument->getProductId(), $comparison);
|
||||
} elseif ($productDocument instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useDocumentQuery()
|
||||
->filterByPrimaryKeys($document->getPrimaryKeys())
|
||||
->useProductDocumentQuery()
|
||||
->filterByPrimaryKeys($productDocument->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
throw new PropelException('filterByProductDocument() only accepts arguments of type \Thelia\Model\ProductDocument or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document relation
|
||||
* Adds a JOIN clause to the query using the ProductDocument relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProductQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinDocument($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinProductDocument($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
$relationMap = $tableMap->getRelation('ProductDocument');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
@@ -1191,14 +1191,14 @@ abstract class ProductQuery extends ModelCriteria
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Document');
|
||||
$this->addJoinObject($join, 'ProductDocument');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document object
|
||||
* Use the ProductDocument relation ProductDocument object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
@@ -1206,13 +1206,13 @@ abstract class ProductQuery extends ModelCriteria
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\DocumentQuery A secondary query class using the current class as primary query
|
||||
* @return \Thelia\Model\ProductDocumentQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function useProductDocumentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
->joinProductDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProductDocument', '\Thelia\Model\ProductDocumentQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,17 +14,17 @@ use Propel\Runtime\Exception\BadMethodCallException;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Parser\AbstractParser;
|
||||
use Thelia\Model\Document as ChildDocument;
|
||||
use Thelia\Model\DocumentI18nQuery as ChildDocumentI18nQuery;
|
||||
use Thelia\Model\DocumentQuery as ChildDocumentQuery;
|
||||
use Thelia\Model\Map\DocumentI18nTableMap;
|
||||
use Thelia\Model\ProdutImage as ChildProdutImage;
|
||||
use Thelia\Model\ProdutImageI18nQuery as ChildProdutImageI18nQuery;
|
||||
use Thelia\Model\ProdutImageQuery as ChildProdutImageQuery;
|
||||
use Thelia\Model\Map\ProdutImageI18nTableMap;
|
||||
|
||||
abstract class DocumentI18n implements ActiveRecordInterface
|
||||
abstract class ProdutImageI18n implements ActiveRecordInterface
|
||||
{
|
||||
/**
|
||||
* TableMap class name
|
||||
*/
|
||||
const TABLE_MAP = '\\Thelia\\Model\\Map\\DocumentI18nTableMap';
|
||||
const TABLE_MAP = '\\Thelia\\Model\\Map\\ProdutImageI18nTableMap';
|
||||
|
||||
|
||||
/**
|
||||
@@ -91,9 +91,9 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
protected $postscriptum;
|
||||
|
||||
/**
|
||||
* @var Document
|
||||
* @var ProdutImage
|
||||
*/
|
||||
protected $aDocument;
|
||||
protected $aProdutImage;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
@@ -115,7 +115,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes internal state of Thelia\Model\Base\DocumentI18n object.
|
||||
* Initializes internal state of Thelia\Model\Base\ProdutImageI18n object.
|
||||
* @see applyDefaults()
|
||||
*/
|
||||
public function __construct()
|
||||
@@ -212,9 +212,9 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares this with another <code>DocumentI18n</code> instance. If
|
||||
* <code>obj</code> is an instance of <code>DocumentI18n</code>, delegates to
|
||||
* <code>equals(DocumentI18n)</code>. Otherwise, returns <code>false</code>.
|
||||
* Compares this with another <code>ProdutImageI18n</code> instance. If
|
||||
* <code>obj</code> is an instance of <code>ProdutImageI18n</code>, delegates to
|
||||
* <code>equals(ProdutImageI18n)</code>. Otherwise, returns <code>false</code>.
|
||||
*
|
||||
* @param obj The object to compare to.
|
||||
* @return Whether equal to the object specified.
|
||||
@@ -295,7 +295,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* @param string $name The virtual column name
|
||||
* @param mixed $value The value to give to the virtual column
|
||||
*
|
||||
* @return DocumentI18n The current object, for fluid interface
|
||||
* @return ProdutImageI18n The current object, for fluid interface
|
||||
*/
|
||||
public function setVirtualColumn($name, $value)
|
||||
{
|
||||
@@ -327,7 +327,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
|
||||
* @param string $data The source data to import from
|
||||
*
|
||||
* @return DocumentI18n The current object, for fluid interface
|
||||
* @return ProdutImageI18n The current object, for fluid interface
|
||||
*/
|
||||
public function importFrom($parser, $data)
|
||||
{
|
||||
@@ -440,7 +440,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setId($v)
|
||||
{
|
||||
@@ -450,11 +450,11 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->id !== $v) {
|
||||
$this->id = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::ID;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::ID;
|
||||
}
|
||||
|
||||
if ($this->aDocument !== null && $this->aDocument->getId() !== $v) {
|
||||
$this->aDocument = null;
|
||||
if ($this->aProdutImage !== null && $this->aProdutImage->getId() !== $v) {
|
||||
$this->aProdutImage = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [locale] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setLocale($v)
|
||||
{
|
||||
@@ -475,7 +475,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->locale !== $v) {
|
||||
$this->locale = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::LOCALE;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::LOCALE;
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [title] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setTitle($v)
|
||||
{
|
||||
@@ -496,7 +496,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->title !== $v) {
|
||||
$this->title = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::TITLE;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::TITLE;
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [description] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setDescription($v)
|
||||
{
|
||||
@@ -517,7 +517,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->description !== $v) {
|
||||
$this->description = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::DESCRIPTION;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
@@ -528,7 +528,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [chapo] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setChapo($v)
|
||||
{
|
||||
@@ -538,7 +538,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->chapo !== $v) {
|
||||
$this->chapo = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::CHAPO;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::CHAPO;
|
||||
}
|
||||
|
||||
|
||||
@@ -549,7 +549,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* Set the value of [postscriptum] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
*/
|
||||
public function setPostscriptum($v)
|
||||
{
|
||||
@@ -559,7 +559,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($this->postscriptum !== $v) {
|
||||
$this->postscriptum = $v;
|
||||
$this->modifiedColumns[] = DocumentI18nTableMap::POSTSCRIPTUM;
|
||||
$this->modifiedColumns[] = ProdutImageI18nTableMap::POSTSCRIPTUM;
|
||||
}
|
||||
|
||||
|
||||
@@ -607,22 +607,22 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
try {
|
||||
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : DocumentI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ProdutImageI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : DocumentI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ProdutImageI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->locale = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : DocumentI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProdutImageI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->title = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : DocumentI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProdutImageI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->description = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : DocumentI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProdutImageI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->chapo = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : DocumentI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProdutImageI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->postscriptum = (null !== $col) ? (string) $col : null;
|
||||
$this->resetModified();
|
||||
|
||||
@@ -632,10 +632,10 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 6; // 6 = DocumentI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 6; // 6 = ProdutImageI18nTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\DocumentI18n object", 0, $e);
|
||||
throw new PropelException("Error populating \Thelia\Model\ProdutImageI18n object", 0, $e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,8 +654,8 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function ensureConsistency()
|
||||
{
|
||||
if ($this->aDocument !== null && $this->id !== $this->aDocument->getId()) {
|
||||
$this->aDocument = null;
|
||||
if ($this->aProdutImage !== null && $this->id !== $this->aProdutImage->getId()) {
|
||||
$this->aProdutImage = null;
|
||||
}
|
||||
} // ensureConsistency
|
||||
|
||||
@@ -680,13 +680,13 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
// We don't need to alter the object instance pool; we're just modifying this instance
|
||||
// already in the pool.
|
||||
|
||||
$dataFetcher = ChildDocumentI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
|
||||
$dataFetcher = ChildProdutImageI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
|
||||
$row = $dataFetcher->fetch();
|
||||
$dataFetcher->close();
|
||||
if (!$row) {
|
||||
@@ -696,7 +696,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
if ($deep) { // also de-associate any related objects?
|
||||
|
||||
$this->aDocument = null;
|
||||
$this->aProdutImage = null;
|
||||
} // if (deep)
|
||||
}
|
||||
|
||||
@@ -706,8 +706,8 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* @param ConnectionInterface $con
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
* @see DocumentI18n::setDeleted()
|
||||
* @see DocumentI18n::isDeleted()
|
||||
* @see ProdutImageI18n::setDeleted()
|
||||
* @see ProdutImageI18n::isDeleted()
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
@@ -716,12 +716,12 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$con->beginTransaction();
|
||||
try {
|
||||
$deleteQuery = ChildDocumentI18nQuery::create()
|
||||
$deleteQuery = ChildProdutImageI18nQuery::create()
|
||||
->filterByPrimaryKey($this->getPrimaryKey());
|
||||
$ret = $this->preDelete($con);
|
||||
if ($ret) {
|
||||
@@ -758,7 +758,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$con->beginTransaction();
|
||||
@@ -778,7 +778,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
$this->postUpdate($con);
|
||||
}
|
||||
$this->postSave($con);
|
||||
DocumentI18nTableMap::addInstanceToPool($this);
|
||||
ProdutImageI18nTableMap::addInstanceToPool($this);
|
||||
} else {
|
||||
$affectedRows = 0;
|
||||
}
|
||||
@@ -813,11 +813,11 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
// method. This object relates to these object(s) by a
|
||||
// foreign key reference.
|
||||
|
||||
if ($this->aDocument !== null) {
|
||||
if ($this->aDocument->isModified() || $this->aDocument->isNew()) {
|
||||
$affectedRows += $this->aDocument->save($con);
|
||||
if ($this->aProdutImage !== null) {
|
||||
if ($this->aProdutImage->isModified() || $this->aProdutImage->isNew()) {
|
||||
$affectedRows += $this->aProdutImage->save($con);
|
||||
}
|
||||
$this->setDocument($this->aDocument);
|
||||
$this->setProdutImage($this->aProdutImage);
|
||||
}
|
||||
|
||||
if ($this->isNew() || $this->isModified()) {
|
||||
@@ -853,27 +853,27 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
|
||||
// check the columns in natural order for more readable SQL queries
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::ID)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'ID';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::LOCALE)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::LOCALE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'LOCALE';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::TITLE)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::TITLE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'TITLE';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::DESCRIPTION)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::DESCRIPTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::CHAPO)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::CHAPO)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CHAPO';
|
||||
}
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::POSTSCRIPTUM)) {
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::POSTSCRIPTUM)) {
|
||||
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'INSERT INTO document_i18n (%s) VALUES (%s)',
|
||||
'INSERT INTO produt_image_i18n (%s) VALUES (%s)',
|
||||
implode(', ', $modifiedColumns),
|
||||
implode(', ', array_keys($modifiedColumns))
|
||||
);
|
||||
@@ -939,7 +939,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = DocumentI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$pos = ProdutImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$field = $this->getByPosition($pos);
|
||||
|
||||
return $field;
|
||||
@@ -996,11 +996,11 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
|
||||
{
|
||||
if (isset($alreadyDumpedObjects['DocumentI18n'][serialize($this->getPrimaryKey())])) {
|
||||
if (isset($alreadyDumpedObjects['ProdutImageI18n'][serialize($this->getPrimaryKey())])) {
|
||||
return '*RECURSION*';
|
||||
}
|
||||
$alreadyDumpedObjects['DocumentI18n'][serialize($this->getPrimaryKey())] = true;
|
||||
$keys = DocumentI18nTableMap::getFieldNames($keyType);
|
||||
$alreadyDumpedObjects['ProdutImageI18n'][serialize($this->getPrimaryKey())] = true;
|
||||
$keys = ProdutImageI18nTableMap::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getLocale(),
|
||||
@@ -1016,8 +1016,8 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aDocument) {
|
||||
$result['Document'] = $this->aDocument->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
if (null !== $this->aProdutImage) {
|
||||
$result['ProdutImage'] = $this->aProdutImage->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1037,7 +1037,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = DocumentI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
$pos = ProdutImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
|
||||
|
||||
return $this->setByPosition($pos, $value);
|
||||
}
|
||||
@@ -1093,7 +1093,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = DocumentI18nTableMap::getFieldNames($keyType);
|
||||
$keys = ProdutImageI18nTableMap::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setLocale($arr[$keys[1]]);
|
||||
@@ -1110,14 +1110,14 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function buildCriteria()
|
||||
{
|
||||
$criteria = new Criteria(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$criteria = new Criteria(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::ID)) $criteria->add(DocumentI18nTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::LOCALE)) $criteria->add(DocumentI18nTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::TITLE)) $criteria->add(DocumentI18nTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::DESCRIPTION)) $criteria->add(DocumentI18nTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::CHAPO)) $criteria->add(DocumentI18nTableMap::CHAPO, $this->chapo);
|
||||
if ($this->isColumnModified(DocumentI18nTableMap::POSTSCRIPTUM)) $criteria->add(DocumentI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::ID)) $criteria->add(ProdutImageI18nTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::LOCALE)) $criteria->add(ProdutImageI18nTableMap::LOCALE, $this->locale);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::TITLE)) $criteria->add(ProdutImageI18nTableMap::TITLE, $this->title);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::DESCRIPTION)) $criteria->add(ProdutImageI18nTableMap::DESCRIPTION, $this->description);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::CHAPO)) $criteria->add(ProdutImageI18nTableMap::CHAPO, $this->chapo);
|
||||
if ($this->isColumnModified(ProdutImageI18nTableMap::POSTSCRIPTUM)) $criteria->add(ProdutImageI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1132,9 +1132,9 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function buildPkeyCriteria()
|
||||
{
|
||||
$criteria = new Criteria(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$criteria->add(DocumentI18nTableMap::ID, $this->id);
|
||||
$criteria->add(DocumentI18nTableMap::LOCALE, $this->locale);
|
||||
$criteria = new Criteria(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria->add(ProdutImageI18nTableMap::ID, $this->id);
|
||||
$criteria->add(ProdutImageI18nTableMap::LOCALE, $this->locale);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1181,7 +1181,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param object $copyObj An object of \Thelia\Model\DocumentI18n (or compatible) type.
|
||||
* @param object $copyObj An object of \Thelia\Model\ProdutImageI18n (or compatible) type.
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
|
||||
* @throws PropelException
|
||||
@@ -1208,7 +1208,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
* objects.
|
||||
*
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @return \Thelia\Model\DocumentI18n Clone of current object.
|
||||
* @return \Thelia\Model\ProdutImageI18n Clone of current object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copy($deepCopy = false)
|
||||
@@ -1222,13 +1222,13 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a ChildDocument object.
|
||||
* Declares an association between this object and a ChildProdutImage object.
|
||||
*
|
||||
* @param ChildDocument $v
|
||||
* @return \Thelia\Model\DocumentI18n The current object (for fluent API support)
|
||||
* @param ChildProdutImage $v
|
||||
* @return \Thelia\Model\ProdutImageI18n The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setDocument(ChildDocument $v = null)
|
||||
public function setProdutImage(ChildProdutImage $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setId(NULL);
|
||||
@@ -1236,12 +1236,12 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
$this->setId($v->getId());
|
||||
}
|
||||
|
||||
$this->aDocument = $v;
|
||||
$this->aProdutImage = $v;
|
||||
|
||||
// Add binding for other direction of this n:n relationship.
|
||||
// If this object has already been added to the ChildDocument object, it will not be re-added.
|
||||
// If this object has already been added to the ChildProdutImage object, it will not be re-added.
|
||||
if ($v !== null) {
|
||||
$v->addDocumentI18n($this);
|
||||
$v->addProdutImageI18n($this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1250,26 +1250,26 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
|
||||
|
||||
/**
|
||||
* Get the associated ChildDocument object
|
||||
* Get the associated ChildProdutImage object
|
||||
*
|
||||
* @param ConnectionInterface $con Optional Connection object.
|
||||
* @return ChildDocument The associated ChildDocument object.
|
||||
* @return ChildProdutImage The associated ChildProdutImage object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getDocument(ConnectionInterface $con = null)
|
||||
public function getProdutImage(ConnectionInterface $con = null)
|
||||
{
|
||||
if ($this->aDocument === null && ($this->id !== null)) {
|
||||
$this->aDocument = ChildDocumentQuery::create()->findPk($this->id, $con);
|
||||
if ($this->aProdutImage === null && ($this->id !== null)) {
|
||||
$this->aProdutImage = ChildProdutImageQuery::create()->findPk($this->id, $con);
|
||||
/* The following can be used additionally to
|
||||
guarantee the related object contains a reference
|
||||
to this object. This level of coupling may, however, be
|
||||
undesirable since it could result in an only partially populated collection
|
||||
in the referenced object.
|
||||
$this->aDocument->addDocumentI18ns($this);
|
||||
$this->aProdutImage->addProdutImageI18ns($this);
|
||||
*/
|
||||
}
|
||||
|
||||
return $this->aDocument;
|
||||
return $this->aProdutImage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1305,7 +1305,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
if ($deep) {
|
||||
} // if ($deep)
|
||||
|
||||
$this->aDocument = null;
|
||||
$this->aProdutImage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1315,7 +1315,7 @@ abstract class DocumentI18n implements ActiveRecordInterface
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->exportTo(DocumentI18nTableMap::DEFAULT_STRING_FORMAT);
|
||||
return (string) $this->exportTo(ProdutImageI18nTableMap::DEFAULT_STRING_FORMAT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -12,84 +12,84 @@ use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\DocumentI18n as ChildDocumentI18n;
|
||||
use Thelia\Model\DocumentI18nQuery as ChildDocumentI18nQuery;
|
||||
use Thelia\Model\Map\DocumentI18nTableMap;
|
||||
use Thelia\Model\ProdutImageI18n as ChildProdutImageI18n;
|
||||
use Thelia\Model\ProdutImageI18nQuery as ChildProdutImageI18nQuery;
|
||||
use Thelia\Model\Map\ProdutImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'document_i18n' table.
|
||||
* Base class that represents a query for the 'produt_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildDocumentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildDocumentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildDocumentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildDocumentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildDocumentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildDocumentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
* @method ChildProdutImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildProdutImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildProdutImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildProdutImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildProdutImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildProdutImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildDocumentI18nQuery groupById() Group by the id column
|
||||
* @method ChildDocumentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildDocumentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildDocumentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildDocumentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildDocumentI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
* @method ChildProdutImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildProdutImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildProdutImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildProdutImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildProdutImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildProdutImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildDocumentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildDocumentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildDocumentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @method ChildProdutImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildProdutImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildProdutImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildDocumentI18nQuery leftJoinDocument($relationAlias = null) Adds a LEFT JOIN clause to the query using the Document relation
|
||||
* @method ChildDocumentI18nQuery rightJoinDocument($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Document relation
|
||||
* @method ChildDocumentI18nQuery innerJoinDocument($relationAlias = null) Adds a INNER JOIN clause to the query using the Document relation
|
||||
* @method ChildProdutImageI18nQuery leftJoinProdutImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProdutImage relation
|
||||
* @method ChildProdutImageI18nQuery rightJoinProdutImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProdutImage relation
|
||||
* @method ChildProdutImageI18nQuery innerJoinProdutImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ProdutImage relation
|
||||
*
|
||||
* @method ChildDocumentI18n findOne(ConnectionInterface $con = null) Return the first ChildDocumentI18n matching the query
|
||||
* @method ChildDocumentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildDocumentI18n matching the query, or a new ChildDocumentI18n object populated from the query conditions when no match is found
|
||||
* @method ChildProdutImageI18n findOne(ConnectionInterface $con = null) Return the first ChildProdutImageI18n matching the query
|
||||
* @method ChildProdutImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProdutImageI18n matching the query, or a new ChildProdutImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildDocumentI18n findOneById(int $id) Return the first ChildDocumentI18n filtered by the id column
|
||||
* @method ChildDocumentI18n findOneByLocale(string $locale) Return the first ChildDocumentI18n filtered by the locale column
|
||||
* @method ChildDocumentI18n findOneByTitle(string $title) Return the first ChildDocumentI18n filtered by the title column
|
||||
* @method ChildDocumentI18n findOneByDescription(string $description) Return the first ChildDocumentI18n filtered by the description column
|
||||
* @method ChildDocumentI18n findOneByChapo(string $chapo) Return the first ChildDocumentI18n filtered by the chapo column
|
||||
* @method ChildDocumentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildDocumentI18n filtered by the postscriptum column
|
||||
* @method ChildProdutImageI18n findOneById(int $id) Return the first ChildProdutImageI18n filtered by the id column
|
||||
* @method ChildProdutImageI18n findOneByLocale(string $locale) Return the first ChildProdutImageI18n filtered by the locale column
|
||||
* @method ChildProdutImageI18n findOneByTitle(string $title) Return the first ChildProdutImageI18n filtered by the title column
|
||||
* @method ChildProdutImageI18n findOneByDescription(string $description) Return the first ChildProdutImageI18n filtered by the description column
|
||||
* @method ChildProdutImageI18n findOneByChapo(string $chapo) Return the first ChildProdutImageI18n filtered by the chapo column
|
||||
* @method ChildProdutImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildProdutImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildDocumentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildDocumentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildDocumentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildDocumentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildDocumentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildDocumentI18n objects filtered by the postscriptum column
|
||||
* @method array findById(int $id) Return ChildProdutImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildProdutImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildProdutImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildProdutImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildProdutImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildProdutImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class DocumentI18nQuery extends ModelCriteria
|
||||
abstract class ProdutImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\DocumentI18nQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\ProdutImageI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\DocumentI18n', $modelAlias = null)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ProdutImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildDocumentI18nQuery object.
|
||||
* Returns a new ChildProdutImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildDocumentI18nQuery
|
||||
* @return ChildProdutImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\DocumentI18nQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\ProdutImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\DocumentI18nQuery();
|
||||
$query = new \Thelia\Model\ProdutImageI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -112,19 +112,19 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
* @return ChildProdutImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = DocumentI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
if ((null !== ($obj = ProdutImageI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -143,11 +143,11 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildDocumentI18n A model object, or null if the key is not found
|
||||
* @return ChildProdutImageI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM document_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM produt_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
@@ -159,9 +159,9 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildDocumentI18n();
|
||||
$obj = new ChildProdutImageI18n();
|
||||
$obj->hydrate($row);
|
||||
DocumentI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
ProdutImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -174,7 +174,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildDocumentI18n|array|mixed the result, formatted by the current formatter
|
||||
* @return ChildProdutImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
@@ -216,12 +216,12 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(DocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(DocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ProdutImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ProdutImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -239,8 +239,8 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(DocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(DocumentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(ProdutImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ProdutImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByDocument()
|
||||
* @see filterByProdutImage()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
@@ -266,18 +266,18 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(DocumentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ProdutImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(DocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ProdutImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -288,7 +288,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
@@ -317,7 +317,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -333,7 +333,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
@@ -346,7 +346,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::TITLE, $title, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +362,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
@@ -375,7 +375,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -391,7 +391,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
@@ -404,7 +404,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -420,7 +420,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
@@ -433,46 +433,46 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(DocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
return $this->addUsingAlias(ProdutImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Document object
|
||||
* Filter the query by a related \Thelia\Model\ProdutImage object
|
||||
*
|
||||
* @param \Thelia\Model\Document|ObjectCollection $document The related object(s) to use as filter
|
||||
* @param \Thelia\Model\ProdutImage|ObjectCollection $produtImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDocument($document, $comparison = null)
|
||||
public function filterByProdutImage($produtImage, $comparison = null)
|
||||
{
|
||||
if ($document instanceof \Thelia\Model\Document) {
|
||||
if ($produtImage instanceof \Thelia\Model\ProdutImage) {
|
||||
return $this
|
||||
->addUsingAlias(DocumentI18nTableMap::ID, $document->getId(), $comparison);
|
||||
} elseif ($document instanceof ObjectCollection) {
|
||||
->addUsingAlias(ProdutImageI18nTableMap::ID, $produtImage->getId(), $comparison);
|
||||
} elseif ($produtImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(DocumentI18nTableMap::ID, $document->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ProdutImageI18nTableMap::ID, $produtImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByDocument() only accepts arguments of type \Thelia\Model\Document or Collection');
|
||||
throw new PropelException('filterByProdutImage() only accepts arguments of type \Thelia\Model\ProdutImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Document relation
|
||||
* Adds a JOIN clause to the query using the ProdutImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinDocument($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
public function joinProdutImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Document');
|
||||
$relationMap = $tableMap->getRelation('ProdutImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
@@ -487,14 +487,14 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Document');
|
||||
$this->addJoinObject($join, 'ProdutImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Document relation Document object
|
||||
* Use the ProdutImage relation ProdutImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
@@ -502,27 +502,27 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\DocumentQuery A secondary query class using the current class as primary query
|
||||
* @return \Thelia\Model\ProdutImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useDocumentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
public function useProdutImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinDocument($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
|
||||
->joinProdutImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProdutImage', '\Thelia\Model\ProdutImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildDocumentI18n $documentI18n Object to remove from the list of results
|
||||
* @param ChildProdutImageI18n $produtImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildDocumentI18nQuery The current query, for fluid interface
|
||||
* @return ChildProdutImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($documentI18n = null)
|
||||
public function prune($produtImageI18n = null)
|
||||
{
|
||||
if ($documentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(DocumentI18nTableMap::ID), $documentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(DocumentI18nTableMap::LOCALE), $documentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
if ($produtImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ProdutImageI18nTableMap::ID), $produtImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ProdutImageI18nTableMap::LOCALE), $produtImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the document_i18n table.
|
||||
* Deletes all rows from the produt_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
@@ -538,7 +538,7 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
@@ -549,8 +549,8 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
DocumentI18nTableMap::clearInstancePool();
|
||||
DocumentI18nTableMap::clearRelatedInstancePool();
|
||||
ProdutImageI18nTableMap::clearInstancePool();
|
||||
ProdutImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
@@ -562,9 +562,9 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildDocumentI18n or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ChildProdutImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildDocumentI18n object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ChildProdutImageI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
@@ -575,13 +575,13 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$criteria->setDbName(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
@@ -591,10 +591,10 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
DocumentI18nTableMap::removeInstanceFromPool($criteria);
|
||||
ProdutImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
DocumentI18nTableMap::clearRelatedInstancePool();
|
||||
ProdutImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
@@ -604,4 +604,4 @@ abstract class DocumentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
} // DocumentI18nQuery
|
||||
} // ProdutImageI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/ProdutImageQuery.php
Normal file
846
core/lib/Thelia/Model/Base/ProdutImageQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ProdutImage as ChildProdutImage;
|
||||
use Thelia\Model\ProdutImageI18nQuery as ChildProdutImageI18nQuery;
|
||||
use Thelia\Model\ProdutImageQuery as ChildProdutImageQuery;
|
||||
use Thelia\Model\Map\ProdutImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'produt_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildProdutImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildProdutImageQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
|
||||
* @method ChildProdutImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildProdutImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildProdutImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildProdutImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildProdutImageQuery groupById() Group by the id column
|
||||
* @method ChildProdutImageQuery groupByProductId() Group by the product_id column
|
||||
* @method ChildProdutImageQuery groupByFile() Group by the file column
|
||||
* @method ChildProdutImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildProdutImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildProdutImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildProdutImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildProdutImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildProdutImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildProdutImageQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
|
||||
* @method ChildProdutImageQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
|
||||
* @method ChildProdutImageQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
|
||||
*
|
||||
* @method ChildProdutImageQuery leftJoinProdutImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProdutImageI18n relation
|
||||
* @method ChildProdutImageQuery rightJoinProdutImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProdutImageI18n relation
|
||||
* @method ChildProdutImageQuery innerJoinProdutImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ProdutImageI18n relation
|
||||
*
|
||||
* @method ChildProdutImage findOne(ConnectionInterface $con = null) Return the first ChildProdutImage matching the query
|
||||
* @method ChildProdutImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProdutImage matching the query, or a new ChildProdutImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildProdutImage findOneById(int $id) Return the first ChildProdutImage filtered by the id column
|
||||
* @method ChildProdutImage findOneByProductId(int $product_id) Return the first ChildProdutImage filtered by the product_id column
|
||||
* @method ChildProdutImage findOneByFile(string $file) Return the first ChildProdutImage filtered by the file column
|
||||
* @method ChildProdutImage findOneByPosition(int $position) Return the first ChildProdutImage filtered by the position column
|
||||
* @method ChildProdutImage findOneByCreatedAt(string $created_at) Return the first ChildProdutImage filtered by the created_at column
|
||||
* @method ChildProdutImage findOneByUpdatedAt(string $updated_at) Return the first ChildProdutImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildProdutImage objects filtered by the id column
|
||||
* @method array findByProductId(int $product_id) Return ChildProdutImage objects filtered by the product_id column
|
||||
* @method array findByFile(string $file) Return ChildProdutImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildProdutImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildProdutImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildProdutImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class ProdutImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ProdutImageQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ProdutImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildProdutImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildProdutImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ProdutImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ProdutImageQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildProdutImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ProdutImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ProdutImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildProdutImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, PRODUCT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM produt_image WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildProdutImage();
|
||||
$obj->hydrate($row);
|
||||
ProdutImageTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildProdutImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the product_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByProductId(1234); // WHERE product_id = 1234
|
||||
* $query->filterByProductId(array(12, 34)); // WHERE product_id IN (12, 34)
|
||||
* $query->filterByProductId(array('min' => 12)); // WHERE product_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByProduct()
|
||||
*
|
||||
* @param mixed $productId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProductId($productId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($productId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($productId['min'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($productId['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::PRODUCT_ID, $productId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::FILE, $file, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $createdAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCreatedAt($createdAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($createdAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($createdAt['min'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $updatedAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($updatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($updatedAt['min'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ProdutImageTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Product object
|
||||
*
|
||||
* @param \Thelia\Model\Product|ObjectCollection $product The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProduct($product, $comparison = null)
|
||||
{
|
||||
if ($product instanceof \Thelia\Model\Product) {
|
||||
return $this
|
||||
->addUsingAlias(ProdutImageTableMap::PRODUCT_ID, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ProdutImageTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByProduct() only accepts arguments of type \Thelia\Model\Product or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Product relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Product');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Product');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Product relation Product object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ProductQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinProduct($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Product', '\Thelia\Model\ProductQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ProdutImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\ProdutImageI18n|ObjectCollection $produtImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProdutImageI18n($produtImageI18n, $comparison = null)
|
||||
{
|
||||
if ($produtImageI18n instanceof \Thelia\Model\ProdutImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ProdutImageTableMap::ID, $produtImageI18n->getId(), $comparison);
|
||||
} elseif ($produtImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useProdutImageI18nQuery()
|
||||
->filterByPrimaryKeys($produtImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByProdutImageI18n() only accepts arguments of type \Thelia\Model\ProdutImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ProdutImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProdutImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ProdutImageI18n');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ProdutImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ProdutImageI18n relation ProdutImageI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ProdutImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useProdutImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinProdutImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProdutImageI18n', '\Thelia\Model\ProdutImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildProdutImage $produtImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($produtImage = null)
|
||||
{
|
||||
if ($produtImage) {
|
||||
$this->addUsingAlias(ProdutImageTableMap::ID, $produtImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the produt_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ProdutImageTableMap::clearInstancePool();
|
||||
ProdutImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildProdutImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildProdutImage object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ProdutImageTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ProdutImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ProdutImageTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// timestampable behavior
|
||||
|
||||
/**
|
||||
* Filter by the latest updated
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProdutImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ProdutImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProdutImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProdutImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ProdutImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ProdutImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ProdutImageI18n';
|
||||
|
||||
return $this
|
||||
->joinProdutImageI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProdutImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('ProdutImageI18n');
|
||||
$this->with['ProdutImageI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildProdutImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ProdutImageI18n', '\Thelia\Model\ProdutImageI18nQuery');
|
||||
}
|
||||
|
||||
} // ProdutImageQuery
|
||||
10
core/lib/Thelia/Model/CategoryDocument.php
Normal file
10
core/lib/Thelia/Model/CategoryDocument.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\CategoryDocument as BaseCategoryDocument;
|
||||
|
||||
class CategoryDocument extends BaseCategoryDocument
|
||||
{
|
||||
|
||||
}
|
||||
10
core/lib/Thelia/Model/CategoryDocumentI18n.php
Normal file
10
core/lib/Thelia/Model/CategoryDocumentI18n.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\CategoryDocumentI18n as BaseCategoryDocumentI18n;
|
||||
|
||||
class CategoryDocumentI18n extends BaseCategoryDocumentI18n
|
||||
{
|
||||
|
||||
}
|
||||
21
core/lib/Thelia/Model/CategoryDocumentI18nQuery.php
Normal file
21
core/lib/Thelia/Model/CategoryDocumentI18nQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\CategoryDocumentI18nQuery as BaseCategoryDocumentI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'category_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class CategoryDocumentI18nQuery extends BaseCategoryDocumentI18nQuery
|
||||
{
|
||||
|
||||
} // CategoryDocumentI18nQuery
|
||||
21
core/lib/Thelia/Model/CategoryDocumentQuery.php
Normal file
21
core/lib/Thelia/Model/CategoryDocumentQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\CategoryDocumentQuery as BaseCategoryDocumentQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'category_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class CategoryDocumentQuery extends BaseCategoryDocumentQuery
|
||||
{
|
||||
|
||||
} // CategoryDocumentQuery
|
||||
10
core/lib/Thelia/Model/CategoryImage.php
Normal file
10
core/lib/Thelia/Model/CategoryImage.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\CategoryImage as BaseCategoryImage;
|
||||
|
||||
class CategoryImage extends BaseCategoryImage
|
||||
{
|
||||
|
||||
}
|
||||
10
core/lib/Thelia/Model/CategoryImageI18n.php
Normal file
10
core/lib/Thelia/Model/CategoryImageI18n.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\CategoryImageI18n as BaseCategoryImageI18n;
|
||||
|
||||
class CategoryImageI18n extends BaseCategoryImageI18n
|
||||
{
|
||||
|
||||
}
|
||||
21
core/lib/Thelia/Model/CategoryImageI18nQuery.php
Normal file
21
core/lib/Thelia/Model/CategoryImageI18nQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\CategoryImageI18nQuery as BaseCategoryImageI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'category_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class CategoryImageI18nQuery extends BaseCategoryImageI18nQuery
|
||||
{
|
||||
|
||||
} // CategoryImageI18nQuery
|
||||
9
core/lib/Thelia/Model/ImageQuery.php → core/lib/Thelia/Model/CategoryImageQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/ImageQuery.php → core/lib/Thelia/Model/CategoryImageQuery.php
Executable file → Normal file
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ImageQuery as BaseImageQuery;
|
||||
use Thelia\Model\Base\CategoryImageQuery as BaseCategoryImageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'image' table.
|
||||
* Skeleton subclass for performing query and update operations on the 'category_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -15,6 +15,7 @@ use Thelia\Model\Base\ImageQuery as BaseImageQuery;
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ImageQuery extends BaseImageQuery {
|
||||
class CategoryImageQuery extends BaseCategoryImageQuery
|
||||
{
|
||||
|
||||
} // ImageQuery
|
||||
} // CategoryImageQuery
|
||||
10
core/lib/Thelia/Model/ContentDocument.php
Normal file
10
core/lib/Thelia/Model/ContentDocument.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ContentDocument as BaseContentDocument;
|
||||
|
||||
class ContentDocument extends BaseContentDocument
|
||||
{
|
||||
|
||||
}
|
||||
10
core/lib/Thelia/Model/ContentDocumentI18n.php
Normal file
10
core/lib/Thelia/Model/ContentDocumentI18n.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ContentDocumentI18n as BaseContentDocumentI18n;
|
||||
|
||||
class ContentDocumentI18n extends BaseContentDocumentI18n
|
||||
{
|
||||
|
||||
}
|
||||
21
core/lib/Thelia/Model/ContentDocumentI18nQuery.php
Normal file
21
core/lib/Thelia/Model/ContentDocumentI18nQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ContentDocumentI18nQuery as BaseContentDocumentI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'content_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ContentDocumentI18nQuery extends BaseContentDocumentI18nQuery
|
||||
{
|
||||
|
||||
} // ContentDocumentI18nQuery
|
||||
21
core/lib/Thelia/Model/ContentDocumentQuery.php
Normal file
21
core/lib/Thelia/Model/ContentDocumentQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ContentDocumentQuery as BaseContentDocumentQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'content_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ContentDocumentQuery extends BaseContentDocumentQuery
|
||||
{
|
||||
|
||||
} // ContentDocumentQuery
|
||||
10
core/lib/Thelia/Model/ContentImage.php
Normal file
10
core/lib/Thelia/Model/ContentImage.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ContentImage as BaseContentImage;
|
||||
|
||||
class ContentImage extends BaseContentImage
|
||||
{
|
||||
|
||||
}
|
||||
10
core/lib/Thelia/Model/ContentImageI18n.php
Normal file
10
core/lib/Thelia/Model/ContentImageI18n.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ContentImageI18n as BaseContentImageI18n;
|
||||
|
||||
class ContentImageI18n extends BaseContentImageI18n
|
||||
{
|
||||
|
||||
}
|
||||
21
core/lib/Thelia/Model/ContentImageI18nQuery.php
Normal file
21
core/lib/Thelia/Model/ContentImageI18nQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ContentImageI18nQuery as BaseContentImageI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'content_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ContentImageI18nQuery extends BaseContentImageI18nQuery
|
||||
{
|
||||
|
||||
} // ContentImageI18nQuery
|
||||
9
core/lib/Thelia/Model/DocumentI18nQuery.php → core/lib/Thelia/Model/ContentImageQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/DocumentI18nQuery.php → core/lib/Thelia/Model/ContentImageQuery.php
Executable file → Normal file
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\DocumentI18nQuery as BaseDocumentI18nQuery;
|
||||
use Thelia\Model\Base\ContentImageQuery as BaseContentImageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'document_i18n' table.
|
||||
* Skeleton subclass for performing query and update operations on the 'content_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -15,6 +15,7 @@ use Thelia\Model\Base\DocumentI18nQuery as BaseDocumentI18nQuery;
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class DocumentI18nQuery extends BaseDocumentI18nQuery {
|
||||
class ContentImageQuery extends BaseContentImageQuery
|
||||
{
|
||||
|
||||
} // DocumentI18nQuery
|
||||
} // ContentImageQuery
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\Document as BaseDocument;
|
||||
|
||||
class Document extends BaseDocument {
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\DocumentI18n as BaseDocumentI18n;
|
||||
|
||||
class DocumentI18n extends BaseDocumentI18n {
|
||||
|
||||
}
|
||||
10
core/lib/Thelia/Model/FolderDocument.php
Normal file
10
core/lib/Thelia/Model/FolderDocument.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\FolderDocument as BaseFolderDocument;
|
||||
|
||||
class FolderDocument extends BaseFolderDocument
|
||||
{
|
||||
|
||||
}
|
||||
10
core/lib/Thelia/Model/FolderDocumentI18n.php
Normal file
10
core/lib/Thelia/Model/FolderDocumentI18n.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\FolderDocumentI18n as BaseFolderDocumentI18n;
|
||||
|
||||
class FolderDocumentI18n extends BaseFolderDocumentI18n
|
||||
{
|
||||
|
||||
}
|
||||
21
core/lib/Thelia/Model/FolderDocumentI18nQuery.php
Normal file
21
core/lib/Thelia/Model/FolderDocumentI18nQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\FolderDocumentI18nQuery as BaseFolderDocumentI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'folder_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class FolderDocumentI18nQuery extends BaseFolderDocumentI18nQuery
|
||||
{
|
||||
|
||||
} // FolderDocumentI18nQuery
|
||||
21
core/lib/Thelia/Model/FolderDocumentQuery.php
Normal file
21
core/lib/Thelia/Model/FolderDocumentQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\FolderDocumentQuery as BaseFolderDocumentQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'folder_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class FolderDocumentQuery extends BaseFolderDocumentQuery
|
||||
{
|
||||
|
||||
} // FolderDocumentQuery
|
||||
10
core/lib/Thelia/Model/FolderImage.php
Normal file
10
core/lib/Thelia/Model/FolderImage.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\FolderImage as BaseFolderImage;
|
||||
|
||||
class FolderImage extends BaseFolderImage
|
||||
{
|
||||
|
||||
}
|
||||
10
core/lib/Thelia/Model/FolderImageI18n.php
Normal file
10
core/lib/Thelia/Model/FolderImageI18n.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\FolderImageI18n as BaseFolderImageI18n;
|
||||
|
||||
class FolderImageI18n extends BaseFolderImageI18n
|
||||
{
|
||||
|
||||
}
|
||||
21
core/lib/Thelia/Model/FolderImageI18nQuery.php
Normal file
21
core/lib/Thelia/Model/FolderImageI18nQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\FolderImageI18nQuery as BaseFolderImageI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'folder_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class FolderImageI18nQuery extends BaseFolderImageI18nQuery
|
||||
{
|
||||
|
||||
} // FolderImageI18nQuery
|
||||
9
core/lib/Thelia/Model/DocumentQuery.php → core/lib/Thelia/Model/FolderImageQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/DocumentQuery.php → core/lib/Thelia/Model/FolderImageQuery.php
Executable file → Normal file
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\DocumentQuery as BaseDocumentQuery;
|
||||
use Thelia\Model\Base\FolderImageQuery as BaseFolderImageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'document' table.
|
||||
* Skeleton subclass for performing query and update operations on the 'folder_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -15,6 +15,7 @@ use Thelia\Model\Base\DocumentQuery as BaseDocumentQuery;
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class DocumentQuery extends BaseDocumentQuery {
|
||||
class FolderImageQuery extends BaseFolderImageQuery
|
||||
{
|
||||
|
||||
} // DocumentQuery
|
||||
} // FolderImageQuery
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\Image as BaseImage;
|
||||
|
||||
class Image extends BaseImage {
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ImageI18n as BaseImageI18n;
|
||||
|
||||
class ImageI18n extends BaseImageI18n {
|
||||
|
||||
}
|
||||
@@ -161,7 +161,7 @@ class CartTableMap extends TableMap
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addColumn('TOKEN', 'Token', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('TOKEN', 'Token', 'VARCHAR', false, 255, null);
|
||||
$this->addForeignKey('CUSTOMER_ID', 'CustomerId', 'INTEGER', 'customer', 'ID', false, null, null);
|
||||
$this->addForeignKey('ADDRESS_DELIVERY_ID', 'AddressDeliveryId', 'INTEGER', 'address', 'ID', false, null, null);
|
||||
$this->addForeignKey('ADDRESS_INVOICE_ID', 'AddressInvoiceId', 'INTEGER', 'address', 'ID', false, null, null);
|
||||
|
||||
497
core/lib/Thelia/Model/Map/CategoryDocumentI18nTableMap.php
Normal file
497
core/lib/Thelia/Model/Map/CategoryDocumentI18nTableMap.php
Normal file
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\CategoryDocumentI18n;
|
||||
use Thelia\Model\CategoryDocumentI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'category_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class CategoryDocumentI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.CategoryDocumentI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'category_document_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\CategoryDocumentI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.CategoryDocumentI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'category_document_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'category_document_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'category_document_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'category_document_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* the column name for the CHAPO field
|
||||
*/
|
||||
const CHAPO = 'category_document_i18n.CHAPO';
|
||||
|
||||
/**
|
||||
* the column name for the POSTSCRIPTUM field
|
||||
*/
|
||||
const POSTSCRIPTUM = 'category_document_i18n.POSTSCRIPTUM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_COLNAME => array(CategoryDocumentI18nTableMap::ID, CategoryDocumentI18nTableMap::LOCALE, CategoryDocumentI18nTableMap::TITLE, CategoryDocumentI18nTableMap::DESCRIPTION, CategoryDocumentI18nTableMap::CHAPO, CategoryDocumentI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_COLNAME => array(CategoryDocumentI18nTableMap::ID => 0, CategoryDocumentI18nTableMap::LOCALE => 1, CategoryDocumentI18nTableMap::TITLE => 2, CategoryDocumentI18nTableMap::DESCRIPTION => 3, CategoryDocumentI18nTableMap::CHAPO => 4, CategoryDocumentI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('category_document_i18n');
|
||||
$this->setPhpName('CategoryDocumentI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\CategoryDocumentI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'category_document', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CategoryDocument', '\\Thelia\\Model\\CategoryDocument', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\CategoryDocumentI18n $obj A \Thelia\Model\CategoryDocumentI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (null === $key) {
|
||||
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\CategoryDocumentI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\CategoryDocumentI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
// assume we've been passed a primary key";
|
||||
$key = serialize(array((string) $value[0], (string) $value[1]));
|
||||
} elseif ($value instanceof Criteria) {
|
||||
self::$instances = [];
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\CategoryDocumentI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? CategoryDocumentI18nTableMap::CLASS_DEFAULT : CategoryDocumentI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (CategoryDocumentI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = CategoryDocumentI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = CategoryDocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + CategoryDocumentI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = CategoryDocumentI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
CategoryDocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = CategoryDocumentI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = CategoryDocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
CategoryDocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(CategoryDocumentI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(CategoryDocumentI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(CategoryDocumentI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(CategoryDocumentI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(CategoryDocumentI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(CategoryDocumentI18nTableMap::POSTSCRIPTUM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
$criteria->addSelectColumn($alias . '.CHAPO');
|
||||
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(CategoryDocumentI18nTableMap::DATABASE_NAME)->getTable(CategoryDocumentI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CategoryDocumentI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(CategoryDocumentI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new CategoryDocumentI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a CategoryDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or CategoryDocumentI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\CategoryDocumentI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(CategoryDocumentI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(CategoryDocumentI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(CategoryDocumentI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = CategoryDocumentI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { CategoryDocumentI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { CategoryDocumentI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_document_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return CategoryDocumentI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a CategoryDocumentI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or CategoryDocumentI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from CategoryDocumentI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = CategoryDocumentI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // CategoryDocumentI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
CategoryDocumentI18nTableMap::buildTableMap();
|
||||
475
core/lib/Thelia/Model/Map/CategoryDocumentTableMap.php
Normal file
475
core/lib/Thelia/Model/Map/CategoryDocumentTableMap.php
Normal file
@@ -0,0 +1,475 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\CategoryDocument;
|
||||
use Thelia\Model\CategoryDocumentQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'category_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class CategoryDocumentTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.CategoryDocumentTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'category_document';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\CategoryDocument';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.CategoryDocument';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'category_document.ID';
|
||||
|
||||
/**
|
||||
* the column name for the CATEGORY_ID field
|
||||
*/
|
||||
const CATEGORY_ID = 'category_document.CATEGORY_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FILE field
|
||||
*/
|
||||
const FILE = 'category_document.FILE';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'category_document.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'category_document.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'category_document.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* The default locale to use for translations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_LOCALE = 'en_US';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'CategoryId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'categoryId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(CategoryDocumentTableMap::ID, CategoryDocumentTableMap::CATEGORY_ID, CategoryDocumentTableMap::FILE, CategoryDocumentTableMap::POSITION, CategoryDocumentTableMap::CREATED_AT, CategoryDocumentTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'CATEGORY_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'category_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'CategoryId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'categoryId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(CategoryDocumentTableMap::ID => 0, CategoryDocumentTableMap::CATEGORY_ID => 1, CategoryDocumentTableMap::FILE => 2, CategoryDocumentTableMap::POSITION => 3, CategoryDocumentTableMap::CREATED_AT => 4, CategoryDocumentTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CATEGORY_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'category_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('category_document');
|
||||
$this->setPhpName('CategoryDocument');
|
||||
$this->setClassName('\\Thelia\\Model\\CategoryDocument');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('CATEGORY_ID', 'CategoryId', 'INTEGER', 'category', 'ID', true, null, null);
|
||||
$this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Category', '\\Thelia\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('CategoryDocumentI18n', '\\Thelia\\Model\\CategoryDocumentI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CategoryDocumentI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
|
||||
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to category_document * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CategoryDocumentI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? CategoryDocumentTableMap::CLASS_DEFAULT : CategoryDocumentTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (CategoryDocument object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = CategoryDocumentTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = CategoryDocumentTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + CategoryDocumentTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = CategoryDocumentTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
CategoryDocumentTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = CategoryDocumentTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = CategoryDocumentTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
CategoryDocumentTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(CategoryDocumentTableMap::ID);
|
||||
$criteria->addSelectColumn(CategoryDocumentTableMap::CATEGORY_ID);
|
||||
$criteria->addSelectColumn(CategoryDocumentTableMap::FILE);
|
||||
$criteria->addSelectColumn(CategoryDocumentTableMap::POSITION);
|
||||
$criteria->addSelectColumn(CategoryDocumentTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(CategoryDocumentTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.CATEGORY_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(CategoryDocumentTableMap::DATABASE_NAME)->getTable(CategoryDocumentTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CategoryDocumentTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(CategoryDocumentTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new CategoryDocumentTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a CategoryDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or CategoryDocument object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\CategoryDocument) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(CategoryDocumentTableMap::DATABASE_NAME);
|
||||
$criteria->add(CategoryDocumentTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = CategoryDocumentQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { CategoryDocumentTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { CategoryDocumentTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_document table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return CategoryDocumentQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a CategoryDocument or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or CategoryDocument object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from CategoryDocument object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(CategoryDocumentTableMap::ID) && $criteria->keyContainsValue(CategoryDocumentTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CategoryDocumentTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = CategoryDocumentQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // CategoryDocumentTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
CategoryDocumentTableMap::buildTableMap();
|
||||
497
core/lib/Thelia/Model/Map/CategoryImageI18nTableMap.php
Normal file
497
core/lib/Thelia/Model/Map/CategoryImageI18nTableMap.php
Normal file
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\CategoryImageI18n;
|
||||
use Thelia\Model\CategoryImageI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'category_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class CategoryImageI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.CategoryImageI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'category_image_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\CategoryImageI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.CategoryImageI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'category_image_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'category_image_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'category_image_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'category_image_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* the column name for the CHAPO field
|
||||
*/
|
||||
const CHAPO = 'category_image_i18n.CHAPO';
|
||||
|
||||
/**
|
||||
* the column name for the POSTSCRIPTUM field
|
||||
*/
|
||||
const POSTSCRIPTUM = 'category_image_i18n.POSTSCRIPTUM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_COLNAME => array(CategoryImageI18nTableMap::ID, CategoryImageI18nTableMap::LOCALE, CategoryImageI18nTableMap::TITLE, CategoryImageI18nTableMap::DESCRIPTION, CategoryImageI18nTableMap::CHAPO, CategoryImageI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_COLNAME => array(CategoryImageI18nTableMap::ID => 0, CategoryImageI18nTableMap::LOCALE => 1, CategoryImageI18nTableMap::TITLE => 2, CategoryImageI18nTableMap::DESCRIPTION => 3, CategoryImageI18nTableMap::CHAPO => 4, CategoryImageI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('category_image_i18n');
|
||||
$this->setPhpName('CategoryImageI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\CategoryImageI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'category_image', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CategoryImage', '\\Thelia\\Model\\CategoryImage', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\CategoryImageI18n $obj A \Thelia\Model\CategoryImageI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (null === $key) {
|
||||
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\CategoryImageI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\CategoryImageI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
// assume we've been passed a primary key";
|
||||
$key = serialize(array((string) $value[0], (string) $value[1]));
|
||||
} elseif ($value instanceof Criteria) {
|
||||
self::$instances = [];
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\CategoryImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? CategoryImageI18nTableMap::CLASS_DEFAULT : CategoryImageI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (CategoryImageI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = CategoryImageI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = CategoryImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + CategoryImageI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = CategoryImageI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
CategoryImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = CategoryImageI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = CategoryImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
CategoryImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(CategoryImageI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(CategoryImageI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(CategoryImageI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(CategoryImageI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(CategoryImageI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(CategoryImageI18nTableMap::POSTSCRIPTUM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
$criteria->addSelectColumn($alias . '.CHAPO');
|
||||
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(CategoryImageI18nTableMap::DATABASE_NAME)->getTable(CategoryImageI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CategoryImageI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(CategoryImageI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new CategoryImageI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a CategoryImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or CategoryImageI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\CategoryImageI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(CategoryImageI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(CategoryImageI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(CategoryImageI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = CategoryImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { CategoryImageI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { CategoryImageI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return CategoryImageI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a CategoryImageI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or CategoryImageI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from CategoryImageI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = CategoryImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // CategoryImageI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
CategoryImageI18nTableMap::buildTableMap();
|
||||
475
core/lib/Thelia/Model/Map/CategoryImageTableMap.php
Normal file
475
core/lib/Thelia/Model/Map/CategoryImageTableMap.php
Normal file
@@ -0,0 +1,475 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\CategoryImage;
|
||||
use Thelia\Model\CategoryImageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'category_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class CategoryImageTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.CategoryImageTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'category_image';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\CategoryImage';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.CategoryImage';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'category_image.ID';
|
||||
|
||||
/**
|
||||
* the column name for the CATEGORY_ID field
|
||||
*/
|
||||
const CATEGORY_ID = 'category_image.CATEGORY_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FILE field
|
||||
*/
|
||||
const FILE = 'category_image.FILE';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'category_image.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'category_image.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'category_image.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* The default locale to use for translations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_LOCALE = 'en_US';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'CategoryId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'categoryId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(CategoryImageTableMap::ID, CategoryImageTableMap::CATEGORY_ID, CategoryImageTableMap::FILE, CategoryImageTableMap::POSITION, CategoryImageTableMap::CREATED_AT, CategoryImageTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'CATEGORY_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'category_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'CategoryId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'categoryId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(CategoryImageTableMap::ID => 0, CategoryImageTableMap::CATEGORY_ID => 1, CategoryImageTableMap::FILE => 2, CategoryImageTableMap::POSITION => 3, CategoryImageTableMap::CREATED_AT => 4, CategoryImageTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CATEGORY_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'category_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('category_image');
|
||||
$this->setPhpName('CategoryImage');
|
||||
$this->setClassName('\\Thelia\\Model\\CategoryImage');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('CATEGORY_ID', 'CategoryId', 'INTEGER', 'category', 'ID', true, null, null);
|
||||
$this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Category', '\\Thelia\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('CategoryImageI18n', '\\Thelia\\Model\\CategoryImageI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CategoryImageI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
|
||||
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to category_image * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CategoryImageI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? CategoryImageTableMap::CLASS_DEFAULT : CategoryImageTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (CategoryImage object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = CategoryImageTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = CategoryImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + CategoryImageTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = CategoryImageTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
CategoryImageTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = CategoryImageTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = CategoryImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
CategoryImageTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(CategoryImageTableMap::ID);
|
||||
$criteria->addSelectColumn(CategoryImageTableMap::CATEGORY_ID);
|
||||
$criteria->addSelectColumn(CategoryImageTableMap::FILE);
|
||||
$criteria->addSelectColumn(CategoryImageTableMap::POSITION);
|
||||
$criteria->addSelectColumn(CategoryImageTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(CategoryImageTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.CATEGORY_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(CategoryImageTableMap::DATABASE_NAME)->getTable(CategoryImageTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CategoryImageTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(CategoryImageTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new CategoryImageTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a CategoryImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or CategoryImage object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\CategoryImage) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(CategoryImageTableMap::DATABASE_NAME);
|
||||
$criteria->add(CategoryImageTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = CategoryImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { CategoryImageTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { CategoryImageTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the category_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return CategoryImageQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a CategoryImage or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or CategoryImage object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(CategoryImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from CategoryImage object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(CategoryImageTableMap::ID) && $criteria->keyContainsValue(CategoryImageTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CategoryImageTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = CategoryImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // CategoryImageTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
CategoryImageTableMap::buildTableMap();
|
||||
@@ -194,9 +194,9 @@ class CategoryTableMap extends TableMap
|
||||
$this->addRelation('FeatureCategory', '\\Thelia\\Model\\FeatureCategory', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), 'CASCADE', 'RESTRICT', 'FeatureCategories');
|
||||
$this->addRelation('AttributeCategory', '\\Thelia\\Model\\AttributeCategory', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), 'CASCADE', 'RESTRICT', 'AttributeCategories');
|
||||
$this->addRelation('ContentAssoc', '\\Thelia\\Model\\ContentAssoc', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), 'CASCADE', 'RESTRICT', 'ContentAssocs');
|
||||
$this->addRelation('Image', '\\Thelia\\Model\\Image', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), 'CASCADE', 'RESTRICT', 'Images');
|
||||
$this->addRelation('Document', '\\Thelia\\Model\\Document', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), 'CASCADE', 'RESTRICT', 'Documents');
|
||||
$this->addRelation('Rewriting', '\\Thelia\\Model\\Rewriting', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), 'CASCADE', 'RESTRICT', 'Rewritings');
|
||||
$this->addRelation('CategoryImage', '\\Thelia\\Model\\CategoryImage', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), 'CASCADE', 'RESTRICT', 'CategoryImages');
|
||||
$this->addRelation('CategoryDocument', '\\Thelia\\Model\\CategoryDocument', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), 'CASCADE', 'RESTRICT', 'CategoryDocuments');
|
||||
$this->addRelation('CategoryI18n', '\\Thelia\\Model\\CategoryI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CategoryI18ns');
|
||||
$this->addRelation('CategoryVersion', '\\Thelia\\Model\\CategoryVersion', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CategoryVersions');
|
||||
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'RESTRICT', 'Products');
|
||||
@@ -229,9 +229,9 @@ class CategoryTableMap extends TableMap
|
||||
FeatureCategoryTableMap::clearInstancePool();
|
||||
AttributeCategoryTableMap::clearInstancePool();
|
||||
ContentAssocTableMap::clearInstancePool();
|
||||
ImageTableMap::clearInstancePool();
|
||||
DocumentTableMap::clearInstancePool();
|
||||
RewritingTableMap::clearInstancePool();
|
||||
CategoryImageTableMap::clearInstancePool();
|
||||
CategoryDocumentTableMap::clearInstancePool();
|
||||
CategoryI18nTableMap::clearInstancePool();
|
||||
CategoryVersionTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
497
core/lib/Thelia/Model/Map/ContentDocumentI18nTableMap.php
Normal file
497
core/lib/Thelia/Model/Map/ContentDocumentI18nTableMap.php
Normal file
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ContentDocumentI18n;
|
||||
use Thelia\Model\ContentDocumentI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'content_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ContentDocumentI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ContentDocumentI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'content_document_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ContentDocumentI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ContentDocumentI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'content_document_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'content_document_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'content_document_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'content_document_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* the column name for the CHAPO field
|
||||
*/
|
||||
const CHAPO = 'content_document_i18n.CHAPO';
|
||||
|
||||
/**
|
||||
* the column name for the POSTSCRIPTUM field
|
||||
*/
|
||||
const POSTSCRIPTUM = 'content_document_i18n.POSTSCRIPTUM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_COLNAME => array(ContentDocumentI18nTableMap::ID, ContentDocumentI18nTableMap::LOCALE, ContentDocumentI18nTableMap::TITLE, ContentDocumentI18nTableMap::DESCRIPTION, ContentDocumentI18nTableMap::CHAPO, ContentDocumentI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_COLNAME => array(ContentDocumentI18nTableMap::ID => 0, ContentDocumentI18nTableMap::LOCALE => 1, ContentDocumentI18nTableMap::TITLE => 2, ContentDocumentI18nTableMap::DESCRIPTION => 3, ContentDocumentI18nTableMap::CHAPO => 4, ContentDocumentI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('content_document_i18n');
|
||||
$this->setPhpName('ContentDocumentI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ContentDocumentI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'content_document', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ContentDocument', '\\Thelia\\Model\\ContentDocument', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\ContentDocumentI18n $obj A \Thelia\Model\ContentDocumentI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (null === $key) {
|
||||
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\ContentDocumentI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ContentDocumentI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
// assume we've been passed a primary key";
|
||||
$key = serialize(array((string) $value[0], (string) $value[1]));
|
||||
} elseif ($value instanceof Criteria) {
|
||||
self::$instances = [];
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ContentDocumentI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ContentDocumentI18nTableMap::CLASS_DEFAULT : ContentDocumentI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ContentDocumentI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ContentDocumentI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ContentDocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ContentDocumentI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ContentDocumentI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ContentDocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ContentDocumentI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ContentDocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ContentDocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ContentDocumentI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ContentDocumentI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ContentDocumentI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ContentDocumentI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(ContentDocumentI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(ContentDocumentI18nTableMap::POSTSCRIPTUM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
$criteria->addSelectColumn($alias . '.CHAPO');
|
||||
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ContentDocumentI18nTableMap::DATABASE_NAME)->getTable(ContentDocumentI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ContentDocumentI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ContentDocumentI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ContentDocumentI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ContentDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ContentDocumentI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ContentDocumentI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ContentDocumentI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(ContentDocumentI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ContentDocumentI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = ContentDocumentI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ContentDocumentI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ContentDocumentI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_document_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ContentDocumentI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ContentDocumentI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ContentDocumentI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ContentDocumentI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ContentDocumentI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ContentDocumentI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ContentDocumentI18nTableMap::buildTableMap();
|
||||
475
core/lib/Thelia/Model/Map/ContentDocumentTableMap.php
Normal file
475
core/lib/Thelia/Model/Map/ContentDocumentTableMap.php
Normal file
@@ -0,0 +1,475 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ContentDocument;
|
||||
use Thelia\Model\ContentDocumentQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'content_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ContentDocumentTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ContentDocumentTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'content_document';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ContentDocument';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ContentDocument';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'content_document.ID';
|
||||
|
||||
/**
|
||||
* the column name for the CONTENT_ID field
|
||||
*/
|
||||
const CONTENT_ID = 'content_document.CONTENT_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FILE field
|
||||
*/
|
||||
const FILE = 'content_document.FILE';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'content_document.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'content_document.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'content_document.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* The default locale to use for translations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_LOCALE = 'en_US';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'ContentId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'contentId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ContentDocumentTableMap::ID, ContentDocumentTableMap::CONTENT_ID, ContentDocumentTableMap::FILE, ContentDocumentTableMap::POSITION, ContentDocumentTableMap::CREATED_AT, ContentDocumentTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'CONTENT_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'content_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'ContentId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'contentId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(ContentDocumentTableMap::ID => 0, ContentDocumentTableMap::CONTENT_ID => 1, ContentDocumentTableMap::FILE => 2, ContentDocumentTableMap::POSITION => 3, ContentDocumentTableMap::CREATED_AT => 4, ContentDocumentTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CONTENT_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'content_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('content_document');
|
||||
$this->setPhpName('ContentDocument');
|
||||
$this->setClassName('\\Thelia\\Model\\ContentDocument');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('CONTENT_ID', 'ContentId', 'INTEGER', 'content', 'ID', true, null, null);
|
||||
$this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Content', '\\Thelia\\Model\\Content', RelationMap::MANY_TO_ONE, array('content_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('ContentDocumentI18n', '\\Thelia\\Model\\ContentDocumentI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ContentDocumentI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
|
||||
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to content_document * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ContentDocumentI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ContentDocumentTableMap::CLASS_DEFAULT : ContentDocumentTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ContentDocument object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ContentDocumentTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ContentDocumentTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ContentDocumentTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ContentDocumentTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ContentDocumentTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ContentDocumentTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ContentDocumentTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ContentDocumentTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ContentDocumentTableMap::ID);
|
||||
$criteria->addSelectColumn(ContentDocumentTableMap::CONTENT_ID);
|
||||
$criteria->addSelectColumn(ContentDocumentTableMap::FILE);
|
||||
$criteria->addSelectColumn(ContentDocumentTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ContentDocumentTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ContentDocumentTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.CONTENT_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ContentDocumentTableMap::DATABASE_NAME)->getTable(ContentDocumentTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ContentDocumentTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ContentDocumentTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ContentDocumentTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ContentDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ContentDocument object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ContentDocument) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ContentDocumentTableMap::DATABASE_NAME);
|
||||
$criteria->add(ContentDocumentTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ContentDocumentQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ContentDocumentTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ContentDocumentTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_document table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ContentDocumentQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ContentDocument or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ContentDocument object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ContentDocument object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ContentDocumentTableMap::ID) && $criteria->keyContainsValue(ContentDocumentTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ContentDocumentTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ContentDocumentQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ContentDocumentTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ContentDocumentTableMap::buildTableMap();
|
||||
497
core/lib/Thelia/Model/Map/ContentImageI18nTableMap.php
Normal file
497
core/lib/Thelia/Model/Map/ContentImageI18nTableMap.php
Normal file
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ContentImageI18n;
|
||||
use Thelia\Model\ContentImageI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'content_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ContentImageI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ContentImageI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'content_image_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ContentImageI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ContentImageI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'content_image_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'content_image_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'content_image_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'content_image_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* the column name for the CHAPO field
|
||||
*/
|
||||
const CHAPO = 'content_image_i18n.CHAPO';
|
||||
|
||||
/**
|
||||
* the column name for the POSTSCRIPTUM field
|
||||
*/
|
||||
const POSTSCRIPTUM = 'content_image_i18n.POSTSCRIPTUM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_COLNAME => array(ContentImageI18nTableMap::ID, ContentImageI18nTableMap::LOCALE, ContentImageI18nTableMap::TITLE, ContentImageI18nTableMap::DESCRIPTION, ContentImageI18nTableMap::CHAPO, ContentImageI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_COLNAME => array(ContentImageI18nTableMap::ID => 0, ContentImageI18nTableMap::LOCALE => 1, ContentImageI18nTableMap::TITLE => 2, ContentImageI18nTableMap::DESCRIPTION => 3, ContentImageI18nTableMap::CHAPO => 4, ContentImageI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('content_image_i18n');
|
||||
$this->setPhpName('ContentImageI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ContentImageI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'content_image', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ContentImage', '\\Thelia\\Model\\ContentImage', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\ContentImageI18n $obj A \Thelia\Model\ContentImageI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (null === $key) {
|
||||
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\ContentImageI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ContentImageI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
// assume we've been passed a primary key";
|
||||
$key = serialize(array((string) $value[0], (string) $value[1]));
|
||||
} elseif ($value instanceof Criteria) {
|
||||
self::$instances = [];
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ContentImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ContentImageI18nTableMap::CLASS_DEFAULT : ContentImageI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ContentImageI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ContentImageI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ContentImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ContentImageI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ContentImageI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ContentImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ContentImageI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ContentImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ContentImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ContentImageI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ContentImageI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ContentImageI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ContentImageI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(ContentImageI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(ContentImageI18nTableMap::POSTSCRIPTUM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
$criteria->addSelectColumn($alias . '.CHAPO');
|
||||
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ContentImageI18nTableMap::DATABASE_NAME)->getTable(ContentImageI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ContentImageI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ContentImageI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ContentImageI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ContentImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ContentImageI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ContentImageI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ContentImageI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(ContentImageI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ContentImageI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = ContentImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ContentImageI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ContentImageI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ContentImageI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ContentImageI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ContentImageI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ContentImageI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ContentImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ContentImageI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ContentImageI18nTableMap::buildTableMap();
|
||||
475
core/lib/Thelia/Model/Map/ContentImageTableMap.php
Normal file
475
core/lib/Thelia/Model/Map/ContentImageTableMap.php
Normal file
@@ -0,0 +1,475 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ContentImage;
|
||||
use Thelia\Model\ContentImageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'content_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ContentImageTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ContentImageTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'content_image';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ContentImage';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ContentImage';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'content_image.ID';
|
||||
|
||||
/**
|
||||
* the column name for the CONTENT_ID field
|
||||
*/
|
||||
const CONTENT_ID = 'content_image.CONTENT_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FILE field
|
||||
*/
|
||||
const FILE = 'content_image.FILE';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'content_image.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'content_image.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'content_image.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* The default locale to use for translations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_LOCALE = 'en_US';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'ContentId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'contentId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ContentImageTableMap::ID, ContentImageTableMap::CONTENT_ID, ContentImageTableMap::FILE, ContentImageTableMap::POSITION, ContentImageTableMap::CREATED_AT, ContentImageTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'CONTENT_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'content_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'ContentId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'contentId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(ContentImageTableMap::ID => 0, ContentImageTableMap::CONTENT_ID => 1, ContentImageTableMap::FILE => 2, ContentImageTableMap::POSITION => 3, ContentImageTableMap::CREATED_AT => 4, ContentImageTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CONTENT_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'content_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('content_image');
|
||||
$this->setPhpName('ContentImage');
|
||||
$this->setClassName('\\Thelia\\Model\\ContentImage');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('CONTENT_ID', 'ContentId', 'INTEGER', 'content', 'ID', true, null, null);
|
||||
$this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Content', '\\Thelia\\Model\\Content', RelationMap::MANY_TO_ONE, array('content_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('ContentImageI18n', '\\Thelia\\Model\\ContentImageI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ContentImageI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
|
||||
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to content_image * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ContentImageI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ContentImageTableMap::CLASS_DEFAULT : ContentImageTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ContentImage object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ContentImageTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ContentImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ContentImageTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ContentImageTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ContentImageTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ContentImageTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ContentImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ContentImageTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ContentImageTableMap::ID);
|
||||
$criteria->addSelectColumn(ContentImageTableMap::CONTENT_ID);
|
||||
$criteria->addSelectColumn(ContentImageTableMap::FILE);
|
||||
$criteria->addSelectColumn(ContentImageTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ContentImageTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ContentImageTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.CONTENT_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ContentImageTableMap::DATABASE_NAME)->getTable(ContentImageTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ContentImageTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ContentImageTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ContentImageTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ContentImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ContentImage object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ContentImage) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ContentImageTableMap::DATABASE_NAME);
|
||||
$criteria->add(ContentImageTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ContentImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ContentImageTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ContentImageTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the content_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ContentImageQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ContentImage or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ContentImage object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ContentImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ContentImage object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ContentImageTableMap::ID) && $criteria->keyContainsValue(ContentImageTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ContentImageTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ContentImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ContentImageTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ContentImageTableMap::buildTableMap();
|
||||
@@ -185,10 +185,10 @@ class ContentTableMap extends TableMap
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ContentAssoc', '\\Thelia\\Model\\ContentAssoc', RelationMap::ONE_TO_MANY, array('id' => 'content_id', ), 'CASCADE', 'RESTRICT', 'ContentAssocs');
|
||||
$this->addRelation('Image', '\\Thelia\\Model\\Image', RelationMap::ONE_TO_MANY, array('id' => 'content_id', ), 'CASCADE', 'RESTRICT', 'Images');
|
||||
$this->addRelation('Document', '\\Thelia\\Model\\Document', RelationMap::ONE_TO_MANY, array('id' => 'content_id', ), 'CASCADE', 'RESTRICT', 'Documents');
|
||||
$this->addRelation('Rewriting', '\\Thelia\\Model\\Rewriting', RelationMap::ONE_TO_MANY, array('id' => 'content_id', ), 'CASCADE', 'RESTRICT', 'Rewritings');
|
||||
$this->addRelation('ContentFolder', '\\Thelia\\Model\\ContentFolder', RelationMap::ONE_TO_MANY, array('id' => 'content_id', ), 'CASCADE', 'RESTRICT', 'ContentFolders');
|
||||
$this->addRelation('ContentImage', '\\Thelia\\Model\\ContentImage', RelationMap::ONE_TO_MANY, array('id' => 'content_id', ), 'CASCADE', 'RESTRICT', 'ContentImages');
|
||||
$this->addRelation('ContentDocument', '\\Thelia\\Model\\ContentDocument', RelationMap::ONE_TO_MANY, array('id' => 'content_id', ), 'CASCADE', 'RESTRICT', 'ContentDocuments');
|
||||
$this->addRelation('ContentI18n', '\\Thelia\\Model\\ContentI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ContentI18ns');
|
||||
$this->addRelation('ContentVersion', '\\Thelia\\Model\\ContentVersion', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ContentVersions');
|
||||
$this->addRelation('Folder', '\\Thelia\\Model\\Folder', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'RESTRICT', 'Folders');
|
||||
@@ -216,10 +216,10 @@ class ContentTableMap extends TableMap
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ContentAssocTableMap::clearInstancePool();
|
||||
ImageTableMap::clearInstancePool();
|
||||
DocumentTableMap::clearInstancePool();
|
||||
RewritingTableMap::clearInstancePool();
|
||||
ContentFolderTableMap::clearInstancePool();
|
||||
ContentImageTableMap::clearInstancePool();
|
||||
ContentDocumentTableMap::clearInstancePool();
|
||||
ContentI18nTableMap::clearInstancePool();
|
||||
ContentVersionTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class CurrencyTableMap extends TableMap
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 8;
|
||||
const NUM_COLUMNS = 7;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
@@ -67,7 +67,7 @@ class CurrencyTableMap extends TableMap
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 8;
|
||||
const NUM_HYDRATE_COLUMNS = 7;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
@@ -94,11 +94,6 @@ class CurrencyTableMap extends TableMap
|
||||
*/
|
||||
const BY_DEFAULT = 'currency.BY_DEFAULT';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'currency.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
@@ -130,12 +125,12 @@ class CurrencyTableMap extends TableMap
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Code', 'Symbol', 'Rate', 'ByDefault', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'code', 'symbol', 'rate', 'byDefault', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(CurrencyTableMap::ID, CurrencyTableMap::CODE, CurrencyTableMap::SYMBOL, CurrencyTableMap::RATE, CurrencyTableMap::BY_DEFAULT, CurrencyTableMap::POSITION, CurrencyTableMap::CREATED_AT, CurrencyTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'CODE', 'SYMBOL', 'RATE', 'BY_DEFAULT', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'code', 'symbol', 'rate', 'by_default', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
self::TYPE_PHPNAME => array('Id', 'Code', 'Symbol', 'Rate', 'ByDefault', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'code', 'symbol', 'rate', 'byDefault', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(CurrencyTableMap::ID, CurrencyTableMap::CODE, CurrencyTableMap::SYMBOL, CurrencyTableMap::RATE, CurrencyTableMap::BY_DEFAULT, CurrencyTableMap::CREATED_AT, CurrencyTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'CODE', 'SYMBOL', 'RATE', 'BY_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'code', 'symbol', 'rate', 'by_default', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -145,12 +140,12 @@ class CurrencyTableMap extends TableMap
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Code' => 1, 'Symbol' => 2, 'Rate' => 3, 'ByDefault' => 4, 'Position' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'code' => 1, 'symbol' => 2, 'rate' => 3, 'byDefault' => 4, 'position' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
|
||||
self::TYPE_COLNAME => array(CurrencyTableMap::ID => 0, CurrencyTableMap::CODE => 1, CurrencyTableMap::SYMBOL => 2, CurrencyTableMap::RATE => 3, CurrencyTableMap::BY_DEFAULT => 4, CurrencyTableMap::POSITION => 5, CurrencyTableMap::CREATED_AT => 6, CurrencyTableMap::UPDATED_AT => 7, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CODE' => 1, 'SYMBOL' => 2, 'RATE' => 3, 'BY_DEFAULT' => 4, 'POSITION' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'code' => 1, 'symbol' => 2, 'rate' => 3, 'by_default' => 4, 'position' => 5, 'created_at' => 6, 'updated_at' => 7, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Code' => 1, 'Symbol' => 2, 'Rate' => 3, 'ByDefault' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'code' => 1, 'symbol' => 2, 'rate' => 3, 'byDefault' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
|
||||
self::TYPE_COLNAME => array(CurrencyTableMap::ID => 0, CurrencyTableMap::CODE => 1, CurrencyTableMap::SYMBOL => 2, CurrencyTableMap::RATE => 3, CurrencyTableMap::BY_DEFAULT => 4, CurrencyTableMap::CREATED_AT => 5, CurrencyTableMap::UPDATED_AT => 6, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CODE' => 1, 'SYMBOL' => 2, 'RATE' => 3, 'BY_DEFAULT' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'code' => 1, 'symbol' => 2, 'rate' => 3, 'by_default' => 4, 'created_at' => 5, 'updated_at' => 6, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -174,7 +169,6 @@ class CurrencyTableMap extends TableMap
|
||||
$this->addColumn('SYMBOL', 'Symbol', 'VARCHAR', false, 45, null);
|
||||
$this->addColumn('RATE', 'Rate', 'FLOAT', false, null, null);
|
||||
$this->addColumn('BY_DEFAULT', 'ByDefault', 'TINYINT', false, null, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
@@ -358,7 +352,6 @@ class CurrencyTableMap extends TableMap
|
||||
$criteria->addSelectColumn(CurrencyTableMap::SYMBOL);
|
||||
$criteria->addSelectColumn(CurrencyTableMap::RATE);
|
||||
$criteria->addSelectColumn(CurrencyTableMap::BY_DEFAULT);
|
||||
$criteria->addSelectColumn(CurrencyTableMap::POSITION);
|
||||
$criteria->addSelectColumn(CurrencyTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(CurrencyTableMap::UPDATED_AT);
|
||||
} else {
|
||||
@@ -367,7 +360,6 @@ class CurrencyTableMap extends TableMap
|
||||
$criteria->addSelectColumn($alias . '.SYMBOL');
|
||||
$criteria->addSelectColumn($alias . '.RATE');
|
||||
$criteria->addSelectColumn($alias . '.BY_DEFAULT');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
|
||||
497
core/lib/Thelia/Model/Map/FolderDocumentI18nTableMap.php
Normal file
497
core/lib/Thelia/Model/Map/FolderDocumentI18nTableMap.php
Normal file
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\FolderDocumentI18n;
|
||||
use Thelia\Model\FolderDocumentI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'folder_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class FolderDocumentI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.FolderDocumentI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'folder_document_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\FolderDocumentI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.FolderDocumentI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'folder_document_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'folder_document_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'folder_document_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'folder_document_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* the column name for the CHAPO field
|
||||
*/
|
||||
const CHAPO = 'folder_document_i18n.CHAPO';
|
||||
|
||||
/**
|
||||
* the column name for the POSTSCRIPTUM field
|
||||
*/
|
||||
const POSTSCRIPTUM = 'folder_document_i18n.POSTSCRIPTUM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_COLNAME => array(FolderDocumentI18nTableMap::ID, FolderDocumentI18nTableMap::LOCALE, FolderDocumentI18nTableMap::TITLE, FolderDocumentI18nTableMap::DESCRIPTION, FolderDocumentI18nTableMap::CHAPO, FolderDocumentI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_COLNAME => array(FolderDocumentI18nTableMap::ID => 0, FolderDocumentI18nTableMap::LOCALE => 1, FolderDocumentI18nTableMap::TITLE => 2, FolderDocumentI18nTableMap::DESCRIPTION => 3, FolderDocumentI18nTableMap::CHAPO => 4, FolderDocumentI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('folder_document_i18n');
|
||||
$this->setPhpName('FolderDocumentI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\FolderDocumentI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'folder_document', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('FolderDocument', '\\Thelia\\Model\\FolderDocument', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\FolderDocumentI18n $obj A \Thelia\Model\FolderDocumentI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (null === $key) {
|
||||
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\FolderDocumentI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\FolderDocumentI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
// assume we've been passed a primary key";
|
||||
$key = serialize(array((string) $value[0], (string) $value[1]));
|
||||
} elseif ($value instanceof Criteria) {
|
||||
self::$instances = [];
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\FolderDocumentI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? FolderDocumentI18nTableMap::CLASS_DEFAULT : FolderDocumentI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (FolderDocumentI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = FolderDocumentI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = FolderDocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + FolderDocumentI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = FolderDocumentI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
FolderDocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = FolderDocumentI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = FolderDocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
FolderDocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(FolderDocumentI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(FolderDocumentI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(FolderDocumentI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(FolderDocumentI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(FolderDocumentI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(FolderDocumentI18nTableMap::POSTSCRIPTUM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
$criteria->addSelectColumn($alias . '.CHAPO');
|
||||
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(FolderDocumentI18nTableMap::DATABASE_NAME)->getTable(FolderDocumentI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(FolderDocumentI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(FolderDocumentI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new FolderDocumentI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a FolderDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or FolderDocumentI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\FolderDocumentI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(FolderDocumentI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(FolderDocumentI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(FolderDocumentI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = FolderDocumentI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { FolderDocumentI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { FolderDocumentI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the folder_document_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return FolderDocumentI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a FolderDocumentI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or FolderDocumentI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from FolderDocumentI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = FolderDocumentI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // FolderDocumentI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
FolderDocumentI18nTableMap::buildTableMap();
|
||||
475
core/lib/Thelia/Model/Map/FolderDocumentTableMap.php
Normal file
475
core/lib/Thelia/Model/Map/FolderDocumentTableMap.php
Normal file
@@ -0,0 +1,475 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\FolderDocument;
|
||||
use Thelia\Model\FolderDocumentQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'folder_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class FolderDocumentTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.FolderDocumentTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'folder_document';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\FolderDocument';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.FolderDocument';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'folder_document.ID';
|
||||
|
||||
/**
|
||||
* the column name for the FOLDER_ID field
|
||||
*/
|
||||
const FOLDER_ID = 'folder_document.FOLDER_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FILE field
|
||||
*/
|
||||
const FILE = 'folder_document.FILE';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'folder_document.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'folder_document.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'folder_document.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* The default locale to use for translations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_LOCALE = 'en_US';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'FolderId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'folderId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(FolderDocumentTableMap::ID, FolderDocumentTableMap::FOLDER_ID, FolderDocumentTableMap::FILE, FolderDocumentTableMap::POSITION, FolderDocumentTableMap::CREATED_AT, FolderDocumentTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'FOLDER_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'folder_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'FolderId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'folderId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(FolderDocumentTableMap::ID => 0, FolderDocumentTableMap::FOLDER_ID => 1, FolderDocumentTableMap::FILE => 2, FolderDocumentTableMap::POSITION => 3, FolderDocumentTableMap::CREATED_AT => 4, FolderDocumentTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'FOLDER_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'folder_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('folder_document');
|
||||
$this->setPhpName('FolderDocument');
|
||||
$this->setClassName('\\Thelia\\Model\\FolderDocument');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('FOLDER_ID', 'FolderId', 'INTEGER', 'folder', 'ID', true, null, null);
|
||||
$this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Folder', '\\Thelia\\Model\\Folder', RelationMap::MANY_TO_ONE, array('folder_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('FolderDocumentI18n', '\\Thelia\\Model\\FolderDocumentI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'FolderDocumentI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
|
||||
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to folder_document * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
FolderDocumentI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? FolderDocumentTableMap::CLASS_DEFAULT : FolderDocumentTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (FolderDocument object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = FolderDocumentTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = FolderDocumentTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + FolderDocumentTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = FolderDocumentTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
FolderDocumentTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = FolderDocumentTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = FolderDocumentTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
FolderDocumentTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(FolderDocumentTableMap::ID);
|
||||
$criteria->addSelectColumn(FolderDocumentTableMap::FOLDER_ID);
|
||||
$criteria->addSelectColumn(FolderDocumentTableMap::FILE);
|
||||
$criteria->addSelectColumn(FolderDocumentTableMap::POSITION);
|
||||
$criteria->addSelectColumn(FolderDocumentTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(FolderDocumentTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.FOLDER_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(FolderDocumentTableMap::DATABASE_NAME)->getTable(FolderDocumentTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(FolderDocumentTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(FolderDocumentTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new FolderDocumentTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a FolderDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or FolderDocument object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\FolderDocument) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(FolderDocumentTableMap::DATABASE_NAME);
|
||||
$criteria->add(FolderDocumentTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = FolderDocumentQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { FolderDocumentTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { FolderDocumentTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the folder_document table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return FolderDocumentQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a FolderDocument or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or FolderDocument object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from FolderDocument object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(FolderDocumentTableMap::ID) && $criteria->keyContainsValue(FolderDocumentTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.FolderDocumentTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = FolderDocumentQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // FolderDocumentTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
FolderDocumentTableMap::buildTableMap();
|
||||
@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\DocumentI18n;
|
||||
use Thelia\Model\DocumentI18nQuery;
|
||||
use Thelia\Model\FolderImageI18n;
|
||||
use Thelia\Model\FolderImageI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'document_i18n' table.
|
||||
* This class defines the structure of the 'folder_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -25,14 +25,14 @@ use Thelia\Model\DocumentI18nQuery;
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class DocumentI18nTableMap extends TableMap
|
||||
class FolderImageI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.DocumentI18nTableMap';
|
||||
const CLASS_NAME = 'Thelia.Model.Map.FolderImageI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
@@ -42,17 +42,17 @@ class DocumentI18nTableMap extends TableMap
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'document_i18n';
|
||||
const TABLE_NAME = 'folder_image_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\DocumentI18n';
|
||||
const OM_CLASS = '\\Thelia\\Model\\FolderImageI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.DocumentI18n';
|
||||
const CLASS_DEFAULT = 'Thelia.Model.FolderImageI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
@@ -72,32 +72,32 @@ class DocumentI18nTableMap extends TableMap
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'document_i18n.ID';
|
||||
const ID = 'folder_image_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'document_i18n.LOCALE';
|
||||
const LOCALE = 'folder_image_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'document_i18n.TITLE';
|
||||
const TITLE = 'folder_image_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'document_i18n.DESCRIPTION';
|
||||
const DESCRIPTION = 'folder_image_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* the column name for the CHAPO field
|
||||
*/
|
||||
const CHAPO = 'document_i18n.CHAPO';
|
||||
const CHAPO = 'folder_image_i18n.CHAPO';
|
||||
|
||||
/**
|
||||
* the column name for the POSTSCRIPTUM field
|
||||
*/
|
||||
const POSTSCRIPTUM = 'document_i18n.POSTSCRIPTUM';
|
||||
const POSTSCRIPTUM = 'folder_image_i18n.POSTSCRIPTUM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
@@ -113,7 +113,7 @@ class DocumentI18nTableMap extends TableMap
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_COLNAME => array(DocumentI18nTableMap::ID, DocumentI18nTableMap::LOCALE, DocumentI18nTableMap::TITLE, DocumentI18nTableMap::DESCRIPTION, DocumentI18nTableMap::CHAPO, DocumentI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_COLNAME => array(FolderImageI18nTableMap::ID, FolderImageI18nTableMap::LOCALE, FolderImageI18nTableMap::TITLE, FolderImageI18nTableMap::DESCRIPTION, FolderImageI18nTableMap::CHAPO, FolderImageI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
@@ -128,7 +128,7 @@ class DocumentI18nTableMap extends TableMap
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_COLNAME => array(DocumentI18nTableMap::ID => 0, DocumentI18nTableMap::LOCALE => 1, DocumentI18nTableMap::TITLE => 2, DocumentI18nTableMap::DESCRIPTION => 3, DocumentI18nTableMap::CHAPO => 4, DocumentI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_COLNAME => array(FolderImageI18nTableMap::ID => 0, FolderImageI18nTableMap::LOCALE => 1, FolderImageI18nTableMap::TITLE => 2, FolderImageI18nTableMap::DESCRIPTION => 3, FolderImageI18nTableMap::CHAPO => 4, FolderImageI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
@@ -144,13 +144,13 @@ class DocumentI18nTableMap extends TableMap
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('document_i18n');
|
||||
$this->setPhpName('DocumentI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\DocumentI18n');
|
||||
$this->setName('folder_image_i18n');
|
||||
$this->setPhpName('FolderImageI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\FolderImageI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'document', 'ID', true, null, null);
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'folder_image', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
@@ -163,7 +163,7 @@ class DocumentI18nTableMap extends TableMap
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Document', '\\Thelia\\Model\\Document', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('FolderImage', '\\Thelia\\Model\\FolderImage', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
@@ -174,7 +174,7 @@ class DocumentI18nTableMap extends TableMap
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\DocumentI18n $obj A \Thelia\Model\DocumentI18n object.
|
||||
* @param \Thelia\Model\FolderImageI18n $obj A \Thelia\Model\FolderImageI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
@@ -195,12 +195,12 @@ class DocumentI18nTableMap extends TableMap
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\DocumentI18n object or a primary key value.
|
||||
* @param mixed $value A \Thelia\Model\FolderImageI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\DocumentI18n) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\FolderImageI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
@@ -211,7 +211,7 @@ class DocumentI18nTableMap extends TableMap
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\DocumentI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\FolderImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ class DocumentI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? DocumentI18nTableMap::CLASS_DEFAULT : DocumentI18nTableMap::OM_CLASS;
|
||||
return $withPrefix ? FolderImageI18nTableMap::CLASS_DEFAULT : FolderImageI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -285,21 +285,21 @@ class DocumentI18nTableMap extends TableMap
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (DocumentI18n object, last column rank)
|
||||
* @return array (FolderImageI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = DocumentI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = DocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
$key = FolderImageI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = FolderImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + DocumentI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
$col = $offset + FolderImageI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = DocumentI18nTableMap::OM_CLASS;
|
||||
$cls = FolderImageI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
DocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
FolderImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
@@ -322,8 +322,8 @@ class DocumentI18nTableMap extends TableMap
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = DocumentI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = DocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
$key = FolderImageI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = FolderImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
@@ -332,7 +332,7 @@ class DocumentI18nTableMap extends TableMap
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
DocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
FolderImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
@@ -353,12 +353,12 @@ class DocumentI18nTableMap extends TableMap
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(DocumentI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(DocumentI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(DocumentI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(DocumentI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(DocumentI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(DocumentI18nTableMap::POSTSCRIPTUM);
|
||||
$criteria->addSelectColumn(FolderImageI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(FolderImageI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(FolderImageI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(FolderImageI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(FolderImageI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(FolderImageI18nTableMap::POSTSCRIPTUM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
@@ -378,7 +378,7 @@ class DocumentI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(DocumentI18nTableMap::DATABASE_NAME)->getTable(DocumentI18nTableMap::TABLE_NAME);
|
||||
return Propel::getServiceContainer()->getDatabaseMap(FolderImageI18nTableMap::DATABASE_NAME)->getTable(FolderImageI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -386,16 +386,16 @@ class DocumentI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(DocumentI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(DocumentI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new DocumentI18nTableMap());
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(FolderImageI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new FolderImageI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a DocumentI18n or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a FolderImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or DocumentI18n object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or FolderImageI18n 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
|
||||
@@ -406,17 +406,17 @@ class DocumentI18nTableMap extends TableMap
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\DocumentI18n) { // it's a model object
|
||||
} elseif ($values instanceof \Thelia\Model\FolderImageI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$criteria = new Criteria(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
@@ -424,17 +424,17 @@ class DocumentI18nTableMap extends TableMap
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(DocumentI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(DocumentI18nTableMap::LOCALE, $value[1]));
|
||||
$criterion = $criteria->getNewCriterion(FolderImageI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(FolderImageI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = DocumentI18nQuery::create()->mergeWith($criteria);
|
||||
$query = FolderImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { DocumentI18nTableMap::clearInstancePool();
|
||||
if ($values instanceof Criteria) { FolderImageI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { DocumentI18nTableMap::removeInstanceFromPool($singleval);
|
||||
foreach ((array) $values as $singleval) { FolderImageI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,20 +442,20 @@ class DocumentI18nTableMap extends TableMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the document_i18n table.
|
||||
* Deletes all rows from the folder_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return DocumentI18nQuery::create()->doDeleteAll($con);
|
||||
return FolderImageI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a DocumentI18n or Criteria object.
|
||||
* Performs an INSERT on the database, given a FolderImageI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or DocumentI18n object containing data that is used to create the INSERT statement.
|
||||
* @param mixed $criteria Criteria or FolderImageI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
@@ -464,18 +464,18 @@ class DocumentI18nTableMap extends TableMap
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from DocumentI18n object
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from FolderImageI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = DocumentI18nQuery::create()->mergeWith($criteria);
|
||||
$query = FolderImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
@@ -491,7 +491,7 @@ class DocumentI18nTableMap extends TableMap
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // DocumentI18nTableMap
|
||||
} // FolderImageI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
DocumentI18nTableMap::buildTableMap();
|
||||
FolderImageI18nTableMap::buildTableMap();
|
||||
475
core/lib/Thelia/Model/Map/FolderImageTableMap.php
Normal file
475
core/lib/Thelia/Model/Map/FolderImageTableMap.php
Normal file
@@ -0,0 +1,475 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\FolderImage;
|
||||
use Thelia\Model\FolderImageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'folder_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class FolderImageTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.FolderImageTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'folder_image';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\FolderImage';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.FolderImage';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'folder_image.ID';
|
||||
|
||||
/**
|
||||
* the column name for the FOLDER_ID field
|
||||
*/
|
||||
const FOLDER_ID = 'folder_image.FOLDER_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FILE field
|
||||
*/
|
||||
const FILE = 'folder_image.FILE';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'folder_image.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'folder_image.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'folder_image.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* The default locale to use for translations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_LOCALE = 'en_US';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'FolderId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'folderId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(FolderImageTableMap::ID, FolderImageTableMap::FOLDER_ID, FolderImageTableMap::FILE, FolderImageTableMap::POSITION, FolderImageTableMap::CREATED_AT, FolderImageTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'FOLDER_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'folder_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'FolderId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'folderId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(FolderImageTableMap::ID => 0, FolderImageTableMap::FOLDER_ID => 1, FolderImageTableMap::FILE => 2, FolderImageTableMap::POSITION => 3, FolderImageTableMap::CREATED_AT => 4, FolderImageTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'FOLDER_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'folder_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('folder_image');
|
||||
$this->setPhpName('FolderImage');
|
||||
$this->setClassName('\\Thelia\\Model\\FolderImage');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('FOLDER_ID', 'FolderId', 'INTEGER', 'folder', 'ID', true, null, null);
|
||||
$this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Folder', '\\Thelia\\Model\\Folder', RelationMap::MANY_TO_ONE, array('folder_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('FolderImageI18n', '\\Thelia\\Model\\FolderImageI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'FolderImageI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
|
||||
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to folder_image * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
FolderImageI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? FolderImageTableMap::CLASS_DEFAULT : FolderImageTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (FolderImage object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = FolderImageTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = FolderImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + FolderImageTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = FolderImageTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
FolderImageTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = FolderImageTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = FolderImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
FolderImageTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(FolderImageTableMap::ID);
|
||||
$criteria->addSelectColumn(FolderImageTableMap::FOLDER_ID);
|
||||
$criteria->addSelectColumn(FolderImageTableMap::FILE);
|
||||
$criteria->addSelectColumn(FolderImageTableMap::POSITION);
|
||||
$criteria->addSelectColumn(FolderImageTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(FolderImageTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.FOLDER_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(FolderImageTableMap::DATABASE_NAME)->getTable(FolderImageTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(FolderImageTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(FolderImageTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new FolderImageTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a FolderImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or FolderImage object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\FolderImage) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(FolderImageTableMap::DATABASE_NAME);
|
||||
$criteria->add(FolderImageTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = FolderImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { FolderImageTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { FolderImageTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the folder_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return FolderImageQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a FolderImage or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or FolderImage object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(FolderImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from FolderImage object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(FolderImageTableMap::ID) && $criteria->keyContainsValue(FolderImageTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.FolderImageTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = FolderImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // FolderImageTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
FolderImageTableMap::buildTableMap();
|
||||
@@ -190,10 +190,10 @@ class FolderTableMap extends TableMap
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Image', '\\Thelia\\Model\\Image', RelationMap::ONE_TO_MANY, array('id' => 'folder_id', ), 'CASCADE', 'RESTRICT', 'Images');
|
||||
$this->addRelation('Document', '\\Thelia\\Model\\Document', RelationMap::ONE_TO_MANY, array('id' => 'folder_id', ), 'CASCADE', 'RESTRICT', 'Documents');
|
||||
$this->addRelation('Rewriting', '\\Thelia\\Model\\Rewriting', RelationMap::ONE_TO_MANY, array('id' => 'folder_id', ), 'CASCADE', 'RESTRICT', 'Rewritings');
|
||||
$this->addRelation('ContentFolder', '\\Thelia\\Model\\ContentFolder', RelationMap::ONE_TO_MANY, array('id' => 'folder_id', ), 'CASCADE', 'RESTRICT', 'ContentFolders');
|
||||
$this->addRelation('FolderImage', '\\Thelia\\Model\\FolderImage', RelationMap::ONE_TO_MANY, array('id' => 'folder_id', ), 'CASCADE', 'RESTRICT', 'FolderImages');
|
||||
$this->addRelation('FolderDocument', '\\Thelia\\Model\\FolderDocument', RelationMap::ONE_TO_MANY, array('id' => 'folder_id', ), 'CASCADE', 'RESTRICT', 'FolderDocuments');
|
||||
$this->addRelation('FolderI18n', '\\Thelia\\Model\\FolderI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'FolderI18ns');
|
||||
$this->addRelation('FolderVersion', '\\Thelia\\Model\\FolderVersion', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'FolderVersions');
|
||||
$this->addRelation('Content', '\\Thelia\\Model\\Content', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'RESTRICT', 'Contents');
|
||||
@@ -220,10 +220,10 @@ class FolderTableMap extends TableMap
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ImageTableMap::clearInstancePool();
|
||||
DocumentTableMap::clearInstancePool();
|
||||
RewritingTableMap::clearInstancePool();
|
||||
ContentFolderTableMap::clearInstancePool();
|
||||
FolderImageTableMap::clearInstancePool();
|
||||
FolderDocumentTableMap::clearInstancePool();
|
||||
FolderI18nTableMap::clearInstancePool();
|
||||
FolderVersionTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class LangTableMap extends TableMap
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 9;
|
||||
const NUM_COLUMNS = 8;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
@@ -67,7 +67,7 @@ class LangTableMap extends TableMap
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 9;
|
||||
const NUM_HYDRATE_COLUMNS = 8;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
@@ -99,11 +99,6 @@ class LangTableMap extends TableMap
|
||||
*/
|
||||
const BY_DEFAULT = 'lang.BY_DEFAULT';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'lang.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
@@ -126,12 +121,12 @@ class LangTableMap extends TableMap
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Title', 'Code', 'Locale', 'Url', 'ByDefault', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'title', 'code', 'locale', 'url', 'byDefault', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(LangTableMap::ID, LangTableMap::TITLE, LangTableMap::CODE, LangTableMap::LOCALE, LangTableMap::URL, LangTableMap::BY_DEFAULT, LangTableMap::POSITION, LangTableMap::CREATED_AT, LangTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'TITLE', 'CODE', 'LOCALE', 'URL', 'BY_DEFAULT', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'title', 'code', 'locale', 'url', 'by_default', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
||||
self::TYPE_PHPNAME => array('Id', 'Title', 'Code', 'Locale', 'Url', 'ByDefault', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'title', 'code', 'locale', 'url', 'byDefault', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(LangTableMap::ID, LangTableMap::TITLE, LangTableMap::CODE, LangTableMap::LOCALE, LangTableMap::URL, LangTableMap::BY_DEFAULT, LangTableMap::CREATED_AT, LangTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'TITLE', 'CODE', 'LOCALE', 'URL', 'BY_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'title', 'code', 'locale', 'url', 'by_default', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -141,12 +136,12 @@ class LangTableMap extends TableMap
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Title' => 1, 'Code' => 2, 'Locale' => 3, 'Url' => 4, 'ByDefault' => 5, 'Position' => 6, 'CreatedAt' => 7, 'UpdatedAt' => 8, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'title' => 1, 'code' => 2, 'locale' => 3, 'url' => 4, 'byDefault' => 5, 'position' => 6, 'createdAt' => 7, 'updatedAt' => 8, ),
|
||||
self::TYPE_COLNAME => array(LangTableMap::ID => 0, LangTableMap::TITLE => 1, LangTableMap::CODE => 2, LangTableMap::LOCALE => 3, LangTableMap::URL => 4, LangTableMap::BY_DEFAULT => 5, LangTableMap::POSITION => 6, LangTableMap::CREATED_AT => 7, LangTableMap::UPDATED_AT => 8, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'TITLE' => 1, 'CODE' => 2, 'LOCALE' => 3, 'URL' => 4, 'BY_DEFAULT' => 5, 'POSITION' => 6, 'CREATED_AT' => 7, 'UPDATED_AT' => 8, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'title' => 1, 'code' => 2, 'locale' => 3, 'url' => 4, 'by_default' => 5, 'position' => 6, 'created_at' => 7, 'updated_at' => 8, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Title' => 1, 'Code' => 2, 'Locale' => 3, 'Url' => 4, 'ByDefault' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'title' => 1, 'code' => 2, 'locale' => 3, 'url' => 4, 'byDefault' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
|
||||
self::TYPE_COLNAME => array(LangTableMap::ID => 0, LangTableMap::TITLE => 1, LangTableMap::CODE => 2, LangTableMap::LOCALE => 3, LangTableMap::URL => 4, LangTableMap::BY_DEFAULT => 5, LangTableMap::CREATED_AT => 6, LangTableMap::UPDATED_AT => 7, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'TITLE' => 1, 'CODE' => 2, 'LOCALE' => 3, 'URL' => 4, 'BY_DEFAULT' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'title' => 1, 'code' => 2, 'locale' => 3, 'url' => 4, 'by_default' => 5, 'created_at' => 6, 'updated_at' => 7, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -171,7 +166,6 @@ class LangTableMap extends TableMap
|
||||
$this->addColumn('LOCALE', 'Locale', 'VARCHAR', false, 45, null);
|
||||
$this->addColumn('URL', 'Url', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('BY_DEFAULT', 'ByDefault', 'TINYINT', false, null, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
@@ -340,7 +334,6 @@ class LangTableMap extends TableMap
|
||||
$criteria->addSelectColumn(LangTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(LangTableMap::URL);
|
||||
$criteria->addSelectColumn(LangTableMap::BY_DEFAULT);
|
||||
$criteria->addSelectColumn(LangTableMap::POSITION);
|
||||
$criteria->addSelectColumn(LangTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(LangTableMap::UPDATED_AT);
|
||||
} else {
|
||||
@@ -350,7 +343,6 @@ class LangTableMap extends TableMap
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.URL');
|
||||
$criteria->addSelectColumn($alias . '.BY_DEFAULT');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
|
||||
497
core/lib/Thelia/Model/Map/ProductDocumentI18nTableMap.php
Normal file
497
core/lib/Thelia/Model/Map/ProductDocumentI18nTableMap.php
Normal file
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ProductDocumentI18n;
|
||||
use Thelia\Model\ProductDocumentI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'product_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ProductDocumentI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ProductDocumentI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'product_document_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ProductDocumentI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ProductDocumentI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'product_document_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'product_document_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'product_document_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'product_document_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* the column name for the CHAPO field
|
||||
*/
|
||||
const CHAPO = 'product_document_i18n.CHAPO';
|
||||
|
||||
/**
|
||||
* the column name for the POSTSCRIPTUM field
|
||||
*/
|
||||
const POSTSCRIPTUM = 'product_document_i18n.POSTSCRIPTUM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_COLNAME => array(ProductDocumentI18nTableMap::ID, ProductDocumentI18nTableMap::LOCALE, ProductDocumentI18nTableMap::TITLE, ProductDocumentI18nTableMap::DESCRIPTION, ProductDocumentI18nTableMap::CHAPO, ProductDocumentI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_COLNAME => array(ProductDocumentI18nTableMap::ID => 0, ProductDocumentI18nTableMap::LOCALE => 1, ProductDocumentI18nTableMap::TITLE => 2, ProductDocumentI18nTableMap::DESCRIPTION => 3, ProductDocumentI18nTableMap::CHAPO => 4, ProductDocumentI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('product_document_i18n');
|
||||
$this->setPhpName('ProductDocumentI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ProductDocumentI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product_document', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ProductDocument', '\\Thelia\\Model\\ProductDocument', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\ProductDocumentI18n $obj A \Thelia\Model\ProductDocumentI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (null === $key) {
|
||||
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\ProductDocumentI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ProductDocumentI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
// assume we've been passed a primary key";
|
||||
$key = serialize(array((string) $value[0], (string) $value[1]));
|
||||
} elseif ($value instanceof Criteria) {
|
||||
self::$instances = [];
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ProductDocumentI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ProductDocumentI18nTableMap::CLASS_DEFAULT : ProductDocumentI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ProductDocumentI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ProductDocumentI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ProductDocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ProductDocumentI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ProductDocumentI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ProductDocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ProductDocumentI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ProductDocumentI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ProductDocumentI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ProductDocumentI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ProductDocumentI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ProductDocumentI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ProductDocumentI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(ProductDocumentI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(ProductDocumentI18nTableMap::POSTSCRIPTUM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
$criteria->addSelectColumn($alias . '.CHAPO');
|
||||
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ProductDocumentI18nTableMap::DATABASE_NAME)->getTable(ProductDocumentI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProductDocumentI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ProductDocumentI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ProductDocumentI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ProductDocumentI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ProductDocumentI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProductDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ProductDocumentI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ProductDocumentI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(ProductDocumentI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ProductDocumentI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = ProductDocumentI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ProductDocumentI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ProductDocumentI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the product_document_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ProductDocumentI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ProductDocumentI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ProductDocumentI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProductDocumentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ProductDocumentI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ProductDocumentI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ProductDocumentI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ProductDocumentI18nTableMap::buildTableMap();
|
||||
@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\Document;
|
||||
use Thelia\Model\DocumentQuery;
|
||||
use Thelia\Model\ProductDocument;
|
||||
use Thelia\Model\ProductDocumentQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'document' table.
|
||||
* This class defines the structure of the 'product_document' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -25,14 +25,14 @@ use Thelia\Model\DocumentQuery;
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class DocumentTableMap extends TableMap
|
||||
class ProductDocumentTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.DocumentTableMap';
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ProductDocumentTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
@@ -42,22 +42,22 @@ class DocumentTableMap extends TableMap
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'document';
|
||||
const TABLE_NAME = 'product_document';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\Document';
|
||||
const OM_CLASS = '\\Thelia\\Model\\ProductDocument';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.Document';
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ProductDocument';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 9;
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
@@ -67,52 +67,37 @@ class DocumentTableMap extends TableMap
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 9;
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'document.ID';
|
||||
const ID = 'product_document.ID';
|
||||
|
||||
/**
|
||||
* the column name for the PRODUCT_ID field
|
||||
*/
|
||||
const PRODUCT_ID = 'document.PRODUCT_ID';
|
||||
|
||||
/**
|
||||
* the column name for the CATEGORY_ID field
|
||||
*/
|
||||
const CATEGORY_ID = 'document.CATEGORY_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FOLDER_ID field
|
||||
*/
|
||||
const FOLDER_ID = 'document.FOLDER_ID';
|
||||
|
||||
/**
|
||||
* the column name for the CONTENT_ID field
|
||||
*/
|
||||
const CONTENT_ID = 'document.CONTENT_ID';
|
||||
const PRODUCT_ID = 'product_document.PRODUCT_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FILE field
|
||||
*/
|
||||
const FILE = 'document.FILE';
|
||||
const FILE = 'product_document.FILE';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'document.POSITION';
|
||||
const POSITION = 'product_document.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'document.CREATED_AT';
|
||||
const CREATED_AT = 'product_document.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'document.UPDATED_AT';
|
||||
const UPDATED_AT = 'product_document.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
@@ -135,12 +120,12 @@ class DocumentTableMap extends TableMap
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'ProductId', 'CategoryId', 'FolderId', 'ContentId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'categoryId', 'folderId', 'contentId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(DocumentTableMap::ID, DocumentTableMap::PRODUCT_ID, DocumentTableMap::CATEGORY_ID, DocumentTableMap::FOLDER_ID, DocumentTableMap::CONTENT_ID, DocumentTableMap::FILE, DocumentTableMap::POSITION, DocumentTableMap::CREATED_AT, DocumentTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'CATEGORY_ID', 'FOLDER_ID', 'CONTENT_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'product_id', 'category_id', 'folder_id', 'content_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
||||
self::TYPE_PHPNAME => array('Id', 'ProductId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ProductDocumentTableMap::ID, ProductDocumentTableMap::PRODUCT_ID, ProductDocumentTableMap::FILE, ProductDocumentTableMap::POSITION, ProductDocumentTableMap::CREATED_AT, ProductDocumentTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'product_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -150,12 +135,12 @@ class DocumentTableMap extends TableMap
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'CategoryId' => 2, 'FolderId' => 3, 'ContentId' => 4, 'File' => 5, 'Position' => 6, 'CreatedAt' => 7, 'UpdatedAt' => 8, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'categoryId' => 2, 'folderId' => 3, 'contentId' => 4, 'file' => 5, 'position' => 6, 'createdAt' => 7, 'updatedAt' => 8, ),
|
||||
self::TYPE_COLNAME => array(DocumentTableMap::ID => 0, DocumentTableMap::PRODUCT_ID => 1, DocumentTableMap::CATEGORY_ID => 2, DocumentTableMap::FOLDER_ID => 3, DocumentTableMap::CONTENT_ID => 4, DocumentTableMap::FILE => 5, DocumentTableMap::POSITION => 6, DocumentTableMap::CREATED_AT => 7, DocumentTableMap::UPDATED_AT => 8, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'CATEGORY_ID' => 2, 'FOLDER_ID' => 3, 'CONTENT_ID' => 4, 'FILE' => 5, 'POSITION' => 6, 'CREATED_AT' => 7, 'UPDATED_AT' => 8, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'category_id' => 2, 'folder_id' => 3, 'content_id' => 4, 'file' => 5, 'position' => 6, 'created_at' => 7, 'updated_at' => 8, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(ProductDocumentTableMap::ID => 0, ProductDocumentTableMap::PRODUCT_ID => 1, ProductDocumentTableMap::FILE => 2, ProductDocumentTableMap::POSITION => 3, ProductDocumentTableMap::CREATED_AT => 4, ProductDocumentTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -168,17 +153,14 @@ class DocumentTableMap extends TableMap
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('document');
|
||||
$this->setPhpName('Document');
|
||||
$this->setClassName('\\Thelia\\Model\\Document');
|
||||
$this->setName('product_document');
|
||||
$this->setPhpName('ProductDocument');
|
||||
$this->setClassName('\\Thelia\\Model\\ProductDocument');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('PRODUCT_ID', 'ProductId', 'INTEGER', 'product', 'ID', false, null, null);
|
||||
$this->addForeignKey('CATEGORY_ID', 'CategoryId', 'INTEGER', 'category', 'ID', false, null, null);
|
||||
$this->addForeignKey('FOLDER_ID', 'FolderId', 'INTEGER', 'folder', 'ID', false, null, null);
|
||||
$this->addForeignKey('CONTENT_ID', 'ContentId', 'INTEGER', 'content', 'ID', false, null, null);
|
||||
$this->addForeignKey('PRODUCT_ID', 'ProductId', 'INTEGER', 'product', 'ID', true, null, null);
|
||||
$this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
@@ -191,10 +173,7 @@ class DocumentTableMap extends TableMap
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::MANY_TO_ONE, array('product_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('Category', '\\Thelia\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('Content', '\\Thelia\\Model\\Content', RelationMap::MANY_TO_ONE, array('content_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('Folder', '\\Thelia\\Model\\Folder', RelationMap::MANY_TO_ONE, array('folder_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('DocumentI18n', '\\Thelia\\Model\\DocumentI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'DocumentI18ns');
|
||||
$this->addRelation('ProductDocumentI18n', '\\Thelia\\Model\\ProductDocumentI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ProductDocumentI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
@@ -211,13 +190,13 @@ class DocumentTableMap extends TableMap
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to document * by a foreign key with ON DELETE CASCADE
|
||||
* Method to invalidate the instance pool of all tables related to product_document * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
DocumentI18nTableMap::clearInstancePool();
|
||||
ProductDocumentI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -276,7 +255,7 @@ class DocumentTableMap extends TableMap
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? DocumentTableMap::CLASS_DEFAULT : DocumentTableMap::OM_CLASS;
|
||||
return $withPrefix ? ProductDocumentTableMap::CLASS_DEFAULT : ProductDocumentTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,21 +269,21 @@ class DocumentTableMap extends TableMap
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (Document object, last column rank)
|
||||
* @return array (ProductDocument object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = DocumentTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = DocumentTableMap::getInstanceFromPool($key))) {
|
||||
$key = ProductDocumentTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ProductDocumentTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + DocumentTableMap::NUM_HYDRATE_COLUMNS;
|
||||
$col = $offset + ProductDocumentTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = DocumentTableMap::OM_CLASS;
|
||||
$cls = ProductDocumentTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
DocumentTableMap::addInstanceToPool($obj, $key);
|
||||
ProductDocumentTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
@@ -327,8 +306,8 @@ class DocumentTableMap extends TableMap
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = DocumentTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = DocumentTableMap::getInstanceFromPool($key))) {
|
||||
$key = ProductDocumentTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ProductDocumentTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
@@ -337,7 +316,7 @@ class DocumentTableMap extends TableMap
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
DocumentTableMap::addInstanceToPool($obj, $key);
|
||||
ProductDocumentTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
@@ -358,21 +337,15 @@ class DocumentTableMap extends TableMap
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(DocumentTableMap::ID);
|
||||
$criteria->addSelectColumn(DocumentTableMap::PRODUCT_ID);
|
||||
$criteria->addSelectColumn(DocumentTableMap::CATEGORY_ID);
|
||||
$criteria->addSelectColumn(DocumentTableMap::FOLDER_ID);
|
||||
$criteria->addSelectColumn(DocumentTableMap::CONTENT_ID);
|
||||
$criteria->addSelectColumn(DocumentTableMap::FILE);
|
||||
$criteria->addSelectColumn(DocumentTableMap::POSITION);
|
||||
$criteria->addSelectColumn(DocumentTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(DocumentTableMap::UPDATED_AT);
|
||||
$criteria->addSelectColumn(ProductDocumentTableMap::ID);
|
||||
$criteria->addSelectColumn(ProductDocumentTableMap::PRODUCT_ID);
|
||||
$criteria->addSelectColumn(ProductDocumentTableMap::FILE);
|
||||
$criteria->addSelectColumn(ProductDocumentTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ProductDocumentTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ProductDocumentTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.PRODUCT_ID');
|
||||
$criteria->addSelectColumn($alias . '.CATEGORY_ID');
|
||||
$criteria->addSelectColumn($alias . '.FOLDER_ID');
|
||||
$criteria->addSelectColumn($alias . '.CONTENT_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
@@ -389,7 +362,7 @@ class DocumentTableMap extends TableMap
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(DocumentTableMap::DATABASE_NAME)->getTable(DocumentTableMap::TABLE_NAME);
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ProductDocumentTableMap::DATABASE_NAME)->getTable(ProductDocumentTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -397,16 +370,16 @@ class DocumentTableMap extends TableMap
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(DocumentTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(DocumentTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new DocumentTableMap());
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProductDocumentTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ProductDocumentTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ProductDocumentTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a Document or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ProductDocument or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or Document object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ProductDocument 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
|
||||
@@ -417,25 +390,25 @@ class DocumentTableMap extends TableMap
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProductDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\Document) { // it's a model object
|
||||
} elseif ($values instanceof \Thelia\Model\ProductDocument) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(DocumentTableMap::DATABASE_NAME);
|
||||
$criteria->add(DocumentTableMap::ID, (array) $values, Criteria::IN);
|
||||
$criteria = new Criteria(ProductDocumentTableMap::DATABASE_NAME);
|
||||
$criteria->add(ProductDocumentTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = DocumentQuery::create()->mergeWith($criteria);
|
||||
$query = ProductDocumentQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { DocumentTableMap::clearInstancePool();
|
||||
if ($values instanceof Criteria) { ProductDocumentTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { DocumentTableMap::removeInstanceFromPool($singleval);
|
||||
foreach ((array) $values as $singleval) { ProductDocumentTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,20 +416,20 @@ class DocumentTableMap extends TableMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the document table.
|
||||
* Deletes all rows from the product_document table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return DocumentQuery::create()->doDeleteAll($con);
|
||||
return ProductDocumentQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a Document or Criteria object.
|
||||
* Performs an INSERT on the database, given a ProductDocument or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or Document object containing data that is used to create the INSERT statement.
|
||||
* @param mixed $criteria Criteria or ProductDocument object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
@@ -465,22 +438,22 @@ class DocumentTableMap extends TableMap
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(DocumentTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProductDocumentTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from Document object
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ProductDocument object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(DocumentTableMap::ID) && $criteria->keyContainsValue(DocumentTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.DocumentTableMap::ID.')');
|
||||
if ($criteria->containsKey(ProductDocumentTableMap::ID) && $criteria->keyContainsValue(ProductDocumentTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ProductDocumentTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = DocumentQuery::create()->mergeWith($criteria);
|
||||
$query = ProductDocumentQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
@@ -496,7 +469,7 @@ class DocumentTableMap extends TableMap
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // DocumentTableMap
|
||||
} // ProductDocumentTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
DocumentTableMap::buildTableMap();
|
||||
ProductDocumentTableMap::buildTableMap();
|
||||
@@ -201,8 +201,8 @@ class ProductTableMap extends TableMap
|
||||
$this->addRelation('FeatureProduct', '\\Thelia\\Model\\FeatureProduct', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'FeatureProducts');
|
||||
$this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProductSaleElementss');
|
||||
$this->addRelation('ContentAssoc', '\\Thelia\\Model\\ContentAssoc', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ContentAssocs');
|
||||
$this->addRelation('Image', '\\Thelia\\Model\\Image', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'Images');
|
||||
$this->addRelation('Document', '\\Thelia\\Model\\Document', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'Documents');
|
||||
$this->addRelation('ProdutImage', '\\Thelia\\Model\\ProdutImage', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProdutImages');
|
||||
$this->addRelation('ProductDocument', '\\Thelia\\Model\\ProductDocument', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProductDocuments');
|
||||
$this->addRelation('AccessoryRelatedByProductId', '\\Thelia\\Model\\Accessory', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'AccessoriesRelatedByProductId');
|
||||
$this->addRelation('AccessoryRelatedByAccessory', '\\Thelia\\Model\\Accessory', RelationMap::ONE_TO_MANY, array('id' => 'accessory', ), 'CASCADE', 'RESTRICT', 'AccessoriesRelatedByAccessory');
|
||||
$this->addRelation('Rewriting', '\\Thelia\\Model\\Rewriting', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'Rewritings');
|
||||
@@ -239,8 +239,8 @@ class ProductTableMap extends TableMap
|
||||
FeatureProductTableMap::clearInstancePool();
|
||||
ProductSaleElementsTableMap::clearInstancePool();
|
||||
ContentAssocTableMap::clearInstancePool();
|
||||
ImageTableMap::clearInstancePool();
|
||||
DocumentTableMap::clearInstancePool();
|
||||
ProdutImageTableMap::clearInstancePool();
|
||||
ProductDocumentTableMap::clearInstancePool();
|
||||
AccessoryTableMap::clearInstancePool();
|
||||
RewritingTableMap::clearInstancePool();
|
||||
ProductI18nTableMap::clearInstancePool();
|
||||
|
||||
@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ImageI18n;
|
||||
use Thelia\Model\ImageI18nQuery;
|
||||
use Thelia\Model\ProdutImageI18n;
|
||||
use Thelia\Model\ProdutImageI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'image_i18n' table.
|
||||
* This class defines the structure of the 'produt_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -25,14 +25,14 @@ use Thelia\Model\ImageI18nQuery;
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ImageI18nTableMap extends TableMap
|
||||
class ProdutImageI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImageI18nTableMap';
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ProdutImageI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
@@ -42,17 +42,17 @@ class ImageI18nTableMap extends TableMap
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'image_i18n';
|
||||
const TABLE_NAME = 'produt_image_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ImageI18n';
|
||||
const OM_CLASS = '\\Thelia\\Model\\ProdutImageI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ImageI18n';
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ProdutImageI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
@@ -72,32 +72,32 @@ class ImageI18nTableMap extends TableMap
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'image_i18n.ID';
|
||||
const ID = 'produt_image_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'image_i18n.LOCALE';
|
||||
const LOCALE = 'produt_image_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'image_i18n.TITLE';
|
||||
const TITLE = 'produt_image_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'image_i18n.DESCRIPTION';
|
||||
const DESCRIPTION = 'produt_image_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* the column name for the CHAPO field
|
||||
*/
|
||||
const CHAPO = 'image_i18n.CHAPO';
|
||||
const CHAPO = 'produt_image_i18n.CHAPO';
|
||||
|
||||
/**
|
||||
* the column name for the POSTSCRIPTUM field
|
||||
*/
|
||||
const POSTSCRIPTUM = 'image_i18n.POSTSCRIPTUM';
|
||||
const POSTSCRIPTUM = 'produt_image_i18n.POSTSCRIPTUM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
@@ -113,7 +113,7 @@ class ImageI18nTableMap extends TableMap
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_COLNAME => array(ImageI18nTableMap::ID, ImageI18nTableMap::LOCALE, ImageI18nTableMap::TITLE, ImageI18nTableMap::DESCRIPTION, ImageI18nTableMap::CHAPO, ImageI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_COLNAME => array(ProdutImageI18nTableMap::ID, ProdutImageI18nTableMap::LOCALE, ProdutImageI18nTableMap::TITLE, ProdutImageI18nTableMap::DESCRIPTION, ProdutImageI18nTableMap::CHAPO, ProdutImageI18nTableMap::POSTSCRIPTUM, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
@@ -128,7 +128,7 @@ class ImageI18nTableMap extends TableMap
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_COLNAME => array(ImageI18nTableMap::ID => 0, ImageI18nTableMap::LOCALE => 1, ImageI18nTableMap::TITLE => 2, ImageI18nTableMap::DESCRIPTION => 3, ImageI18nTableMap::CHAPO => 4, ImageI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_COLNAME => array(ProdutImageI18nTableMap::ID => 0, ProdutImageI18nTableMap::LOCALE => 1, ProdutImageI18nTableMap::TITLE => 2, ProdutImageI18nTableMap::DESCRIPTION => 3, ProdutImageI18nTableMap::CHAPO => 4, ProdutImageI18nTableMap::POSTSCRIPTUM => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
@@ -144,13 +144,13 @@ class ImageI18nTableMap extends TableMap
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('image_i18n');
|
||||
$this->setPhpName('ImageI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ImageI18n');
|
||||
$this->setName('produt_image_i18n');
|
||||
$this->setPhpName('ProdutImageI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ProdutImageI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'image', 'ID', true, null, null);
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'produt_image', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
@@ -163,7 +163,7 @@ class ImageI18nTableMap extends TableMap
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Image', '\\Thelia\\Model\\Image', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('ProdutImage', '\\Thelia\\Model\\ProdutImage', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
@@ -174,7 +174,7 @@ class ImageI18nTableMap extends TableMap
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\ImageI18n $obj A \Thelia\Model\ImageI18n object.
|
||||
* @param \Thelia\Model\ProdutImageI18n $obj A \Thelia\Model\ProdutImageI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
@@ -195,12 +195,12 @@ class ImageI18nTableMap extends TableMap
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\ImageI18n object or a primary key value.
|
||||
* @param mixed $value A \Thelia\Model\ProdutImageI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ImageI18n) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ProdutImageI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
@@ -211,7 +211,7 @@ class ImageI18nTableMap extends TableMap
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ProdutImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ class ImageI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ImageI18nTableMap::CLASS_DEFAULT : ImageI18nTableMap::OM_CLASS;
|
||||
return $withPrefix ? ProdutImageI18nTableMap::CLASS_DEFAULT : ProdutImageI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -285,21 +285,21 @@ class ImageI18nTableMap extends TableMap
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ImageI18n object, last column rank)
|
||||
* @return array (ProdutImageI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ImageI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
$key = ProdutImageI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ProdutImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ImageI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
$col = $offset + ProdutImageI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ImageI18nTableMap::OM_CLASS;
|
||||
$cls = ProdutImageI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
ProdutImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
@@ -322,8 +322,8 @@ class ImageI18nTableMap extends TableMap
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ImageI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
$key = ProdutImageI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ProdutImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
@@ -332,7 +332,7 @@ class ImageI18nTableMap extends TableMap
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
ProdutImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
@@ -353,12 +353,12 @@ class ImageI18nTableMap extends TableMap
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ImageI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ImageI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ImageI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ImageI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(ImageI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(ImageI18nTableMap::POSTSCRIPTUM);
|
||||
$criteria->addSelectColumn(ProdutImageI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ProdutImageI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ProdutImageI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ProdutImageI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(ProdutImageI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(ProdutImageI18nTableMap::POSTSCRIPTUM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
@@ -378,7 +378,7 @@ class ImageI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImageI18nTableMap::DATABASE_NAME)->getTable(ImageI18nTableMap::TABLE_NAME);
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ProdutImageI18nTableMap::DATABASE_NAME)->getTable(ProdutImageI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -386,16 +386,16 @@ class ImageI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImageI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImageI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImageI18nTableMap());
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ProdutImageI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ProdutImageI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ImageI18n or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ProdutImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ImageI18n object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ProdutImageI18n 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
|
||||
@@ -406,17 +406,17 @@ class ImageI18nTableMap extends TableMap
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ImageI18n) { // it's a model object
|
||||
} elseif ($values instanceof \Thelia\Model\ProdutImageI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ImageI18nTableMap::DATABASE_NAME);
|
||||
$criteria = new Criteria(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
@@ -424,17 +424,17 @@ class ImageI18nTableMap extends TableMap
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(ImageI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ImageI18nTableMap::LOCALE, $value[1]));
|
||||
$criterion = $criteria->getNewCriterion(ProdutImageI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ProdutImageI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = ImageI18nQuery::create()->mergeWith($criteria);
|
||||
$query = ProdutImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ImageI18nTableMap::clearInstancePool();
|
||||
if ($values instanceof Criteria) { ProdutImageI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ImageI18nTableMap::removeInstanceFromPool($singleval);
|
||||
foreach ((array) $values as $singleval) { ProdutImageI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,20 +442,20 @@ class ImageI18nTableMap extends TableMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the image_i18n table.
|
||||
* Deletes all rows from the produt_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ImageI18nQuery::create()->doDeleteAll($con);
|
||||
return ProdutImageI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ImageI18n or Criteria object.
|
||||
* Performs an INSERT on the database, given a ProdutImageI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ImageI18n object containing data that is used to create the INSERT statement.
|
||||
* @param mixed $criteria Criteria or ProdutImageI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
@@ -464,18 +464,18 @@ class ImageI18nTableMap extends TableMap
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ImageI18n object
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ProdutImageI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ImageI18nQuery::create()->mergeWith($criteria);
|
||||
$query = ProdutImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
@@ -491,7 +491,7 @@ class ImageI18nTableMap extends TableMap
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ImageI18nTableMap
|
||||
} // ProdutImageI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ImageI18nTableMap::buildTableMap();
|
||||
ProdutImageI18nTableMap::buildTableMap();
|
||||
@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\Image;
|
||||
use Thelia\Model\ImageQuery;
|
||||
use Thelia\Model\ProdutImage;
|
||||
use Thelia\Model\ProdutImageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'image' table.
|
||||
* This class defines the structure of the 'produt_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -25,14 +25,14 @@ use Thelia\Model\ImageQuery;
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ImageTableMap extends TableMap
|
||||
class ProdutImageTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImageTableMap';
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ProdutImageTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
@@ -42,22 +42,22 @@ class ImageTableMap extends TableMap
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'image';
|
||||
const TABLE_NAME = 'produt_image';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\Image';
|
||||
const OM_CLASS = '\\Thelia\\Model\\ProdutImage';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.Image';
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ProdutImage';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 9;
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
@@ -67,52 +67,37 @@ class ImageTableMap extends TableMap
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 9;
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'image.ID';
|
||||
const ID = 'produt_image.ID';
|
||||
|
||||
/**
|
||||
* the column name for the PRODUCT_ID field
|
||||
*/
|
||||
const PRODUCT_ID = 'image.PRODUCT_ID';
|
||||
|
||||
/**
|
||||
* the column name for the CATEGORY_ID field
|
||||
*/
|
||||
const CATEGORY_ID = 'image.CATEGORY_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FOLDER_ID field
|
||||
*/
|
||||
const FOLDER_ID = 'image.FOLDER_ID';
|
||||
|
||||
/**
|
||||
* the column name for the CONTENT_ID field
|
||||
*/
|
||||
const CONTENT_ID = 'image.CONTENT_ID';
|
||||
const PRODUCT_ID = 'produt_image.PRODUCT_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FILE field
|
||||
*/
|
||||
const FILE = 'image.FILE';
|
||||
const FILE = 'produt_image.FILE';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'image.POSITION';
|
||||
const POSITION = 'produt_image.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'image.CREATED_AT';
|
||||
const CREATED_AT = 'produt_image.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'image.UPDATED_AT';
|
||||
const UPDATED_AT = 'produt_image.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
@@ -135,12 +120,12 @@ class ImageTableMap extends TableMap
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'ProductId', 'CategoryId', 'FolderId', 'ContentId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'categoryId', 'folderId', 'contentId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ImageTableMap::ID, ImageTableMap::PRODUCT_ID, ImageTableMap::CATEGORY_ID, ImageTableMap::FOLDER_ID, ImageTableMap::CONTENT_ID, ImageTableMap::FILE, ImageTableMap::POSITION, ImageTableMap::CREATED_AT, ImageTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'CATEGORY_ID', 'FOLDER_ID', 'CONTENT_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'product_id', 'category_id', 'folder_id', 'content_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
||||
self::TYPE_PHPNAME => array('Id', 'ProductId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ProdutImageTableMap::ID, ProdutImageTableMap::PRODUCT_ID, ProdutImageTableMap::FILE, ProdutImageTableMap::POSITION, ProdutImageTableMap::CREATED_AT, ProdutImageTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'product_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -150,12 +135,12 @@ class ImageTableMap extends TableMap
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'CategoryId' => 2, 'FolderId' => 3, 'ContentId' => 4, 'File' => 5, 'Position' => 6, 'CreatedAt' => 7, 'UpdatedAt' => 8, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'categoryId' => 2, 'folderId' => 3, 'contentId' => 4, 'file' => 5, 'position' => 6, 'createdAt' => 7, 'updatedAt' => 8, ),
|
||||
self::TYPE_COLNAME => array(ImageTableMap::ID => 0, ImageTableMap::PRODUCT_ID => 1, ImageTableMap::CATEGORY_ID => 2, ImageTableMap::FOLDER_ID => 3, ImageTableMap::CONTENT_ID => 4, ImageTableMap::FILE => 5, ImageTableMap::POSITION => 6, ImageTableMap::CREATED_AT => 7, ImageTableMap::UPDATED_AT => 8, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'CATEGORY_ID' => 2, 'FOLDER_ID' => 3, 'CONTENT_ID' => 4, 'FILE' => 5, 'POSITION' => 6, 'CREATED_AT' => 7, 'UPDATED_AT' => 8, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'category_id' => 2, 'folder_id' => 3, 'content_id' => 4, 'file' => 5, 'position' => 6, 'created_at' => 7, 'updated_at' => 8, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(ProdutImageTableMap::ID => 0, ProdutImageTableMap::PRODUCT_ID => 1, ProdutImageTableMap::FILE => 2, ProdutImageTableMap::POSITION => 3, ProdutImageTableMap::CREATED_AT => 4, ProdutImageTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -168,17 +153,14 @@ class ImageTableMap extends TableMap
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('image');
|
||||
$this->setPhpName('Image');
|
||||
$this->setClassName('\\Thelia\\Model\\Image');
|
||||
$this->setName('produt_image');
|
||||
$this->setPhpName('ProdutImage');
|
||||
$this->setClassName('\\Thelia\\Model\\ProdutImage');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('PRODUCT_ID', 'ProductId', 'INTEGER', 'product', 'ID', false, null, null);
|
||||
$this->addForeignKey('CATEGORY_ID', 'CategoryId', 'INTEGER', 'category', 'ID', false, null, null);
|
||||
$this->addForeignKey('FOLDER_ID', 'FolderId', 'INTEGER', 'folder', 'ID', false, null, null);
|
||||
$this->addForeignKey('CONTENT_ID', 'ContentId', 'INTEGER', 'content', 'ID', false, null, null);
|
||||
$this->addForeignKey('PRODUCT_ID', 'ProductId', 'INTEGER', 'product', 'ID', true, null, null);
|
||||
$this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
@@ -191,10 +173,7 @@ class ImageTableMap extends TableMap
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::MANY_TO_ONE, array('product_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('Category', '\\Thelia\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('Content', '\\Thelia\\Model\\Content', RelationMap::MANY_TO_ONE, array('content_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('Folder', '\\Thelia\\Model\\Folder', RelationMap::MANY_TO_ONE, array('folder_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('ImageI18n', '\\Thelia\\Model\\ImageI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ImageI18ns');
|
||||
$this->addRelation('ProdutImageI18n', '\\Thelia\\Model\\ProdutImageI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ProdutImageI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
@@ -211,13 +190,13 @@ class ImageTableMap extends TableMap
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to image * by a foreign key with ON DELETE CASCADE
|
||||
* Method to invalidate the instance pool of all tables related to produt_image * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ImageI18nTableMap::clearInstancePool();
|
||||
ProdutImageI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -276,7 +255,7 @@ class ImageTableMap extends TableMap
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ImageTableMap::CLASS_DEFAULT : ImageTableMap::OM_CLASS;
|
||||
return $withPrefix ? ProdutImageTableMap::CLASS_DEFAULT : ProdutImageTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,21 +269,21 @@ class ImageTableMap extends TableMap
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (Image object, last column rank)
|
||||
* @return array (ProdutImage object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ImageTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImageTableMap::getInstanceFromPool($key))) {
|
||||
$key = ProdutImageTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ProdutImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ImageTableMap::NUM_HYDRATE_COLUMNS;
|
||||
$col = $offset + ProdutImageTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ImageTableMap::OM_CLASS;
|
||||
$cls = ProdutImageTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ImageTableMap::addInstanceToPool($obj, $key);
|
||||
ProdutImageTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
@@ -327,8 +306,8 @@ class ImageTableMap extends TableMap
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ImageTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImageTableMap::getInstanceFromPool($key))) {
|
||||
$key = ProdutImageTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ProdutImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
@@ -337,7 +316,7 @@ class ImageTableMap extends TableMap
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ImageTableMap::addInstanceToPool($obj, $key);
|
||||
ProdutImageTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
@@ -358,21 +337,15 @@ class ImageTableMap extends TableMap
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ImageTableMap::ID);
|
||||
$criteria->addSelectColumn(ImageTableMap::PRODUCT_ID);
|
||||
$criteria->addSelectColumn(ImageTableMap::CATEGORY_ID);
|
||||
$criteria->addSelectColumn(ImageTableMap::FOLDER_ID);
|
||||
$criteria->addSelectColumn(ImageTableMap::CONTENT_ID);
|
||||
$criteria->addSelectColumn(ImageTableMap::FILE);
|
||||
$criteria->addSelectColumn(ImageTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ImageTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ImageTableMap::UPDATED_AT);
|
||||
$criteria->addSelectColumn(ProdutImageTableMap::ID);
|
||||
$criteria->addSelectColumn(ProdutImageTableMap::PRODUCT_ID);
|
||||
$criteria->addSelectColumn(ProdutImageTableMap::FILE);
|
||||
$criteria->addSelectColumn(ProdutImageTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ProdutImageTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ProdutImageTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.PRODUCT_ID');
|
||||
$criteria->addSelectColumn($alias . '.CATEGORY_ID');
|
||||
$criteria->addSelectColumn($alias . '.FOLDER_ID');
|
||||
$criteria->addSelectColumn($alias . '.CONTENT_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
@@ -389,7 +362,7 @@ class ImageTableMap extends TableMap
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImageTableMap::DATABASE_NAME)->getTable(ImageTableMap::TABLE_NAME);
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ProdutImageTableMap::DATABASE_NAME)->getTable(ProdutImageTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -397,16 +370,16 @@ class ImageTableMap extends TableMap
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImageTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImageTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImageTableMap());
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProdutImageTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ProdutImageTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ProdutImageTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a Image or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ProdutImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or Image object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ProdutImage 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
|
||||
@@ -417,25 +390,25 @@ class ImageTableMap extends TableMap
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\Image) { // it's a model object
|
||||
} elseif ($values instanceof \Thelia\Model\ProdutImage) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ImageTableMap::DATABASE_NAME);
|
||||
$criteria->add(ImageTableMap::ID, (array) $values, Criteria::IN);
|
||||
$criteria = new Criteria(ProdutImageTableMap::DATABASE_NAME);
|
||||
$criteria->add(ProdutImageTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ImageQuery::create()->mergeWith($criteria);
|
||||
$query = ProdutImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ImageTableMap::clearInstancePool();
|
||||
if ($values instanceof Criteria) { ProdutImageTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ImageTableMap::removeInstanceFromPool($singleval);
|
||||
foreach ((array) $values as $singleval) { ProdutImageTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,20 +416,20 @@ class ImageTableMap extends TableMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the image table.
|
||||
* Deletes all rows from the produt_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ImageQuery::create()->doDeleteAll($con);
|
||||
return ProdutImageQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a Image or Criteria object.
|
||||
* Performs an INSERT on the database, given a ProdutImage or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or Image object containing data that is used to create the INSERT statement.
|
||||
* @param mixed $criteria Criteria or ProdutImage object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
@@ -465,22 +438,22 @@ class ImageTableMap extends TableMap
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImageTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ProdutImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from Image object
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ProdutImage object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ImageTableMap::ID) && $criteria->keyContainsValue(ImageTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ImageTableMap::ID.')');
|
||||
if ($criteria->containsKey(ProdutImageTableMap::ID) && $criteria->keyContainsValue(ProdutImageTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ProdutImageTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ImageQuery::create()->mergeWith($criteria);
|
||||
$query = ProdutImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
@@ -496,7 +469,7 @@ class ImageTableMap extends TableMap
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ImageTableMap
|
||||
} // ProdutImageTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ImageTableMap::buildTableMap();
|
||||
ProdutImageTableMap::buildTableMap();
|
||||
10
core/lib/Thelia/Model/ProductDocument.php
Normal file
10
core/lib/Thelia/Model/ProductDocument.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ProductDocument as BaseProductDocument;
|
||||
|
||||
class ProductDocument extends BaseProductDocument
|
||||
{
|
||||
|
||||
}
|
||||
10
core/lib/Thelia/Model/ProductDocumentI18n.php
Normal file
10
core/lib/Thelia/Model/ProductDocumentI18n.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ProductDocumentI18n as BaseProductDocumentI18n;
|
||||
|
||||
class ProductDocumentI18n extends BaseProductDocumentI18n
|
||||
{
|
||||
|
||||
}
|
||||
21
core/lib/Thelia/Model/ProductDocumentI18nQuery.php
Normal file
21
core/lib/Thelia/Model/ProductDocumentI18nQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ProductDocumentI18nQuery as BaseProductDocumentI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'product_document_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ProductDocumentI18nQuery extends BaseProductDocumentI18nQuery
|
||||
{
|
||||
|
||||
} // ProductDocumentI18nQuery
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user