Merge branch 'customer'

Conflicts:
	core/lib/Thelia/Core/Template/Loop/Category.php
	core/lib/Thelia/Model/Customer.php
	templates/smarty-sample/index.html
This commit is contained in:
Manuel Raynaud
2013-07-04 19:46:08 +02:00
237 changed files with 252286 additions and 12 deletions

View File

@@ -28,7 +28,10 @@ use Thelia\Core\Event\ActionEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\BaseForm;
use Thelia\Form\CustomerCreation;
use Thelia\Form\CustomerModification;
use Thelia\Model\Customer as CustomerModel;
use Thelia\Log\Tlog;
use Thelia\Model\CustomerQuery;
class Customer implements EventSubscriberInterface
{
@@ -50,8 +53,9 @@ class Customer implements EventSubscriberInterface
if ($form->isValid()) {
$data = $form->getData();
$customer = new \Thelia\Model\Customer();
$customer = new CustomerModel();
try {
\Thelia\Log\Tlog::getInstance()->debug($data);
$customer->createOrUpdate(
$data["title"],
$data["firstname"],
@@ -64,13 +68,16 @@ class Customer implements EventSubscriberInterface
$data["zipcode"],
$data["country"],
$data["email"],
$data["password"]
$data["password"],
$request->getSession()->get("lang")
);
} catch (\PropelException $e) {
Tlog::getInstance()->error(sprintf('error during creating customer on action/createCustomer with message "%s"', $e->getMessage()));
$event->setFormError($form);
}
echo "ok"; exit;
//Customer is create, he is automatically connected
} else {
$event->setFormError($form);
@@ -82,6 +89,41 @@ class Customer implements EventSubscriberInterface
public function modify(ActionEvent $event)
{
$request = $event->getRequest();
$customerModification = new CustomerModification($request);
$form = $customerModification->getForm();
if ($request->isMethod("post")) {
$form->bind($request);
if ($form->isValid()) {
$data = $form->getData();
$customer = CustomerQuery::create()->findPk(1);
try {
$data = $form->getData();
$customer->createOrUpdate(
$data["title"],
$data["firstname"],
$data["lastname"],
$data["address1"],
$data["address2"],
$data["address3"],
$data["phone"],
$data["cellphone"],
$data["zipcode"],
$data["country"]
);
} catch(\PropelException $e) {
Tlog::getInstance()->error(sprintf('error during modifying customer on action/modifyCustomer with message "%s"', $e->getMessage()));
$event->setFormError($form);
}
} else {
$event->setFormError($form);
}
}
}

View File

@@ -23,6 +23,7 @@
<forms>
<form name="thelia.customer.creation" class="Thelia\Form\CustomerCreation"/>
<form name="thelia.customer.modification" class="Thelia\Form\CustomerModification"/>
<form name="thelia.admin_login" class="Thelia\Form\AdminLogin"/>
</forms>

View File

@@ -23,6 +23,7 @@
namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResult;
@@ -33,6 +34,7 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Log\Tlog;
use Thelia\Model\CategoryQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Type\TypeCollection;
use Thelia\Type;
@@ -109,7 +111,7 @@ class Category extends BaseLoop
$search = CategoryQuery::create();
if (!is_null($this->id)) {
$search->filterById(explode(',', $this->id), ModelCriteria::IN);
$search->filterById(explode(',', $this->id), Criteria::IN);
}
if (!is_null($this->parent)) {
@@ -119,11 +121,11 @@ class Category extends BaseLoop
if ($this->current == 1) {
$search->filterById($this->request->get("category_id"));
} elseif (null !== $this->current && $this->current == 0) {
$search->filterById($this->request->get("category_id"), ModelCriteria::NOT_IN);
$search->filterById($this->request->get("category_id"), Criteria::NOT_IN);
}
if (!is_null($this->exclude)) {
$search->filterById(explode(",", $this->exclude), ModelCriteria::NOT_IN);
$search->filterById(explode(",", $this->exclude), Criteria::NOT_IN);
}
if (!is_null($this->link)) {
@@ -157,7 +159,11 @@ class Category extends BaseLoop
*
* @todo : verify here if we want results for row without translations.
*/
$search->joinWithI18n('en_US');
$search->joinWithI18n(
$this->request->getSession()->get('locale', 'en_US'),
(ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN
);
$categories = $this->search($search, $pagination);

View File

@@ -107,6 +107,13 @@ class Thelia extends Kernel
$manager = new ConnectionManagerSingle();
$manager->setConfiguration($definePropel->getConfig());
$serviceContainer->setConnectionManager('thelia', $manager);
if ($this->isDebug()) {
$serviceContainer->setLogger('defaultLogger', Tlog::getInstance());
$con = Propel::getConnection("thelia");
$con->useDebug(true);
}
}
/**

View File

@@ -22,6 +22,7 @@
/*************************************************************************************/
namespace Thelia\Core;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -76,6 +77,7 @@ class TheliaHttpKernel extends HttpKernel
{
//$request->headers->set('X-Php-Ob-Level', ob_get_level());
$request = $this->initSession($request);
$this->initParam($request);
$this->container->enterScope('request');
$this->container->set('request', $request, 'request');
@@ -119,6 +121,59 @@ class TheliaHttpKernel extends HttpKernel
*/
protected function initParam(Request $request)
{
$lang = $this->detectLang($request);
if ($lang) {
$request->getSession()->set("lang", $lang->getCode());
$request->getSession()->set("locale", $lang->getLocale());
}
}
/**
* @param Request $request
* @return null|\Thelia\Model\Lang
*/
protected function detectLang(Request $request)
{
$lang = null;
//first priority => lang parameter present in request (get or post)
if($request->query->has("lang")) {
$lang = Model\LangQuery::create()->findOneByCode($request->query->get("lang"));
if(is_null($lang)) {
return;
}
//if each lang had is own domain, we redirect the user to the good one.
if (Model\ConfigQuery::read("one_domain_foreach_lang", false) == 1) {
//if lang domain is different from actuel domain, redirect to the good one
if (rtrim($lang->getUrl(), "/") != $request->getSchemeAndHttpHost()) {
// TODO : search if http status 302 is the good one.
$redirect = new RedirectResponse($lang->getUrl(), 302);
$redirect->send();
exit;
} else {
//the user is actually on the good domain, nothing to change
return null;
}
} else {
//one domain for all languages, the lang is set into session
return $lang;
}
}
//check if lang is not defined. If not we have to search the good one.
if (null === $request->getSession()->get("lang")) {
if (Model\ConfigQuery::read("one_domain_foreach_lang", false) == 1) {
//find lang with domain
return Model\LangQuery::create()->filterByUrl($request->getSchemeAndHttpHost(), ModelCriteria::LIKE)->findOne();
}
//find default lang
return Model\LangQuery::create()->findOneByByDefault(1);
}
}

View File

@@ -30,7 +30,6 @@ use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationExtension;
use Symfony\Component\Form\Extension\Csrf\CsrfExtension;
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider;
use Symfony\Component\Validator\Validation;
use Thelia\Form\Extension\NameFormExtension;
use Thelia\Model\ConfigQuery;
abstract class BaseForm {
@@ -89,7 +88,7 @@ abstract class BaseForm {
* ),
* "label" => "email",
* "constraints" => array(
* new NotBlank()
* new \Symfony\Component\Validator\Constraints\NotBlank()
* )
* )
* )

View File

@@ -117,12 +117,14 @@ class CustomerCreation extends BaseForm
))
->add("password", "password", array(
"constraints" => array(
new Constraints\NotBlank(),
new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4)))
),
"label" => "password"
))
->add("password_confirm", "password", array(
"constraints" => array(
new Constraints\NotBlank(),
new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4))),
new Constraints\Callback(array("methods" => array(
array($this, "verifyPasswordField")

View File

@@ -0,0 +1,120 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Thelia\Model\Customer;
class CustomerModification extends BaseForm {
/**
*
* in this function you add all the fields you need for your Form.
* Form this you have to call add method on $this->form attribute :
*
* $this->form->add("name", "text")
* ->add("email", "email", array(
* "attr" => array(
* "class" => "field"
* ),
* "label" => "email",
* "constraints" => array(
* new NotBlank()
* )
* )
* )
* ->add('age', 'integer');
*
* @return null
*/
protected function buildForm()
{
$this->form
->add("firstname", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => "firstname"
))
->add("lastname", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => "lastname"
))
->add("address1", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => "address"
))
->add("address2", "text", array(
"label" => "Address Line 2"
))
->add("address3", "text", array(
"label" => "Address Line 3"
))
->add("phone", "text", array(
"label" => "phone"
))
->add("cellphone", "text", array(
"label" => "cellphone"
))
->add("zipcode", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => "zipcode"
))
->add("city", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => "city"
))
->add("country", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => "country"
))
->add("title", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => "title"
))
;
}
/**
* @return string the name of you form. This name must be unique
*/
public function getName()
{
return "customerModification";
}
}

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,778 @@
<?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\AdminGroup as ChildAdminGroup;
use Thelia\Model\AdminGroupQuery as ChildAdminGroupQuery;
use Thelia\Model\Map\AdminGroupTableMap;
/**
* Base class that represents a query for the 'admin_group' table.
*
*
*
* @method ChildAdminGroupQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAdminGroupQuery orderByGroupId($order = Criteria::ASC) Order by the group_id column
* @method ChildAdminGroupQuery orderByAdminId($order = Criteria::ASC) Order by the admin_id column
* @method ChildAdminGroupQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAdminGroupQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAdminGroupQuery groupById() Group by the id column
* @method ChildAdminGroupQuery groupByGroupId() Group by the group_id column
* @method ChildAdminGroupQuery groupByAdminId() Group by the admin_id column
* @method ChildAdminGroupQuery groupByCreatedAt() Group by the created_at column
* @method ChildAdminGroupQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildAdminGroupQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAdminGroupQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAdminGroupQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAdminGroupQuery leftJoinGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the Group relation
* @method ChildAdminGroupQuery rightJoinGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Group relation
* @method ChildAdminGroupQuery innerJoinGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the Group relation
*
* @method ChildAdminGroupQuery leftJoinAdmin($relationAlias = null) Adds a LEFT JOIN clause to the query using the Admin relation
* @method ChildAdminGroupQuery rightJoinAdmin($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Admin relation
* @method ChildAdminGroupQuery innerJoinAdmin($relationAlias = null) Adds a INNER JOIN clause to the query using the Admin relation
*
* @method ChildAdminGroup findOne(ConnectionInterface $con = null) Return the first ChildAdminGroup matching the query
* @method ChildAdminGroup findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAdminGroup matching the query, or a new ChildAdminGroup object populated from the query conditions when no match is found
*
* @method ChildAdminGroup findOneById(int $id) Return the first ChildAdminGroup filtered by the id column
* @method ChildAdminGroup findOneByGroupId(int $group_id) Return the first ChildAdminGroup filtered by the group_id column
* @method ChildAdminGroup findOneByAdminId(int $admin_id) Return the first ChildAdminGroup filtered by the admin_id column
* @method ChildAdminGroup findOneByCreatedAt(string $created_at) Return the first ChildAdminGroup filtered by the created_at column
* @method ChildAdminGroup findOneByUpdatedAt(string $updated_at) Return the first ChildAdminGroup filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAdminGroup objects filtered by the id column
* @method array findByGroupId(int $group_id) Return ChildAdminGroup objects filtered by the group_id column
* @method array findByAdminId(int $admin_id) Return ChildAdminGroup objects filtered by the admin_id column
* @method array findByCreatedAt(string $created_at) Return ChildAdminGroup objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAdminGroup objects filtered by the updated_at column
*
*/
abstract class AdminGroupQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\AdminGroupQuery 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\\AdminGroup', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAdminGroupQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAdminGroupQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\AdminGroupQuery) {
return $criteria;
}
$query = new \Thelia\Model\AdminGroupQuery();
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, 56), $con);
* </code>
*
* @param array[$id, $group_id, $admin_id] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildAdminGroup|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AdminGroupTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AdminGroupTableMap::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 ChildAdminGroup A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, GROUP_ID, ADMIN_ID, CREATED_AT, UPDATED_AT FROM admin_group WHERE ID = :p0 AND GROUP_ID = :p1 AND ADMIN_ID = :p2';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
$stmt->bindValue(':p2', $key[2], 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 ChildAdminGroup();
$obj->hydrate($row);
AdminGroupTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2])));
}
$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 ChildAdminGroup|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 ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(AdminGroupTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $key[1], Criteria::EQUAL);
$this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $key[2], 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 ChildAdminGroupQuery 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(AdminGroupTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(AdminGroupTableMap::GROUP_ID, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$cton2 = $this->getNewCriterion(AdminGroupTableMap::ADMIN_ID, $key[2], Criteria::EQUAL);
$cton0->addAnd($cton2);
$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>
*
* @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 ChildAdminGroupQuery 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(AdminGroupTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AdminGroupTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the group_id column
*
* Example usage:
* <code>
* $query->filterByGroupId(1234); // WHERE group_id = 1234
* $query->filterByGroupId(array(12, 34)); // WHERE group_id IN (12, 34)
* $query->filterByGroupId(array('min' => 12)); // WHERE group_id > 12
* </code>
*
* @see filterByGroup()
*
* @param mixed $groupId 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 ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByGroupId($groupId = null, $comparison = null)
{
if (is_array($groupId)) {
$useMinMax = false;
if (isset($groupId['min'])) {
$this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($groupId['max'])) {
$this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $groupId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $groupId, $comparison);
}
/**
* Filter the query on the admin_id column
*
* Example usage:
* <code>
* $query->filterByAdminId(1234); // WHERE admin_id = 1234
* $query->filterByAdminId(array(12, 34)); // WHERE admin_id IN (12, 34)
* $query->filterByAdminId(array('min' => 12)); // WHERE admin_id > 12
* </code>
*
* @see filterByAdmin()
*
* @param mixed $adminId 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 ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByAdminId($adminId = null, $comparison = null)
{
if (is_array($adminId)) {
$useMinMax = false;
if (isset($adminId['min'])) {
$this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $adminId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($adminId['max'])) {
$this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $adminId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $adminId, $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 ChildAdminGroupQuery 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(AdminGroupTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(AdminGroupTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::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 ChildAdminGroupQuery 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(AdminGroupTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Group object
*
* @param \Thelia\Model\Group|ObjectCollection $group The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByGroup($group, $comparison = null)
{
if ($group instanceof \Thelia\Model\Group) {
return $this
->addUsingAlias(AdminGroupTableMap::GROUP_ID, $group->getId(), $comparison);
} elseif ($group instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AdminGroupTableMap::GROUP_ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByGroup() only accepts arguments of type \Thelia\Model\Group or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Group relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function joinGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Group');
// 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, 'Group');
}
return $this;
}
/**
* Use the Group relation Group 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\GroupQuery A secondary query class using the current class as primary query
*/
public function useGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Group', '\Thelia\Model\GroupQuery');
}
/**
* Filter the query by a related \Thelia\Model\Admin object
*
* @param \Thelia\Model\Admin|ObjectCollection $admin The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByAdmin($admin, $comparison = null)
{
if ($admin instanceof \Thelia\Model\Admin) {
return $this
->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $admin->getId(), $comparison);
} elseif ($admin instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $admin->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByAdmin() only accepts arguments of type \Thelia\Model\Admin or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Admin relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function joinAdmin($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Admin');
// 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, 'Admin');
}
return $this;
}
/**
* Use the Admin relation Admin 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\AdminQuery A secondary query class using the current class as primary query
*/
public function useAdminQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAdmin($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Admin', '\Thelia\Model\AdminQuery');
}
/**
* Exclude object from result
*
* @param ChildAdminGroup $adminGroup Object to remove from the list of results
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function prune($adminGroup = null)
{
if ($adminGroup) {
$this->addCond('pruneCond0', $this->getAliasedColName(AdminGroupTableMap::ID), $adminGroup->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(AdminGroupTableMap::GROUP_ID), $adminGroup->getGroupId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond2', $this->getAliasedColName(AdminGroupTableMap::ADMIN_ID), $adminGroup->getAdminId(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1', 'pruneCond2'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the admin_group 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(AdminGroupTableMap::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).
AdminGroupTableMap::clearInstancePool();
AdminGroupTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildAdminGroup or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildAdminGroup 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(AdminGroupTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AdminGroupTableMap::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();
AdminGroupTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AdminGroupTableMap::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 ChildAdminGroupQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(AdminGroupTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(AdminGroupTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(AdminGroupTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(AdminGroupTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(AdminGroupTableMap::CREATED_AT);
}
} // AdminGroupQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,669 @@
<?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\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\AdminLog as ChildAdminLog;
use Thelia\Model\AdminLogQuery as ChildAdminLogQuery;
use Thelia\Model\Map\AdminLogTableMap;
/**
* Base class that represents a query for the 'admin_log' table.
*
*
*
* @method ChildAdminLogQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAdminLogQuery orderByAdminLogin($order = Criteria::ASC) Order by the admin_login column
* @method ChildAdminLogQuery orderByAdminFirstname($order = Criteria::ASC) Order by the admin_firstname column
* @method ChildAdminLogQuery orderByAdminLastname($order = Criteria::ASC) Order by the admin_lastname column
* @method ChildAdminLogQuery orderByAction($order = Criteria::ASC) Order by the action column
* @method ChildAdminLogQuery orderByRequest($order = Criteria::ASC) Order by the request column
* @method ChildAdminLogQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAdminLogQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAdminLogQuery groupById() Group by the id column
* @method ChildAdminLogQuery groupByAdminLogin() Group by the admin_login column
* @method ChildAdminLogQuery groupByAdminFirstname() Group by the admin_firstname column
* @method ChildAdminLogQuery groupByAdminLastname() Group by the admin_lastname column
* @method ChildAdminLogQuery groupByAction() Group by the action column
* @method ChildAdminLogQuery groupByRequest() Group by the request column
* @method ChildAdminLogQuery groupByCreatedAt() Group by the created_at column
* @method ChildAdminLogQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildAdminLogQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAdminLogQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAdminLogQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAdminLog findOne(ConnectionInterface $con = null) Return the first ChildAdminLog matching the query
* @method ChildAdminLog findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAdminLog matching the query, or a new ChildAdminLog object populated from the query conditions when no match is found
*
* @method ChildAdminLog findOneById(int $id) Return the first ChildAdminLog filtered by the id column
* @method ChildAdminLog findOneByAdminLogin(string $admin_login) Return the first ChildAdminLog filtered by the admin_login column
* @method ChildAdminLog findOneByAdminFirstname(string $admin_firstname) Return the first ChildAdminLog filtered by the admin_firstname column
* @method ChildAdminLog findOneByAdminLastname(string $admin_lastname) Return the first ChildAdminLog filtered by the admin_lastname column
* @method ChildAdminLog findOneByAction(string $action) Return the first ChildAdminLog filtered by the action column
* @method ChildAdminLog findOneByRequest(string $request) Return the first ChildAdminLog filtered by the request column
* @method ChildAdminLog findOneByCreatedAt(string $created_at) Return the first ChildAdminLog filtered by the created_at column
* @method ChildAdminLog findOneByUpdatedAt(string $updated_at) Return the first ChildAdminLog filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAdminLog objects filtered by the id column
* @method array findByAdminLogin(string $admin_login) Return ChildAdminLog objects filtered by the admin_login column
* @method array findByAdminFirstname(string $admin_firstname) Return ChildAdminLog objects filtered by the admin_firstname column
* @method array findByAdminLastname(string $admin_lastname) Return ChildAdminLog objects filtered by the admin_lastname column
* @method array findByAction(string $action) Return ChildAdminLog objects filtered by the action column
* @method array findByRequest(string $request) Return ChildAdminLog objects filtered by the request column
* @method array findByCreatedAt(string $created_at) Return ChildAdminLog objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAdminLog objects filtered by the updated_at column
*
*/
abstract class AdminLogQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\AdminLogQuery 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\\AdminLog', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAdminLogQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAdminLogQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\AdminLogQuery) {
return $criteria;
}
$query = new \Thelia\Model\AdminLogQuery();
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 ChildAdminLog|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AdminLogTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AdminLogTableMap::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 ChildAdminLog A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, ADMIN_LOGIN, ADMIN_FIRSTNAME, ADMIN_LASTNAME, ACTION, REQUEST, CREATED_AT, UPDATED_AT FROM admin_log 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 ChildAdminLog();
$obj->hydrate($row);
AdminLogTableMap::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 ChildAdminLog|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 ChildAdminLogQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(AdminLogTableMap::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 ChildAdminLogQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(AdminLogTableMap::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 ChildAdminLogQuery 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(AdminLogTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AdminLogTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminLogTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the admin_login column
*
* Example usage:
* <code>
* $query->filterByAdminLogin('fooValue'); // WHERE admin_login = 'fooValue'
* $query->filterByAdminLogin('%fooValue%'); // WHERE admin_login LIKE '%fooValue%'
* </code>
*
* @param string $adminLogin 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 ChildAdminLogQuery The current query, for fluid interface
*/
public function filterByAdminLogin($adminLogin = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($adminLogin)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $adminLogin)) {
$adminLogin = str_replace('*', '%', $adminLogin);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminLogTableMap::ADMIN_LOGIN, $adminLogin, $comparison);
}
/**
* Filter the query on the admin_firstname column
*
* Example usage:
* <code>
* $query->filterByAdminFirstname('fooValue'); // WHERE admin_firstname = 'fooValue'
* $query->filterByAdminFirstname('%fooValue%'); // WHERE admin_firstname LIKE '%fooValue%'
* </code>
*
* @param string $adminFirstname 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 ChildAdminLogQuery The current query, for fluid interface
*/
public function filterByAdminFirstname($adminFirstname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($adminFirstname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $adminFirstname)) {
$adminFirstname = str_replace('*', '%', $adminFirstname);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminLogTableMap::ADMIN_FIRSTNAME, $adminFirstname, $comparison);
}
/**
* Filter the query on the admin_lastname column
*
* Example usage:
* <code>
* $query->filterByAdminLastname('fooValue'); // WHERE admin_lastname = 'fooValue'
* $query->filterByAdminLastname('%fooValue%'); // WHERE admin_lastname LIKE '%fooValue%'
* </code>
*
* @param string $adminLastname 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 ChildAdminLogQuery The current query, for fluid interface
*/
public function filterByAdminLastname($adminLastname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($adminLastname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $adminLastname)) {
$adminLastname = str_replace('*', '%', $adminLastname);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminLogTableMap::ADMIN_LASTNAME, $adminLastname, $comparison);
}
/**
* Filter the query on the action column
*
* Example usage:
* <code>
* $query->filterByAction('fooValue'); // WHERE action = 'fooValue'
* $query->filterByAction('%fooValue%'); // WHERE action LIKE '%fooValue%'
* </code>
*
* @param string $action 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 ChildAdminLogQuery The current query, for fluid interface
*/
public function filterByAction($action = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($action)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $action)) {
$action = str_replace('*', '%', $action);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminLogTableMap::ACTION, $action, $comparison);
}
/**
* Filter the query on the request column
*
* Example usage:
* <code>
* $query->filterByRequest('fooValue'); // WHERE request = 'fooValue'
* $query->filterByRequest('%fooValue%'); // WHERE request LIKE '%fooValue%'
* </code>
*
* @param string $request 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 ChildAdminLogQuery The current query, for fluid interface
*/
public function filterByRequest($request = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($request)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $request)) {
$request = str_replace('*', '%', $request);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminLogTableMap::REQUEST, $request, $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 ChildAdminLogQuery 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(AdminLogTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(AdminLogTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminLogTableMap::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 ChildAdminLogQuery 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(AdminLogTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(AdminLogTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminLogTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Exclude object from result
*
* @param ChildAdminLog $adminLog Object to remove from the list of results
*
* @return ChildAdminLogQuery The current query, for fluid interface
*/
public function prune($adminLog = null)
{
if ($adminLog) {
$this->addUsingAlias(AdminLogTableMap::ID, $adminLog->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the admin_log 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(AdminLogTableMap::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).
AdminLogTableMap::clearInstancePool();
AdminLogTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildAdminLog or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildAdminLog 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(AdminLogTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AdminLogTableMap::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();
AdminLogTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AdminLogTableMap::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 ChildAdminLogQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(AdminLogTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildAdminLogQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(AdminLogTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildAdminLogQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(AdminLogTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildAdminLogQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(AdminLogTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildAdminLogQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(AdminLogTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildAdminLogQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(AdminLogTableMap::CREATED_AT);
}
} // AdminLogQuery

View File

@@ -0,0 +1,799 @@
<?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\Admin as ChildAdmin;
use Thelia\Model\AdminQuery as ChildAdminQuery;
use Thelia\Model\Map\AdminTableMap;
/**
* Base class that represents a query for the 'admin' table.
*
*
*
* @method ChildAdminQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAdminQuery orderByFirstname($order = Criteria::ASC) Order by the firstname column
* @method ChildAdminQuery orderByLastname($order = Criteria::ASC) Order by the lastname column
* @method ChildAdminQuery orderByLogin($order = Criteria::ASC) Order by the login column
* @method ChildAdminQuery orderByPassword($order = Criteria::ASC) Order by the password column
* @method ChildAdminQuery orderByAlgo($order = Criteria::ASC) Order by the algo column
* @method ChildAdminQuery orderBySalt($order = Criteria::ASC) Order by the salt column
* @method ChildAdminQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAdminQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAdminQuery groupById() Group by the id column
* @method ChildAdminQuery groupByFirstname() Group by the firstname column
* @method ChildAdminQuery groupByLastname() Group by the lastname column
* @method ChildAdminQuery groupByLogin() Group by the login column
* @method ChildAdminQuery groupByPassword() Group by the password column
* @method ChildAdminQuery groupByAlgo() Group by the algo column
* @method ChildAdminQuery groupBySalt() Group by the salt column
* @method ChildAdminQuery groupByCreatedAt() Group by the created_at column
* @method ChildAdminQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildAdminQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAdminQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAdminQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAdminQuery leftJoinAdminGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the AdminGroup relation
* @method ChildAdminQuery rightJoinAdminGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AdminGroup relation
* @method ChildAdminQuery innerJoinAdminGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the AdminGroup relation
*
* @method ChildAdmin findOne(ConnectionInterface $con = null) Return the first ChildAdmin matching the query
* @method ChildAdmin findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAdmin matching the query, or a new ChildAdmin object populated from the query conditions when no match is found
*
* @method ChildAdmin findOneById(int $id) Return the first ChildAdmin filtered by the id column
* @method ChildAdmin findOneByFirstname(string $firstname) Return the first ChildAdmin filtered by the firstname column
* @method ChildAdmin findOneByLastname(string $lastname) Return the first ChildAdmin filtered by the lastname column
* @method ChildAdmin findOneByLogin(string $login) Return the first ChildAdmin filtered by the login column
* @method ChildAdmin findOneByPassword(string $password) Return the first ChildAdmin filtered by the password column
* @method ChildAdmin findOneByAlgo(string $algo) Return the first ChildAdmin filtered by the algo column
* @method ChildAdmin findOneBySalt(string $salt) Return the first ChildAdmin filtered by the salt column
* @method ChildAdmin findOneByCreatedAt(string $created_at) Return the first ChildAdmin filtered by the created_at column
* @method ChildAdmin findOneByUpdatedAt(string $updated_at) Return the first ChildAdmin filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAdmin objects filtered by the id column
* @method array findByFirstname(string $firstname) Return ChildAdmin objects filtered by the firstname column
* @method array findByLastname(string $lastname) Return ChildAdmin objects filtered by the lastname column
* @method array findByLogin(string $login) Return ChildAdmin objects filtered by the login column
* @method array findByPassword(string $password) Return ChildAdmin objects filtered by the password column
* @method array findByAlgo(string $algo) Return ChildAdmin objects filtered by the algo column
* @method array findBySalt(string $salt) Return ChildAdmin objects filtered by the salt column
* @method array findByCreatedAt(string $created_at) Return ChildAdmin objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAdmin objects filtered by the updated_at column
*
*/
abstract class AdminQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\AdminQuery 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\\Admin', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAdminQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAdminQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\AdminQuery) {
return $criteria;
}
$query = new \Thelia\Model\AdminQuery();
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 ChildAdmin|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AdminTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AdminTableMap::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 ChildAdmin A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, FIRSTNAME, LASTNAME, LOGIN, PASSWORD, ALGO, SALT, CREATED_AT, UPDATED_AT FROM admin 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 ChildAdmin();
$obj->hydrate($row);
AdminTableMap::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 ChildAdmin|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 ChildAdminQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(AdminTableMap::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 ChildAdminQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(AdminTableMap::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 ChildAdminQuery 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(AdminTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AdminTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the firstname column
*
* Example usage:
* <code>
* $query->filterByFirstname('fooValue'); // WHERE firstname = 'fooValue'
* $query->filterByFirstname('%fooValue%'); // WHERE firstname LIKE '%fooValue%'
* </code>
*
* @param string $firstname 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 ChildAdminQuery The current query, for fluid interface
*/
public function filterByFirstname($firstname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($firstname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $firstname)) {
$firstname = str_replace('*', '%', $firstname);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminTableMap::FIRSTNAME, $firstname, $comparison);
}
/**
* Filter the query on the lastname column
*
* Example usage:
* <code>
* $query->filterByLastname('fooValue'); // WHERE lastname = 'fooValue'
* $query->filterByLastname('%fooValue%'); // WHERE lastname LIKE '%fooValue%'
* </code>
*
* @param string $lastname 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 ChildAdminQuery The current query, for fluid interface
*/
public function filterByLastname($lastname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lastname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $lastname)) {
$lastname = str_replace('*', '%', $lastname);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminTableMap::LASTNAME, $lastname, $comparison);
}
/**
* Filter the query on the login column
*
* Example usage:
* <code>
* $query->filterByLogin('fooValue'); // WHERE login = 'fooValue'
* $query->filterByLogin('%fooValue%'); // WHERE login LIKE '%fooValue%'
* </code>
*
* @param string $login 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 ChildAdminQuery The current query, for fluid interface
*/
public function filterByLogin($login = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($login)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $login)) {
$login = str_replace('*', '%', $login);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminTableMap::LOGIN, $login, $comparison);
}
/**
* Filter the query on the password column
*
* Example usage:
* <code>
* $query->filterByPassword('fooValue'); // WHERE password = 'fooValue'
* $query->filterByPassword('%fooValue%'); // WHERE password LIKE '%fooValue%'
* </code>
*
* @param string $password 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 ChildAdminQuery The current query, for fluid interface
*/
public function filterByPassword($password = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($password)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $password)) {
$password = str_replace('*', '%', $password);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminTableMap::PASSWORD, $password, $comparison);
}
/**
* Filter the query on the algo column
*
* Example usage:
* <code>
* $query->filterByAlgo('fooValue'); // WHERE algo = 'fooValue'
* $query->filterByAlgo('%fooValue%'); // WHERE algo LIKE '%fooValue%'
* </code>
*
* @param string $algo 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 ChildAdminQuery The current query, for fluid interface
*/
public function filterByAlgo($algo = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($algo)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $algo)) {
$algo = str_replace('*', '%', $algo);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminTableMap::ALGO, $algo, $comparison);
}
/**
* Filter the query on the salt column
*
* Example usage:
* <code>
* $query->filterBySalt('fooValue'); // WHERE salt = 'fooValue'
* $query->filterBySalt('%fooValue%'); // WHERE salt LIKE '%fooValue%'
* </code>
*
* @param string $salt 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 ChildAdminQuery The current query, for fluid interface
*/
public function filterBySalt($salt = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($salt)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $salt)) {
$salt = str_replace('*', '%', $salt);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AdminTableMap::SALT, $salt, $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 ChildAdminQuery 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(AdminTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(AdminTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminTableMap::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 ChildAdminQuery 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(AdminTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(AdminTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\AdminGroup object
*
* @param \Thelia\Model\AdminGroup|ObjectCollection $adminGroup the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function filterByAdminGroup($adminGroup, $comparison = null)
{
if ($adminGroup instanceof \Thelia\Model\AdminGroup) {
return $this
->addUsingAlias(AdminTableMap::ID, $adminGroup->getAdminId(), $comparison);
} elseif ($adminGroup instanceof ObjectCollection) {
return $this
->useAdminGroupQuery()
->filterByPrimaryKeys($adminGroup->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAdminGroup() only accepts arguments of type \Thelia\Model\AdminGroup or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AdminGroup relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function joinAdminGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AdminGroup');
// 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, 'AdminGroup');
}
return $this;
}
/**
* Use the AdminGroup relation AdminGroup 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\AdminGroupQuery A secondary query class using the current class as primary query
*/
public function useAdminGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAdminGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AdminGroup', '\Thelia\Model\AdminGroupQuery');
}
/**
* Filter the query by a related Group object
* using the admin_group table as cross reference
*
* @param Group $group the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function filterByGroup($group, $comparison = Criteria::EQUAL)
{
return $this
->useAdminGroupQuery()
->filterByGroup($group, $comparison)
->endUse();
}
/**
* Exclude object from result
*
* @param ChildAdmin $admin Object to remove from the list of results
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function prune($admin = null)
{
if ($admin) {
$this->addUsingAlias(AdminTableMap::ID, $admin->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the admin 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(AdminTableMap::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).
AdminTableMap::clearInstancePool();
AdminTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildAdmin or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildAdmin 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(AdminTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AdminTableMap::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();
AdminTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AdminTableMap::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 ChildAdminQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(AdminTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(AdminTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(AdminTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(AdminTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(AdminTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(AdminTableMap::CREATED_AT);
}
} // AdminQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,739 @@
<?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\Area as ChildArea;
use Thelia\Model\AreaQuery as ChildAreaQuery;
use Thelia\Model\Map\AreaTableMap;
/**
* Base class that represents a query for the 'area' table.
*
*
*
* @method ChildAreaQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAreaQuery orderByName($order = Criteria::ASC) Order by the name column
* @method ChildAreaQuery orderByUnit($order = Criteria::ASC) Order by the unit column
* @method ChildAreaQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAreaQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAreaQuery groupById() Group by the id column
* @method ChildAreaQuery groupByName() Group by the name column
* @method ChildAreaQuery groupByUnit() Group by the unit column
* @method ChildAreaQuery groupByCreatedAt() Group by the created_at column
* @method ChildAreaQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildAreaQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAreaQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAreaQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAreaQuery leftJoinCountry($relationAlias = null) Adds a LEFT JOIN clause to the query using the Country relation
* @method ChildAreaQuery rightJoinCountry($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Country relation
* @method ChildAreaQuery innerJoinCountry($relationAlias = null) Adds a INNER JOIN clause to the query using the Country relation
*
* @method ChildAreaQuery leftJoinDelivzone($relationAlias = null) Adds a LEFT JOIN clause to the query using the Delivzone relation
* @method ChildAreaQuery rightJoinDelivzone($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Delivzone relation
* @method ChildAreaQuery innerJoinDelivzone($relationAlias = null) Adds a INNER JOIN clause to the query using the Delivzone relation
*
* @method ChildArea findOne(ConnectionInterface $con = null) Return the first ChildArea matching the query
* @method ChildArea findOneOrCreate(ConnectionInterface $con = null) Return the first ChildArea matching the query, or a new ChildArea object populated from the query conditions when no match is found
*
* @method ChildArea findOneById(int $id) Return the first ChildArea filtered by the id column
* @method ChildArea findOneByName(string $name) Return the first ChildArea filtered by the name column
* @method ChildArea findOneByUnit(double $unit) Return the first ChildArea filtered by the unit column
* @method ChildArea findOneByCreatedAt(string $created_at) Return the first ChildArea filtered by the created_at column
* @method ChildArea findOneByUpdatedAt(string $updated_at) Return the first ChildArea filtered by the updated_at column
*
* @method array findById(int $id) Return ChildArea objects filtered by the id column
* @method array findByName(string $name) Return ChildArea objects filtered by the name column
* @method array findByUnit(double $unit) Return ChildArea objects filtered by the unit column
* @method array findByCreatedAt(string $created_at) Return ChildArea objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildArea objects filtered by the updated_at column
*
*/
abstract class AreaQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\AreaQuery 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\\Area', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAreaQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAreaQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\AreaQuery) {
return $criteria;
}
$query = new \Thelia\Model\AreaQuery();
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 ChildArea|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AreaTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AreaTableMap::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 ChildArea A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, NAME, UNIT, CREATED_AT, UPDATED_AT FROM area 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 ChildArea();
$obj->hydrate($row);
AreaTableMap::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 ChildArea|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 ChildAreaQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(AreaTableMap::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 ChildAreaQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(AreaTableMap::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 ChildAreaQuery 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(AreaTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AreaTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AreaTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the name column
*
* Example usage:
* <code>
* $query->filterByName('fooValue'); // WHERE name = 'fooValue'
* $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
* </code>
*
* @param string $name 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 ChildAreaQuery The current query, for fluid interface
*/
public function filterByName($name = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($name)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $name)) {
$name = str_replace('*', '%', $name);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AreaTableMap::NAME, $name, $comparison);
}
/**
* Filter the query on the unit column
*
* Example usage:
* <code>
* $query->filterByUnit(1234); // WHERE unit = 1234
* $query->filterByUnit(array(12, 34)); // WHERE unit IN (12, 34)
* $query->filterByUnit(array('min' => 12)); // WHERE unit > 12
* </code>
*
* @param mixed $unit 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 ChildAreaQuery The current query, for fluid interface
*/
public function filterByUnit($unit = null, $comparison = null)
{
if (is_array($unit)) {
$useMinMax = false;
if (isset($unit['min'])) {
$this->addUsingAlias(AreaTableMap::UNIT, $unit['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($unit['max'])) {
$this->addUsingAlias(AreaTableMap::UNIT, $unit['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AreaTableMap::UNIT, $unit, $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 ChildAreaQuery 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(AreaTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(AreaTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AreaTableMap::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 ChildAreaQuery 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(AreaTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(AreaTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AreaTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Country object
*
* @param \Thelia\Model\Country|ObjectCollection $country the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function filterByCountry($country, $comparison = null)
{
if ($country instanceof \Thelia\Model\Country) {
return $this
->addUsingAlias(AreaTableMap::ID, $country->getAreaId(), $comparison);
} elseif ($country instanceof ObjectCollection) {
return $this
->useCountryQuery()
->filterByPrimaryKeys($country->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByCountry() only accepts arguments of type \Thelia\Model\Country or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Country relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function joinCountry($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Country');
// 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, 'Country');
}
return $this;
}
/**
* Use the Country relation Country 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\CountryQuery A secondary query class using the current class as primary query
*/
public function useCountryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCountry($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Country', '\Thelia\Model\CountryQuery');
}
/**
* Filter the query by a related \Thelia\Model\Delivzone object
*
* @param \Thelia\Model\Delivzone|ObjectCollection $delivzone the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function filterByDelivzone($delivzone, $comparison = null)
{
if ($delivzone instanceof \Thelia\Model\Delivzone) {
return $this
->addUsingAlias(AreaTableMap::ID, $delivzone->getAreaId(), $comparison);
} elseif ($delivzone instanceof ObjectCollection) {
return $this
->useDelivzoneQuery()
->filterByPrimaryKeys($delivzone->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByDelivzone() only accepts arguments of type \Thelia\Model\Delivzone or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Delivzone relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function joinDelivzone($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Delivzone');
// 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, 'Delivzone');
}
return $this;
}
/**
* Use the Delivzone relation Delivzone 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\DelivzoneQuery A secondary query class using the current class as primary query
*/
public function useDelivzoneQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinDelivzone($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Delivzone', '\Thelia\Model\DelivzoneQuery');
}
/**
* Exclude object from result
*
* @param ChildArea $area Object to remove from the list of results
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function prune($area = null)
{
if ($area) {
$this->addUsingAlias(AreaTableMap::ID, $area->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the area 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(AreaTableMap::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).
AreaTableMap::clearInstancePool();
AreaTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildArea or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildArea 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(AreaTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AreaTableMap::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();
AreaTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AreaTableMap::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 ChildAreaQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(AreaTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(AreaTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(AreaTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(AreaTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(AreaTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(AreaTableMap::CREATED_AT);
}
} // AreaQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -0,0 +1,890 @@
<?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\AttributeAv as ChildAttributeAv;
use Thelia\Model\AttributeAvI18nQuery as ChildAttributeAvI18nQuery;
use Thelia\Model\AttributeAvQuery as ChildAttributeAvQuery;
use Thelia\Model\Map\AttributeAvTableMap;
/**
* Base class that represents a query for the 'attribute_av' table.
*
*
*
* @method ChildAttributeAvQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAttributeAvQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
* @method ChildAttributeAvQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildAttributeAvQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAttributeAvQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAttributeAvQuery groupById() Group by the id column
* @method ChildAttributeAvQuery groupByAttributeId() Group by the attribute_id column
* @method ChildAttributeAvQuery groupByPosition() Group by the position column
* @method ChildAttributeAvQuery groupByCreatedAt() Group by the created_at column
* @method ChildAttributeAvQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildAttributeAvQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAttributeAvQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAttributeAvQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAttributeAvQuery leftJoinAttribute($relationAlias = null) Adds a LEFT JOIN clause to the query using the Attribute relation
* @method ChildAttributeAvQuery rightJoinAttribute($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Attribute relation
* @method ChildAttributeAvQuery innerJoinAttribute($relationAlias = null) Adds a INNER JOIN clause to the query using the Attribute relation
*
* @method ChildAttributeAvQuery leftJoinAttributeCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeCombination relation
* @method ChildAttributeAvQuery rightJoinAttributeCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCombination relation
* @method ChildAttributeAvQuery innerJoinAttributeCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCombination relation
*
* @method ChildAttributeAvQuery leftJoinAttributeAvI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeAvI18n relation
* @method ChildAttributeAvQuery rightJoinAttributeAvI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeAvI18n relation
* @method ChildAttributeAvQuery innerJoinAttributeAvI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeAvI18n relation
*
* @method ChildAttributeAv findOne(ConnectionInterface $con = null) Return the first ChildAttributeAv matching the query
* @method ChildAttributeAv findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAttributeAv matching the query, or a new ChildAttributeAv object populated from the query conditions when no match is found
*
* @method ChildAttributeAv findOneById(int $id) Return the first ChildAttributeAv filtered by the id column
* @method ChildAttributeAv findOneByAttributeId(int $attribute_id) Return the first ChildAttributeAv filtered by the attribute_id column
* @method ChildAttributeAv findOneByPosition(int $position) Return the first ChildAttributeAv filtered by the position column
* @method ChildAttributeAv findOneByCreatedAt(string $created_at) Return the first ChildAttributeAv filtered by the created_at column
* @method ChildAttributeAv findOneByUpdatedAt(string $updated_at) Return the first ChildAttributeAv filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAttributeAv objects filtered by the id column
* @method array findByAttributeId(int $attribute_id) Return ChildAttributeAv objects filtered by the attribute_id column
* @method array findByPosition(int $position) Return ChildAttributeAv objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildAttributeAv objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAttributeAv objects filtered by the updated_at column
*
*/
abstract class AttributeAvQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\AttributeAvQuery 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\\AttributeAv', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAttributeAvQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAttributeAvQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\AttributeAvQuery) {
return $criteria;
}
$query = new \Thelia\Model\AttributeAvQuery();
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 ChildAttributeAv|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AttributeAvTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AttributeAvTableMap::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 ChildAttributeAv A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, ATTRIBUTE_ID, POSITION, CREATED_AT, UPDATED_AT FROM attribute_av 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 ChildAttributeAv();
$obj->hydrate($row);
AttributeAvTableMap::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 ChildAttributeAv|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 ChildAttributeAvQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(AttributeAvTableMap::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 ChildAttributeAvQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(AttributeAvTableMap::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 ChildAttributeAvQuery 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(AttributeAvTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AttributeAvTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeAvTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the attribute_id column
*
* Example usage:
* <code>
* $query->filterByAttributeId(1234); // WHERE attribute_id = 1234
* $query->filterByAttributeId(array(12, 34)); // WHERE attribute_id IN (12, 34)
* $query->filterByAttributeId(array('min' => 12)); // WHERE attribute_id > 12
* </code>
*
* @see filterByAttribute()
*
* @param mixed $attributeId 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 ChildAttributeAvQuery The current query, for fluid interface
*/
public function filterByAttributeId($attributeId = null, $comparison = null)
{
if (is_array($attributeId)) {
$useMinMax = false;
if (isset($attributeId['min'])) {
$this->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($attributeId['max'])) {
$this->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attributeId, $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 ChildAttributeAvQuery 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(AttributeAvTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(AttributeAvTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeAvTableMap::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 ChildAttributeAvQuery 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(AttributeAvTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(AttributeAvTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeAvTableMap::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 ChildAttributeAvQuery 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(AttributeAvTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(AttributeAvTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeAvTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Attribute object
*
* @param \Thelia\Model\Attribute|ObjectCollection $attribute The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function filterByAttribute($attribute, $comparison = null)
{
if ($attribute instanceof \Thelia\Model\Attribute) {
return $this
->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attribute->getId(), $comparison);
} elseif ($attribute instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByAttribute() only accepts arguments of type \Thelia\Model\Attribute or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Attribute relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function joinAttribute($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Attribute');
// 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, 'Attribute');
}
return $this;
}
/**
* Use the Attribute relation Attribute 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\AttributeQuery A secondary query class using the current class as primary query
*/
public function useAttributeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAttribute($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Attribute', '\Thelia\Model\AttributeQuery');
}
/**
* Filter the query by a related \Thelia\Model\AttributeCombination object
*
* @param \Thelia\Model\AttributeCombination|ObjectCollection $attributeCombination the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function filterByAttributeCombination($attributeCombination, $comparison = null)
{
if ($attributeCombination instanceof \Thelia\Model\AttributeCombination) {
return $this
->addUsingAlias(AttributeAvTableMap::ID, $attributeCombination->getAttributeAvId(), $comparison);
} elseif ($attributeCombination instanceof ObjectCollection) {
return $this
->useAttributeCombinationQuery()
->filterByPrimaryKeys($attributeCombination->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAttributeCombination() only accepts arguments of type \Thelia\Model\AttributeCombination or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AttributeCombination relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function joinAttributeCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AttributeCombination');
// 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, 'AttributeCombination');
}
return $this;
}
/**
* Use the AttributeCombination relation AttributeCombination 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\AttributeCombinationQuery A secondary query class using the current class as primary query
*/
public function useAttributeCombinationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAttributeCombination($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeCombination', '\Thelia\Model\AttributeCombinationQuery');
}
/**
* Filter the query by a related \Thelia\Model\AttributeAvI18n object
*
* @param \Thelia\Model\AttributeAvI18n|ObjectCollection $attributeAvI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function filterByAttributeAvI18n($attributeAvI18n, $comparison = null)
{
if ($attributeAvI18n instanceof \Thelia\Model\AttributeAvI18n) {
return $this
->addUsingAlias(AttributeAvTableMap::ID, $attributeAvI18n->getId(), $comparison);
} elseif ($attributeAvI18n instanceof ObjectCollection) {
return $this
->useAttributeAvI18nQuery()
->filterByPrimaryKeys($attributeAvI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAttributeAvI18n() only accepts arguments of type \Thelia\Model\AttributeAvI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AttributeAvI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function joinAttributeAvI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AttributeAvI18n');
// 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, 'AttributeAvI18n');
}
return $this;
}
/**
* Use the AttributeAvI18n relation AttributeAvI18n 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\AttributeAvI18nQuery A secondary query class using the current class as primary query
*/
public function useAttributeAvI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinAttributeAvI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeAvI18n', '\Thelia\Model\AttributeAvI18nQuery');
}
/**
* Exclude object from result
*
* @param ChildAttributeAv $attributeAv Object to remove from the list of results
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function prune($attributeAv = null)
{
if ($attributeAv) {
$this->addUsingAlias(AttributeAvTableMap::ID, $attributeAv->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the attribute_av 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(AttributeAvTableMap::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).
AttributeAvTableMap::clearInstancePool();
AttributeAvTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildAttributeAv or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildAttributeAv 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(AttributeAvTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AttributeAvTableMap::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();
AttributeAvTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AttributeAvTableMap::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 ChildAttributeAvQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(AttributeAvTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(AttributeAvTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(AttributeAvTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(AttributeAvTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(AttributeAvTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildAttributeAvQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(AttributeAvTableMap::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 ChildAttributeAvQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'AttributeAvI18n';
return $this
->joinAttributeAvI18n($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 ChildAttributeAvQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('AttributeAvI18n');
$this->with['AttributeAvI18n']->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 ChildAttributeAvI18nQuery A secondary query class using the current class as primary query
*/
public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeAvI18n', '\Thelia\Model\AttributeAvI18nQuery');
}
} // AttributeAvQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,759 @@
<?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\AttributeCategory as ChildAttributeCategory;
use Thelia\Model\AttributeCategoryQuery as ChildAttributeCategoryQuery;
use Thelia\Model\Map\AttributeCategoryTableMap;
/**
* Base class that represents a query for the 'attribute_category' table.
*
*
*
* @method ChildAttributeCategoryQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAttributeCategoryQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
* @method ChildAttributeCategoryQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
* @method ChildAttributeCategoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAttributeCategoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAttributeCategoryQuery groupById() Group by the id column
* @method ChildAttributeCategoryQuery groupByCategoryId() Group by the category_id column
* @method ChildAttributeCategoryQuery groupByAttributeId() Group by the attribute_id column
* @method ChildAttributeCategoryQuery groupByCreatedAt() Group by the created_at column
* @method ChildAttributeCategoryQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildAttributeCategoryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAttributeCategoryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAttributeCategoryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAttributeCategoryQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
* @method ChildAttributeCategoryQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
* @method ChildAttributeCategoryQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
*
* @method ChildAttributeCategoryQuery leftJoinAttribute($relationAlias = null) Adds a LEFT JOIN clause to the query using the Attribute relation
* @method ChildAttributeCategoryQuery rightJoinAttribute($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Attribute relation
* @method ChildAttributeCategoryQuery innerJoinAttribute($relationAlias = null) Adds a INNER JOIN clause to the query using the Attribute relation
*
* @method ChildAttributeCategory findOne(ConnectionInterface $con = null) Return the first ChildAttributeCategory matching the query
* @method ChildAttributeCategory findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAttributeCategory matching the query, or a new ChildAttributeCategory object populated from the query conditions when no match is found
*
* @method ChildAttributeCategory findOneById(int $id) Return the first ChildAttributeCategory filtered by the id column
* @method ChildAttributeCategory findOneByCategoryId(int $category_id) Return the first ChildAttributeCategory filtered by the category_id column
* @method ChildAttributeCategory findOneByAttributeId(int $attribute_id) Return the first ChildAttributeCategory filtered by the attribute_id column
* @method ChildAttributeCategory findOneByCreatedAt(string $created_at) Return the first ChildAttributeCategory filtered by the created_at column
* @method ChildAttributeCategory findOneByUpdatedAt(string $updated_at) Return the first ChildAttributeCategory filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAttributeCategory objects filtered by the id column
* @method array findByCategoryId(int $category_id) Return ChildAttributeCategory objects filtered by the category_id column
* @method array findByAttributeId(int $attribute_id) Return ChildAttributeCategory objects filtered by the attribute_id column
* @method array findByCreatedAt(string $created_at) Return ChildAttributeCategory objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAttributeCategory objects filtered by the updated_at column
*
*/
abstract class AttributeCategoryQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\AttributeCategoryQuery 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\\AttributeCategory', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAttributeCategoryQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAttributeCategoryQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\AttributeCategoryQuery) {
return $criteria;
}
$query = new \Thelia\Model\AttributeCategoryQuery();
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 ChildAttributeCategory|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AttributeCategoryTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AttributeCategoryTableMap::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 ChildAttributeCategory A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CATEGORY_ID, ATTRIBUTE_ID, CREATED_AT, UPDATED_AT FROM attribute_category 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 ChildAttributeCategory();
$obj->hydrate($row);
AttributeCategoryTableMap::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 ChildAttributeCategory|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 ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(AttributeCategoryTableMap::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 ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(AttributeCategoryTableMap::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 ChildAttributeCategoryQuery 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(AttributeCategoryTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AttributeCategoryTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCategoryTableMap::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 ChildAttributeCategoryQuery 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(AttributeCategoryTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($categoryId['max'])) {
$this->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $categoryId, $comparison);
}
/**
* Filter the query on the attribute_id column
*
* Example usage:
* <code>
* $query->filterByAttributeId(1234); // WHERE attribute_id = 1234
* $query->filterByAttributeId(array(12, 34)); // WHERE attribute_id IN (12, 34)
* $query->filterByAttributeId(array('min' => 12)); // WHERE attribute_id > 12
* </code>
*
* @see filterByAttribute()
*
* @param mixed $attributeId 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 ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function filterByAttributeId($attributeId = null, $comparison = null)
{
if (is_array($attributeId)) {
$useMinMax = false;
if (isset($attributeId['min'])) {
$this->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($attributeId['max'])) {
$this->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attributeId, $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 ChildAttributeCategoryQuery 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(AttributeCategoryTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(AttributeCategoryTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCategoryTableMap::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 ChildAttributeCategoryQuery 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(AttributeCategoryTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(AttributeCategoryTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCategoryTableMap::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 ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function filterByCategory($category, $comparison = null)
{
if ($category instanceof \Thelia\Model\Category) {
return $this
->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $category->getId(), $comparison);
} elseif ($category instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AttributeCategoryTableMap::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 ChildAttributeCategoryQuery 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\Attribute object
*
* @param \Thelia\Model\Attribute|ObjectCollection $attribute The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function filterByAttribute($attribute, $comparison = null)
{
if ($attribute instanceof \Thelia\Model\Attribute) {
return $this
->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attribute->getId(), $comparison);
} elseif ($attribute instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByAttribute() only accepts arguments of type \Thelia\Model\Attribute or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Attribute relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function joinAttribute($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Attribute');
// 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, 'Attribute');
}
return $this;
}
/**
* Use the Attribute relation Attribute 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\AttributeQuery A secondary query class using the current class as primary query
*/
public function useAttributeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAttribute($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Attribute', '\Thelia\Model\AttributeQuery');
}
/**
* Exclude object from result
*
* @param ChildAttributeCategory $attributeCategory Object to remove from the list of results
*
* @return ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function prune($attributeCategory = null)
{
if ($attributeCategory) {
$this->addUsingAlias(AttributeCategoryTableMap::ID, $attributeCategory->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the attribute_category 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(AttributeCategoryTableMap::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).
AttributeCategoryTableMap::clearInstancePool();
AttributeCategoryTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildAttributeCategory or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildAttributeCategory 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(AttributeCategoryTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AttributeCategoryTableMap::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();
AttributeCategoryTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AttributeCategoryTableMap::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 ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(AttributeCategoryTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(AttributeCategoryTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(AttributeCategoryTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(AttributeCategoryTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(AttributeCategoryTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildAttributeCategoryQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(AttributeCategoryTableMap::CREATED_AT);
}
} // AttributeCategoryQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,909 @@
<?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\AttributeCombination as ChildAttributeCombination;
use Thelia\Model\AttributeCombinationQuery as ChildAttributeCombinationQuery;
use Thelia\Model\Map\AttributeCombinationTableMap;
/**
* Base class that represents a query for the 'attribute_combination' table.
*
*
*
* @method ChildAttributeCombinationQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAttributeCombinationQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
* @method ChildAttributeCombinationQuery orderByCombinationId($order = Criteria::ASC) Order by the combination_id column
* @method ChildAttributeCombinationQuery orderByAttributeAvId($order = Criteria::ASC) Order by the attribute_av_id column
* @method ChildAttributeCombinationQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAttributeCombinationQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAttributeCombinationQuery groupById() Group by the id column
* @method ChildAttributeCombinationQuery groupByAttributeId() Group by the attribute_id column
* @method ChildAttributeCombinationQuery groupByCombinationId() Group by the combination_id column
* @method ChildAttributeCombinationQuery groupByAttributeAvId() Group by the attribute_av_id column
* @method ChildAttributeCombinationQuery groupByCreatedAt() Group by the created_at column
* @method ChildAttributeCombinationQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildAttributeCombinationQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAttributeCombinationQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAttributeCombinationQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAttributeCombinationQuery leftJoinAttribute($relationAlias = null) Adds a LEFT JOIN clause to the query using the Attribute relation
* @method ChildAttributeCombinationQuery rightJoinAttribute($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Attribute relation
* @method ChildAttributeCombinationQuery innerJoinAttribute($relationAlias = null) Adds a INNER JOIN clause to the query using the Attribute relation
*
* @method ChildAttributeCombinationQuery leftJoinAttributeAv($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeAv relation
* @method ChildAttributeCombinationQuery rightJoinAttributeAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeAv relation
* @method ChildAttributeCombinationQuery innerJoinAttributeAv($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeAv relation
*
* @method ChildAttributeCombinationQuery leftJoinCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the Combination relation
* @method ChildAttributeCombinationQuery rightJoinCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Combination relation
* @method ChildAttributeCombinationQuery innerJoinCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the Combination relation
*
* @method ChildAttributeCombination findOne(ConnectionInterface $con = null) Return the first ChildAttributeCombination matching the query
* @method ChildAttributeCombination findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAttributeCombination matching the query, or a new ChildAttributeCombination object populated from the query conditions when no match is found
*
* @method ChildAttributeCombination findOneById(int $id) Return the first ChildAttributeCombination filtered by the id column
* @method ChildAttributeCombination findOneByAttributeId(int $attribute_id) Return the first ChildAttributeCombination filtered by the attribute_id column
* @method ChildAttributeCombination findOneByCombinationId(int $combination_id) Return the first ChildAttributeCombination filtered by the combination_id column
* @method ChildAttributeCombination findOneByAttributeAvId(int $attribute_av_id) Return the first ChildAttributeCombination filtered by the attribute_av_id column
* @method ChildAttributeCombination findOneByCreatedAt(string $created_at) Return the first ChildAttributeCombination filtered by the created_at column
* @method ChildAttributeCombination findOneByUpdatedAt(string $updated_at) Return the first ChildAttributeCombination filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAttributeCombination objects filtered by the id column
* @method array findByAttributeId(int $attribute_id) Return ChildAttributeCombination objects filtered by the attribute_id column
* @method array findByCombinationId(int $combination_id) Return ChildAttributeCombination objects filtered by the combination_id column
* @method array findByAttributeAvId(int $attribute_av_id) Return ChildAttributeCombination objects filtered by the attribute_av_id column
* @method array findByCreatedAt(string $created_at) Return ChildAttributeCombination objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAttributeCombination objects filtered by the updated_at column
*
*/
abstract class AttributeCombinationQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\AttributeCombinationQuery 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\\AttributeCombination', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAttributeCombinationQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAttributeCombinationQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\AttributeCombinationQuery) {
return $criteria;
}
$query = new \Thelia\Model\AttributeCombinationQuery();
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, 56, 78), $con);
* </code>
*
* @param array[$id, $attribute_id, $combination_id, $attribute_av_id] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildAttributeCombination|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AttributeCombinationTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2], (string) $key[3]))))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AttributeCombinationTableMap::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 ChildAttributeCombination A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, ATTRIBUTE_ID, COMBINATION_ID, ATTRIBUTE_AV_ID, CREATED_AT, UPDATED_AT FROM attribute_combination WHERE ID = :p0 AND ATTRIBUTE_ID = :p1 AND COMBINATION_ID = :p2 AND ATTRIBUTE_AV_ID = :p3';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
$stmt->bindValue(':p2', $key[2], PDO::PARAM_INT);
$stmt->bindValue(':p3', $key[3], 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 ChildAttributeCombination();
$obj->hydrate($row);
AttributeCombinationTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2], (string) $key[3])));
}
$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 ChildAttributeCombination|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 ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(AttributeCombinationTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $key[1], Criteria::EQUAL);
$this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $key[2], Criteria::EQUAL);
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $key[3], 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 ChildAttributeCombinationQuery 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(AttributeCombinationTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_ID, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$cton2 = $this->getNewCriterion(AttributeCombinationTableMap::COMBINATION_ID, $key[2], Criteria::EQUAL);
$cton0->addAnd($cton2);
$cton3 = $this->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $key[3], Criteria::EQUAL);
$cton0->addAnd($cton3);
$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>
*
* @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 ChildAttributeCombinationQuery 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(AttributeCombinationTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AttributeCombinationTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCombinationTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the attribute_id column
*
* Example usage:
* <code>
* $query->filterByAttributeId(1234); // WHERE attribute_id = 1234
* $query->filterByAttributeId(array(12, 34)); // WHERE attribute_id IN (12, 34)
* $query->filterByAttributeId(array('min' => 12)); // WHERE attribute_id > 12
* </code>
*
* @see filterByAttribute()
*
* @param mixed $attributeId 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 ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function filterByAttributeId($attributeId = null, $comparison = null)
{
if (is_array($attributeId)) {
$useMinMax = false;
if (isset($attributeId['min'])) {
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($attributeId['max'])) {
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attributeId, $comparison);
}
/**
* Filter the query on the combination_id column
*
* Example usage:
* <code>
* $query->filterByCombinationId(1234); // WHERE combination_id = 1234
* $query->filterByCombinationId(array(12, 34)); // WHERE combination_id IN (12, 34)
* $query->filterByCombinationId(array('min' => 12)); // WHERE combination_id > 12
* </code>
*
* @see filterByCombination()
*
* @param mixed $combinationId 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 ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function filterByCombinationId($combinationId = null, $comparison = null)
{
if (is_array($combinationId)) {
$useMinMax = false;
if (isset($combinationId['min'])) {
$this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combinationId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($combinationId['max'])) {
$this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combinationId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combinationId, $comparison);
}
/**
* Filter the query on the attribute_av_id column
*
* Example usage:
* <code>
* $query->filterByAttributeAvId(1234); // WHERE attribute_av_id = 1234
* $query->filterByAttributeAvId(array(12, 34)); // WHERE attribute_av_id IN (12, 34)
* $query->filterByAttributeAvId(array('min' => 12)); // WHERE attribute_av_id > 12
* </code>
*
* @see filterByAttributeAv()
*
* @param mixed $attributeAvId 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 ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function filterByAttributeAvId($attributeAvId = null, $comparison = null)
{
if (is_array($attributeAvId)) {
$useMinMax = false;
if (isset($attributeAvId['min'])) {
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAvId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($attributeAvId['max'])) {
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAvId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAvId, $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 ChildAttributeCombinationQuery 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(AttributeCombinationTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(AttributeCombinationTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCombinationTableMap::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 ChildAttributeCombinationQuery 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(AttributeCombinationTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(AttributeCombinationTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeCombinationTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Attribute object
*
* @param \Thelia\Model\Attribute|ObjectCollection $attribute The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function filterByAttribute($attribute, $comparison = null)
{
if ($attribute instanceof \Thelia\Model\Attribute) {
return $this
->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attribute->getId(), $comparison);
} elseif ($attribute instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByAttribute() only accepts arguments of type \Thelia\Model\Attribute or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Attribute relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function joinAttribute($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Attribute');
// 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, 'Attribute');
}
return $this;
}
/**
* Use the Attribute relation Attribute 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\AttributeQuery A secondary query class using the current class as primary query
*/
public function useAttributeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAttribute($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Attribute', '\Thelia\Model\AttributeQuery');
}
/**
* Filter the query by a related \Thelia\Model\AttributeAv object
*
* @param \Thelia\Model\AttributeAv|ObjectCollection $attributeAv The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function filterByAttributeAv($attributeAv, $comparison = null)
{
if ($attributeAv instanceof \Thelia\Model\AttributeAv) {
return $this
->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAv->getId(), $comparison);
} elseif ($attributeAv instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAv->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByAttributeAv() only accepts arguments of type \Thelia\Model\AttributeAv or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AttributeAv relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function joinAttributeAv($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AttributeAv');
// 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, 'AttributeAv');
}
return $this;
}
/**
* Use the AttributeAv relation AttributeAv 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\AttributeAvQuery A secondary query class using the current class as primary query
*/
public function useAttributeAvQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAttributeAv($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeAv', '\Thelia\Model\AttributeAvQuery');
}
/**
* Filter the query by a related \Thelia\Model\Combination object
*
* @param \Thelia\Model\Combination|ObjectCollection $combination The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function filterByCombination($combination, $comparison = null)
{
if ($combination instanceof \Thelia\Model\Combination) {
return $this
->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combination->getId(), $comparison);
} elseif ($combination instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combination->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCombination() only accepts arguments of type \Thelia\Model\Combination or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Combination relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function joinCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Combination');
// 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, 'Combination');
}
return $this;
}
/**
* Use the Combination relation Combination 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\CombinationQuery A secondary query class using the current class as primary query
*/
public function useCombinationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCombination($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Combination', '\Thelia\Model\CombinationQuery');
}
/**
* Exclude object from result
*
* @param ChildAttributeCombination $attributeCombination Object to remove from the list of results
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function prune($attributeCombination = null)
{
if ($attributeCombination) {
$this->addCond('pruneCond0', $this->getAliasedColName(AttributeCombinationTableMap::ID), $attributeCombination->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(AttributeCombinationTableMap::ATTRIBUTE_ID), $attributeCombination->getAttributeId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond2', $this->getAliasedColName(AttributeCombinationTableMap::COMBINATION_ID), $attributeCombination->getCombinationId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond3', $this->getAliasedColName(AttributeCombinationTableMap::ATTRIBUTE_AV_ID), $attributeCombination->getAttributeAvId(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1', 'pruneCond2', 'pruneCond3'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the attribute_combination 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(AttributeCombinationTableMap::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).
AttributeCombinationTableMap::clearInstancePool();
AttributeCombinationTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildAttributeCombination or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildAttributeCombination 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(AttributeCombinationTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AttributeCombinationTableMap::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();
AttributeCombinationTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AttributeCombinationTableMap::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 ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(AttributeCombinationTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(AttributeCombinationTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(AttributeCombinationTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(AttributeCombinationTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(AttributeCombinationTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildAttributeCombinationQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(AttributeCombinationTableMap::CREATED_AT);
}
} // AttributeCombinationQuery

File diff suppressed because it is too large Load Diff

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

View File

@@ -0,0 +1,935 @@
<?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\Attribute as ChildAttribute;
use Thelia\Model\AttributeI18nQuery as ChildAttributeI18nQuery;
use Thelia\Model\AttributeQuery as ChildAttributeQuery;
use Thelia\Model\Map\AttributeTableMap;
/**
* Base class that represents a query for the 'attribute' table.
*
*
*
* @method ChildAttributeQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAttributeQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildAttributeQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAttributeQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAttributeQuery groupById() Group by the id column
* @method ChildAttributeQuery groupByPosition() Group by the position column
* @method ChildAttributeQuery groupByCreatedAt() Group by the created_at column
* @method ChildAttributeQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildAttributeQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAttributeQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAttributeQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAttributeQuery leftJoinAttributeAv($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeAv relation
* @method ChildAttributeQuery rightJoinAttributeAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeAv relation
* @method ChildAttributeQuery innerJoinAttributeAv($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeAv relation
*
* @method ChildAttributeQuery leftJoinAttributeCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeCombination relation
* @method ChildAttributeQuery rightJoinAttributeCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCombination relation
* @method ChildAttributeQuery innerJoinAttributeCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCombination relation
*
* @method ChildAttributeQuery leftJoinAttributeCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeCategory relation
* @method ChildAttributeQuery rightJoinAttributeCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCategory relation
* @method ChildAttributeQuery innerJoinAttributeCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCategory relation
*
* @method ChildAttributeQuery leftJoinAttributeI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeI18n relation
* @method ChildAttributeQuery rightJoinAttributeI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeI18n relation
* @method ChildAttributeQuery innerJoinAttributeI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeI18n relation
*
* @method ChildAttribute findOne(ConnectionInterface $con = null) Return the first ChildAttribute matching the query
* @method ChildAttribute findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAttribute matching the query, or a new ChildAttribute object populated from the query conditions when no match is found
*
* @method ChildAttribute findOneById(int $id) Return the first ChildAttribute filtered by the id column
* @method ChildAttribute findOneByPosition(int $position) Return the first ChildAttribute filtered by the position column
* @method ChildAttribute findOneByCreatedAt(string $created_at) Return the first ChildAttribute filtered by the created_at column
* @method ChildAttribute findOneByUpdatedAt(string $updated_at) Return the first ChildAttribute filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAttribute objects filtered by the id column
* @method array findByPosition(int $position) Return ChildAttribute objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildAttribute objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAttribute objects filtered by the updated_at column
*
*/
abstract class AttributeQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\AttributeQuery 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\\Attribute', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAttributeQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAttributeQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\AttributeQuery) {
return $criteria;
}
$query = new \Thelia\Model\AttributeQuery();
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 ChildAttribute|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AttributeTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AttributeTableMap::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 ChildAttribute A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, POSITION, CREATED_AT, UPDATED_AT FROM attribute 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 ChildAttribute();
$obj->hydrate($row);
AttributeTableMap::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 ChildAttribute|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 ChildAttributeQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(AttributeTableMap::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 ChildAttributeQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(AttributeTableMap::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 ChildAttributeQuery 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(AttributeTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AttributeTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeTableMap::ID, $id, $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 ChildAttributeQuery 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(AttributeTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(AttributeTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeTableMap::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 ChildAttributeQuery 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(AttributeTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(AttributeTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeTableMap::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 ChildAttributeQuery 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(AttributeTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(AttributeTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AttributeTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\AttributeAv object
*
* @param \Thelia\Model\AttributeAv|ObjectCollection $attributeAv the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function filterByAttributeAv($attributeAv, $comparison = null)
{
if ($attributeAv instanceof \Thelia\Model\AttributeAv) {
return $this
->addUsingAlias(AttributeTableMap::ID, $attributeAv->getAttributeId(), $comparison);
} elseif ($attributeAv instanceof ObjectCollection) {
return $this
->useAttributeAvQuery()
->filterByPrimaryKeys($attributeAv->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAttributeAv() only accepts arguments of type \Thelia\Model\AttributeAv or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AttributeAv relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function joinAttributeAv($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AttributeAv');
// 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, 'AttributeAv');
}
return $this;
}
/**
* Use the AttributeAv relation AttributeAv 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\AttributeAvQuery A secondary query class using the current class as primary query
*/
public function useAttributeAvQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAttributeAv($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeAv', '\Thelia\Model\AttributeAvQuery');
}
/**
* Filter the query by a related \Thelia\Model\AttributeCombination object
*
* @param \Thelia\Model\AttributeCombination|ObjectCollection $attributeCombination the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function filterByAttributeCombination($attributeCombination, $comparison = null)
{
if ($attributeCombination instanceof \Thelia\Model\AttributeCombination) {
return $this
->addUsingAlias(AttributeTableMap::ID, $attributeCombination->getAttributeId(), $comparison);
} elseif ($attributeCombination instanceof ObjectCollection) {
return $this
->useAttributeCombinationQuery()
->filterByPrimaryKeys($attributeCombination->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAttributeCombination() only accepts arguments of type \Thelia\Model\AttributeCombination or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AttributeCombination relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function joinAttributeCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AttributeCombination');
// 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, 'AttributeCombination');
}
return $this;
}
/**
* Use the AttributeCombination relation AttributeCombination 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\AttributeCombinationQuery A secondary query class using the current class as primary query
*/
public function useAttributeCombinationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAttributeCombination($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeCombination', '\Thelia\Model\AttributeCombinationQuery');
}
/**
* Filter the query by a related \Thelia\Model\AttributeCategory object
*
* @param \Thelia\Model\AttributeCategory|ObjectCollection $attributeCategory the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function filterByAttributeCategory($attributeCategory, $comparison = null)
{
if ($attributeCategory instanceof \Thelia\Model\AttributeCategory) {
return $this
->addUsingAlias(AttributeTableMap::ID, $attributeCategory->getAttributeId(), $comparison);
} elseif ($attributeCategory instanceof ObjectCollection) {
return $this
->useAttributeCategoryQuery()
->filterByPrimaryKeys($attributeCategory->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAttributeCategory() only accepts arguments of type \Thelia\Model\AttributeCategory or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AttributeCategory relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function joinAttributeCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AttributeCategory');
// 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, 'AttributeCategory');
}
return $this;
}
/**
* Use the AttributeCategory relation AttributeCategory 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\AttributeCategoryQuery A secondary query class using the current class as primary query
*/
public function useAttributeCategoryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAttributeCategory($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeCategory', '\Thelia\Model\AttributeCategoryQuery');
}
/**
* Filter the query by a related \Thelia\Model\AttributeI18n object
*
* @param \Thelia\Model\AttributeI18n|ObjectCollection $attributeI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function filterByAttributeI18n($attributeI18n, $comparison = null)
{
if ($attributeI18n instanceof \Thelia\Model\AttributeI18n) {
return $this
->addUsingAlias(AttributeTableMap::ID, $attributeI18n->getId(), $comparison);
} elseif ($attributeI18n instanceof ObjectCollection) {
return $this
->useAttributeI18nQuery()
->filterByPrimaryKeys($attributeI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAttributeI18n() only accepts arguments of type \Thelia\Model\AttributeI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AttributeI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function joinAttributeI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AttributeI18n');
// 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, 'AttributeI18n');
}
return $this;
}
/**
* Use the AttributeI18n relation AttributeI18n 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\AttributeI18nQuery A secondary query class using the current class as primary query
*/
public function useAttributeI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinAttributeI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeI18n', '\Thelia\Model\AttributeI18nQuery');
}
/**
* Filter the query by a related Category object
* using the attribute_category table as cross reference
*
* @param Category $category the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function filterByCategory($category, $comparison = Criteria::EQUAL)
{
return $this
->useAttributeCategoryQuery()
->filterByCategory($category, $comparison)
->endUse();
}
/**
* Exclude object from result
*
* @param ChildAttribute $attribute Object to remove from the list of results
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function prune($attribute = null)
{
if ($attribute) {
$this->addUsingAlias(AttributeTableMap::ID, $attribute->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the attribute 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(AttributeTableMap::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).
AttributeTableMap::clearInstancePool();
AttributeTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildAttribute or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildAttribute 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(AttributeTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AttributeTableMap::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();
AttributeTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AttributeTableMap::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 ChildAttributeQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(AttributeTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(AttributeTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(AttributeTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(AttributeTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(AttributeTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildAttributeQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(AttributeTableMap::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 ChildAttributeQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'AttributeI18n';
return $this
->joinAttributeI18n($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 ChildAttributeQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('AttributeI18n');
$this->with['AttributeI18n']->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 ChildAttributeI18nQuery A secondary query class using the current class as primary query
*/
public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeI18n', '\Thelia\Model\AttributeI18nQuery');
}
} // AttributeQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,607 @@
<?php
namespace 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\CategoryI18n as ChildCategoryI18n;
use Thelia\Model\CategoryI18nQuery as ChildCategoryI18nQuery;
use Thelia\Model\Map\CategoryI18nTableMap;
/**
* Base class that represents a query for the 'category_i18n' table.
*
*
*
* @method ChildCategoryI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCategoryI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildCategoryI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildCategoryI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildCategoryI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildCategoryI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
*
* @method ChildCategoryI18nQuery groupById() Group by the id column
* @method ChildCategoryI18nQuery groupByLocale() Group by the locale column
* @method ChildCategoryI18nQuery groupByTitle() Group by the title column
* @method ChildCategoryI18nQuery groupByDescription() Group by the description column
* @method ChildCategoryI18nQuery groupByChapo() Group by the chapo column
* @method ChildCategoryI18nQuery groupByPostscriptum() Group by the postscriptum column
*
* @method ChildCategoryI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCategoryI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCategoryI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCategoryI18nQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
* @method ChildCategoryI18nQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
* @method ChildCategoryI18nQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
*
* @method ChildCategoryI18n findOne(ConnectionInterface $con = null) Return the first ChildCategoryI18n matching the query
* @method ChildCategoryI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryI18n matching the query, or a new ChildCategoryI18n object populated from the query conditions when no match is found
*
* @method ChildCategoryI18n findOneById(int $id) Return the first ChildCategoryI18n filtered by the id column
* @method ChildCategoryI18n findOneByLocale(string $locale) Return the first ChildCategoryI18n filtered by the locale column
* @method ChildCategoryI18n findOneByTitle(string $title) Return the first ChildCategoryI18n filtered by the title column
* @method ChildCategoryI18n findOneByDescription(string $description) Return the first ChildCategoryI18n filtered by the description column
* @method ChildCategoryI18n findOneByChapo(string $chapo) Return the first ChildCategoryI18n filtered by the chapo column
* @method ChildCategoryI18n findOneByPostscriptum(string $postscriptum) Return the first ChildCategoryI18n filtered by the postscriptum column
*
* @method array findById(int $id) Return ChildCategoryI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildCategoryI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildCategoryI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildCategoryI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildCategoryI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildCategoryI18n objects filtered by the postscriptum column
*
*/
abstract class CategoryI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CategoryI18nQuery 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\\CategoryI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCategoryI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCategoryI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CategoryI18nQuery) {
return $criteria;
}
$query = new \Thelia\Model\CategoryI18nQuery();
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 ChildCategoryI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CategoryI18nTableMap::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(CategoryI18nTableMap::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 ChildCategoryI18n 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_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 ChildCategoryI18n();
$obj->hydrate($row);
CategoryI18nTableMap::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 ChildCategoryI18n|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 ChildCategoryI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(CategoryI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(CategoryI18nTableMap::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 ChildCategoryI18nQuery 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(CategoryI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(CategoryI18nTableMap::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 filterByCategory()
*
* @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 ChildCategoryI18nQuery 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(CategoryI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CategoryI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryI18nTableMap::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 ChildCategoryI18nQuery 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(CategoryI18nTableMap::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 ChildCategoryI18nQuery 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(CategoryI18nTableMap::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 ChildCategoryI18nQuery 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(CategoryI18nTableMap::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 ChildCategoryI18nQuery 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(CategoryI18nTableMap::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 ChildCategoryI18nQuery 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(CategoryI18nTableMap::POSTSCRIPTUM, $postscriptum, $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 ChildCategoryI18nQuery The current query, for fluid interface
*/
public function filterByCategory($category, $comparison = null)
{
if ($category instanceof \Thelia\Model\Category) {
return $this
->addUsingAlias(CategoryI18nTableMap::ID, $category->getId(), $comparison);
} elseif ($category instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CategoryI18nTableMap::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 ChildCategoryI18nQuery The current query, for fluid interface
*/
public function joinCategory($relationAlias = null, $joinType = 'LEFT 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 = 'LEFT JOIN')
{
return $this
->joinCategory($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Category', '\Thelia\Model\CategoryQuery');
}
/**
* Exclude object from result
*
* @param ChildCategoryI18n $categoryI18n Object to remove from the list of results
*
* @return ChildCategoryI18nQuery The current query, for fluid interface
*/
public function prune($categoryI18n = null)
{
if ($categoryI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(CategoryI18nTableMap::ID), $categoryI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(CategoryI18nTableMap::LOCALE), $categoryI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the category_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(CategoryI18nTableMap::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).
CategoryI18nTableMap::clearInstancePool();
CategoryI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCategoryI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCategoryI18n 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(CategoryI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CategoryI18nTableMap::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();
CategoryI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CategoryI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // CategoryI18nQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,829 @@
<?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\CategoryVersion as ChildCategoryVersion;
use Thelia\Model\CategoryVersionQuery as ChildCategoryVersionQuery;
use Thelia\Model\Map\CategoryVersionTableMap;
/**
* Base class that represents a query for the 'category_version' table.
*
*
*
* @method ChildCategoryVersionQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCategoryVersionQuery orderByParent($order = Criteria::ASC) Order by the parent column
* @method ChildCategoryVersionQuery orderByLink($order = Criteria::ASC) Order by the link column
* @method ChildCategoryVersionQuery orderByVisible($order = Criteria::ASC) Order by the visible column
* @method ChildCategoryVersionQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildCategoryVersionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCategoryVersionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
* @method ChildCategoryVersionQuery orderByVersion($order = Criteria::ASC) Order by the version column
* @method ChildCategoryVersionQuery orderByVersionCreatedAt($order = Criteria::ASC) Order by the version_created_at column
* @method ChildCategoryVersionQuery orderByVersionCreatedBy($order = Criteria::ASC) Order by the version_created_by column
*
* @method ChildCategoryVersionQuery groupById() Group by the id column
* @method ChildCategoryVersionQuery groupByParent() Group by the parent column
* @method ChildCategoryVersionQuery groupByLink() Group by the link column
* @method ChildCategoryVersionQuery groupByVisible() Group by the visible column
* @method ChildCategoryVersionQuery groupByPosition() Group by the position column
* @method ChildCategoryVersionQuery groupByCreatedAt() Group by the created_at column
* @method ChildCategoryVersionQuery groupByUpdatedAt() Group by the updated_at column
* @method ChildCategoryVersionQuery groupByVersion() Group by the version column
* @method ChildCategoryVersionQuery groupByVersionCreatedAt() Group by the version_created_at column
* @method ChildCategoryVersionQuery groupByVersionCreatedBy() Group by the version_created_by column
*
* @method ChildCategoryVersionQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCategoryVersionQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCategoryVersionQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCategoryVersionQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
* @method ChildCategoryVersionQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
* @method ChildCategoryVersionQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
*
* @method ChildCategoryVersion findOne(ConnectionInterface $con = null) Return the first ChildCategoryVersion matching the query
* @method ChildCategoryVersion findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCategoryVersion matching the query, or a new ChildCategoryVersion object populated from the query conditions when no match is found
*
* @method ChildCategoryVersion findOneById(int $id) Return the first ChildCategoryVersion filtered by the id column
* @method ChildCategoryVersion findOneByParent(int $parent) Return the first ChildCategoryVersion filtered by the parent column
* @method ChildCategoryVersion findOneByLink(string $link) Return the first ChildCategoryVersion filtered by the link column
* @method ChildCategoryVersion findOneByVisible(int $visible) Return the first ChildCategoryVersion filtered by the visible column
* @method ChildCategoryVersion findOneByPosition(int $position) Return the first ChildCategoryVersion filtered by the position column
* @method ChildCategoryVersion findOneByCreatedAt(string $created_at) Return the first ChildCategoryVersion filtered by the created_at column
* @method ChildCategoryVersion findOneByUpdatedAt(string $updated_at) Return the first ChildCategoryVersion filtered by the updated_at column
* @method ChildCategoryVersion findOneByVersion(int $version) Return the first ChildCategoryVersion filtered by the version column
* @method ChildCategoryVersion findOneByVersionCreatedAt(string $version_created_at) Return the first ChildCategoryVersion filtered by the version_created_at column
* @method ChildCategoryVersion findOneByVersionCreatedBy(string $version_created_by) Return the first ChildCategoryVersion filtered by the version_created_by column
*
* @method array findById(int $id) Return ChildCategoryVersion objects filtered by the id column
* @method array findByParent(int $parent) Return ChildCategoryVersion objects filtered by the parent column
* @method array findByLink(string $link) Return ChildCategoryVersion objects filtered by the link column
* @method array findByVisible(int $visible) Return ChildCategoryVersion objects filtered by the visible column
* @method array findByPosition(int $position) Return ChildCategoryVersion objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildCategoryVersion objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCategoryVersion objects filtered by the updated_at column
* @method array findByVersion(int $version) Return ChildCategoryVersion objects filtered by the version column
* @method array findByVersionCreatedAt(string $version_created_at) Return ChildCategoryVersion objects filtered by the version_created_at column
* @method array findByVersionCreatedBy(string $version_created_by) Return ChildCategoryVersion objects filtered by the version_created_by column
*
*/
abstract class CategoryVersionQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CategoryVersionQuery 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\\CategoryVersion', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCategoryVersionQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCategoryVersionQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CategoryVersionQuery) {
return $criteria;
}
$query = new \Thelia\Model\CategoryVersionQuery();
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, $version] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildCategoryVersion|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CategoryVersionTableMap::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(CategoryVersionTableMap::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 ChildCategoryVersion A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, PARENT, LINK, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM category_version WHERE ID = :p0 AND VERSION = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildCategoryVersion();
$obj->hydrate($row);
CategoryVersionTableMap::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 ChildCategoryVersion|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 ChildCategoryVersionQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(CategoryVersionTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(CategoryVersionTableMap::VERSION, $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 ChildCategoryVersionQuery 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(CategoryVersionTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(CategoryVersionTableMap::VERSION, $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 filterByCategory()
*
* @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 ChildCategoryVersionQuery 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(CategoryVersionTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CategoryVersionTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the parent column
*
* Example usage:
* <code>
* $query->filterByParent(1234); // WHERE parent = 1234
* $query->filterByParent(array(12, 34)); // WHERE parent IN (12, 34)
* $query->filterByParent(array('min' => 12)); // WHERE parent > 12
* </code>
*
* @param mixed $parent 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 ChildCategoryVersionQuery The current query, for fluid interface
*/
public function filterByParent($parent = null, $comparison = null)
{
if (is_array($parent)) {
$useMinMax = false;
if (isset($parent['min'])) {
$this->addUsingAlias(CategoryVersionTableMap::PARENT, $parent['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($parent['max'])) {
$this->addUsingAlias(CategoryVersionTableMap::PARENT, $parent['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::PARENT, $parent, $comparison);
}
/**
* Filter the query on the link column
*
* Example usage:
* <code>
* $query->filterByLink('fooValue'); // WHERE link = 'fooValue'
* $query->filterByLink('%fooValue%'); // WHERE link LIKE '%fooValue%'
* </code>
*
* @param string $link 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 ChildCategoryVersionQuery The current query, for fluid interface
*/
public function filterByLink($link = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($link)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $link)) {
$link = str_replace('*', '%', $link);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::LINK, $link, $comparison);
}
/**
* Filter the query on the visible column
*
* Example usage:
* <code>
* $query->filterByVisible(1234); // WHERE visible = 1234
* $query->filterByVisible(array(12, 34)); // WHERE visible IN (12, 34)
* $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
* </code>
*
* @param mixed $visible The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryVersionQuery The current query, for fluid interface
*/
public function filterByVisible($visible = null, $comparison = null)
{
if (is_array($visible)) {
$useMinMax = false;
if (isset($visible['min'])) {
$this->addUsingAlias(CategoryVersionTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($visible['max'])) {
$this->addUsingAlias(CategoryVersionTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::VISIBLE, $visible, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryVersionQuery 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(CategoryVersionTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(CategoryVersionTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::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 ChildCategoryVersionQuery 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(CategoryVersionTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(CategoryVersionTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::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 ChildCategoryVersionQuery 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(CategoryVersionTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(CategoryVersionTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query on the version column
*
* Example usage:
* <code>
* $query->filterByVersion(1234); // WHERE version = 1234
* $query->filterByVersion(array(12, 34)); // WHERE version IN (12, 34)
* $query->filterByVersion(array('min' => 12)); // WHERE version > 12
* </code>
*
* @param mixed $version 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 ChildCategoryVersionQuery The current query, for fluid interface
*/
public function filterByVersion($version = null, $comparison = null)
{
if (is_array($version)) {
$useMinMax = false;
if (isset($version['min'])) {
$this->addUsingAlias(CategoryVersionTableMap::VERSION, $version['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($version['max'])) {
$this->addUsingAlias(CategoryVersionTableMap::VERSION, $version['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::VERSION, $version, $comparison);
}
/**
* Filter the query on the version_created_at column
*
* Example usage:
* <code>
* $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14'
* $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14'
* $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at > '2011-03-13'
* </code>
*
* @param mixed $versionCreatedAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryVersionQuery The current query, for fluid interface
*/
public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null)
{
if (is_array($versionCreatedAt)) {
$useMinMax = false;
if (isset($versionCreatedAt['min'])) {
$this->addUsingAlias(CategoryVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($versionCreatedAt['max'])) {
$this->addUsingAlias(CategoryVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
}
/**
* Filter the query on the version_created_by column
*
* Example usage:
* <code>
* $query->filterByVersionCreatedBy('fooValue'); // WHERE version_created_by = 'fooValue'
* $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%'
* </code>
*
* @param string $versionCreatedBy The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryVersionQuery The current query, for fluid interface
*/
public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($versionCreatedBy)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $versionCreatedBy)) {
$versionCreatedBy = str_replace('*', '%', $versionCreatedBy);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CategoryVersionTableMap::VERSION_CREATED_BY, $versionCreatedBy, $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 ChildCategoryVersionQuery The current query, for fluid interface
*/
public function filterByCategory($category, $comparison = null)
{
if ($category instanceof \Thelia\Model\Category) {
return $this
->addUsingAlias(CategoryVersionTableMap::ID, $category->getId(), $comparison);
} elseif ($category instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CategoryVersionTableMap::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 ChildCategoryVersionQuery 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');
}
/**
* Exclude object from result
*
* @param ChildCategoryVersion $categoryVersion Object to remove from the list of results
*
* @return ChildCategoryVersionQuery The current query, for fluid interface
*/
public function prune($categoryVersion = null)
{
if ($categoryVersion) {
$this->addCond('pruneCond0', $this->getAliasedColName(CategoryVersionTableMap::ID), $categoryVersion->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(CategoryVersionTableMap::VERSION), $categoryVersion->getVersion(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the category_version 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(CategoryVersionTableMap::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).
CategoryVersionTableMap::clearInstancePool();
CategoryVersionTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCategoryVersion or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCategoryVersion 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(CategoryVersionTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CategoryVersionTableMap::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();
CategoryVersionTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CategoryVersionTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // CategoryVersionQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,694 @@
<?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\Combination as ChildCombination;
use Thelia\Model\CombinationQuery as ChildCombinationQuery;
use Thelia\Model\Map\CombinationTableMap;
/**
* Base class that represents a query for the 'combination' table.
*
*
*
* @method ChildCombinationQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCombinationQuery orderByRef($order = Criteria::ASC) Order by the ref column
* @method ChildCombinationQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCombinationQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildCombinationQuery groupById() Group by the id column
* @method ChildCombinationQuery groupByRef() Group by the ref column
* @method ChildCombinationQuery groupByCreatedAt() Group by the created_at column
* @method ChildCombinationQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildCombinationQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCombinationQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCombinationQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCombinationQuery leftJoinAttributeCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeCombination relation
* @method ChildCombinationQuery rightJoinAttributeCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCombination relation
* @method ChildCombinationQuery innerJoinAttributeCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCombination relation
*
* @method ChildCombinationQuery leftJoinStock($relationAlias = null) Adds a LEFT JOIN clause to the query using the Stock relation
* @method ChildCombinationQuery rightJoinStock($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Stock relation
* @method ChildCombinationQuery innerJoinStock($relationAlias = null) Adds a INNER JOIN clause to the query using the Stock relation
*
* @method ChildCombination findOne(ConnectionInterface $con = null) Return the first ChildCombination matching the query
* @method ChildCombination findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCombination matching the query, or a new ChildCombination object populated from the query conditions when no match is found
*
* @method ChildCombination findOneById(int $id) Return the first ChildCombination filtered by the id column
* @method ChildCombination findOneByRef(string $ref) Return the first ChildCombination filtered by the ref column
* @method ChildCombination findOneByCreatedAt(string $created_at) Return the first ChildCombination filtered by the created_at column
* @method ChildCombination findOneByUpdatedAt(string $updated_at) Return the first ChildCombination filtered by the updated_at column
*
* @method array findById(int $id) Return ChildCombination objects filtered by the id column
* @method array findByRef(string $ref) Return ChildCombination objects filtered by the ref column
* @method array findByCreatedAt(string $created_at) Return ChildCombination objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCombination objects filtered by the updated_at column
*
*/
abstract class CombinationQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CombinationQuery 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\\Combination', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCombinationQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCombinationQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CombinationQuery) {
return $criteria;
}
$query = new \Thelia\Model\CombinationQuery();
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 ChildCombination|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CombinationTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(CombinationTableMap::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 ChildCombination A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, REF, CREATED_AT, UPDATED_AT FROM combination 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 ChildCombination();
$obj->hydrate($row);
CombinationTableMap::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 ChildCombination|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 ChildCombinationQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CombinationTableMap::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 ChildCombinationQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CombinationTableMap::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 ChildCombinationQuery 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(CombinationTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CombinationTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CombinationTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the ref column
*
* Example usage:
* <code>
* $query->filterByRef('fooValue'); // WHERE ref = 'fooValue'
* $query->filterByRef('%fooValue%'); // WHERE ref LIKE '%fooValue%'
* </code>
*
* @param string $ref 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 ChildCombinationQuery The current query, for fluid interface
*/
public function filterByRef($ref = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($ref)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $ref)) {
$ref = str_replace('*', '%', $ref);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CombinationTableMap::REF, $ref, $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 ChildCombinationQuery 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(CombinationTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(CombinationTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CombinationTableMap::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 ChildCombinationQuery 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(CombinationTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(CombinationTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CombinationTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\AttributeCombination object
*
* @param \Thelia\Model\AttributeCombination|ObjectCollection $attributeCombination the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function filterByAttributeCombination($attributeCombination, $comparison = null)
{
if ($attributeCombination instanceof \Thelia\Model\AttributeCombination) {
return $this
->addUsingAlias(CombinationTableMap::ID, $attributeCombination->getCombinationId(), $comparison);
} elseif ($attributeCombination instanceof ObjectCollection) {
return $this
->useAttributeCombinationQuery()
->filterByPrimaryKeys($attributeCombination->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAttributeCombination() only accepts arguments of type \Thelia\Model\AttributeCombination or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AttributeCombination relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function joinAttributeCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AttributeCombination');
// 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, 'AttributeCombination');
}
return $this;
}
/**
* Use the AttributeCombination relation AttributeCombination 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\AttributeCombinationQuery A secondary query class using the current class as primary query
*/
public function useAttributeCombinationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAttributeCombination($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AttributeCombination', '\Thelia\Model\AttributeCombinationQuery');
}
/**
* Filter the query by a related \Thelia\Model\Stock object
*
* @param \Thelia\Model\Stock|ObjectCollection $stock the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function filterByStock($stock, $comparison = null)
{
if ($stock instanceof \Thelia\Model\Stock) {
return $this
->addUsingAlias(CombinationTableMap::ID, $stock->getCombinationId(), $comparison);
} elseif ($stock instanceof ObjectCollection) {
return $this
->useStockQuery()
->filterByPrimaryKeys($stock->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByStock() only accepts arguments of type \Thelia\Model\Stock or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Stock relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function joinStock($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Stock');
// 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, 'Stock');
}
return $this;
}
/**
* Use the Stock relation Stock 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\StockQuery A secondary query class using the current class as primary query
*/
public function useStockQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinStock($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Stock', '\Thelia\Model\StockQuery');
}
/**
* Exclude object from result
*
* @param ChildCombination $combination Object to remove from the list of results
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function prune($combination = null)
{
if ($combination) {
$this->addUsingAlias(CombinationTableMap::ID, $combination->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the combination 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(CombinationTableMap::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).
CombinationTableMap::clearInstancePool();
CombinationTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCombination or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCombination 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(CombinationTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CombinationTableMap::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();
CombinationTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CombinationTableMap::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 ChildCombinationQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(CombinationTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(CombinationTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(CombinationTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(CombinationTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(CombinationTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildCombinationQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(CombinationTableMap::CREATED_AT);
}
} // CombinationQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -0,0 +1,798 @@
<?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\Config as ChildConfig;
use Thelia\Model\ConfigI18nQuery as ChildConfigI18nQuery;
use Thelia\Model\ConfigQuery as ChildConfigQuery;
use Thelia\Model\Map\ConfigTableMap;
/**
* Base class that represents a query for the 'config' table.
*
*
*
* @method ChildConfigQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildConfigQuery orderByName($order = Criteria::ASC) Order by the name column
* @method ChildConfigQuery orderByValue($order = Criteria::ASC) Order by the value column
* @method ChildConfigQuery orderBySecured($order = Criteria::ASC) Order by the secured column
* @method ChildConfigQuery orderByHidden($order = Criteria::ASC) Order by the hidden column
* @method ChildConfigQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildConfigQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildConfigQuery groupById() Group by the id column
* @method ChildConfigQuery groupByName() Group by the name column
* @method ChildConfigQuery groupByValue() Group by the value column
* @method ChildConfigQuery groupBySecured() Group by the secured column
* @method ChildConfigQuery groupByHidden() Group by the hidden column
* @method ChildConfigQuery groupByCreatedAt() Group by the created_at column
* @method ChildConfigQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildConfigQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildConfigQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildConfigQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildConfigQuery leftJoinConfigI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ConfigI18n relation
* @method ChildConfigQuery rightJoinConfigI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ConfigI18n relation
* @method ChildConfigQuery innerJoinConfigI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ConfigI18n relation
*
* @method ChildConfig findOne(ConnectionInterface $con = null) Return the first ChildConfig matching the query
* @method ChildConfig findOneOrCreate(ConnectionInterface $con = null) Return the first ChildConfig matching the query, or a new ChildConfig object populated from the query conditions when no match is found
*
* @method ChildConfig findOneById(int $id) Return the first ChildConfig filtered by the id column
* @method ChildConfig findOneByName(string $name) Return the first ChildConfig filtered by the name column
* @method ChildConfig findOneByValue(string $value) Return the first ChildConfig filtered by the value column
* @method ChildConfig findOneBySecured(int $secured) Return the first ChildConfig filtered by the secured column
* @method ChildConfig findOneByHidden(int $hidden) Return the first ChildConfig filtered by the hidden column
* @method ChildConfig findOneByCreatedAt(string $created_at) Return the first ChildConfig filtered by the created_at column
* @method ChildConfig findOneByUpdatedAt(string $updated_at) Return the first ChildConfig filtered by the updated_at column
*
* @method array findById(int $id) Return ChildConfig objects filtered by the id column
* @method array findByName(string $name) Return ChildConfig objects filtered by the name column
* @method array findByValue(string $value) Return ChildConfig objects filtered by the value column
* @method array findBySecured(int $secured) Return ChildConfig objects filtered by the secured column
* @method array findByHidden(int $hidden) Return ChildConfig objects filtered by the hidden column
* @method array findByCreatedAt(string $created_at) Return ChildConfig objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildConfig objects filtered by the updated_at column
*
*/
abstract class ConfigQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\ConfigQuery 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\\Config', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildConfigQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildConfigQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\ConfigQuery) {
return $criteria;
}
$query = new \Thelia\Model\ConfigQuery();
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 ChildConfig|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = ConfigTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(ConfigTableMap::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 ChildConfig A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, NAME, VALUE, SECURED, HIDDEN, CREATED_AT, UPDATED_AT FROM config 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 ChildConfig();
$obj->hydrate($row);
ConfigTableMap::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 ChildConfig|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 ChildConfigQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(ConfigTableMap::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 ChildConfigQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(ConfigTableMap::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 ChildConfigQuery 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(ConfigTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(ConfigTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ConfigTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the name column
*
* Example usage:
* <code>
* $query->filterByName('fooValue'); // WHERE name = 'fooValue'
* $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
* </code>
*
* @param string $name 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 ChildConfigQuery The current query, for fluid interface
*/
public function filterByName($name = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($name)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $name)) {
$name = str_replace('*', '%', $name);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ConfigTableMap::NAME, $name, $comparison);
}
/**
* Filter the query on the value column
*
* Example usage:
* <code>
* $query->filterByValue('fooValue'); // WHERE value = 'fooValue'
* $query->filterByValue('%fooValue%'); // WHERE value LIKE '%fooValue%'
* </code>
*
* @param string $value 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 ChildConfigQuery The current query, for fluid interface
*/
public function filterByValue($value = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($value)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $value)) {
$value = str_replace('*', '%', $value);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ConfigTableMap::VALUE, $value, $comparison);
}
/**
* Filter the query on the secured column
*
* Example usage:
* <code>
* $query->filterBySecured(1234); // WHERE secured = 1234
* $query->filterBySecured(array(12, 34)); // WHERE secured IN (12, 34)
* $query->filterBySecured(array('min' => 12)); // WHERE secured > 12
* </code>
*
* @param mixed $secured 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 ChildConfigQuery The current query, for fluid interface
*/
public function filterBySecured($secured = null, $comparison = null)
{
if (is_array($secured)) {
$useMinMax = false;
if (isset($secured['min'])) {
$this->addUsingAlias(ConfigTableMap::SECURED, $secured['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($secured['max'])) {
$this->addUsingAlias(ConfigTableMap::SECURED, $secured['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ConfigTableMap::SECURED, $secured, $comparison);
}
/**
* Filter the query on the hidden column
*
* Example usage:
* <code>
* $query->filterByHidden(1234); // WHERE hidden = 1234
* $query->filterByHidden(array(12, 34)); // WHERE hidden IN (12, 34)
* $query->filterByHidden(array('min' => 12)); // WHERE hidden > 12
* </code>
*
* @param mixed $hidden 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 ChildConfigQuery The current query, for fluid interface
*/
public function filterByHidden($hidden = null, $comparison = null)
{
if (is_array($hidden)) {
$useMinMax = false;
if (isset($hidden['min'])) {
$this->addUsingAlias(ConfigTableMap::HIDDEN, $hidden['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($hidden['max'])) {
$this->addUsingAlias(ConfigTableMap::HIDDEN, $hidden['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ConfigTableMap::HIDDEN, $hidden, $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 ChildConfigQuery 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(ConfigTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(ConfigTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ConfigTableMap::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 ChildConfigQuery 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(ConfigTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(ConfigTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ConfigTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\ConfigI18n object
*
* @param \Thelia\Model\ConfigI18n|ObjectCollection $configI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildConfigQuery The current query, for fluid interface
*/
public function filterByConfigI18n($configI18n, $comparison = null)
{
if ($configI18n instanceof \Thelia\Model\ConfigI18n) {
return $this
->addUsingAlias(ConfigTableMap::ID, $configI18n->getId(), $comparison);
} elseif ($configI18n instanceof ObjectCollection) {
return $this
->useConfigI18nQuery()
->filterByPrimaryKeys($configI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByConfigI18n() only accepts arguments of type \Thelia\Model\ConfigI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the ConfigI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildConfigQuery The current query, for fluid interface
*/
public function joinConfigI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ConfigI18n');
// 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, 'ConfigI18n');
}
return $this;
}
/**
* Use the ConfigI18n relation ConfigI18n 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\ConfigI18nQuery A secondary query class using the current class as primary query
*/
public function useConfigI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinConfigI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ConfigI18n', '\Thelia\Model\ConfigI18nQuery');
}
/**
* Exclude object from result
*
* @param ChildConfig $config Object to remove from the list of results
*
* @return ChildConfigQuery The current query, for fluid interface
*/
public function prune($config = null)
{
if ($config) {
$this->addUsingAlias(ConfigTableMap::ID, $config->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the config 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(ConfigTableMap::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).
ConfigTableMap::clearInstancePool();
ConfigTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildConfig or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildConfig 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(ConfigTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(ConfigTableMap::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();
ConfigTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
ConfigTableMap::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 ChildConfigQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(ConfigTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildConfigQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(ConfigTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildConfigQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(ConfigTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildConfigQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(ConfigTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildConfigQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(ConfigTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildConfigQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(ConfigTableMap::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 ChildConfigQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'ConfigI18n';
return $this
->joinConfigI18n($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 ChildConfigQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('ConfigI18n');
$this->with['ConfigI18n']->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 ChildConfigI18nQuery A secondary query class using the current class as primary query
*/
public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ConfigI18n', '\Thelia\Model\ConfigI18nQuery');
}
} // ConfigQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,930 @@
<?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\ContentAssoc as ChildContentAssoc;
use Thelia\Model\ContentAssocQuery as ChildContentAssocQuery;
use Thelia\Model\Map\ContentAssocTableMap;
/**
* Base class that represents a query for the 'content_assoc' table.
*
*
*
* @method ChildContentAssocQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildContentAssocQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
* @method ChildContentAssocQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
* @method ChildContentAssocQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
* @method ChildContentAssocQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildContentAssocQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildContentAssocQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildContentAssocQuery groupById() Group by the id column
* @method ChildContentAssocQuery groupByCategoryId() Group by the category_id column
* @method ChildContentAssocQuery groupByProductId() Group by the product_id column
* @method ChildContentAssocQuery groupByContentId() Group by the content_id column
* @method ChildContentAssocQuery groupByPosition() Group by the position column
* @method ChildContentAssocQuery groupByCreatedAt() Group by the created_at column
* @method ChildContentAssocQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildContentAssocQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildContentAssocQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildContentAssocQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildContentAssocQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
* @method ChildContentAssocQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
* @method ChildContentAssocQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
*
* @method ChildContentAssocQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
* @method ChildContentAssocQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
* @method ChildContentAssocQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
*
* @method ChildContentAssocQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
* @method ChildContentAssocQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
* @method ChildContentAssocQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
*
* @method ChildContentAssoc findOne(ConnectionInterface $con = null) Return the first ChildContentAssoc matching the query
* @method ChildContentAssoc findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentAssoc matching the query, or a new ChildContentAssoc object populated from the query conditions when no match is found
*
* @method ChildContentAssoc findOneById(int $id) Return the first ChildContentAssoc filtered by the id column
* @method ChildContentAssoc findOneByCategoryId(int $category_id) Return the first ChildContentAssoc filtered by the category_id column
* @method ChildContentAssoc findOneByProductId(int $product_id) Return the first ChildContentAssoc filtered by the product_id column
* @method ChildContentAssoc findOneByContentId(int $content_id) Return the first ChildContentAssoc filtered by the content_id column
* @method ChildContentAssoc findOneByPosition(int $position) Return the first ChildContentAssoc filtered by the position column
* @method ChildContentAssoc findOneByCreatedAt(string $created_at) Return the first ChildContentAssoc filtered by the created_at column
* @method ChildContentAssoc findOneByUpdatedAt(string $updated_at) Return the first ChildContentAssoc filtered by the updated_at column
*
* @method array findById(int $id) Return ChildContentAssoc objects filtered by the id column
* @method array findByCategoryId(int $category_id) Return ChildContentAssoc objects filtered by the category_id column
* @method array findByProductId(int $product_id) Return ChildContentAssoc objects filtered by the product_id column
* @method array findByContentId(int $content_id) Return ChildContentAssoc objects filtered by the content_id column
* @method array findByPosition(int $position) Return ChildContentAssoc objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildContentAssoc objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildContentAssoc objects filtered by the updated_at column
*
*/
abstract class ContentAssocQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\ContentAssocQuery 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\\ContentAssoc', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildContentAssocQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildContentAssocQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\ContentAssocQuery) {
return $criteria;
}
$query = new \Thelia\Model\ContentAssocQuery();
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 ChildContentAssoc|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = ContentAssocTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(ContentAssocTableMap::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 ChildContentAssoc A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CATEGORY_ID, PRODUCT_ID, CONTENT_ID, POSITION, CREATED_AT, UPDATED_AT FROM content_assoc 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 ChildContentAssoc();
$obj->hydrate($row);
ContentAssocTableMap::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 ChildContentAssoc|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 ChildContentAssocQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(ContentAssocTableMap::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 ChildContentAssocQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(ContentAssocTableMap::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 ChildContentAssocQuery 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(ContentAssocTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(ContentAssocTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentAssocTableMap::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 ChildContentAssocQuery 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(ContentAssocTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($categoryId['max'])) {
$this->addUsingAlias(ContentAssocTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentAssocTableMap::CATEGORY_ID, $categoryId, $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 ChildContentAssocQuery 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(ContentAssocTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($productId['max'])) {
$this->addUsingAlias(ContentAssocTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentAssocTableMap::PRODUCT_ID, $productId, $comparison);
}
/**
* Filter the query on the content_id column
*
* Example usage:
* <code>
* $query->filterByContentId(1234); // WHERE content_id = 1234
* $query->filterByContentId(array(12, 34)); // WHERE content_id IN (12, 34)
* $query->filterByContentId(array('min' => 12)); // WHERE content_id > 12
* </code>
*
* @see filterByContent()
*
* @param mixed $contentId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentAssocQuery 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(ContentAssocTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($contentId['max'])) {
$this->addUsingAlias(ContentAssocTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentAssocTableMap::CONTENT_ID, $contentId, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentAssocQuery 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(ContentAssocTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(ContentAssocTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentAssocTableMap::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 ChildContentAssocQuery 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(ContentAssocTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(ContentAssocTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentAssocTableMap::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 ChildContentAssocQuery 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(ContentAssocTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(ContentAssocTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentAssocTableMap::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 ChildContentAssocQuery The current query, for fluid interface
*/
public function filterByCategory($category, $comparison = null)
{
if ($category instanceof \Thelia\Model\Category) {
return $this
->addUsingAlias(ContentAssocTableMap::CATEGORY_ID, $category->getId(), $comparison);
} elseif ($category instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ContentAssocTableMap::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 ChildContentAssocQuery The current query, for fluid interface
*/
public function joinCategory($relationAlias = null, $joinType = Criteria::LEFT_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::LEFT_JOIN)
{
return $this
->joinCategory($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Category', '\Thelia\Model\CategoryQuery');
}
/**
* 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 ChildContentAssocQuery The current query, for fluid interface
*/
public function filterByProduct($product, $comparison = null)
{
if ($product instanceof \Thelia\Model\Product) {
return $this
->addUsingAlias(ContentAssocTableMap::PRODUCT_ID, $product->getId(), $comparison);
} elseif ($product instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ContentAssocTableMap::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 ChildContentAssocQuery The current query, for fluid interface
*/
public function joinProduct($relationAlias = null, $joinType = Criteria::LEFT_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::LEFT_JOIN)
{
return $this
->joinProduct($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Product', '\Thelia\Model\ProductQuery');
}
/**
* Filter the query by a related \Thelia\Model\Content object
*
* @param \Thelia\Model\Content|ObjectCollection $content The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentAssocQuery The current query, for fluid interface
*/
public function filterByContent($content, $comparison = null)
{
if ($content instanceof \Thelia\Model\Content) {
return $this
->addUsingAlias(ContentAssocTableMap::CONTENT_ID, $content->getId(), $comparison);
} elseif ($content instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ContentAssocTableMap::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 ChildContentAssocQuery The current query, for fluid interface
*/
public function joinContent($relationAlias = null, $joinType = Criteria::LEFT_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::LEFT_JOIN)
{
return $this
->joinContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Content', '\Thelia\Model\ContentQuery');
}
/**
* Exclude object from result
*
* @param ChildContentAssoc $contentAssoc Object to remove from the list of results
*
* @return ChildContentAssocQuery The current query, for fluid interface
*/
public function prune($contentAssoc = null)
{
if ($contentAssoc) {
$this->addUsingAlias(ContentAssocTableMap::ID, $contentAssoc->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the content_assoc 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(ContentAssocTableMap::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).
ContentAssocTableMap::clearInstancePool();
ContentAssocTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildContentAssoc or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildContentAssoc 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(ContentAssocTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(ContentAssocTableMap::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();
ContentAssocTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
ContentAssocTableMap::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 ChildContentAssocQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(ContentAssocTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildContentAssocQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(ContentAssocTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildContentAssocQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(ContentAssocTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildContentAssocQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(ContentAssocTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildContentAssocQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(ContentAssocTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildContentAssocQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(ContentAssocTableMap::CREATED_AT);
}
} // ContentAssocQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,728 @@
<?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\ContentFolder as ChildContentFolder;
use Thelia\Model\ContentFolderQuery as ChildContentFolderQuery;
use Thelia\Model\Map\ContentFolderTableMap;
/**
* Base class that represents a query for the 'content_folder' table.
*
*
*
* @method ChildContentFolderQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
* @method ChildContentFolderQuery orderByFolderId($order = Criteria::ASC) Order by the folder_id column
* @method ChildContentFolderQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildContentFolderQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildContentFolderQuery groupByContentId() Group by the content_id column
* @method ChildContentFolderQuery groupByFolderId() Group by the folder_id column
* @method ChildContentFolderQuery groupByCreatedAt() Group by the created_at column
* @method ChildContentFolderQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildContentFolderQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildContentFolderQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildContentFolderQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildContentFolderQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
* @method ChildContentFolderQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
* @method ChildContentFolderQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
*
* @method ChildContentFolderQuery leftJoinFolder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Folder relation
* @method ChildContentFolderQuery rightJoinFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Folder relation
* @method ChildContentFolderQuery innerJoinFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the Folder relation
*
* @method ChildContentFolder findOne(ConnectionInterface $con = null) Return the first ChildContentFolder matching the query
* @method ChildContentFolder findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentFolder matching the query, or a new ChildContentFolder object populated from the query conditions when no match is found
*
* @method ChildContentFolder findOneByContentId(int $content_id) Return the first ChildContentFolder filtered by the content_id column
* @method ChildContentFolder findOneByFolderId(int $folder_id) Return the first ChildContentFolder filtered by the folder_id column
* @method ChildContentFolder findOneByCreatedAt(string $created_at) Return the first ChildContentFolder filtered by the created_at column
* @method ChildContentFolder findOneByUpdatedAt(string $updated_at) Return the first ChildContentFolder filtered by the updated_at column
*
* @method array findByContentId(int $content_id) Return ChildContentFolder objects filtered by the content_id column
* @method array findByFolderId(int $folder_id) Return ChildContentFolder objects filtered by the folder_id column
* @method array findByCreatedAt(string $created_at) Return ChildContentFolder objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildContentFolder objects filtered by the updated_at column
*
*/
abstract class ContentFolderQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\ContentFolderQuery 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\\ContentFolder', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildContentFolderQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildContentFolderQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\ContentFolderQuery) {
return $criteria;
}
$query = new \Thelia\Model\ContentFolderQuery();
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[$content_id, $folder_id] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildContentFolder|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = ContentFolderTableMap::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(ContentFolderTableMap::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 ChildContentFolder A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT CONTENT_ID, FOLDER_ID, CREATED_AT, UPDATED_AT FROM content_folder WHERE CONTENT_ID = :p0 AND FOLDER_ID = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildContentFolder();
$obj->hydrate($row);
ContentFolderTableMap::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 ChildContentFolder|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 ChildContentFolderQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $key[1], Criteria::EQUAL);
return $this;
}
/**
* Filter the query by a list of primary keys
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildContentFolderQuery 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(ContentFolderTableMap::CONTENT_ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(ContentFolderTableMap::FOLDER_ID, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$this->addOr($cton0);
}
return $this;
}
/**
* 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 ChildContentFolderQuery 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(ContentFolderTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($contentId['max'])) {
$this->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $contentId, $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 ChildContentFolderQuery 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(ContentFolderTableMap::FOLDER_ID, $folderId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($folderId['max'])) {
$this->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folderId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folderId, $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 ChildContentFolderQuery 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(ContentFolderTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(ContentFolderTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentFolderTableMap::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 ChildContentFolderQuery 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(ContentFolderTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(ContentFolderTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentFolderTableMap::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 ChildContentFolderQuery The current query, for fluid interface
*/
public function filterByContent($content, $comparison = null)
{
if ($content instanceof \Thelia\Model\Content) {
return $this
->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $content->getId(), $comparison);
} elseif ($content instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ContentFolderTableMap::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 ChildContentFolderQuery 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\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 ChildContentFolderQuery The current query, for fluid interface
*/
public function filterByFolder($folder, $comparison = null)
{
if ($folder instanceof \Thelia\Model\Folder) {
return $this
->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folder->getId(), $comparison);
} elseif ($folder instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ContentFolderTableMap::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 ChildContentFolderQuery 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');
}
/**
* Exclude object from result
*
* @param ChildContentFolder $contentFolder Object to remove from the list of results
*
* @return ChildContentFolderQuery The current query, for fluid interface
*/
public function prune($contentFolder = null)
{
if ($contentFolder) {
$this->addCond('pruneCond0', $this->getAliasedColName(ContentFolderTableMap::CONTENT_ID), $contentFolder->getContentId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(ContentFolderTableMap::FOLDER_ID), $contentFolder->getFolderId(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the content_folder 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(ContentFolderTableMap::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).
ContentFolderTableMap::clearInstancePool();
ContentFolderTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildContentFolder or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildContentFolder 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(ContentFolderTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(ContentFolderTableMap::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();
ContentFolderTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
ContentFolderTableMap::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 ChildContentFolderQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(ContentFolderTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildContentFolderQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(ContentFolderTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildContentFolderQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(ContentFolderTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildContentFolderQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(ContentFolderTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildContentFolderQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(ContentFolderTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildContentFolderQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(ContentFolderTableMap::CREATED_AT);
}
} // ContentFolderQuery

File diff suppressed because it is too large Load Diff

View 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\ContentI18n as ChildContentI18n;
use Thelia\Model\ContentI18nQuery as ChildContentI18nQuery;
use Thelia\Model\Map\ContentI18nTableMap;
/**
* Base class that represents a query for the 'content_i18n' table.
*
*
*
* @method ChildContentI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildContentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildContentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildContentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildContentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildContentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
*
* @method ChildContentI18nQuery groupById() Group by the id column
* @method ChildContentI18nQuery groupByLocale() Group by the locale column
* @method ChildContentI18nQuery groupByTitle() Group by the title column
* @method ChildContentI18nQuery groupByDescription() Group by the description column
* @method ChildContentI18nQuery groupByChapo() Group by the chapo column
* @method ChildContentI18nQuery groupByPostscriptum() Group by the postscriptum column
*
* @method ChildContentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildContentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildContentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildContentI18nQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
* @method ChildContentI18nQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
* @method ChildContentI18nQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
*
* @method ChildContentI18n findOne(ConnectionInterface $con = null) Return the first ChildContentI18n matching the query
* @method ChildContentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentI18n matching the query, or a new ChildContentI18n object populated from the query conditions when no match is found
*
* @method ChildContentI18n findOneById(int $id) Return the first ChildContentI18n filtered by the id column
* @method ChildContentI18n findOneByLocale(string $locale) Return the first ChildContentI18n filtered by the locale column
* @method ChildContentI18n findOneByTitle(string $title) Return the first ChildContentI18n filtered by the title column
* @method ChildContentI18n findOneByDescription(string $description) Return the first ChildContentI18n filtered by the description column
* @method ChildContentI18n findOneByChapo(string $chapo) Return the first ChildContentI18n filtered by the chapo column
* @method ChildContentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildContentI18n filtered by the postscriptum column
*
* @method array findById(int $id) Return ChildContentI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildContentI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildContentI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildContentI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildContentI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildContentI18n objects filtered by the postscriptum column
*
*/
abstract class ContentI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\ContentI18nQuery 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\\ContentI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildContentI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildContentI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\ContentI18nQuery) {
return $criteria;
}
$query = new \Thelia\Model\ContentI18nQuery();
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 ChildContentI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = ContentI18nTableMap::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(ContentI18nTableMap::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 ChildContentI18n 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_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 ChildContentI18n();
$obj->hydrate($row);
ContentI18nTableMap::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 ChildContentI18n|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 ChildContentI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(ContentI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(ContentI18nTableMap::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 ChildContentI18nQuery 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(ContentI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(ContentI18nTableMap::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 filterByContent()
*
* @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 ChildContentI18nQuery 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(ContentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(ContentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentI18nTableMap::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 ChildContentI18nQuery 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(ContentI18nTableMap::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 ChildContentI18nQuery 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(ContentI18nTableMap::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 ChildContentI18nQuery 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(ContentI18nTableMap::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 ChildContentI18nQuery 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(ContentI18nTableMap::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 ChildContentI18nQuery 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(ContentI18nTableMap::POSTSCRIPTUM, $postscriptum, $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 ChildContentI18nQuery The current query, for fluid interface
*/
public function filterByContent($content, $comparison = null)
{
if ($content instanceof \Thelia\Model\Content) {
return $this
->addUsingAlias(ContentI18nTableMap::ID, $content->getId(), $comparison);
} elseif ($content instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ContentI18nTableMap::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 ChildContentI18nQuery The current query, for fluid interface
*/
public function joinContent($relationAlias = null, $joinType = 'LEFT 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 = 'LEFT JOIN')
{
return $this
->joinContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Content', '\Thelia\Model\ContentQuery');
}
/**
* Exclude object from result
*
* @param ChildContentI18n $contentI18n Object to remove from the list of results
*
* @return ChildContentI18nQuery The current query, for fluid interface
*/
public function prune($contentI18n = null)
{
if ($contentI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(ContentI18nTableMap::ID), $contentI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(ContentI18nTableMap::LOCALE), $contentI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the content_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(ContentI18nTableMap::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).
ContentI18nTableMap::clearInstancePool();
ContentI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildContentI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildContentI18n 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(ContentI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(ContentI18nTableMap::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();
ContentI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
ContentI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // ContentI18nQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,751 @@
<?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\ContentVersion as ChildContentVersion;
use Thelia\Model\ContentVersionQuery as ChildContentVersionQuery;
use Thelia\Model\Map\ContentVersionTableMap;
/**
* Base class that represents a query for the 'content_version' table.
*
*
*
* @method ChildContentVersionQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildContentVersionQuery orderByVisible($order = Criteria::ASC) Order by the visible column
* @method ChildContentVersionQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildContentVersionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildContentVersionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
* @method ChildContentVersionQuery orderByVersion($order = Criteria::ASC) Order by the version column
* @method ChildContentVersionQuery orderByVersionCreatedAt($order = Criteria::ASC) Order by the version_created_at column
* @method ChildContentVersionQuery orderByVersionCreatedBy($order = Criteria::ASC) Order by the version_created_by column
*
* @method ChildContentVersionQuery groupById() Group by the id column
* @method ChildContentVersionQuery groupByVisible() Group by the visible column
* @method ChildContentVersionQuery groupByPosition() Group by the position column
* @method ChildContentVersionQuery groupByCreatedAt() Group by the created_at column
* @method ChildContentVersionQuery groupByUpdatedAt() Group by the updated_at column
* @method ChildContentVersionQuery groupByVersion() Group by the version column
* @method ChildContentVersionQuery groupByVersionCreatedAt() Group by the version_created_at column
* @method ChildContentVersionQuery groupByVersionCreatedBy() Group by the version_created_by column
*
* @method ChildContentVersionQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildContentVersionQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildContentVersionQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildContentVersionQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
* @method ChildContentVersionQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
* @method ChildContentVersionQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
*
* @method ChildContentVersion findOne(ConnectionInterface $con = null) Return the first ChildContentVersion matching the query
* @method ChildContentVersion findOneOrCreate(ConnectionInterface $con = null) Return the first ChildContentVersion matching the query, or a new ChildContentVersion object populated from the query conditions when no match is found
*
* @method ChildContentVersion findOneById(int $id) Return the first ChildContentVersion filtered by the id column
* @method ChildContentVersion findOneByVisible(int $visible) Return the first ChildContentVersion filtered by the visible column
* @method ChildContentVersion findOneByPosition(int $position) Return the first ChildContentVersion filtered by the position column
* @method ChildContentVersion findOneByCreatedAt(string $created_at) Return the first ChildContentVersion filtered by the created_at column
* @method ChildContentVersion findOneByUpdatedAt(string $updated_at) Return the first ChildContentVersion filtered by the updated_at column
* @method ChildContentVersion findOneByVersion(int $version) Return the first ChildContentVersion filtered by the version column
* @method ChildContentVersion findOneByVersionCreatedAt(string $version_created_at) Return the first ChildContentVersion filtered by the version_created_at column
* @method ChildContentVersion findOneByVersionCreatedBy(string $version_created_by) Return the first ChildContentVersion filtered by the version_created_by column
*
* @method array findById(int $id) Return ChildContentVersion objects filtered by the id column
* @method array findByVisible(int $visible) Return ChildContentVersion objects filtered by the visible column
* @method array findByPosition(int $position) Return ChildContentVersion objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildContentVersion objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildContentVersion objects filtered by the updated_at column
* @method array findByVersion(int $version) Return ChildContentVersion objects filtered by the version column
* @method array findByVersionCreatedAt(string $version_created_at) Return ChildContentVersion objects filtered by the version_created_at column
* @method array findByVersionCreatedBy(string $version_created_by) Return ChildContentVersion objects filtered by the version_created_by column
*
*/
abstract class ContentVersionQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\ContentVersionQuery 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\\ContentVersion', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildContentVersionQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildContentVersionQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\ContentVersionQuery) {
return $criteria;
}
$query = new \Thelia\Model\ContentVersionQuery();
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, $version] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildContentVersion|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = ContentVersionTableMap::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(ContentVersionTableMap::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 ChildContentVersion A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM content_version WHERE ID = :p0 AND VERSION = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildContentVersion();
$obj->hydrate($row);
ContentVersionTableMap::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 ChildContentVersion|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 ChildContentVersionQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(ContentVersionTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(ContentVersionTableMap::VERSION, $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 ChildContentVersionQuery 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(ContentVersionTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(ContentVersionTableMap::VERSION, $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 filterByContent()
*
* @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 ChildContentVersionQuery 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(ContentVersionTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(ContentVersionTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentVersionTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the visible column
*
* Example usage:
* <code>
* $query->filterByVisible(1234); // WHERE visible = 1234
* $query->filterByVisible(array(12, 34)); // WHERE visible IN (12, 34)
* $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
* </code>
*
* @param mixed $visible The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentVersionQuery The current query, for fluid interface
*/
public function filterByVisible($visible = null, $comparison = null)
{
if (is_array($visible)) {
$useMinMax = false;
if (isset($visible['min'])) {
$this->addUsingAlias(ContentVersionTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($visible['max'])) {
$this->addUsingAlias(ContentVersionTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentVersionTableMap::VISIBLE, $visible, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentVersionQuery 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(ContentVersionTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(ContentVersionTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentVersionTableMap::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 ChildContentVersionQuery 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(ContentVersionTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(ContentVersionTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentVersionTableMap::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 ChildContentVersionQuery 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(ContentVersionTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(ContentVersionTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentVersionTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query on the version column
*
* Example usage:
* <code>
* $query->filterByVersion(1234); // WHERE version = 1234
* $query->filterByVersion(array(12, 34)); // WHERE version IN (12, 34)
* $query->filterByVersion(array('min' => 12)); // WHERE version > 12
* </code>
*
* @param mixed $version 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 ChildContentVersionQuery The current query, for fluid interface
*/
public function filterByVersion($version = null, $comparison = null)
{
if (is_array($version)) {
$useMinMax = false;
if (isset($version['min'])) {
$this->addUsingAlias(ContentVersionTableMap::VERSION, $version['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($version['max'])) {
$this->addUsingAlias(ContentVersionTableMap::VERSION, $version['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentVersionTableMap::VERSION, $version, $comparison);
}
/**
* Filter the query on the version_created_at column
*
* Example usage:
* <code>
* $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14'
* $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14'
* $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at > '2011-03-13'
* </code>
*
* @param mixed $versionCreatedAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentVersionQuery The current query, for fluid interface
*/
public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null)
{
if (is_array($versionCreatedAt)) {
$useMinMax = false;
if (isset($versionCreatedAt['min'])) {
$this->addUsingAlias(ContentVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($versionCreatedAt['max'])) {
$this->addUsingAlias(ContentVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ContentVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
}
/**
* Filter the query on the version_created_by column
*
* Example usage:
* <code>
* $query->filterByVersionCreatedBy('fooValue'); // WHERE version_created_by = 'fooValue'
* $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%'
* </code>
*
* @param string $versionCreatedBy The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentVersionQuery The current query, for fluid interface
*/
public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($versionCreatedBy)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $versionCreatedBy)) {
$versionCreatedBy = str_replace('*', '%', $versionCreatedBy);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ContentVersionTableMap::VERSION_CREATED_BY, $versionCreatedBy, $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 ChildContentVersionQuery The current query, for fluid interface
*/
public function filterByContent($content, $comparison = null)
{
if ($content instanceof \Thelia\Model\Content) {
return $this
->addUsingAlias(ContentVersionTableMap::ID, $content->getId(), $comparison);
} elseif ($content instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ContentVersionTableMap::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 ChildContentVersionQuery The current query, for fluid interface
*/
public function joinContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Content');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Content');
}
return $this;
}
/**
* Use the Content relation Content object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\ContentQuery A secondary query class using the current class as primary query
*/
public function useContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinContent($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Content', '\Thelia\Model\ContentQuery');
}
/**
* Exclude object from result
*
* @param ChildContentVersion $contentVersion Object to remove from the list of results
*
* @return ChildContentVersionQuery The current query, for fluid interface
*/
public function prune($contentVersion = null)
{
if ($contentVersion) {
$this->addCond('pruneCond0', $this->getAliasedColName(ContentVersionTableMap::ID), $contentVersion->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(ContentVersionTableMap::VERSION), $contentVersion->getVersion(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the content_version 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(ContentVersionTableMap::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).
ContentVersionTableMap::clearInstancePool();
ContentVersionTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildContentVersion or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildContentVersion 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(ContentVersionTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(ContentVersionTableMap::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();
ContentVersionTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
ContentVersionTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // ContentVersionQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -0,0 +1,944 @@
<?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\Country as ChildCountry;
use Thelia\Model\CountryI18nQuery as ChildCountryI18nQuery;
use Thelia\Model\CountryQuery as ChildCountryQuery;
use Thelia\Model\Map\CountryTableMap;
/**
* Base class that represents a query for the 'country' table.
*
*
*
* @method ChildCountryQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCountryQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
* @method ChildCountryQuery orderByIsocode($order = Criteria::ASC) Order by the isocode column
* @method ChildCountryQuery orderByIsoalpha2($order = Criteria::ASC) Order by the isoalpha2 column
* @method ChildCountryQuery orderByIsoalpha3($order = Criteria::ASC) Order by the isoalpha3 column
* @method ChildCountryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCountryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildCountryQuery groupById() Group by the id column
* @method ChildCountryQuery groupByAreaId() Group by the area_id column
* @method ChildCountryQuery groupByIsocode() Group by the isocode column
* @method ChildCountryQuery groupByIsoalpha2() Group by the isoalpha2 column
* @method ChildCountryQuery groupByIsoalpha3() Group by the isoalpha3 column
* @method ChildCountryQuery groupByCreatedAt() Group by the created_at column
* @method ChildCountryQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildCountryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCountryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCountryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCountryQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
* @method ChildCountryQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
* @method ChildCountryQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
*
* @method ChildCountryQuery leftJoinTaxRuleCountry($relationAlias = null) Adds a LEFT JOIN clause to the query using the TaxRuleCountry relation
* @method ChildCountryQuery rightJoinTaxRuleCountry($relationAlias = null) Adds a RIGHT JOIN clause to the query using the TaxRuleCountry relation
* @method ChildCountryQuery innerJoinTaxRuleCountry($relationAlias = null) Adds a INNER JOIN clause to the query using the TaxRuleCountry relation
*
* @method ChildCountryQuery leftJoinCountryI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CountryI18n relation
* @method ChildCountryQuery rightJoinCountryI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CountryI18n relation
* @method ChildCountryQuery innerJoinCountryI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CountryI18n relation
*
* @method ChildCountry findOne(ConnectionInterface $con = null) Return the first ChildCountry matching the query
* @method ChildCountry findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCountry matching the query, or a new ChildCountry object populated from the query conditions when no match is found
*
* @method ChildCountry findOneById(int $id) Return the first ChildCountry filtered by the id column
* @method ChildCountry findOneByAreaId(int $area_id) Return the first ChildCountry filtered by the area_id column
* @method ChildCountry findOneByIsocode(string $isocode) Return the first ChildCountry filtered by the isocode column
* @method ChildCountry findOneByIsoalpha2(string $isoalpha2) Return the first ChildCountry filtered by the isoalpha2 column
* @method ChildCountry findOneByIsoalpha3(string $isoalpha3) Return the first ChildCountry filtered by the isoalpha3 column
* @method ChildCountry findOneByCreatedAt(string $created_at) Return the first ChildCountry filtered by the created_at column
* @method ChildCountry findOneByUpdatedAt(string $updated_at) Return the first ChildCountry filtered by the updated_at column
*
* @method array findById(int $id) Return ChildCountry objects filtered by the id column
* @method array findByAreaId(int $area_id) Return ChildCountry objects filtered by the area_id column
* @method array findByIsocode(string $isocode) Return ChildCountry objects filtered by the isocode column
* @method array findByIsoalpha2(string $isoalpha2) Return ChildCountry objects filtered by the isoalpha2 column
* @method array findByIsoalpha3(string $isoalpha3) Return ChildCountry objects filtered by the isoalpha3 column
* @method array findByCreatedAt(string $created_at) Return ChildCountry objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCountry objects filtered by the updated_at column
*
*/
abstract class CountryQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CountryQuery 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\\Country', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCountryQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCountryQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CountryQuery) {
return $criteria;
}
$query = new \Thelia\Model\CountryQuery();
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 ChildCountry|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CountryTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(CountryTableMap::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 ChildCountry A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, AREA_ID, ISOCODE, ISOALPHA2, ISOALPHA3, CREATED_AT, UPDATED_AT FROM country 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 ChildCountry();
$obj->hydrate($row);
CountryTableMap::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 ChildCountry|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 ChildCountryQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CountryTableMap::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 ChildCountryQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CountryTableMap::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 ChildCountryQuery 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(CountryTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CountryTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CountryTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the area_id column
*
* Example usage:
* <code>
* $query->filterByAreaId(1234); // WHERE area_id = 1234
* $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
* $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
* </code>
*
* @see filterByArea()
*
* @param mixed $areaId 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 ChildCountryQuery The current query, for fluid interface
*/
public function filterByAreaId($areaId = null, $comparison = null)
{
if (is_array($areaId)) {
$useMinMax = false;
if (isset($areaId['min'])) {
$this->addUsingAlias(CountryTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($areaId['max'])) {
$this->addUsingAlias(CountryTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CountryTableMap::AREA_ID, $areaId, $comparison);
}
/**
* Filter the query on the isocode column
*
* Example usage:
* <code>
* $query->filterByIsocode('fooValue'); // WHERE isocode = 'fooValue'
* $query->filterByIsocode('%fooValue%'); // WHERE isocode LIKE '%fooValue%'
* </code>
*
* @param string $isocode 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 ChildCountryQuery The current query, for fluid interface
*/
public function filterByIsocode($isocode = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($isocode)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $isocode)) {
$isocode = str_replace('*', '%', $isocode);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CountryTableMap::ISOCODE, $isocode, $comparison);
}
/**
* Filter the query on the isoalpha2 column
*
* Example usage:
* <code>
* $query->filterByIsoalpha2('fooValue'); // WHERE isoalpha2 = 'fooValue'
* $query->filterByIsoalpha2('%fooValue%'); // WHERE isoalpha2 LIKE '%fooValue%'
* </code>
*
* @param string $isoalpha2 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 ChildCountryQuery The current query, for fluid interface
*/
public function filterByIsoalpha2($isoalpha2 = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($isoalpha2)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $isoalpha2)) {
$isoalpha2 = str_replace('*', '%', $isoalpha2);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CountryTableMap::ISOALPHA2, $isoalpha2, $comparison);
}
/**
* Filter the query on the isoalpha3 column
*
* Example usage:
* <code>
* $query->filterByIsoalpha3('fooValue'); // WHERE isoalpha3 = 'fooValue'
* $query->filterByIsoalpha3('%fooValue%'); // WHERE isoalpha3 LIKE '%fooValue%'
* </code>
*
* @param string $isoalpha3 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 ChildCountryQuery The current query, for fluid interface
*/
public function filterByIsoalpha3($isoalpha3 = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($isoalpha3)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $isoalpha3)) {
$isoalpha3 = str_replace('*', '%', $isoalpha3);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CountryTableMap::ISOALPHA3, $isoalpha3, $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 ChildCountryQuery 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(CountryTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(CountryTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CountryTableMap::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 ChildCountryQuery 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(CountryTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(CountryTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CountryTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Area object
*
* @param \Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function filterByArea($area, $comparison = null)
{
if ($area instanceof \Thelia\Model\Area) {
return $this
->addUsingAlias(CountryTableMap::AREA_ID, $area->getId(), $comparison);
} elseif ($area instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CountryTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByArea() only accepts arguments of type \Thelia\Model\Area or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Area relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function joinArea($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Area');
// 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, 'Area');
}
return $this;
}
/**
* Use the Area relation Area 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\AreaQuery A secondary query class using the current class as primary query
*/
public function useAreaQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinArea($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Area', '\Thelia\Model\AreaQuery');
}
/**
* Filter the query by a related \Thelia\Model\TaxRuleCountry object
*
* @param \Thelia\Model\TaxRuleCountry|ObjectCollection $taxRuleCountry the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function filterByTaxRuleCountry($taxRuleCountry, $comparison = null)
{
if ($taxRuleCountry instanceof \Thelia\Model\TaxRuleCountry) {
return $this
->addUsingAlias(CountryTableMap::ID, $taxRuleCountry->getCountryId(), $comparison);
} elseif ($taxRuleCountry instanceof ObjectCollection) {
return $this
->useTaxRuleCountryQuery()
->filterByPrimaryKeys($taxRuleCountry->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByTaxRuleCountry() only accepts arguments of type \Thelia\Model\TaxRuleCountry or Collection');
}
}
/**
* Adds a JOIN clause to the query using the TaxRuleCountry relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function joinTaxRuleCountry($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('TaxRuleCountry');
// 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, 'TaxRuleCountry');
}
return $this;
}
/**
* Use the TaxRuleCountry relation TaxRuleCountry 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\TaxRuleCountryQuery A secondary query class using the current class as primary query
*/
public function useTaxRuleCountryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinTaxRuleCountry($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'TaxRuleCountry', '\Thelia\Model\TaxRuleCountryQuery');
}
/**
* Filter the query by a related \Thelia\Model\CountryI18n object
*
* @param \Thelia\Model\CountryI18n|ObjectCollection $countryI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function filterByCountryI18n($countryI18n, $comparison = null)
{
if ($countryI18n instanceof \Thelia\Model\CountryI18n) {
return $this
->addUsingAlias(CountryTableMap::ID, $countryI18n->getId(), $comparison);
} elseif ($countryI18n instanceof ObjectCollection) {
return $this
->useCountryI18nQuery()
->filterByPrimaryKeys($countryI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByCountryI18n() only accepts arguments of type \Thelia\Model\CountryI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the CountryI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function joinCountryI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CountryI18n');
// 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, 'CountryI18n');
}
return $this;
}
/**
* Use the CountryI18n relation CountryI18n 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\CountryI18nQuery A secondary query class using the current class as primary query
*/
public function useCountryI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinCountryI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CountryI18n', '\Thelia\Model\CountryI18nQuery');
}
/**
* Exclude object from result
*
* @param ChildCountry $country Object to remove from the list of results
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function prune($country = null)
{
if ($country) {
$this->addUsingAlias(CountryTableMap::ID, $country->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the country 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(CountryTableMap::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).
CountryTableMap::clearInstancePool();
CountryTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCountry or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCountry 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(CountryTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CountryTableMap::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();
CountryTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CountryTableMap::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 ChildCountryQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(CountryTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(CountryTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(CountryTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(CountryTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(CountryTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildCountryQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(CountryTableMap::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 ChildCountryQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'CountryI18n';
return $this
->joinCountryI18n($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 ChildCountryQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('CountryI18n');
$this->with['CountryI18n']->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 ChildCountryI18nQuery A secondary query class using the current class as primary query
*/
public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CountryI18n', '\Thelia\Model\CountryI18nQuery');
}
} // CountryQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,711 @@
<?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\CouponOrder as ChildCouponOrder;
use Thelia\Model\CouponOrderQuery as ChildCouponOrderQuery;
use Thelia\Model\Map\CouponOrderTableMap;
/**
* Base class that represents a query for the 'coupon_order' table.
*
*
*
* @method ChildCouponOrderQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCouponOrderQuery orderByOrderId($order = Criteria::ASC) Order by the order_id column
* @method ChildCouponOrderQuery orderByCode($order = Criteria::ASC) Order by the code column
* @method ChildCouponOrderQuery orderByValue($order = Criteria::ASC) Order by the value column
* @method ChildCouponOrderQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCouponOrderQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildCouponOrderQuery groupById() Group by the id column
* @method ChildCouponOrderQuery groupByOrderId() Group by the order_id column
* @method ChildCouponOrderQuery groupByCode() Group by the code column
* @method ChildCouponOrderQuery groupByValue() Group by the value column
* @method ChildCouponOrderQuery groupByCreatedAt() Group by the created_at column
* @method ChildCouponOrderQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildCouponOrderQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCouponOrderQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCouponOrderQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCouponOrderQuery leftJoinOrder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Order relation
* @method ChildCouponOrderQuery rightJoinOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Order relation
* @method ChildCouponOrderQuery innerJoinOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the Order relation
*
* @method ChildCouponOrder findOne(ConnectionInterface $con = null) Return the first ChildCouponOrder matching the query
* @method ChildCouponOrder findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCouponOrder matching the query, or a new ChildCouponOrder object populated from the query conditions when no match is found
*
* @method ChildCouponOrder findOneById(int $id) Return the first ChildCouponOrder filtered by the id column
* @method ChildCouponOrder findOneByOrderId(int $order_id) Return the first ChildCouponOrder filtered by the order_id column
* @method ChildCouponOrder findOneByCode(string $code) Return the first ChildCouponOrder filtered by the code column
* @method ChildCouponOrder findOneByValue(double $value) Return the first ChildCouponOrder filtered by the value column
* @method ChildCouponOrder findOneByCreatedAt(string $created_at) Return the first ChildCouponOrder filtered by the created_at column
* @method ChildCouponOrder findOneByUpdatedAt(string $updated_at) Return the first ChildCouponOrder filtered by the updated_at column
*
* @method array findById(int $id) Return ChildCouponOrder objects filtered by the id column
* @method array findByOrderId(int $order_id) Return ChildCouponOrder objects filtered by the order_id column
* @method array findByCode(string $code) Return ChildCouponOrder objects filtered by the code column
* @method array findByValue(double $value) Return ChildCouponOrder objects filtered by the value column
* @method array findByCreatedAt(string $created_at) Return ChildCouponOrder objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCouponOrder objects filtered by the updated_at column
*
*/
abstract class CouponOrderQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CouponOrderQuery 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\\CouponOrder', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCouponOrderQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCouponOrderQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CouponOrderQuery) {
return $criteria;
}
$query = new \Thelia\Model\CouponOrderQuery();
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 ChildCouponOrder|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CouponOrderTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(CouponOrderTableMap::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 ChildCouponOrder A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, ORDER_ID, CODE, VALUE, CREATED_AT, UPDATED_AT FROM coupon_order 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 ChildCouponOrder();
$obj->hydrate($row);
CouponOrderTableMap::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 ChildCouponOrder|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 ChildCouponOrderQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CouponOrderTableMap::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 ChildCouponOrderQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CouponOrderTableMap::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 ChildCouponOrderQuery 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(CouponOrderTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CouponOrderTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponOrderTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the order_id column
*
* Example usage:
* <code>
* $query->filterByOrderId(1234); // WHERE order_id = 1234
* $query->filterByOrderId(array(12, 34)); // WHERE order_id IN (12, 34)
* $query->filterByOrderId(array('min' => 12)); // WHERE order_id > 12
* </code>
*
* @see filterByOrder()
*
* @param mixed $orderId 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 ChildCouponOrderQuery The current query, for fluid interface
*/
public function filterByOrderId($orderId = null, $comparison = null)
{
if (is_array($orderId)) {
$useMinMax = false;
if (isset($orderId['min'])) {
$this->addUsingAlias(CouponOrderTableMap::ORDER_ID, $orderId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($orderId['max'])) {
$this->addUsingAlias(CouponOrderTableMap::ORDER_ID, $orderId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponOrderTableMap::ORDER_ID, $orderId, $comparison);
}
/**
* Filter the query on the code column
*
* Example usage:
* <code>
* $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
* $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
* </code>
*
* @param string $code 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 ChildCouponOrderQuery The current query, for fluid interface
*/
public function filterByCode($code = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($code)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $code)) {
$code = str_replace('*', '%', $code);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CouponOrderTableMap::CODE, $code, $comparison);
}
/**
* Filter the query on the value column
*
* Example usage:
* <code>
* $query->filterByValue(1234); // WHERE value = 1234
* $query->filterByValue(array(12, 34)); // WHERE value IN (12, 34)
* $query->filterByValue(array('min' => 12)); // WHERE value > 12
* </code>
*
* @param mixed $value 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 ChildCouponOrderQuery The current query, for fluid interface
*/
public function filterByValue($value = null, $comparison = null)
{
if (is_array($value)) {
$useMinMax = false;
if (isset($value['min'])) {
$this->addUsingAlias(CouponOrderTableMap::VALUE, $value['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($value['max'])) {
$this->addUsingAlias(CouponOrderTableMap::VALUE, $value['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponOrderTableMap::VALUE, $value, $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 ChildCouponOrderQuery 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(CouponOrderTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(CouponOrderTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponOrderTableMap::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 ChildCouponOrderQuery 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(CouponOrderTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(CouponOrderTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponOrderTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Order object
*
* @param \Thelia\Model\Order|ObjectCollection $order The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponOrderQuery The current query, for fluid interface
*/
public function filterByOrder($order, $comparison = null)
{
if ($order instanceof \Thelia\Model\Order) {
return $this
->addUsingAlias(CouponOrderTableMap::ORDER_ID, $order->getId(), $comparison);
} elseif ($order instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CouponOrderTableMap::ORDER_ID, $order->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByOrder() only accepts arguments of type \Thelia\Model\Order or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Order relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCouponOrderQuery The current query, for fluid interface
*/
public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Order');
// 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, 'Order');
}
return $this;
}
/**
* Use the Order relation Order 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\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrder($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Order', '\Thelia\Model\OrderQuery');
}
/**
* Exclude object from result
*
* @param ChildCouponOrder $couponOrder Object to remove from the list of results
*
* @return ChildCouponOrderQuery The current query, for fluid interface
*/
public function prune($couponOrder = null)
{
if ($couponOrder) {
$this->addUsingAlias(CouponOrderTableMap::ID, $couponOrder->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the coupon_order 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(CouponOrderTableMap::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).
CouponOrderTableMap::clearInstancePool();
CouponOrderTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCouponOrder or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCouponOrder 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(CouponOrderTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CouponOrderTableMap::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();
CouponOrderTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CouponOrderTableMap::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 ChildCouponOrderQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(CouponOrderTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildCouponOrderQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(CouponOrderTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildCouponOrderQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(CouponOrderTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildCouponOrderQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(CouponOrderTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildCouponOrderQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(CouponOrderTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildCouponOrderQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(CouponOrderTableMap::CREATED_AT);
}
} // CouponOrderQuery

View File

@@ -0,0 +1,879 @@
<?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\Coupon as ChildCoupon;
use Thelia\Model\CouponQuery as ChildCouponQuery;
use Thelia\Model\Map\CouponTableMap;
/**
* Base class that represents a query for the 'coupon' table.
*
*
*
* @method ChildCouponQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCouponQuery orderByCode($order = Criteria::ASC) Order by the code column
* @method ChildCouponQuery orderByAction($order = Criteria::ASC) Order by the action column
* @method ChildCouponQuery orderByValue($order = Criteria::ASC) Order by the value column
* @method ChildCouponQuery orderByUsed($order = Criteria::ASC) Order by the used column
* @method ChildCouponQuery orderByAvailableSince($order = Criteria::ASC) Order by the available_since column
* @method ChildCouponQuery orderByDateLimit($order = Criteria::ASC) Order by the date_limit column
* @method ChildCouponQuery orderByActivate($order = Criteria::ASC) Order by the activate column
* @method ChildCouponQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCouponQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildCouponQuery groupById() Group by the id column
* @method ChildCouponQuery groupByCode() Group by the code column
* @method ChildCouponQuery groupByAction() Group by the action column
* @method ChildCouponQuery groupByValue() Group by the value column
* @method ChildCouponQuery groupByUsed() Group by the used column
* @method ChildCouponQuery groupByAvailableSince() Group by the available_since column
* @method ChildCouponQuery groupByDateLimit() Group by the date_limit column
* @method ChildCouponQuery groupByActivate() Group by the activate column
* @method ChildCouponQuery groupByCreatedAt() Group by the created_at column
* @method ChildCouponQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildCouponQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCouponQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCouponQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCouponQuery leftJoinCouponRule($relationAlias = null) Adds a LEFT JOIN clause to the query using the CouponRule relation
* @method ChildCouponQuery rightJoinCouponRule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CouponRule relation
* @method ChildCouponQuery innerJoinCouponRule($relationAlias = null) Adds a INNER JOIN clause to the query using the CouponRule relation
*
* @method ChildCoupon findOne(ConnectionInterface $con = null) Return the first ChildCoupon matching the query
* @method ChildCoupon findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCoupon matching the query, or a new ChildCoupon object populated from the query conditions when no match is found
*
* @method ChildCoupon findOneById(int $id) Return the first ChildCoupon filtered by the id column
* @method ChildCoupon findOneByCode(string $code) Return the first ChildCoupon filtered by the code column
* @method ChildCoupon findOneByAction(string $action) Return the first ChildCoupon filtered by the action column
* @method ChildCoupon findOneByValue(double $value) Return the first ChildCoupon filtered by the value column
* @method ChildCoupon findOneByUsed(int $used) Return the first ChildCoupon filtered by the used column
* @method ChildCoupon findOneByAvailableSince(string $available_since) Return the first ChildCoupon filtered by the available_since column
* @method ChildCoupon findOneByDateLimit(string $date_limit) Return the first ChildCoupon filtered by the date_limit column
* @method ChildCoupon findOneByActivate(int $activate) Return the first ChildCoupon filtered by the activate column
* @method ChildCoupon findOneByCreatedAt(string $created_at) Return the first ChildCoupon filtered by the created_at column
* @method ChildCoupon findOneByUpdatedAt(string $updated_at) Return the first ChildCoupon filtered by the updated_at column
*
* @method array findById(int $id) Return ChildCoupon objects filtered by the id column
* @method array findByCode(string $code) Return ChildCoupon objects filtered by the code column
* @method array findByAction(string $action) Return ChildCoupon objects filtered by the action column
* @method array findByValue(double $value) Return ChildCoupon objects filtered by the value column
* @method array findByUsed(int $used) Return ChildCoupon objects filtered by the used column
* @method array findByAvailableSince(string $available_since) Return ChildCoupon objects filtered by the available_since column
* @method array findByDateLimit(string $date_limit) Return ChildCoupon objects filtered by the date_limit column
* @method array findByActivate(int $activate) Return ChildCoupon objects filtered by the activate column
* @method array findByCreatedAt(string $created_at) Return ChildCoupon objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCoupon objects filtered by the updated_at column
*
*/
abstract class CouponQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CouponQuery 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\\Coupon', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCouponQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCouponQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CouponQuery) {
return $criteria;
}
$query = new \Thelia\Model\CouponQuery();
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 ChildCoupon|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CouponTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(CouponTableMap::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 ChildCoupon A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CODE, ACTION, VALUE, USED, AVAILABLE_SINCE, DATE_LIMIT, ACTIVATE, CREATED_AT, UPDATED_AT FROM coupon 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 ChildCoupon();
$obj->hydrate($row);
CouponTableMap::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 ChildCoupon|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 ChildCouponQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CouponTableMap::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 ChildCouponQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CouponTableMap::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 ChildCouponQuery 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(CouponTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CouponTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the code column
*
* Example usage:
* <code>
* $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
* $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
* </code>
*
* @param string $code The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function filterByCode($code = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($code)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $code)) {
$code = str_replace('*', '%', $code);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CouponTableMap::CODE, $code, $comparison);
}
/**
* Filter the query on the action column
*
* Example usage:
* <code>
* $query->filterByAction('fooValue'); // WHERE action = 'fooValue'
* $query->filterByAction('%fooValue%'); // WHERE action LIKE '%fooValue%'
* </code>
*
* @param string $action The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function filterByAction($action = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($action)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $action)) {
$action = str_replace('*', '%', $action);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CouponTableMap::ACTION, $action, $comparison);
}
/**
* Filter the query on the value column
*
* Example usage:
* <code>
* $query->filterByValue(1234); // WHERE value = 1234
* $query->filterByValue(array(12, 34)); // WHERE value IN (12, 34)
* $query->filterByValue(array('min' => 12)); // WHERE value > 12
* </code>
*
* @param mixed $value The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function filterByValue($value = null, $comparison = null)
{
if (is_array($value)) {
$useMinMax = false;
if (isset($value['min'])) {
$this->addUsingAlias(CouponTableMap::VALUE, $value['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($value['max'])) {
$this->addUsingAlias(CouponTableMap::VALUE, $value['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::VALUE, $value, $comparison);
}
/**
* Filter the query on the used column
*
* Example usage:
* <code>
* $query->filterByUsed(1234); // WHERE used = 1234
* $query->filterByUsed(array(12, 34)); // WHERE used IN (12, 34)
* $query->filterByUsed(array('min' => 12)); // WHERE used > 12
* </code>
*
* @param mixed $used The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function filterByUsed($used = null, $comparison = null)
{
if (is_array($used)) {
$useMinMax = false;
if (isset($used['min'])) {
$this->addUsingAlias(CouponTableMap::USED, $used['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($used['max'])) {
$this->addUsingAlias(CouponTableMap::USED, $used['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::USED, $used, $comparison);
}
/**
* Filter the query on the available_since column
*
* Example usage:
* <code>
* $query->filterByAvailableSince('2011-03-14'); // WHERE available_since = '2011-03-14'
* $query->filterByAvailableSince('now'); // WHERE available_since = '2011-03-14'
* $query->filterByAvailableSince(array('max' => 'yesterday')); // WHERE available_since > '2011-03-13'
* </code>
*
* @param mixed $availableSince The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function filterByAvailableSince($availableSince = null, $comparison = null)
{
if (is_array($availableSince)) {
$useMinMax = false;
if (isset($availableSince['min'])) {
$this->addUsingAlias(CouponTableMap::AVAILABLE_SINCE, $availableSince['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($availableSince['max'])) {
$this->addUsingAlias(CouponTableMap::AVAILABLE_SINCE, $availableSince['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::AVAILABLE_SINCE, $availableSince, $comparison);
}
/**
* Filter the query on the date_limit column
*
* Example usage:
* <code>
* $query->filterByDateLimit('2011-03-14'); // WHERE date_limit = '2011-03-14'
* $query->filterByDateLimit('now'); // WHERE date_limit = '2011-03-14'
* $query->filterByDateLimit(array('max' => 'yesterday')); // WHERE date_limit > '2011-03-13'
* </code>
*
* @param mixed $dateLimit The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function filterByDateLimit($dateLimit = null, $comparison = null)
{
if (is_array($dateLimit)) {
$useMinMax = false;
if (isset($dateLimit['min'])) {
$this->addUsingAlias(CouponTableMap::DATE_LIMIT, $dateLimit['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dateLimit['max'])) {
$this->addUsingAlias(CouponTableMap::DATE_LIMIT, $dateLimit['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::DATE_LIMIT, $dateLimit, $comparison);
}
/**
* Filter the query on the activate column
*
* Example usage:
* <code>
* $query->filterByActivate(1234); // WHERE activate = 1234
* $query->filterByActivate(array(12, 34)); // WHERE activate IN (12, 34)
* $query->filterByActivate(array('min' => 12)); // WHERE activate > 12
* </code>
*
* @param mixed $activate The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function filterByActivate($activate = null, $comparison = null)
{
if (is_array($activate)) {
$useMinMax = false;
if (isset($activate['min'])) {
$this->addUsingAlias(CouponTableMap::ACTIVATE, $activate['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($activate['max'])) {
$this->addUsingAlias(CouponTableMap::ACTIVATE, $activate['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::ACTIVATE, $activate, $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 ChildCouponQuery 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(CouponTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(CouponTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::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 ChildCouponQuery 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(CouponTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(CouponTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\CouponRule object
*
* @param \Thelia\Model\CouponRule|ObjectCollection $couponRule the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function filterByCouponRule($couponRule, $comparison = null)
{
if ($couponRule instanceof \Thelia\Model\CouponRule) {
return $this
->addUsingAlias(CouponTableMap::ID, $couponRule->getCouponId(), $comparison);
} elseif ($couponRule instanceof ObjectCollection) {
return $this
->useCouponRuleQuery()
->filterByPrimaryKeys($couponRule->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByCouponRule() only accepts arguments of type \Thelia\Model\CouponRule or Collection');
}
}
/**
* Adds a JOIN clause to the query using the CouponRule relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function joinCouponRule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CouponRule');
// 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, 'CouponRule');
}
return $this;
}
/**
* Use the CouponRule relation CouponRule 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\CouponRuleQuery A secondary query class using the current class as primary query
*/
public function useCouponRuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCouponRule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CouponRule', '\Thelia\Model\CouponRuleQuery');
}
/**
* Exclude object from result
*
* @param ChildCoupon $coupon Object to remove from the list of results
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function prune($coupon = null)
{
if ($coupon) {
$this->addUsingAlias(CouponTableMap::ID, $coupon->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the coupon 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(CouponTableMap::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).
CouponTableMap::clearInstancePool();
CouponTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCoupon or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCoupon 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(CouponTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CouponTableMap::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();
CouponTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CouponTableMap::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 ChildCouponQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(CouponTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(CouponTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(CouponTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(CouponTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(CouponTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildCouponQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(CouponTableMap::CREATED_AT);
}
} // CouponQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,744 @@
<?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\CouponRule as ChildCouponRule;
use Thelia\Model\CouponRuleQuery as ChildCouponRuleQuery;
use Thelia\Model\Map\CouponRuleTableMap;
/**
* Base class that represents a query for the 'coupon_rule' table.
*
*
*
* @method ChildCouponRuleQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCouponRuleQuery orderByCouponId($order = Criteria::ASC) Order by the coupon_id column
* @method ChildCouponRuleQuery orderByController($order = Criteria::ASC) Order by the controller column
* @method ChildCouponRuleQuery orderByOperation($order = Criteria::ASC) Order by the operation column
* @method ChildCouponRuleQuery orderByValue($order = Criteria::ASC) Order by the value column
* @method ChildCouponRuleQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCouponRuleQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildCouponRuleQuery groupById() Group by the id column
* @method ChildCouponRuleQuery groupByCouponId() Group by the coupon_id column
* @method ChildCouponRuleQuery groupByController() Group by the controller column
* @method ChildCouponRuleQuery groupByOperation() Group by the operation column
* @method ChildCouponRuleQuery groupByValue() Group by the value column
* @method ChildCouponRuleQuery groupByCreatedAt() Group by the created_at column
* @method ChildCouponRuleQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildCouponRuleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCouponRuleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCouponRuleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCouponRuleQuery leftJoinCoupon($relationAlias = null) Adds a LEFT JOIN clause to the query using the Coupon relation
* @method ChildCouponRuleQuery rightJoinCoupon($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Coupon relation
* @method ChildCouponRuleQuery innerJoinCoupon($relationAlias = null) Adds a INNER JOIN clause to the query using the Coupon relation
*
* @method ChildCouponRule findOne(ConnectionInterface $con = null) Return the first ChildCouponRule matching the query
* @method ChildCouponRule findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCouponRule matching the query, or a new ChildCouponRule object populated from the query conditions when no match is found
*
* @method ChildCouponRule findOneById(int $id) Return the first ChildCouponRule filtered by the id column
* @method ChildCouponRule findOneByCouponId(int $coupon_id) Return the first ChildCouponRule filtered by the coupon_id column
* @method ChildCouponRule findOneByController(string $controller) Return the first ChildCouponRule filtered by the controller column
* @method ChildCouponRule findOneByOperation(string $operation) Return the first ChildCouponRule filtered by the operation column
* @method ChildCouponRule findOneByValue(double $value) Return the first ChildCouponRule filtered by the value column
* @method ChildCouponRule findOneByCreatedAt(string $created_at) Return the first ChildCouponRule filtered by the created_at column
* @method ChildCouponRule findOneByUpdatedAt(string $updated_at) Return the first ChildCouponRule filtered by the updated_at column
*
* @method array findById(int $id) Return ChildCouponRule objects filtered by the id column
* @method array findByCouponId(int $coupon_id) Return ChildCouponRule objects filtered by the coupon_id column
* @method array findByController(string $controller) Return ChildCouponRule objects filtered by the controller column
* @method array findByOperation(string $operation) Return ChildCouponRule objects filtered by the operation column
* @method array findByValue(double $value) Return ChildCouponRule objects filtered by the value column
* @method array findByCreatedAt(string $created_at) Return ChildCouponRule objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCouponRule objects filtered by the updated_at column
*
*/
abstract class CouponRuleQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CouponRuleQuery 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\\CouponRule', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCouponRuleQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCouponRuleQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CouponRuleQuery) {
return $criteria;
}
$query = new \Thelia\Model\CouponRuleQuery();
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 ChildCouponRule|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CouponRuleTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(CouponRuleTableMap::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 ChildCouponRule A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, COUPON_ID, CONTROLLER, OPERATION, VALUE, CREATED_AT, UPDATED_AT FROM coupon_rule 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 ChildCouponRule();
$obj->hydrate($row);
CouponRuleTableMap::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 ChildCouponRule|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 ChildCouponRuleQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CouponRuleTableMap::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 ChildCouponRuleQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CouponRuleTableMap::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 ChildCouponRuleQuery 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(CouponRuleTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CouponRuleTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponRuleTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the coupon_id column
*
* Example usage:
* <code>
* $query->filterByCouponId(1234); // WHERE coupon_id = 1234
* $query->filterByCouponId(array(12, 34)); // WHERE coupon_id IN (12, 34)
* $query->filterByCouponId(array('min' => 12)); // WHERE coupon_id > 12
* </code>
*
* @see filterByCoupon()
*
* @param mixed $couponId 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 ChildCouponRuleQuery The current query, for fluid interface
*/
public function filterByCouponId($couponId = null, $comparison = null)
{
if (is_array($couponId)) {
$useMinMax = false;
if (isset($couponId['min'])) {
$this->addUsingAlias(CouponRuleTableMap::COUPON_ID, $couponId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($couponId['max'])) {
$this->addUsingAlias(CouponRuleTableMap::COUPON_ID, $couponId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponRuleTableMap::COUPON_ID, $couponId, $comparison);
}
/**
* Filter the query on the controller column
*
* Example usage:
* <code>
* $query->filterByController('fooValue'); // WHERE controller = 'fooValue'
* $query->filterByController('%fooValue%'); // WHERE controller LIKE '%fooValue%'
* </code>
*
* @param string $controller 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 ChildCouponRuleQuery The current query, for fluid interface
*/
public function filterByController($controller = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($controller)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $controller)) {
$controller = str_replace('*', '%', $controller);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CouponRuleTableMap::CONTROLLER, $controller, $comparison);
}
/**
* Filter the query on the operation column
*
* Example usage:
* <code>
* $query->filterByOperation('fooValue'); // WHERE operation = 'fooValue'
* $query->filterByOperation('%fooValue%'); // WHERE operation LIKE '%fooValue%'
* </code>
*
* @param string $operation 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 ChildCouponRuleQuery The current query, for fluid interface
*/
public function filterByOperation($operation = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($operation)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $operation)) {
$operation = str_replace('*', '%', $operation);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CouponRuleTableMap::OPERATION, $operation, $comparison);
}
/**
* Filter the query on the value column
*
* Example usage:
* <code>
* $query->filterByValue(1234); // WHERE value = 1234
* $query->filterByValue(array(12, 34)); // WHERE value IN (12, 34)
* $query->filterByValue(array('min' => 12)); // WHERE value > 12
* </code>
*
* @param mixed $value 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 ChildCouponRuleQuery The current query, for fluid interface
*/
public function filterByValue($value = null, $comparison = null)
{
if (is_array($value)) {
$useMinMax = false;
if (isset($value['min'])) {
$this->addUsingAlias(CouponRuleTableMap::VALUE, $value['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($value['max'])) {
$this->addUsingAlias(CouponRuleTableMap::VALUE, $value['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponRuleTableMap::VALUE, $value, $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 ChildCouponRuleQuery 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(CouponRuleTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(CouponRuleTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponRuleTableMap::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 ChildCouponRuleQuery 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(CouponRuleTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(CouponRuleTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CouponRuleTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Coupon object
*
* @param \Thelia\Model\Coupon|ObjectCollection $coupon The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCouponRuleQuery The current query, for fluid interface
*/
public function filterByCoupon($coupon, $comparison = null)
{
if ($coupon instanceof \Thelia\Model\Coupon) {
return $this
->addUsingAlias(CouponRuleTableMap::COUPON_ID, $coupon->getId(), $comparison);
} elseif ($coupon instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CouponRuleTableMap::COUPON_ID, $coupon->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCoupon() only accepts arguments of type \Thelia\Model\Coupon or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Coupon relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCouponRuleQuery The current query, for fluid interface
*/
public function joinCoupon($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Coupon');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Coupon');
}
return $this;
}
/**
* Use the Coupon relation Coupon object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\CouponQuery A secondary query class using the current class as primary query
*/
public function useCouponQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCoupon($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Coupon', '\Thelia\Model\CouponQuery');
}
/**
* Exclude object from result
*
* @param ChildCouponRule $couponRule Object to remove from the list of results
*
* @return ChildCouponRuleQuery The current query, for fluid interface
*/
public function prune($couponRule = null)
{
if ($couponRule) {
$this->addUsingAlias(CouponRuleTableMap::ID, $couponRule->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the coupon_rule 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(CouponRuleTableMap::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).
CouponRuleTableMap::clearInstancePool();
CouponRuleTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCouponRule or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCouponRule 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(CouponRuleTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CouponRuleTableMap::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();
CouponRuleTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CouponRuleTableMap::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 ChildCouponRuleQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(CouponRuleTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildCouponRuleQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(CouponRuleTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildCouponRuleQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(CouponRuleTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildCouponRuleQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(CouponRuleTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildCouponRuleQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(CouponRuleTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildCouponRuleQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(CouponRuleTableMap::CREATED_AT);
}
} // CouponRuleQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,773 @@
<?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\Currency as ChildCurrency;
use Thelia\Model\CurrencyQuery as ChildCurrencyQuery;
use Thelia\Model\Map\CurrencyTableMap;
/**
* Base class that represents a query for the 'currency' table.
*
*
*
* @method ChildCurrencyQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCurrencyQuery orderByName($order = Criteria::ASC) Order by the name column
* @method ChildCurrencyQuery orderByCode($order = Criteria::ASC) Order by the code column
* @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 orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCurrencyQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildCurrencyQuery groupById() Group by the id column
* @method ChildCurrencyQuery groupByName() Group by the name column
* @method ChildCurrencyQuery groupByCode() Group by the code column
* @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 groupByCreatedAt() Group by the created_at column
* @method ChildCurrencyQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildCurrencyQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCurrencyQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCurrencyQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCurrencyQuery leftJoinOrder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Order relation
* @method ChildCurrencyQuery rightJoinOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Order relation
* @method ChildCurrencyQuery innerJoinOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the Order relation
*
* @method ChildCurrency findOne(ConnectionInterface $con = null) Return the first ChildCurrency matching the query
* @method ChildCurrency findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCurrency matching the query, or a new ChildCurrency object populated from the query conditions when no match is found
*
* @method ChildCurrency findOneById(int $id) Return the first ChildCurrency filtered by the id column
* @method ChildCurrency findOneByName(string $name) Return the first ChildCurrency filtered by the name column
* @method ChildCurrency findOneByCode(string $code) Return the first ChildCurrency filtered by the code column
* @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 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
*
* @method array findById(int $id) Return ChildCurrency objects filtered by the id column
* @method array findByName(string $name) Return ChildCurrency objects filtered by the name column
* @method array findByCode(string $code) Return ChildCurrency objects filtered by the code column
* @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 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
*
*/
abstract class CurrencyQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CurrencyQuery 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\\Currency', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCurrencyQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCurrencyQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CurrencyQuery) {
return $criteria;
}
$query = new \Thelia\Model\CurrencyQuery();
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 ChildCurrency|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CurrencyTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(CurrencyTableMap::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 ChildCurrency A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, NAME, 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);
$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 ChildCurrency();
$obj->hydrate($row);
CurrencyTableMap::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 ChildCurrency|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 ChildCurrencyQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CurrencyTableMap::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 ChildCurrencyQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CurrencyTableMap::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 ChildCurrencyQuery 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(CurrencyTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CurrencyTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CurrencyTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the name column
*
* Example usage:
* <code>
* $query->filterByName('fooValue'); // WHERE name = 'fooValue'
* $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
* </code>
*
* @param string $name 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 ChildCurrencyQuery The current query, for fluid interface
*/
public function filterByName($name = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($name)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $name)) {
$name = str_replace('*', '%', $name);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CurrencyTableMap::NAME, $name, $comparison);
}
/**
* Filter the query on the code column
*
* Example usage:
* <code>
* $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
* $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
* </code>
*
* @param string $code 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 ChildCurrencyQuery The current query, for fluid interface
*/
public function filterByCode($code = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($code)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $code)) {
$code = str_replace('*', '%', $code);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CurrencyTableMap::CODE, $code, $comparison);
}
/**
* Filter the query on the symbol column
*
* Example usage:
* <code>
* $query->filterBySymbol('fooValue'); // WHERE symbol = 'fooValue'
* $query->filterBySymbol('%fooValue%'); // WHERE symbol LIKE '%fooValue%'
* </code>
*
* @param string $symbol 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 ChildCurrencyQuery The current query, for fluid interface
*/
public function filterBySymbol($symbol = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($symbol)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $symbol)) {
$symbol = str_replace('*', '%', $symbol);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CurrencyTableMap::SYMBOL, $symbol, $comparison);
}
/**
* Filter the query on the rate column
*
* Example usage:
* <code>
* $query->filterByRate(1234); // WHERE rate = 1234
* $query->filterByRate(array(12, 34)); // WHERE rate IN (12, 34)
* $query->filterByRate(array('min' => 12)); // WHERE rate > 12
* </code>
*
* @param mixed $rate 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 filterByRate($rate = null, $comparison = null)
{
if (is_array($rate)) {
$useMinMax = false;
if (isset($rate['min'])) {
$this->addUsingAlias(CurrencyTableMap::RATE, $rate['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($rate['max'])) {
$this->addUsingAlias(CurrencyTableMap::RATE, $rate['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CurrencyTableMap::RATE, $rate, $comparison);
}
/**
* Filter the query on the by_default column
*
* Example usage:
* <code>
* $query->filterByByDefault(1234); // WHERE by_default = 1234
* $query->filterByByDefault(array(12, 34)); // WHERE by_default IN (12, 34)
* $query->filterByByDefault(array('min' => 12)); // WHERE by_default > 12
* </code>
*
* @param mixed $byDefault 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 filterByByDefault($byDefault = null, $comparison = null)
{
if (is_array($byDefault)) {
$useMinMax = false;
if (isset($byDefault['min'])) {
$this->addUsingAlias(CurrencyTableMap::BY_DEFAULT, $byDefault['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($byDefault['max'])) {
$this->addUsingAlias(CurrencyTableMap::BY_DEFAULT, $byDefault['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CurrencyTableMap::BY_DEFAULT, $byDefault, $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 ChildCurrencyQuery 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(CurrencyTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(CurrencyTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CurrencyTableMap::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 ChildCurrencyQuery 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(CurrencyTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(CurrencyTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CurrencyTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Order object
*
* @param \Thelia\Model\Order|ObjectCollection $order the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCurrencyQuery The current query, for fluid interface
*/
public function filterByOrder($order, $comparison = null)
{
if ($order instanceof \Thelia\Model\Order) {
return $this
->addUsingAlias(CurrencyTableMap::ID, $order->getCurrencyId(), $comparison);
} elseif ($order instanceof ObjectCollection) {
return $this
->useOrderQuery()
->filterByPrimaryKeys($order->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByOrder() only accepts arguments of type \Thelia\Model\Order or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Order relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCurrencyQuery The current query, for fluid interface
*/
public function joinOrder($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Order');
// 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, 'Order');
}
return $this;
}
/**
* Use the Order relation Order 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\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinOrder($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Order', '\Thelia\Model\OrderQuery');
}
/**
* Exclude object from result
*
* @param ChildCurrency $currency Object to remove from the list of results
*
* @return ChildCurrencyQuery The current query, for fluid interface
*/
public function prune($currency = null)
{
if ($currency) {
$this->addUsingAlias(CurrencyTableMap::ID, $currency->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the currency 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(CurrencyTableMap::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).
CurrencyTableMap::clearInstancePool();
CurrencyTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCurrency or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCurrency 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(CurrencyTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CurrencyTableMap::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();
CurrencyTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CurrencyTableMap::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 ChildCurrencyQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(CurrencyTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildCurrencyQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(CurrencyTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildCurrencyQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(CurrencyTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildCurrencyQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(CurrencyTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildCurrencyQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(CurrencyTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildCurrencyQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(CurrencyTableMap::CREATED_AT);
}
} // CurrencyQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,541 @@
<?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\CustomerTitleI18n as ChildCustomerTitleI18n;
use Thelia\Model\CustomerTitleI18nQuery as ChildCustomerTitleI18nQuery;
use Thelia\Model\Map\CustomerTitleI18nTableMap;
/**
* Base class that represents a query for the 'customer_title_i18n' table.
*
*
*
* @method ChildCustomerTitleI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCustomerTitleI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildCustomerTitleI18nQuery orderByShort($order = Criteria::ASC) Order by the short column
* @method ChildCustomerTitleI18nQuery orderByLong($order = Criteria::ASC) Order by the long column
*
* @method ChildCustomerTitleI18nQuery groupById() Group by the id column
* @method ChildCustomerTitleI18nQuery groupByLocale() Group by the locale column
* @method ChildCustomerTitleI18nQuery groupByShort() Group by the short column
* @method ChildCustomerTitleI18nQuery groupByLong() Group by the long column
*
* @method ChildCustomerTitleI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCustomerTitleI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCustomerTitleI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCustomerTitleI18nQuery leftJoinCustomerTitle($relationAlias = null) Adds a LEFT JOIN clause to the query using the CustomerTitle relation
* @method ChildCustomerTitleI18nQuery rightJoinCustomerTitle($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CustomerTitle relation
* @method ChildCustomerTitleI18nQuery innerJoinCustomerTitle($relationAlias = null) Adds a INNER JOIN clause to the query using the CustomerTitle relation
*
* @method ChildCustomerTitleI18n findOne(ConnectionInterface $con = null) Return the first ChildCustomerTitleI18n matching the query
* @method ChildCustomerTitleI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCustomerTitleI18n matching the query, or a new ChildCustomerTitleI18n object populated from the query conditions when no match is found
*
* @method ChildCustomerTitleI18n findOneById(int $id) Return the first ChildCustomerTitleI18n filtered by the id column
* @method ChildCustomerTitleI18n findOneByLocale(string $locale) Return the first ChildCustomerTitleI18n filtered by the locale column
* @method ChildCustomerTitleI18n findOneByShort(string $short) Return the first ChildCustomerTitleI18n filtered by the short column
* @method ChildCustomerTitleI18n findOneByLong(string $long) Return the first ChildCustomerTitleI18n filtered by the long column
*
* @method array findById(int $id) Return ChildCustomerTitleI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildCustomerTitleI18n objects filtered by the locale column
* @method array findByShort(string $short) Return ChildCustomerTitleI18n objects filtered by the short column
* @method array findByLong(string $long) Return ChildCustomerTitleI18n objects filtered by the long column
*
*/
abstract class CustomerTitleI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CustomerTitleI18nQuery 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\\CustomerTitleI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCustomerTitleI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCustomerTitleI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CustomerTitleI18nQuery) {
return $criteria;
}
$query = new \Thelia\Model\CustomerTitleI18nQuery();
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 ChildCustomerTitleI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CustomerTitleI18nTableMap::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(CustomerTitleI18nTableMap::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 ChildCustomerTitleI18n A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, LOCALE, SHORT, LONG FROM customer_title_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 ChildCustomerTitleI18n();
$obj->hydrate($row);
CustomerTitleI18nTableMap::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 ChildCustomerTitleI18n|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 ChildCustomerTitleI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(CustomerTitleI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(CustomerTitleI18nTableMap::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 ChildCustomerTitleI18nQuery 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(CustomerTitleI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(CustomerTitleI18nTableMap::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 filterByCustomerTitle()
*
* @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 ChildCustomerTitleI18nQuery 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(CustomerTitleI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CustomerTitleI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CustomerTitleI18nTableMap::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 ChildCustomerTitleI18nQuery 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(CustomerTitleI18nTableMap::LOCALE, $locale, $comparison);
}
/**
* Filter the query on the short column
*
* Example usage:
* <code>
* $query->filterByShort('fooValue'); // WHERE short = 'fooValue'
* $query->filterByShort('%fooValue%'); // WHERE short LIKE '%fooValue%'
* </code>
*
* @param string $short 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 ChildCustomerTitleI18nQuery The current query, for fluid interface
*/
public function filterByShort($short = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($short)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $short)) {
$short = str_replace('*', '%', $short);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTitleI18nTableMap::SHORT, $short, $comparison);
}
/**
* Filter the query on the long column
*
* Example usage:
* <code>
* $query->filterByLong('fooValue'); // WHERE long = 'fooValue'
* $query->filterByLong('%fooValue%'); // WHERE long LIKE '%fooValue%'
* </code>
*
* @param string $long 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 ChildCustomerTitleI18nQuery The current query, for fluid interface
*/
public function filterByLong($long = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($long)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $long)) {
$long = str_replace('*', '%', $long);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTitleI18nTableMap::LONG, $long, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\CustomerTitle object
*
* @param \Thelia\Model\CustomerTitle|ObjectCollection $customerTitle The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCustomerTitleI18nQuery The current query, for fluid interface
*/
public function filterByCustomerTitle($customerTitle, $comparison = null)
{
if ($customerTitle instanceof \Thelia\Model\CustomerTitle) {
return $this
->addUsingAlias(CustomerTitleI18nTableMap::ID, $customerTitle->getId(), $comparison);
} elseif ($customerTitle instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(CustomerTitleI18nTableMap::ID, $customerTitle->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCustomerTitle() only accepts arguments of type \Thelia\Model\CustomerTitle or Collection');
}
}
/**
* Adds a JOIN clause to the query using the CustomerTitle relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCustomerTitleI18nQuery The current query, for fluid interface
*/
public function joinCustomerTitle($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CustomerTitle');
// 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, 'CustomerTitle');
}
return $this;
}
/**
* Use the CustomerTitle relation CustomerTitle 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\CustomerTitleQuery A secondary query class using the current class as primary query
*/
public function useCustomerTitleQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinCustomerTitle($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerTitle', '\Thelia\Model\CustomerTitleQuery');
}
/**
* Exclude object from result
*
* @param ChildCustomerTitleI18n $customerTitleI18n Object to remove from the list of results
*
* @return ChildCustomerTitleI18nQuery The current query, for fluid interface
*/
public function prune($customerTitleI18n = null)
{
if ($customerTitleI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(CustomerTitleI18nTableMap::ID), $customerTitleI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(CustomerTitleI18nTableMap::LOCALE), $customerTitleI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the customer_title_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(CustomerTitleI18nTableMap::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).
CustomerTitleI18nTableMap::clearInstancePool();
CustomerTitleI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCustomerTitleI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCustomerTitleI18n 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(CustomerTitleI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CustomerTitleI18nTableMap::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();
CustomerTitleI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CustomerTitleI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // CustomerTitleI18nQuery

View File

@@ -0,0 +1,874 @@
<?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\CustomerTitle as ChildCustomerTitle;
use Thelia\Model\CustomerTitleI18nQuery as ChildCustomerTitleI18nQuery;
use Thelia\Model\CustomerTitleQuery as ChildCustomerTitleQuery;
use Thelia\Model\Map\CustomerTitleTableMap;
/**
* Base class that represents a query for the 'customer_title' table.
*
*
*
* @method ChildCustomerTitleQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildCustomerTitleQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
* @method ChildCustomerTitleQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildCustomerTitleQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCustomerTitleQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildCustomerTitleQuery groupById() Group by the id column
* @method ChildCustomerTitleQuery groupByByDefault() Group by the by_default column
* @method ChildCustomerTitleQuery groupByPosition() Group by the position column
* @method ChildCustomerTitleQuery groupByCreatedAt() Group by the created_at column
* @method ChildCustomerTitleQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildCustomerTitleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCustomerTitleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildCustomerTitleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildCustomerTitleQuery leftJoinCustomer($relationAlias = null) Adds a LEFT JOIN clause to the query using the Customer relation
* @method ChildCustomerTitleQuery rightJoinCustomer($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Customer relation
* @method ChildCustomerTitleQuery innerJoinCustomer($relationAlias = null) Adds a INNER JOIN clause to the query using the Customer relation
*
* @method ChildCustomerTitleQuery leftJoinAddress($relationAlias = null) Adds a LEFT JOIN clause to the query using the Address relation
* @method ChildCustomerTitleQuery rightJoinAddress($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Address relation
* @method ChildCustomerTitleQuery innerJoinAddress($relationAlias = null) Adds a INNER JOIN clause to the query using the Address relation
*
* @method ChildCustomerTitleQuery leftJoinCustomerTitleI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the CustomerTitleI18n relation
* @method ChildCustomerTitleQuery rightJoinCustomerTitleI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CustomerTitleI18n relation
* @method ChildCustomerTitleQuery innerJoinCustomerTitleI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the CustomerTitleI18n relation
*
* @method ChildCustomerTitle findOne(ConnectionInterface $con = null) Return the first ChildCustomerTitle matching the query
* @method ChildCustomerTitle findOneOrCreate(ConnectionInterface $con = null) Return the first ChildCustomerTitle matching the query, or a new ChildCustomerTitle object populated from the query conditions when no match is found
*
* @method ChildCustomerTitle findOneById(int $id) Return the first ChildCustomerTitle filtered by the id column
* @method ChildCustomerTitle findOneByByDefault(int $by_default) Return the first ChildCustomerTitle filtered by the by_default column
* @method ChildCustomerTitle findOneByPosition(string $position) Return the first ChildCustomerTitle filtered by the position column
* @method ChildCustomerTitle findOneByCreatedAt(string $created_at) Return the first ChildCustomerTitle filtered by the created_at column
* @method ChildCustomerTitle findOneByUpdatedAt(string $updated_at) Return the first ChildCustomerTitle filtered by the updated_at column
*
* @method array findById(int $id) Return ChildCustomerTitle objects filtered by the id column
* @method array findByByDefault(int $by_default) Return ChildCustomerTitle objects filtered by the by_default column
* @method array findByPosition(string $position) Return ChildCustomerTitle objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildCustomerTitle objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCustomerTitle objects filtered by the updated_at column
*
*/
abstract class CustomerTitleQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\CustomerTitleQuery 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\\CustomerTitle', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildCustomerTitleQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildCustomerTitleQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\CustomerTitleQuery) {
return $criteria;
}
$query = new \Thelia\Model\CustomerTitleQuery();
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 ChildCustomerTitle|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = CustomerTitleTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerTitleTableMap::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 ChildCustomerTitle A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM customer_title 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 ChildCustomerTitle();
$obj->hydrate($row);
CustomerTitleTableMap::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 ChildCustomerTitle|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 ChildCustomerTitleQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CustomerTitleTableMap::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 ChildCustomerTitleQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CustomerTitleTableMap::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 ChildCustomerTitleQuery 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(CustomerTitleTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(CustomerTitleTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CustomerTitleTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the by_default column
*
* Example usage:
* <code>
* $query->filterByByDefault(1234); // WHERE by_default = 1234
* $query->filterByByDefault(array(12, 34)); // WHERE by_default IN (12, 34)
* $query->filterByByDefault(array('min' => 12)); // WHERE by_default > 12
* </code>
*
* @param mixed $byDefault 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 ChildCustomerTitleQuery The current query, for fluid interface
*/
public function filterByByDefault($byDefault = null, $comparison = null)
{
if (is_array($byDefault)) {
$useMinMax = false;
if (isset($byDefault['min'])) {
$this->addUsingAlias(CustomerTitleTableMap::BY_DEFAULT, $byDefault['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($byDefault['max'])) {
$this->addUsingAlias(CustomerTitleTableMap::BY_DEFAULT, $byDefault['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CustomerTitleTableMap::BY_DEFAULT, $byDefault, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition('fooValue'); // WHERE position = 'fooValue'
* $query->filterByPosition('%fooValue%'); // WHERE position LIKE '%fooValue%'
* </code>
*
* @param string $position 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 ChildCustomerTitleQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($position)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $position)) {
$position = str_replace('*', '%', $position);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CustomerTitleTableMap::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 ChildCustomerTitleQuery 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(CustomerTitleTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(CustomerTitleTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CustomerTitleTableMap::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 ChildCustomerTitleQuery 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(CustomerTitleTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(CustomerTitleTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CustomerTitleTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Customer object
*
* @param \Thelia\Model\Customer|ObjectCollection $customer the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function filterByCustomer($customer, $comparison = null)
{
if ($customer instanceof \Thelia\Model\Customer) {
return $this
->addUsingAlias(CustomerTitleTableMap::ID, $customer->getCustomerTitleId(), $comparison);
} elseif ($customer instanceof ObjectCollection) {
return $this
->useCustomerQuery()
->filterByPrimaryKeys($customer->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByCustomer() only accepts arguments of type \Thelia\Model\Customer or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Customer relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function joinCustomer($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Customer');
// 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, 'Customer');
}
return $this;
}
/**
* Use the Customer relation Customer 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\CustomerQuery A secondary query class using the current class as primary query
*/
public function useCustomerQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCustomer($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Customer', '\Thelia\Model\CustomerQuery');
}
/**
* Filter the query by a related \Thelia\Model\Address object
*
* @param \Thelia\Model\Address|ObjectCollection $address the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function filterByAddress($address, $comparison = null)
{
if ($address instanceof \Thelia\Model\Address) {
return $this
->addUsingAlias(CustomerTitleTableMap::ID, $address->getCustomerTitleId(), $comparison);
} elseif ($address instanceof ObjectCollection) {
return $this
->useAddressQuery()
->filterByPrimaryKeys($address->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAddress() only accepts arguments of type \Thelia\Model\Address or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Address relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function joinAddress($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Address');
// 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, 'Address');
}
return $this;
}
/**
* Use the Address relation Address 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\AddressQuery A secondary query class using the current class as primary query
*/
public function useAddressQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinAddress($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Address', '\Thelia\Model\AddressQuery');
}
/**
* Filter the query by a related \Thelia\Model\CustomerTitleI18n object
*
* @param \Thelia\Model\CustomerTitleI18n|ObjectCollection $customerTitleI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function filterByCustomerTitleI18n($customerTitleI18n, $comparison = null)
{
if ($customerTitleI18n instanceof \Thelia\Model\CustomerTitleI18n) {
return $this
->addUsingAlias(CustomerTitleTableMap::ID, $customerTitleI18n->getId(), $comparison);
} elseif ($customerTitleI18n instanceof ObjectCollection) {
return $this
->useCustomerTitleI18nQuery()
->filterByPrimaryKeys($customerTitleI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByCustomerTitleI18n() only accepts arguments of type \Thelia\Model\CustomerTitleI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the CustomerTitleI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function joinCustomerTitleI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CustomerTitleI18n');
// 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, 'CustomerTitleI18n');
}
return $this;
}
/**
* Use the CustomerTitleI18n relation CustomerTitleI18n 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\CustomerTitleI18nQuery A secondary query class using the current class as primary query
*/
public function useCustomerTitleI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinCustomerTitleI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerTitleI18n', '\Thelia\Model\CustomerTitleI18nQuery');
}
/**
* Exclude object from result
*
* @param ChildCustomerTitle $customerTitle Object to remove from the list of results
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function prune($customerTitle = null)
{
if ($customerTitle) {
$this->addUsingAlias(CustomerTitleTableMap::ID, $customerTitle->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the customer_title 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(CustomerTitleTableMap::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).
CustomerTitleTableMap::clearInstancePool();
CustomerTitleTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildCustomerTitle or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildCustomerTitle 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(CustomerTitleTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(CustomerTitleTableMap::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();
CustomerTitleTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
CustomerTitleTableMap::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 ChildCustomerTitleQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(CustomerTitleTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(CustomerTitleTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(CustomerTitleTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(CustomerTitleTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(CustomerTitleTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildCustomerTitleQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(CustomerTitleTableMap::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 ChildCustomerTitleQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'CustomerTitleI18n';
return $this
->joinCustomerTitleI18n($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 ChildCustomerTitleQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('CustomerTitleI18n');
$this->with['CustomerTitleI18n']->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 ChildCustomerTitleI18nQuery A secondary query class using the current class as primary query
*/
public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerTitleI18n', '\Thelia\Model\CustomerTitleI18nQuery');
}
} // CustomerTitleQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,666 @@
<?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\Delivzone as ChildDelivzone;
use Thelia\Model\DelivzoneQuery as ChildDelivzoneQuery;
use Thelia\Model\Map\DelivzoneTableMap;
/**
* Base class that represents a query for the 'delivzone' table.
*
*
*
* @method ChildDelivzoneQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildDelivzoneQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
* @method ChildDelivzoneQuery orderByDelivery($order = Criteria::ASC) Order by the delivery column
* @method ChildDelivzoneQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildDelivzoneQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildDelivzoneQuery groupById() Group by the id column
* @method ChildDelivzoneQuery groupByAreaId() Group by the area_id column
* @method ChildDelivzoneQuery groupByDelivery() Group by the delivery column
* @method ChildDelivzoneQuery groupByCreatedAt() Group by the created_at column
* @method ChildDelivzoneQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildDelivzoneQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildDelivzoneQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildDelivzoneQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildDelivzoneQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
* @method ChildDelivzoneQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
* @method ChildDelivzoneQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
*
* @method ChildDelivzone findOne(ConnectionInterface $con = null) Return the first ChildDelivzone matching the query
* @method ChildDelivzone findOneOrCreate(ConnectionInterface $con = null) Return the first ChildDelivzone matching the query, or a new ChildDelivzone object populated from the query conditions when no match is found
*
* @method ChildDelivzone findOneById(int $id) Return the first ChildDelivzone filtered by the id column
* @method ChildDelivzone findOneByAreaId(int $area_id) Return the first ChildDelivzone filtered by the area_id column
* @method ChildDelivzone findOneByDelivery(string $delivery) Return the first ChildDelivzone filtered by the delivery column
* @method ChildDelivzone findOneByCreatedAt(string $created_at) Return the first ChildDelivzone filtered by the created_at column
* @method ChildDelivzone findOneByUpdatedAt(string $updated_at) Return the first ChildDelivzone filtered by the updated_at column
*
* @method array findById(int $id) Return ChildDelivzone objects filtered by the id column
* @method array findByAreaId(int $area_id) Return ChildDelivzone objects filtered by the area_id column
* @method array findByDelivery(string $delivery) Return ChildDelivzone objects filtered by the delivery column
* @method array findByCreatedAt(string $created_at) Return ChildDelivzone objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildDelivzone objects filtered by the updated_at column
*
*/
abstract class DelivzoneQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\DelivzoneQuery 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\\Delivzone', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildDelivzoneQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildDelivzoneQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\DelivzoneQuery) {
return $criteria;
}
$query = new \Thelia\Model\DelivzoneQuery();
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 ChildDelivzone|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = DelivzoneTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(DelivzoneTableMap::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 ChildDelivzone A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, AREA_ID, DELIVERY, CREATED_AT, UPDATED_AT FROM delivzone 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 ChildDelivzone();
$obj->hydrate($row);
DelivzoneTableMap::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 ChildDelivzone|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 ChildDelivzoneQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(DelivzoneTableMap::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 ChildDelivzoneQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(DelivzoneTableMap::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 ChildDelivzoneQuery 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(DelivzoneTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(DelivzoneTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(DelivzoneTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the area_id column
*
* Example usage:
* <code>
* $query->filterByAreaId(1234); // WHERE area_id = 1234
* $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
* $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
* </code>
*
* @see filterByArea()
*
* @param mixed $areaId 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 ChildDelivzoneQuery The current query, for fluid interface
*/
public function filterByAreaId($areaId = null, $comparison = null)
{
if (is_array($areaId)) {
$useMinMax = false;
if (isset($areaId['min'])) {
$this->addUsingAlias(DelivzoneTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($areaId['max'])) {
$this->addUsingAlias(DelivzoneTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(DelivzoneTableMap::AREA_ID, $areaId, $comparison);
}
/**
* Filter the query on the delivery column
*
* Example usage:
* <code>
* $query->filterByDelivery('fooValue'); // WHERE delivery = 'fooValue'
* $query->filterByDelivery('%fooValue%'); // WHERE delivery LIKE '%fooValue%'
* </code>
*
* @param string $delivery 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 ChildDelivzoneQuery The current query, for fluid interface
*/
public function filterByDelivery($delivery = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($delivery)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $delivery)) {
$delivery = str_replace('*', '%', $delivery);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(DelivzoneTableMap::DELIVERY, $delivery, $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 ChildDelivzoneQuery 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(DelivzoneTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(DelivzoneTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(DelivzoneTableMap::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 ChildDelivzoneQuery 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(DelivzoneTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(DelivzoneTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(DelivzoneTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Area object
*
* @param \Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildDelivzoneQuery The current query, for fluid interface
*/
public function filterByArea($area, $comparison = null)
{
if ($area instanceof \Thelia\Model\Area) {
return $this
->addUsingAlias(DelivzoneTableMap::AREA_ID, $area->getId(), $comparison);
} elseif ($area instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(DelivzoneTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByArea() only accepts arguments of type \Thelia\Model\Area or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Area relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildDelivzoneQuery The current query, for fluid interface
*/
public function joinArea($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Area');
// 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, 'Area');
}
return $this;
}
/**
* Use the Area relation Area 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\AreaQuery A secondary query class using the current class as primary query
*/
public function useAreaQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinArea($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Area', '\Thelia\Model\AreaQuery');
}
/**
* Exclude object from result
*
* @param ChildDelivzone $delivzone Object to remove from the list of results
*
* @return ChildDelivzoneQuery The current query, for fluid interface
*/
public function prune($delivzone = null)
{
if ($delivzone) {
$this->addUsingAlias(DelivzoneTableMap::ID, $delivzone->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the delivzone 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(DelivzoneTableMap::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).
DelivzoneTableMap::clearInstancePool();
DelivzoneTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildDelivzone or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildDelivzone 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(DelivzoneTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(DelivzoneTableMap::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();
DelivzoneTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
DelivzoneTableMap::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 ChildDelivzoneQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(DelivzoneTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildDelivzoneQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(DelivzoneTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildDelivzoneQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(DelivzoneTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildDelivzoneQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(DelivzoneTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildDelivzoneQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(DelivzoneTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildDelivzoneQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(DelivzoneTableMap::CREATED_AT);
}
} // DelivzoneQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,607 @@
<?php
namespace 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\DocumentI18n as ChildDocumentI18n;
use Thelia\Model\DocumentI18nQuery as ChildDocumentI18nQuery;
use Thelia\Model\Map\DocumentI18nTableMap;
/**
* Base class that represents a query for the 'document_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 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 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 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 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 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 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
*
*/
abstract class DocumentI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\DocumentI18nQuery 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)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildDocumentI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildDocumentI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\DocumentI18nQuery) {
return $criteria;
}
$query = new \Thelia\Model\DocumentI18nQuery();
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 ChildDocumentI18n|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) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(DocumentI18nTableMap::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 ChildDocumentI18n 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';
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 ChildDocumentI18n();
$obj->hydrate($row);
DocumentI18nTableMap::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 ChildDocumentI18n|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 ChildDocumentI18nQuery 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);
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 ChildDocumentI18nQuery 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(DocumentI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(DocumentI18nTableMap::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 filterByDocument()
*
* @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 ChildDocumentI18nQuery 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);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(DocumentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(DocumentI18nTableMap::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 ChildDocumentI18nQuery 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(DocumentI18nTableMap::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 ChildDocumentI18nQuery 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(DocumentI18nTableMap::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 ChildDocumentI18nQuery 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(DocumentI18nTableMap::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 ChildDocumentI18nQuery 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(DocumentI18nTableMap::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 ChildDocumentI18nQuery 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(DocumentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Document object
*
* @param \Thelia\Model\Document|ObjectCollection $document 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
*/
public function filterByDocument($document, $comparison = null)
{
if ($document instanceof \Thelia\Model\Document) {
return $this
->addUsingAlias(DocumentI18nTableMap::ID, $document->getId(), $comparison);
} elseif ($document instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(DocumentI18nTableMap::ID, $document->toKeyValue('PrimaryKey', 'Id'), $comparison);
} 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 ChildDocumentI18nQuery The current query, for fluid interface
*/
public function joinDocument($relationAlias = null, $joinType = '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 = 'LEFT JOIN')
{
return $this
->joinDocument($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Document', '\Thelia\Model\DocumentQuery');
}
/**
* Exclude object from result
*
* @param ChildDocumentI18n $documentI18n Object to remove from the list of results
*
* @return ChildDocumentI18nQuery The current query, for fluid interface
*/
public function prune($documentI18n = 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);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the 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(DocumentI18nTableMap::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).
DocumentI18nTableMap::clearInstancePool();
DocumentI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildDocumentI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildDocumentI18n 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(DocumentI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(DocumentI18nTableMap::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();
DocumentI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
DocumentI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // DocumentI18nQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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

View File

@@ -0,0 +1,845 @@
<?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\FeatureAv as ChildFeatureAv;
use Thelia\Model\FeatureAvI18nQuery as ChildFeatureAvI18nQuery;
use Thelia\Model\FeatureAvQuery as ChildFeatureAvQuery;
use Thelia\Model\Map\FeatureAvTableMap;
/**
* Base class that represents a query for the 'feature_av' table.
*
*
*
* @method ChildFeatureAvQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildFeatureAvQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
* @method ChildFeatureAvQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildFeatureAvQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildFeatureAvQuery groupById() Group by the id column
* @method ChildFeatureAvQuery groupByFeatureId() Group by the feature_id column
* @method ChildFeatureAvQuery groupByCreatedAt() Group by the created_at column
* @method ChildFeatureAvQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildFeatureAvQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildFeatureAvQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildFeatureAvQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildFeatureAvQuery leftJoinFeature($relationAlias = null) Adds a LEFT JOIN clause to the query using the Feature relation
* @method ChildFeatureAvQuery rightJoinFeature($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Feature relation
* @method ChildFeatureAvQuery innerJoinFeature($relationAlias = null) Adds a INNER JOIN clause to the query using the Feature relation
*
* @method ChildFeatureAvQuery leftJoinFeatureProd($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureProd relation
* @method ChildFeatureAvQuery rightJoinFeatureProd($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureProd relation
* @method ChildFeatureAvQuery innerJoinFeatureProd($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureProd relation
*
* @method ChildFeatureAvQuery leftJoinFeatureAvI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureAvI18n relation
* @method ChildFeatureAvQuery rightJoinFeatureAvI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureAvI18n relation
* @method ChildFeatureAvQuery innerJoinFeatureAvI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureAvI18n relation
*
* @method ChildFeatureAv findOne(ConnectionInterface $con = null) Return the first ChildFeatureAv matching the query
* @method ChildFeatureAv findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFeatureAv matching the query, or a new ChildFeatureAv object populated from the query conditions when no match is found
*
* @method ChildFeatureAv findOneById(int $id) Return the first ChildFeatureAv filtered by the id column
* @method ChildFeatureAv findOneByFeatureId(int $feature_id) Return the first ChildFeatureAv filtered by the feature_id column
* @method ChildFeatureAv findOneByCreatedAt(string $created_at) Return the first ChildFeatureAv filtered by the created_at column
* @method ChildFeatureAv findOneByUpdatedAt(string $updated_at) Return the first ChildFeatureAv filtered by the updated_at column
*
* @method array findById(int $id) Return ChildFeatureAv objects filtered by the id column
* @method array findByFeatureId(int $feature_id) Return ChildFeatureAv objects filtered by the feature_id column
* @method array findByCreatedAt(string $created_at) Return ChildFeatureAv objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildFeatureAv objects filtered by the updated_at column
*
*/
abstract class FeatureAvQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\FeatureAvQuery 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\\FeatureAv', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildFeatureAvQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildFeatureAvQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\FeatureAvQuery) {
return $criteria;
}
$query = new \Thelia\Model\FeatureAvQuery();
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 ChildFeatureAv|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = FeatureAvTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(FeatureAvTableMap::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 ChildFeatureAv A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, FEATURE_ID, CREATED_AT, UPDATED_AT FROM feature_av 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 ChildFeatureAv();
$obj->hydrate($row);
FeatureAvTableMap::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 ChildFeatureAv|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 ChildFeatureAvQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(FeatureAvTableMap::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 ChildFeatureAvQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(FeatureAvTableMap::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 ChildFeatureAvQuery 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(FeatureAvTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(FeatureAvTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureAvTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the feature_id column
*
* Example usage:
* <code>
* $query->filterByFeatureId(1234); // WHERE feature_id = 1234
* $query->filterByFeatureId(array(12, 34)); // WHERE feature_id IN (12, 34)
* $query->filterByFeatureId(array('min' => 12)); // WHERE feature_id > 12
* </code>
*
* @see filterByFeature()
*
* @param mixed $featureId 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 ChildFeatureAvQuery The current query, for fluid interface
*/
public function filterByFeatureId($featureId = null, $comparison = null)
{
if (is_array($featureId)) {
$useMinMax = false;
if (isset($featureId['min'])) {
$this->addUsingAlias(FeatureAvTableMap::FEATURE_ID, $featureId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($featureId['max'])) {
$this->addUsingAlias(FeatureAvTableMap::FEATURE_ID, $featureId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureAvTableMap::FEATURE_ID, $featureId, $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 ChildFeatureAvQuery 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(FeatureAvTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(FeatureAvTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureAvTableMap::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 ChildFeatureAvQuery 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(FeatureAvTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(FeatureAvTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureAvTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Feature object
*
* @param \Thelia\Model\Feature|ObjectCollection $feature The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function filterByFeature($feature, $comparison = null)
{
if ($feature instanceof \Thelia\Model\Feature) {
return $this
->addUsingAlias(FeatureAvTableMap::FEATURE_ID, $feature->getId(), $comparison);
} elseif ($feature instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(FeatureAvTableMap::FEATURE_ID, $feature->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByFeature() only accepts arguments of type \Thelia\Model\Feature or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Feature relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function joinFeature($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Feature');
// 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, 'Feature');
}
return $this;
}
/**
* Use the Feature relation Feature 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\FeatureQuery A secondary query class using the current class as primary query
*/
public function useFeatureQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinFeature($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Feature', '\Thelia\Model\FeatureQuery');
}
/**
* Filter the query by a related \Thelia\Model\FeatureProd object
*
* @param \Thelia\Model\FeatureProd|ObjectCollection $featureProd the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function filterByFeatureProd($featureProd, $comparison = null)
{
if ($featureProd instanceof \Thelia\Model\FeatureProd) {
return $this
->addUsingAlias(FeatureAvTableMap::ID, $featureProd->getFeatureAvId(), $comparison);
} elseif ($featureProd instanceof ObjectCollection) {
return $this
->useFeatureProdQuery()
->filterByPrimaryKeys($featureProd->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByFeatureProd() only accepts arguments of type \Thelia\Model\FeatureProd or Collection');
}
}
/**
* Adds a JOIN clause to the query using the FeatureProd relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function joinFeatureProd($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('FeatureProd');
// 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, 'FeatureProd');
}
return $this;
}
/**
* Use the FeatureProd relation FeatureProd 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\FeatureProdQuery A secondary query class using the current class as primary query
*/
public function useFeatureProdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinFeatureProd($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'FeatureProd', '\Thelia\Model\FeatureProdQuery');
}
/**
* Filter the query by a related \Thelia\Model\FeatureAvI18n object
*
* @param \Thelia\Model\FeatureAvI18n|ObjectCollection $featureAvI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function filterByFeatureAvI18n($featureAvI18n, $comparison = null)
{
if ($featureAvI18n instanceof \Thelia\Model\FeatureAvI18n) {
return $this
->addUsingAlias(FeatureAvTableMap::ID, $featureAvI18n->getId(), $comparison);
} elseif ($featureAvI18n instanceof ObjectCollection) {
return $this
->useFeatureAvI18nQuery()
->filterByPrimaryKeys($featureAvI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByFeatureAvI18n() only accepts arguments of type \Thelia\Model\FeatureAvI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the FeatureAvI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function joinFeatureAvI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('FeatureAvI18n');
// 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, 'FeatureAvI18n');
}
return $this;
}
/**
* Use the FeatureAvI18n relation FeatureAvI18n 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\FeatureAvI18nQuery A secondary query class using the current class as primary query
*/
public function useFeatureAvI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinFeatureAvI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'FeatureAvI18n', '\Thelia\Model\FeatureAvI18nQuery');
}
/**
* Exclude object from result
*
* @param ChildFeatureAv $featureAv Object to remove from the list of results
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function prune($featureAv = null)
{
if ($featureAv) {
$this->addUsingAlias(FeatureAvTableMap::ID, $featureAv->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the feature_av 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(FeatureAvTableMap::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).
FeatureAvTableMap::clearInstancePool();
FeatureAvTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildFeatureAv or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildFeatureAv 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(FeatureAvTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(FeatureAvTableMap::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();
FeatureAvTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
FeatureAvTableMap::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 ChildFeatureAvQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(FeatureAvTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(FeatureAvTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(FeatureAvTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(FeatureAvTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(FeatureAvTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildFeatureAvQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(FeatureAvTableMap::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 ChildFeatureAvQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'FeatureAvI18n';
return $this
->joinFeatureAvI18n($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 ChildFeatureAvQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('FeatureAvI18n');
$this->with['FeatureAvI18n']->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 ChildFeatureAvI18nQuery A secondary query class using the current class as primary query
*/
public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'FeatureAvI18n', '\Thelia\Model\FeatureAvI18nQuery');
}
} // FeatureAvQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,759 @@
<?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\FeatureCategory as ChildFeatureCategory;
use Thelia\Model\FeatureCategoryQuery as ChildFeatureCategoryQuery;
use Thelia\Model\Map\FeatureCategoryTableMap;
/**
* Base class that represents a query for the 'feature_category' table.
*
*
*
* @method ChildFeatureCategoryQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildFeatureCategoryQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
* @method ChildFeatureCategoryQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
* @method ChildFeatureCategoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildFeatureCategoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildFeatureCategoryQuery groupById() Group by the id column
* @method ChildFeatureCategoryQuery groupByFeatureId() Group by the feature_id column
* @method ChildFeatureCategoryQuery groupByCategoryId() Group by the category_id column
* @method ChildFeatureCategoryQuery groupByCreatedAt() Group by the created_at column
* @method ChildFeatureCategoryQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildFeatureCategoryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildFeatureCategoryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildFeatureCategoryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildFeatureCategoryQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
* @method ChildFeatureCategoryQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
* @method ChildFeatureCategoryQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
*
* @method ChildFeatureCategoryQuery leftJoinFeature($relationAlias = null) Adds a LEFT JOIN clause to the query using the Feature relation
* @method ChildFeatureCategoryQuery rightJoinFeature($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Feature relation
* @method ChildFeatureCategoryQuery innerJoinFeature($relationAlias = null) Adds a INNER JOIN clause to the query using the Feature relation
*
* @method ChildFeatureCategory findOne(ConnectionInterface $con = null) Return the first ChildFeatureCategory matching the query
* @method ChildFeatureCategory findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFeatureCategory matching the query, or a new ChildFeatureCategory object populated from the query conditions when no match is found
*
* @method ChildFeatureCategory findOneById(int $id) Return the first ChildFeatureCategory filtered by the id column
* @method ChildFeatureCategory findOneByFeatureId(int $feature_id) Return the first ChildFeatureCategory filtered by the feature_id column
* @method ChildFeatureCategory findOneByCategoryId(int $category_id) Return the first ChildFeatureCategory filtered by the category_id column
* @method ChildFeatureCategory findOneByCreatedAt(string $created_at) Return the first ChildFeatureCategory filtered by the created_at column
* @method ChildFeatureCategory findOneByUpdatedAt(string $updated_at) Return the first ChildFeatureCategory filtered by the updated_at column
*
* @method array findById(int $id) Return ChildFeatureCategory objects filtered by the id column
* @method array findByFeatureId(int $feature_id) Return ChildFeatureCategory objects filtered by the feature_id column
* @method array findByCategoryId(int $category_id) Return ChildFeatureCategory objects filtered by the category_id column
* @method array findByCreatedAt(string $created_at) Return ChildFeatureCategory objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildFeatureCategory objects filtered by the updated_at column
*
*/
abstract class FeatureCategoryQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\FeatureCategoryQuery 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\\FeatureCategory', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildFeatureCategoryQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildFeatureCategoryQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\FeatureCategoryQuery) {
return $criteria;
}
$query = new \Thelia\Model\FeatureCategoryQuery();
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 ChildFeatureCategory|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = FeatureCategoryTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(FeatureCategoryTableMap::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 ChildFeatureCategory A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, FEATURE_ID, CATEGORY_ID, CREATED_AT, UPDATED_AT FROM feature_category 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 ChildFeatureCategory();
$obj->hydrate($row);
FeatureCategoryTableMap::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 ChildFeatureCategory|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 ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(FeatureCategoryTableMap::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 ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(FeatureCategoryTableMap::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 ChildFeatureCategoryQuery 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(FeatureCategoryTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(FeatureCategoryTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureCategoryTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the feature_id column
*
* Example usage:
* <code>
* $query->filterByFeatureId(1234); // WHERE feature_id = 1234
* $query->filterByFeatureId(array(12, 34)); // WHERE feature_id IN (12, 34)
* $query->filterByFeatureId(array('min' => 12)); // WHERE feature_id > 12
* </code>
*
* @see filterByFeature()
*
* @param mixed $featureId 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 ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function filterByFeatureId($featureId = null, $comparison = null)
{
if (is_array($featureId)) {
$useMinMax = false;
if (isset($featureId['min'])) {
$this->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $featureId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($featureId['max'])) {
$this->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $featureId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $featureId, $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 ChildFeatureCategoryQuery 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(FeatureCategoryTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($categoryId['max'])) {
$this->addUsingAlias(FeatureCategoryTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureCategoryTableMap::CATEGORY_ID, $categoryId, $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 ChildFeatureCategoryQuery 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(FeatureCategoryTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(FeatureCategoryTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureCategoryTableMap::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 ChildFeatureCategoryQuery 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(FeatureCategoryTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(FeatureCategoryTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureCategoryTableMap::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 ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function filterByCategory($category, $comparison = null)
{
if ($category instanceof \Thelia\Model\Category) {
return $this
->addUsingAlias(FeatureCategoryTableMap::CATEGORY_ID, $category->getId(), $comparison);
} elseif ($category instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(FeatureCategoryTableMap::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 ChildFeatureCategoryQuery 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\Feature object
*
* @param \Thelia\Model\Feature|ObjectCollection $feature The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function filterByFeature($feature, $comparison = null)
{
if ($feature instanceof \Thelia\Model\Feature) {
return $this
->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $feature->getId(), $comparison);
} elseif ($feature instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(FeatureCategoryTableMap::FEATURE_ID, $feature->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByFeature() only accepts arguments of type \Thelia\Model\Feature or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Feature relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function joinFeature($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Feature');
// 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, 'Feature');
}
return $this;
}
/**
* Use the Feature relation Feature 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\FeatureQuery A secondary query class using the current class as primary query
*/
public function useFeatureQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinFeature($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Feature', '\Thelia\Model\FeatureQuery');
}
/**
* Exclude object from result
*
* @param ChildFeatureCategory $featureCategory Object to remove from the list of results
*
* @return ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function prune($featureCategory = null)
{
if ($featureCategory) {
$this->addUsingAlias(FeatureCategoryTableMap::ID, $featureCategory->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the feature_category 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(FeatureCategoryTableMap::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).
FeatureCategoryTableMap::clearInstancePool();
FeatureCategoryTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildFeatureCategory or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildFeatureCategory 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(FeatureCategoryTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(FeatureCategoryTableMap::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();
FeatureCategoryTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
FeatureCategoryTableMap::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 ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(FeatureCategoryTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(FeatureCategoryTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(FeatureCategoryTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(FeatureCategoryTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(FeatureCategoryTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildFeatureCategoryQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(FeatureCategoryTableMap::CREATED_AT);
}
} // FeatureCategoryQuery

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,963 @@
<?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\FeatureProd as ChildFeatureProd;
use Thelia\Model\FeatureProdQuery as ChildFeatureProdQuery;
use Thelia\Model\Map\FeatureProdTableMap;
/**
* Base class that represents a query for the 'feature_prod' table.
*
*
*
* @method ChildFeatureProdQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildFeatureProdQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
* @method ChildFeatureProdQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
* @method ChildFeatureProdQuery orderByFeatureAvId($order = Criteria::ASC) Order by the feature_av_id column
* @method ChildFeatureProdQuery orderByByDefault($order = Criteria::ASC) Order by the by_default column
* @method ChildFeatureProdQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildFeatureProdQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildFeatureProdQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildFeatureProdQuery groupById() Group by the id column
* @method ChildFeatureProdQuery groupByProductId() Group by the product_id column
* @method ChildFeatureProdQuery groupByFeatureId() Group by the feature_id column
* @method ChildFeatureProdQuery groupByFeatureAvId() Group by the feature_av_id column
* @method ChildFeatureProdQuery groupByByDefault() Group by the by_default column
* @method ChildFeatureProdQuery groupByPosition() Group by the position column
* @method ChildFeatureProdQuery groupByCreatedAt() Group by the created_at column
* @method ChildFeatureProdQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildFeatureProdQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildFeatureProdQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildFeatureProdQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildFeatureProdQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
* @method ChildFeatureProdQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
* @method ChildFeatureProdQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product relation
*
* @method ChildFeatureProdQuery leftJoinFeature($relationAlias = null) Adds a LEFT JOIN clause to the query using the Feature relation
* @method ChildFeatureProdQuery rightJoinFeature($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Feature relation
* @method ChildFeatureProdQuery innerJoinFeature($relationAlias = null) Adds a INNER JOIN clause to the query using the Feature relation
*
* @method ChildFeatureProdQuery leftJoinFeatureAv($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureAv relation
* @method ChildFeatureProdQuery rightJoinFeatureAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureAv relation
* @method ChildFeatureProdQuery innerJoinFeatureAv($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureAv relation
*
* @method ChildFeatureProd findOne(ConnectionInterface $con = null) Return the first ChildFeatureProd matching the query
* @method ChildFeatureProd findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFeatureProd matching the query, or a new ChildFeatureProd object populated from the query conditions when no match is found
*
* @method ChildFeatureProd findOneById(int $id) Return the first ChildFeatureProd filtered by the id column
* @method ChildFeatureProd findOneByProductId(int $product_id) Return the first ChildFeatureProd filtered by the product_id column
* @method ChildFeatureProd findOneByFeatureId(int $feature_id) Return the first ChildFeatureProd filtered by the feature_id column
* @method ChildFeatureProd findOneByFeatureAvId(int $feature_av_id) Return the first ChildFeatureProd filtered by the feature_av_id column
* @method ChildFeatureProd findOneByByDefault(string $by_default) Return the first ChildFeatureProd filtered by the by_default column
* @method ChildFeatureProd findOneByPosition(int $position) Return the first ChildFeatureProd filtered by the position column
* @method ChildFeatureProd findOneByCreatedAt(string $created_at) Return the first ChildFeatureProd filtered by the created_at column
* @method ChildFeatureProd findOneByUpdatedAt(string $updated_at) Return the first ChildFeatureProd filtered by the updated_at column
*
* @method array findById(int $id) Return ChildFeatureProd objects filtered by the id column
* @method array findByProductId(int $product_id) Return ChildFeatureProd objects filtered by the product_id column
* @method array findByFeatureId(int $feature_id) Return ChildFeatureProd objects filtered by the feature_id column
* @method array findByFeatureAvId(int $feature_av_id) Return ChildFeatureProd objects filtered by the feature_av_id column
* @method array findByByDefault(string $by_default) Return ChildFeatureProd objects filtered by the by_default column
* @method array findByPosition(int $position) Return ChildFeatureProd objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildFeatureProd objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildFeatureProd objects filtered by the updated_at column
*
*/
abstract class FeatureProdQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\FeatureProdQuery 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\\FeatureProd', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildFeatureProdQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildFeatureProdQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\FeatureProdQuery) {
return $criteria;
}
$query = new \Thelia\Model\FeatureProdQuery();
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 ChildFeatureProd|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = FeatureProdTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(FeatureProdTableMap::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 ChildFeatureProd A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, PRODUCT_ID, FEATURE_ID, FEATURE_AV_ID, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM feature_prod 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 ChildFeatureProd();
$obj->hydrate($row);
FeatureProdTableMap::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 ChildFeatureProd|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 ChildFeatureProdQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(FeatureProdTableMap::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 ChildFeatureProdQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(FeatureProdTableMap::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 ChildFeatureProdQuery 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(FeatureProdTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(FeatureProdTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureProdTableMap::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 ChildFeatureProdQuery 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(FeatureProdTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($productId['max'])) {
$this->addUsingAlias(FeatureProdTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureProdTableMap::PRODUCT_ID, $productId, $comparison);
}
/**
* Filter the query on the feature_id column
*
* Example usage:
* <code>
* $query->filterByFeatureId(1234); // WHERE feature_id = 1234
* $query->filterByFeatureId(array(12, 34)); // WHERE feature_id IN (12, 34)
* $query->filterByFeatureId(array('min' => 12)); // WHERE feature_id > 12
* </code>
*
* @see filterByFeature()
*
* @param mixed $featureId 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 ChildFeatureProdQuery The current query, for fluid interface
*/
public function filterByFeatureId($featureId = null, $comparison = null)
{
if (is_array($featureId)) {
$useMinMax = false;
if (isset($featureId['min'])) {
$this->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $featureId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($featureId['max'])) {
$this->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $featureId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $featureId, $comparison);
}
/**
* Filter the query on the feature_av_id column
*
* Example usage:
* <code>
* $query->filterByFeatureAvId(1234); // WHERE feature_av_id = 1234
* $query->filterByFeatureAvId(array(12, 34)); // WHERE feature_av_id IN (12, 34)
* $query->filterByFeatureAvId(array('min' => 12)); // WHERE feature_av_id > 12
* </code>
*
* @see filterByFeatureAv()
*
* @param mixed $featureAvId 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 ChildFeatureProdQuery The current query, for fluid interface
*/
public function filterByFeatureAvId($featureAvId = null, $comparison = null)
{
if (is_array($featureAvId)) {
$useMinMax = false;
if (isset($featureAvId['min'])) {
$this->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAvId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($featureAvId['max'])) {
$this->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAvId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAvId, $comparison);
}
/**
* Filter the query on the by_default column
*
* Example usage:
* <code>
* $query->filterByByDefault('fooValue'); // WHERE by_default = 'fooValue'
* $query->filterByByDefault('%fooValue%'); // WHERE by_default LIKE '%fooValue%'
* </code>
*
* @param string $byDefault 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 ChildFeatureProdQuery The current query, for fluid interface
*/
public function filterByByDefault($byDefault = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($byDefault)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $byDefault)) {
$byDefault = str_replace('*', '%', $byDefault);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(FeatureProdTableMap::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 ChildFeatureProdQuery 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(FeatureProdTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(FeatureProdTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureProdTableMap::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 ChildFeatureProdQuery 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(FeatureProdTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(FeatureProdTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureProdTableMap::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 ChildFeatureProdQuery 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(FeatureProdTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(FeatureProdTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureProdTableMap::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 ChildFeatureProdQuery The current query, for fluid interface
*/
public function filterByProduct($product, $comparison = null)
{
if ($product instanceof \Thelia\Model\Product) {
return $this
->addUsingAlias(FeatureProdTableMap::PRODUCT_ID, $product->getId(), $comparison);
} elseif ($product instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(FeatureProdTableMap::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 ChildFeatureProdQuery 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\Feature object
*
* @param \Thelia\Model\Feature|ObjectCollection $feature The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function filterByFeature($feature, $comparison = null)
{
if ($feature instanceof \Thelia\Model\Feature) {
return $this
->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $feature->getId(), $comparison);
} elseif ($feature instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(FeatureProdTableMap::FEATURE_ID, $feature->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByFeature() only accepts arguments of type \Thelia\Model\Feature or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Feature relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function joinFeature($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Feature');
// 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, 'Feature');
}
return $this;
}
/**
* Use the Feature relation Feature 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\FeatureQuery A secondary query class using the current class as primary query
*/
public function useFeatureQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinFeature($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Feature', '\Thelia\Model\FeatureQuery');
}
/**
* Filter the query by a related \Thelia\Model\FeatureAv object
*
* @param \Thelia\Model\FeatureAv|ObjectCollection $featureAv The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function filterByFeatureAv($featureAv, $comparison = null)
{
if ($featureAv instanceof \Thelia\Model\FeatureAv) {
return $this
->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAv->getId(), $comparison);
} elseif ($featureAv instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(FeatureProdTableMap::FEATURE_AV_ID, $featureAv->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByFeatureAv() only accepts arguments of type \Thelia\Model\FeatureAv or Collection');
}
}
/**
* Adds a JOIN clause to the query using the FeatureAv relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function joinFeatureAv($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('FeatureAv');
// 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, 'FeatureAv');
}
return $this;
}
/**
* Use the FeatureAv relation FeatureAv 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\FeatureAvQuery A secondary query class using the current class as primary query
*/
public function useFeatureAvQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinFeatureAv($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'FeatureAv', '\Thelia\Model\FeatureAvQuery');
}
/**
* Exclude object from result
*
* @param ChildFeatureProd $featureProd Object to remove from the list of results
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function prune($featureProd = null)
{
if ($featureProd) {
$this->addUsingAlias(FeatureProdTableMap::ID, $featureProd->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the feature_prod 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(FeatureProdTableMap::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).
FeatureProdTableMap::clearInstancePool();
FeatureProdTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildFeatureProd or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildFeatureProd 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(FeatureProdTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(FeatureProdTableMap::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();
FeatureProdTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
FeatureProdTableMap::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 ChildFeatureProdQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(FeatureProdTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(FeatureProdTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(FeatureProdTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(FeatureProdTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(FeatureProdTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildFeatureProdQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(FeatureProdTableMap::CREATED_AT);
}
} // FeatureProdQuery

View File

@@ -0,0 +1,980 @@
<?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\Feature as ChildFeature;
use Thelia\Model\FeatureI18nQuery as ChildFeatureI18nQuery;
use Thelia\Model\FeatureQuery as ChildFeatureQuery;
use Thelia\Model\Map\FeatureTableMap;
/**
* Base class that represents a query for the 'feature' table.
*
*
*
* @method ChildFeatureQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildFeatureQuery orderByVisible($order = Criteria::ASC) Order by the visible column
* @method ChildFeatureQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildFeatureQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildFeatureQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildFeatureQuery groupById() Group by the id column
* @method ChildFeatureQuery groupByVisible() Group by the visible column
* @method ChildFeatureQuery groupByPosition() Group by the position column
* @method ChildFeatureQuery groupByCreatedAt() Group by the created_at column
* @method ChildFeatureQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildFeatureQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildFeatureQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildFeatureQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildFeatureQuery leftJoinFeatureAv($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureAv relation
* @method ChildFeatureQuery rightJoinFeatureAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureAv relation
* @method ChildFeatureQuery innerJoinFeatureAv($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureAv relation
*
* @method ChildFeatureQuery leftJoinFeatureProd($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureProd relation
* @method ChildFeatureQuery rightJoinFeatureProd($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureProd relation
* @method ChildFeatureQuery innerJoinFeatureProd($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureProd relation
*
* @method ChildFeatureQuery leftJoinFeatureCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureCategory relation
* @method ChildFeatureQuery rightJoinFeatureCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureCategory relation
* @method ChildFeatureQuery innerJoinFeatureCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureCategory relation
*
* @method ChildFeatureQuery leftJoinFeatureI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureI18n relation
* @method ChildFeatureQuery rightJoinFeatureI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureI18n relation
* @method ChildFeatureQuery innerJoinFeatureI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureI18n relation
*
* @method ChildFeature findOne(ConnectionInterface $con = null) Return the first ChildFeature matching the query
* @method ChildFeature findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFeature matching the query, or a new ChildFeature object populated from the query conditions when no match is found
*
* @method ChildFeature findOneById(int $id) Return the first ChildFeature filtered by the id column
* @method ChildFeature findOneByVisible(int $visible) Return the first ChildFeature filtered by the visible column
* @method ChildFeature findOneByPosition(int $position) Return the first ChildFeature filtered by the position column
* @method ChildFeature findOneByCreatedAt(string $created_at) Return the first ChildFeature filtered by the created_at column
* @method ChildFeature findOneByUpdatedAt(string $updated_at) Return the first ChildFeature filtered by the updated_at column
*
* @method array findById(int $id) Return ChildFeature objects filtered by the id column
* @method array findByVisible(int $visible) Return ChildFeature objects filtered by the visible column
* @method array findByPosition(int $position) Return ChildFeature objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildFeature objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildFeature objects filtered by the updated_at column
*
*/
abstract class FeatureQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\FeatureQuery 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\\Feature', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildFeatureQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildFeatureQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\FeatureQuery) {
return $criteria;
}
$query = new \Thelia\Model\FeatureQuery();
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 ChildFeature|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = FeatureTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(FeatureTableMap::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 ChildFeature A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, VISIBLE, POSITION, CREATED_AT, UPDATED_AT FROM feature 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 ChildFeature();
$obj->hydrate($row);
FeatureTableMap::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 ChildFeature|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 ChildFeatureQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(FeatureTableMap::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 ChildFeatureQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(FeatureTableMap::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 ChildFeatureQuery 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(FeatureTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(FeatureTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the visible column
*
* Example usage:
* <code>
* $query->filterByVisible(1234); // WHERE visible = 1234
* $query->filterByVisible(array(12, 34)); // WHERE visible IN (12, 34)
* $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
* </code>
*
* @param mixed $visible The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function filterByVisible($visible = null, $comparison = null)
{
if (is_array($visible)) {
$useMinMax = false;
if (isset($visible['min'])) {
$this->addUsingAlias(FeatureTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($visible['max'])) {
$this->addUsingAlias(FeatureTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureTableMap::VISIBLE, $visible, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureQuery 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(FeatureTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(FeatureTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureTableMap::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 ChildFeatureQuery 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(FeatureTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(FeatureTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureTableMap::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 ChildFeatureQuery 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(FeatureTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(FeatureTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FeatureTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\FeatureAv object
*
* @param \Thelia\Model\FeatureAv|ObjectCollection $featureAv the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function filterByFeatureAv($featureAv, $comparison = null)
{
if ($featureAv instanceof \Thelia\Model\FeatureAv) {
return $this
->addUsingAlias(FeatureTableMap::ID, $featureAv->getFeatureId(), $comparison);
} elseif ($featureAv instanceof ObjectCollection) {
return $this
->useFeatureAvQuery()
->filterByPrimaryKeys($featureAv->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByFeatureAv() only accepts arguments of type \Thelia\Model\FeatureAv or Collection');
}
}
/**
* Adds a JOIN clause to the query using the FeatureAv relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function joinFeatureAv($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('FeatureAv');
// 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, 'FeatureAv');
}
return $this;
}
/**
* Use the FeatureAv relation FeatureAv 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\FeatureAvQuery A secondary query class using the current class as primary query
*/
public function useFeatureAvQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinFeatureAv($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'FeatureAv', '\Thelia\Model\FeatureAvQuery');
}
/**
* Filter the query by a related \Thelia\Model\FeatureProd object
*
* @param \Thelia\Model\FeatureProd|ObjectCollection $featureProd the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function filterByFeatureProd($featureProd, $comparison = null)
{
if ($featureProd instanceof \Thelia\Model\FeatureProd) {
return $this
->addUsingAlias(FeatureTableMap::ID, $featureProd->getFeatureId(), $comparison);
} elseif ($featureProd instanceof ObjectCollection) {
return $this
->useFeatureProdQuery()
->filterByPrimaryKeys($featureProd->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByFeatureProd() only accepts arguments of type \Thelia\Model\FeatureProd or Collection');
}
}
/**
* Adds a JOIN clause to the query using the FeatureProd relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function joinFeatureProd($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('FeatureProd');
// 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, 'FeatureProd');
}
return $this;
}
/**
* Use the FeatureProd relation FeatureProd 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\FeatureProdQuery A secondary query class using the current class as primary query
*/
public function useFeatureProdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinFeatureProd($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'FeatureProd', '\Thelia\Model\FeatureProdQuery');
}
/**
* Filter the query by a related \Thelia\Model\FeatureCategory object
*
* @param \Thelia\Model\FeatureCategory|ObjectCollection $featureCategory the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function filterByFeatureCategory($featureCategory, $comparison = null)
{
if ($featureCategory instanceof \Thelia\Model\FeatureCategory) {
return $this
->addUsingAlias(FeatureTableMap::ID, $featureCategory->getFeatureId(), $comparison);
} elseif ($featureCategory instanceof ObjectCollection) {
return $this
->useFeatureCategoryQuery()
->filterByPrimaryKeys($featureCategory->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByFeatureCategory() only accepts arguments of type \Thelia\Model\FeatureCategory or Collection');
}
}
/**
* Adds a JOIN clause to the query using the FeatureCategory relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function joinFeatureCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('FeatureCategory');
// 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, 'FeatureCategory');
}
return $this;
}
/**
* Use the FeatureCategory relation FeatureCategory 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\FeatureCategoryQuery A secondary query class using the current class as primary query
*/
public function useFeatureCategoryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinFeatureCategory($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'FeatureCategory', '\Thelia\Model\FeatureCategoryQuery');
}
/**
* Filter the query by a related \Thelia\Model\FeatureI18n object
*
* @param \Thelia\Model\FeatureI18n|ObjectCollection $featureI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function filterByFeatureI18n($featureI18n, $comparison = null)
{
if ($featureI18n instanceof \Thelia\Model\FeatureI18n) {
return $this
->addUsingAlias(FeatureTableMap::ID, $featureI18n->getId(), $comparison);
} elseif ($featureI18n instanceof ObjectCollection) {
return $this
->useFeatureI18nQuery()
->filterByPrimaryKeys($featureI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByFeatureI18n() only accepts arguments of type \Thelia\Model\FeatureI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the FeatureI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function joinFeatureI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('FeatureI18n');
// 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, 'FeatureI18n');
}
return $this;
}
/**
* Use the FeatureI18n relation FeatureI18n 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\FeatureI18nQuery A secondary query class using the current class as primary query
*/
public function useFeatureI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinFeatureI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'FeatureI18n', '\Thelia\Model\FeatureI18nQuery');
}
/**
* Filter the query by a related Category object
* using the feature_category table as cross reference
*
* @param Category $category the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function filterByCategory($category, $comparison = Criteria::EQUAL)
{
return $this
->useFeatureCategoryQuery()
->filterByCategory($category, $comparison)
->endUse();
}
/**
* Exclude object from result
*
* @param ChildFeature $feature Object to remove from the list of results
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function prune($feature = null)
{
if ($feature) {
$this->addUsingAlias(FeatureTableMap::ID, $feature->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the feature 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(FeatureTableMap::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).
FeatureTableMap::clearInstancePool();
FeatureTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildFeature or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildFeature 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(FeatureTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(FeatureTableMap::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();
FeatureTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
FeatureTableMap::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 ChildFeatureQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(FeatureTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(FeatureTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(FeatureTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(FeatureTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(FeatureTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildFeatureQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(FeatureTableMap::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 ChildFeatureQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'FeatureI18n';
return $this
->joinFeatureI18n($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 ChildFeatureQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('FeatureI18n');
$this->with['FeatureI18n']->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 ChildFeatureI18nQuery A secondary query class using the current class as primary query
*/
public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'FeatureI18n', '\Thelia\Model\FeatureI18nQuery');
}
} // FeatureQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,607 @@
<?php
namespace 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\FolderI18n as ChildFolderI18n;
use Thelia\Model\FolderI18nQuery as ChildFolderI18nQuery;
use Thelia\Model\Map\FolderI18nTableMap;
/**
* Base class that represents a query for the 'folder_i18n' table.
*
*
*
* @method ChildFolderI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildFolderI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildFolderI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildFolderI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildFolderI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildFolderI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
*
* @method ChildFolderI18nQuery groupById() Group by the id column
* @method ChildFolderI18nQuery groupByLocale() Group by the locale column
* @method ChildFolderI18nQuery groupByTitle() Group by the title column
* @method ChildFolderI18nQuery groupByDescription() Group by the description column
* @method ChildFolderI18nQuery groupByChapo() Group by the chapo column
* @method ChildFolderI18nQuery groupByPostscriptum() Group by the postscriptum column
*
* @method ChildFolderI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildFolderI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildFolderI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildFolderI18nQuery leftJoinFolder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Folder relation
* @method ChildFolderI18nQuery rightJoinFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Folder relation
* @method ChildFolderI18nQuery innerJoinFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the Folder relation
*
* @method ChildFolderI18n findOne(ConnectionInterface $con = null) Return the first ChildFolderI18n matching the query
* @method ChildFolderI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderI18n matching the query, or a new ChildFolderI18n object populated from the query conditions when no match is found
*
* @method ChildFolderI18n findOneById(int $id) Return the first ChildFolderI18n filtered by the id column
* @method ChildFolderI18n findOneByLocale(string $locale) Return the first ChildFolderI18n filtered by the locale column
* @method ChildFolderI18n findOneByTitle(string $title) Return the first ChildFolderI18n filtered by the title column
* @method ChildFolderI18n findOneByDescription(string $description) Return the first ChildFolderI18n filtered by the description column
* @method ChildFolderI18n findOneByChapo(string $chapo) Return the first ChildFolderI18n filtered by the chapo column
* @method ChildFolderI18n findOneByPostscriptum(string $postscriptum) Return the first ChildFolderI18n filtered by the postscriptum column
*
* @method array findById(int $id) Return ChildFolderI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildFolderI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildFolderI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildFolderI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildFolderI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildFolderI18n objects filtered by the postscriptum column
*
*/
abstract class FolderI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\FolderI18nQuery 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\\FolderI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildFolderI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildFolderI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\FolderI18nQuery) {
return $criteria;
}
$query = new \Thelia\Model\FolderI18nQuery();
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 ChildFolderI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = FolderI18nTableMap::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(FolderI18nTableMap::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 ChildFolderI18n 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_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 ChildFolderI18n();
$obj->hydrate($row);
FolderI18nTableMap::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 ChildFolderI18n|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 ChildFolderI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(FolderI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(FolderI18nTableMap::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 ChildFolderI18nQuery 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(FolderI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(FolderI18nTableMap::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 filterByFolder()
*
* @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 ChildFolderI18nQuery 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(FolderI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(FolderI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FolderI18nTableMap::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 ChildFolderI18nQuery 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(FolderI18nTableMap::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 ChildFolderI18nQuery 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(FolderI18nTableMap::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 ChildFolderI18nQuery 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(FolderI18nTableMap::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 ChildFolderI18nQuery 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(FolderI18nTableMap::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 ChildFolderI18nQuery 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(FolderI18nTableMap::POSTSCRIPTUM, $postscriptum, $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 ChildFolderI18nQuery The current query, for fluid interface
*/
public function filterByFolder($folder, $comparison = null)
{
if ($folder instanceof \Thelia\Model\Folder) {
return $this
->addUsingAlias(FolderI18nTableMap::ID, $folder->getId(), $comparison);
} elseif ($folder instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(FolderI18nTableMap::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 ChildFolderI18nQuery The current query, for fluid interface
*/
public function joinFolder($relationAlias = null, $joinType = 'LEFT 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 = 'LEFT JOIN')
{
return $this
->joinFolder($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Folder', '\Thelia\Model\FolderQuery');
}
/**
* Exclude object from result
*
* @param ChildFolderI18n $folderI18n Object to remove from the list of results
*
* @return ChildFolderI18nQuery The current query, for fluid interface
*/
public function prune($folderI18n = null)
{
if ($folderI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(FolderI18nTableMap::ID), $folderI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(FolderI18nTableMap::LOCALE), $folderI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the folder_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(FolderI18nTableMap::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).
FolderI18nTableMap::clearInstancePool();
FolderI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildFolderI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildFolderI18n 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(FolderI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(FolderI18nTableMap::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();
FolderI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
FolderI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // FolderI18nQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,829 @@
<?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\FolderVersion as ChildFolderVersion;
use Thelia\Model\FolderVersionQuery as ChildFolderVersionQuery;
use Thelia\Model\Map\FolderVersionTableMap;
/**
* Base class that represents a query for the 'folder_version' table.
*
*
*
* @method ChildFolderVersionQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildFolderVersionQuery orderByParent($order = Criteria::ASC) Order by the parent column
* @method ChildFolderVersionQuery orderByLink($order = Criteria::ASC) Order by the link column
* @method ChildFolderVersionQuery orderByVisible($order = Criteria::ASC) Order by the visible column
* @method ChildFolderVersionQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildFolderVersionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildFolderVersionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
* @method ChildFolderVersionQuery orderByVersion($order = Criteria::ASC) Order by the version column
* @method ChildFolderVersionQuery orderByVersionCreatedAt($order = Criteria::ASC) Order by the version_created_at column
* @method ChildFolderVersionQuery orderByVersionCreatedBy($order = Criteria::ASC) Order by the version_created_by column
*
* @method ChildFolderVersionQuery groupById() Group by the id column
* @method ChildFolderVersionQuery groupByParent() Group by the parent column
* @method ChildFolderVersionQuery groupByLink() Group by the link column
* @method ChildFolderVersionQuery groupByVisible() Group by the visible column
* @method ChildFolderVersionQuery groupByPosition() Group by the position column
* @method ChildFolderVersionQuery groupByCreatedAt() Group by the created_at column
* @method ChildFolderVersionQuery groupByUpdatedAt() Group by the updated_at column
* @method ChildFolderVersionQuery groupByVersion() Group by the version column
* @method ChildFolderVersionQuery groupByVersionCreatedAt() Group by the version_created_at column
* @method ChildFolderVersionQuery groupByVersionCreatedBy() Group by the version_created_by column
*
* @method ChildFolderVersionQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildFolderVersionQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildFolderVersionQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildFolderVersionQuery leftJoinFolder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Folder relation
* @method ChildFolderVersionQuery rightJoinFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Folder relation
* @method ChildFolderVersionQuery innerJoinFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the Folder relation
*
* @method ChildFolderVersion findOne(ConnectionInterface $con = null) Return the first ChildFolderVersion matching the query
* @method ChildFolderVersion findOneOrCreate(ConnectionInterface $con = null) Return the first ChildFolderVersion matching the query, or a new ChildFolderVersion object populated from the query conditions when no match is found
*
* @method ChildFolderVersion findOneById(int $id) Return the first ChildFolderVersion filtered by the id column
* @method ChildFolderVersion findOneByParent(int $parent) Return the first ChildFolderVersion filtered by the parent column
* @method ChildFolderVersion findOneByLink(string $link) Return the first ChildFolderVersion filtered by the link column
* @method ChildFolderVersion findOneByVisible(int $visible) Return the first ChildFolderVersion filtered by the visible column
* @method ChildFolderVersion findOneByPosition(int $position) Return the first ChildFolderVersion filtered by the position column
* @method ChildFolderVersion findOneByCreatedAt(string $created_at) Return the first ChildFolderVersion filtered by the created_at column
* @method ChildFolderVersion findOneByUpdatedAt(string $updated_at) Return the first ChildFolderVersion filtered by the updated_at column
* @method ChildFolderVersion findOneByVersion(int $version) Return the first ChildFolderVersion filtered by the version column
* @method ChildFolderVersion findOneByVersionCreatedAt(string $version_created_at) Return the first ChildFolderVersion filtered by the version_created_at column
* @method ChildFolderVersion findOneByVersionCreatedBy(string $version_created_by) Return the first ChildFolderVersion filtered by the version_created_by column
*
* @method array findById(int $id) Return ChildFolderVersion objects filtered by the id column
* @method array findByParent(int $parent) Return ChildFolderVersion objects filtered by the parent column
* @method array findByLink(string $link) Return ChildFolderVersion objects filtered by the link column
* @method array findByVisible(int $visible) Return ChildFolderVersion objects filtered by the visible column
* @method array findByPosition(int $position) Return ChildFolderVersion objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildFolderVersion objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildFolderVersion objects filtered by the updated_at column
* @method array findByVersion(int $version) Return ChildFolderVersion objects filtered by the version column
* @method array findByVersionCreatedAt(string $version_created_at) Return ChildFolderVersion objects filtered by the version_created_at column
* @method array findByVersionCreatedBy(string $version_created_by) Return ChildFolderVersion objects filtered by the version_created_by column
*
*/
abstract class FolderVersionQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\FolderVersionQuery 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\\FolderVersion', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildFolderVersionQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildFolderVersionQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\FolderVersionQuery) {
return $criteria;
}
$query = new \Thelia\Model\FolderVersionQuery();
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, $version] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildFolderVersion|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = FolderVersionTableMap::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(FolderVersionTableMap::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 ChildFolderVersion A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, PARENT, LINK, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM folder_version WHERE ID = :p0 AND VERSION = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildFolderVersion();
$obj->hydrate($row);
FolderVersionTableMap::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 ChildFolderVersion|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 ChildFolderVersionQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(FolderVersionTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(FolderVersionTableMap::VERSION, $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 ChildFolderVersionQuery 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(FolderVersionTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(FolderVersionTableMap::VERSION, $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 filterByFolder()
*
* @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 ChildFolderVersionQuery 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(FolderVersionTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(FolderVersionTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FolderVersionTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the parent column
*
* Example usage:
* <code>
* $query->filterByParent(1234); // WHERE parent = 1234
* $query->filterByParent(array(12, 34)); // WHERE parent IN (12, 34)
* $query->filterByParent(array('min' => 12)); // WHERE parent > 12
* </code>
*
* @param mixed $parent 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 ChildFolderVersionQuery The current query, for fluid interface
*/
public function filterByParent($parent = null, $comparison = null)
{
if (is_array($parent)) {
$useMinMax = false;
if (isset($parent['min'])) {
$this->addUsingAlias(FolderVersionTableMap::PARENT, $parent['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($parent['max'])) {
$this->addUsingAlias(FolderVersionTableMap::PARENT, $parent['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FolderVersionTableMap::PARENT, $parent, $comparison);
}
/**
* Filter the query on the link column
*
* Example usage:
* <code>
* $query->filterByLink('fooValue'); // WHERE link = 'fooValue'
* $query->filterByLink('%fooValue%'); // WHERE link LIKE '%fooValue%'
* </code>
*
* @param string $link 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 ChildFolderVersionQuery The current query, for fluid interface
*/
public function filterByLink($link = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($link)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $link)) {
$link = str_replace('*', '%', $link);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(FolderVersionTableMap::LINK, $link, $comparison);
}
/**
* Filter the query on the visible column
*
* Example usage:
* <code>
* $query->filterByVisible(1234); // WHERE visible = 1234
* $query->filterByVisible(array(12, 34)); // WHERE visible IN (12, 34)
* $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
* </code>
*
* @param mixed $visible The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFolderVersionQuery The current query, for fluid interface
*/
public function filterByVisible($visible = null, $comparison = null)
{
if (is_array($visible)) {
$useMinMax = false;
if (isset($visible['min'])) {
$this->addUsingAlias(FolderVersionTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($visible['max'])) {
$this->addUsingAlias(FolderVersionTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FolderVersionTableMap::VISIBLE, $visible, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFolderVersionQuery 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(FolderVersionTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(FolderVersionTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FolderVersionTableMap::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 ChildFolderVersionQuery 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(FolderVersionTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(FolderVersionTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FolderVersionTableMap::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 ChildFolderVersionQuery 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(FolderVersionTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(FolderVersionTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FolderVersionTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query on the version column
*
* Example usage:
* <code>
* $query->filterByVersion(1234); // WHERE version = 1234
* $query->filterByVersion(array(12, 34)); // WHERE version IN (12, 34)
* $query->filterByVersion(array('min' => 12)); // WHERE version > 12
* </code>
*
* @param mixed $version 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 ChildFolderVersionQuery The current query, for fluid interface
*/
public function filterByVersion($version = null, $comparison = null)
{
if (is_array($version)) {
$useMinMax = false;
if (isset($version['min'])) {
$this->addUsingAlias(FolderVersionTableMap::VERSION, $version['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($version['max'])) {
$this->addUsingAlias(FolderVersionTableMap::VERSION, $version['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FolderVersionTableMap::VERSION, $version, $comparison);
}
/**
* Filter the query on the version_created_at column
*
* Example usage:
* <code>
* $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14'
* $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14'
* $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at > '2011-03-13'
* </code>
*
* @param mixed $versionCreatedAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFolderVersionQuery The current query, for fluid interface
*/
public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null)
{
if (is_array($versionCreatedAt)) {
$useMinMax = false;
if (isset($versionCreatedAt['min'])) {
$this->addUsingAlias(FolderVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($versionCreatedAt['max'])) {
$this->addUsingAlias(FolderVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(FolderVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
}
/**
* Filter the query on the version_created_by column
*
* Example usage:
* <code>
* $query->filterByVersionCreatedBy('fooValue'); // WHERE version_created_by = 'fooValue'
* $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%'
* </code>
*
* @param string $versionCreatedBy The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFolderVersionQuery The current query, for fluid interface
*/
public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($versionCreatedBy)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $versionCreatedBy)) {
$versionCreatedBy = str_replace('*', '%', $versionCreatedBy);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(FolderVersionTableMap::VERSION_CREATED_BY, $versionCreatedBy, $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 ChildFolderVersionQuery The current query, for fluid interface
*/
public function filterByFolder($folder, $comparison = null)
{
if ($folder instanceof \Thelia\Model\Folder) {
return $this
->addUsingAlias(FolderVersionTableMap::ID, $folder->getId(), $comparison);
} elseif ($folder instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(FolderVersionTableMap::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 ChildFolderVersionQuery 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');
}
/**
* Exclude object from result
*
* @param ChildFolderVersion $folderVersion Object to remove from the list of results
*
* @return ChildFolderVersionQuery The current query, for fluid interface
*/
public function prune($folderVersion = null)
{
if ($folderVersion) {
$this->addCond('pruneCond0', $this->getAliasedColName(FolderVersionTableMap::ID), $folderVersion->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(FolderVersionTableMap::VERSION), $folderVersion->getVersion(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the folder_version 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(FolderVersionTableMap::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).
FolderVersionTableMap::clearInstancePool();
FolderVersionTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildFolderVersion or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildFolderVersion 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(FolderVersionTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(FolderVersionTableMap::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();
FolderVersionTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
FolderVersionTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // FolderVersionQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More