Merge branch 'master' into loops
Conflicts: core/lib/Thelia/Admin/Controller/BaseAdminController.php core/lib/Thelia/Core/Template/Loop/Category.php core/lib/Thelia/Model/Admin.php core/lib/Thelia/Model/Customer.php templates/smarty-sample/index.html
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
"php": ">=5.3",
|
||||
"ezyang/htmlpurifier": "dev-master",
|
||||
"ircmaxell/password-compat": "dev-master",
|
||||
"propel/propel1" : "1.6.*",
|
||||
"propel/propel": "2.0.0-alpha1",
|
||||
"psr/log" : "1.0",
|
||||
"symfony/class-loader": "2.2.*",
|
||||
"symfony/config" : "2.2.*",
|
||||
|
||||
@@ -25,14 +25,22 @@ namespace Thelia\Action;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
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
|
||||
{
|
||||
|
||||
public function create(ActionEvent $event)
|
||||
{
|
||||
|
||||
$event->getDispatcher()->dispatch(TheliaEvents::BEFORE_CREATECUSTOMER, $event);
|
||||
|
||||
$request = $event->getRequest();
|
||||
|
||||
$customerForm = new CustomerCreation($request);
|
||||
@@ -44,15 +52,78 @@ class Customer implements EventSubscriberInterface
|
||||
$form->bind($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
echo "ok"; exit;
|
||||
$data = $form->getData();
|
||||
$customer = new CustomerModel();
|
||||
try {
|
||||
\Thelia\Log\Tlog::getInstance()->debug($data);
|
||||
$customer->createOrUpdate(
|
||||
$data["title"],
|
||||
$data["firstname"],
|
||||
$data["lastname"],
|
||||
$data["address1"],
|
||||
$data["address2"],
|
||||
$data["address3"],
|
||||
$data["phone"],
|
||||
$data["cellphone"],
|
||||
$data["zipcode"],
|
||||
$data["country"],
|
||||
$data["email"],
|
||||
$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);
|
||||
}
|
||||
|
||||
//Customer is create, he is automatically connected
|
||||
|
||||
} else {
|
||||
echo "ko"; exit;
|
||||
|
||||
$event->setFormError($form);
|
||||
}
|
||||
}
|
||||
|
||||
$event->getDispatcher()->dispatch(TheliaEvents::AFTER_CREATECUSTOMER, $event);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class BaseAdminController extends ContainerAware
|
||||
*/
|
||||
public function render($templateName, $args = array())
|
||||
{
|
||||
$args = array_merge($args, array('lang' => 'fr')); // FIXME
|
||||
$args = array_merge($args, array('lang' => 'fr'));
|
||||
|
||||
$response = new Response();
|
||||
|
||||
@@ -57,7 +57,7 @@ class BaseAdminController extends ContainerAware
|
||||
|
||||
public function renderRaw($templateName, $args = array())
|
||||
{
|
||||
$args = array_merge($args, array('lang' => 'fr')); // FIXME
|
||||
$args = array_merge($args, array('lang' => 'fr'));
|
||||
|
||||
return $this->getParser()->render($templateName, $args);
|
||||
}
|
||||
@@ -79,17 +79,4 @@ class BaseAdminController extends ContainerAware
|
||||
|
||||
return $parser;
|
||||
}
|
||||
|
||||
public function getFormFactory()
|
||||
{
|
||||
return BaseForm::getFormFactory($this->getRequest(), ConfigQuery::read("form.secret.admin", md5(__DIR__)));
|
||||
}
|
||||
|
||||
public function getFormBuilder()
|
||||
{
|
||||
return $this->getFormFactory()->createBuilder("form");
|
||||
}
|
||||
|
||||
protected function isGranted() {
|
||||
}
|
||||
}
|
||||
@@ -41,20 +41,10 @@ class DefinePropel {
|
||||
{
|
||||
$connection = $this->processorConfig["connection"];
|
||||
return $conf = array(
|
||||
"datasources" =>
|
||||
array(
|
||||
"thelia" =>
|
||||
array(
|
||||
"adapter" => $connection["driver"],
|
||||
"connection" =>
|
||||
array(
|
||||
"dsn" => $connection["dsn"],
|
||||
"user" => $connection["user"],
|
||||
"password" => $connection["password"],
|
||||
"classname" => $connection["classname"]
|
||||
)
|
||||
)
|
||||
)
|
||||
"dsn" => $connection["dsn"],
|
||||
"user" => $connection["user"],
|
||||
"password" => $connection["password"],
|
||||
//"classname" => $connection["classname"]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ abstract class ActionEvent extends Event
|
||||
*/
|
||||
protected $action;
|
||||
|
||||
protected $form;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param \Symfony\Component\HttpFoundation\Request $request
|
||||
@@ -75,4 +77,21 @@ abstract class ActionEvent extends Event
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function setFormError($form)
|
||||
{
|
||||
$this->form = $form;
|
||||
$this->stopPropagation();
|
||||
}
|
||||
|
||||
public function getForm()
|
||||
{
|
||||
return $this->form;
|
||||
}
|
||||
|
||||
public function hasFormError()
|
||||
{
|
||||
return $this->form !== null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
53
core/lib/Thelia/Core/Event/CustomRefEvent.php
Normal file
53
core/lib/Thelia/Core/Event/CustomRefEvent.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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\Core\Event;
|
||||
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Thelia\Model\Customer;
|
||||
|
||||
class CustomRefEvent extends Event {
|
||||
protected $ref;
|
||||
public $customer;
|
||||
|
||||
|
||||
public function __construct(Customer $customer)
|
||||
{
|
||||
$this->customer = $customer;
|
||||
}
|
||||
|
||||
public function hasRef()
|
||||
{
|
||||
return null !== $this->ref;
|
||||
}
|
||||
|
||||
public function getRef()
|
||||
{
|
||||
return $this->ref;
|
||||
}
|
||||
|
||||
public function setRef($ref)
|
||||
{
|
||||
$this->ref = $ref;
|
||||
}
|
||||
}
|
||||
@@ -47,4 +47,10 @@ final class TheliaEvents
|
||||
* Send before starting thelia inclusion
|
||||
*/
|
||||
const INCLUSION = "thelia.include";
|
||||
|
||||
const BEFORE_CREATECUSTOMER = "action.before_createcustomer";
|
||||
|
||||
const AFTER_CREATECUSTOMER = "action.after_createcustomer";
|
||||
|
||||
const CREATECUSTOMER_CUSTOMREF = "customer.creation.customref";
|
||||
}
|
||||
|
||||
@@ -46,7 +46,14 @@ class ControllerListener implements EventSubscriberInterface
|
||||
if (false !== $action = $request->get("action")) {
|
||||
//search corresponding action
|
||||
$event = new ActionEventFactory($request, $action, $event->getKernel()->getContainer()->getParameter("thelia.actionEvent"));
|
||||
$dispatcher->dispatch("action.".$action, $event->createActionEvent());
|
||||
$actionEvent = $event->createActionEvent();
|
||||
$dispatcher->dispatch("action.".$action, $actionEvent);
|
||||
|
||||
if ($actionEvent->hasFormError()) {
|
||||
$request->getSession()->set("form_error", true);
|
||||
$request->getSession()->set("form_name", $actionEvent->getForm()->createView()
|
||||
->vars["attr"]["thelia_name"]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace Thelia\Core\Template\Element;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Thelia\Core\Template\Loop\Argument\Argument;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -81,7 +82,7 @@ abstract class BaseLoop
|
||||
*
|
||||
* @return array|mixed|\PropelModelPager|\PropelObjectCollection
|
||||
*/
|
||||
public function search(\ModelCriteria $search, &$pagination = null)
|
||||
public function search(ModelCriteria $search, &$pagination = null)
|
||||
{
|
||||
if($this->page !== null) {
|
||||
return $this->searchWithPagination($search, $pagination);
|
||||
@@ -95,7 +96,7 @@ abstract class BaseLoop
|
||||
*
|
||||
* @return array|mixed|\PropelObjectCollection
|
||||
*/
|
||||
public function searchWithOffset(\ModelCriteria $search)
|
||||
public function searchWithOffset(ModelCriteria $search)
|
||||
{
|
||||
if($this->limit >= 0) {
|
||||
$search->limit($this->limit);
|
||||
@@ -111,7 +112,7 @@ abstract class BaseLoop
|
||||
*
|
||||
* @return array|\PropelModelPager
|
||||
*/
|
||||
public function searchWithPagination(\ModelCriteria $search, &$pagination)
|
||||
public function searchWithPagination(ModelCriteria $search, &$pagination)
|
||||
{
|
||||
$pagination = $search->paginate($this->page, $this->limit);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
namespace Thelia\Core\Template\Loop;
|
||||
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Thelia\Core\Template\Element\BaseLoop;
|
||||
use Thelia\Core\Template\Element\LoopResult;
|
||||
use Thelia\Core\Template\Element\LoopResultRow;
|
||||
@@ -32,6 +33,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($this->id, \Criteria::IN);
|
||||
$search->filterById($this->id, Criteria::IN);
|
||||
}
|
||||
|
||||
if (!is_null($this->parent)) {
|
||||
@@ -119,11 +121,11 @@ class Category extends BaseLoop
|
||||
if ($this->current === true) {
|
||||
$search->filterById($this->request->get("category_id"));
|
||||
} elseif ($this->current === false) {
|
||||
$search->filterById($this->request->get("category_id"), \Criteria::NOT_IN);
|
||||
$search->filterById($this->request->get("category_id"), Criteria::NOT_IN);
|
||||
}
|
||||
|
||||
if (!is_null($this->exclude)) {
|
||||
$search->filterById($this->exclude, \Criteria::NOT_IN);
|
||||
$search->filterById($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($this->request->getSession()->get('locale', 'en_US'), \Criteria::INNER_JOIN);
|
||||
|
||||
$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);
|
||||
|
||||
|
||||
@@ -88,8 +88,17 @@ class Form implements SmartyPluginInterface
|
||||
}
|
||||
|
||||
$instance = $this->getInstance($params['name']);
|
||||
$form = $instance->getForm();
|
||||
|
||||
$template->assign("form", $instance->getForm()->createView());
|
||||
if (
|
||||
true === $this->request->getSession()->get("form_error", false) &&
|
||||
$this->request->getSession()->get("form_name") == $instance->getName())
|
||||
{
|
||||
$form->bind($this->request);
|
||||
$this->request->getSession()->set("form_error", false);
|
||||
}
|
||||
|
||||
$template->assign("form", $form->createView());
|
||||
} else {
|
||||
return $content;
|
||||
}
|
||||
@@ -202,7 +211,10 @@ class Form implements SmartyPluginInterface
|
||||
$class = new \ReflectionClass($this->formDefinition[$name]);
|
||||
|
||||
|
||||
return $class->newInstance($this->request);
|
||||
return $class->newInstance(
|
||||
$this->request,
|
||||
"form"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,8 +46,8 @@ use Thelia\Core\TheliaContainerBuilder;
|
||||
use Thelia\Core\DependencyInjection\Loader\XmlFileLoader;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
|
||||
use Propel;
|
||||
use PropelConfiguration;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\Connection\ConnectionManagerSingle;
|
||||
|
||||
class Thelia extends Kernel
|
||||
{
|
||||
@@ -71,7 +71,7 @@ class Thelia extends Kernel
|
||||
return ;
|
||||
}
|
||||
|
||||
if (! Propel::isInit()) {
|
||||
/* if (! Propel::isInit()) {
|
||||
|
||||
$definePropel = new DefinePropel(new DatabaseConfiguration(),
|
||||
Yaml::parse(THELIA_ROOT . '/local/config/database.yml'));
|
||||
@@ -97,6 +97,22 @@ class Thelia extends Kernel
|
||||
}
|
||||
|
||||
Propel::initialize();
|
||||
}*/
|
||||
|
||||
$definePropel = new DefinePropel(new DatabaseConfiguration(),
|
||||
Yaml::parse(THELIA_ROOT . '/local/config/database.yml'));
|
||||
$propelConfig = $definePropel->getConfig();
|
||||
$serviceContainer = Propel::getServiceContainer();
|
||||
$serviceContainer->setAdapterClass('thelia', 'mysql');
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -47,4 +47,9 @@ class AdminLogin extends BaseForm {
|
||||
->add("remember_me", "checkbox");
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "admin_login";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,25 +38,33 @@ abstract class BaseForm {
|
||||
*/
|
||||
protected $form;
|
||||
|
||||
public $name;
|
||||
|
||||
public function __construct(Request $request, $type= "form", $data = array(), $options = array())
|
||||
{
|
||||
$validator = Validation::createValidator();
|
||||
|
||||
if(!isset($options["attr"]["name"])) {
|
||||
$options["attr"]["thelia_name"] = $this->getName();
|
||||
}
|
||||
|
||||
$this->form = Forms::createFormFactoryBuilder()
|
||||
->addExtension(new HttpFoundationExtension())
|
||||
->addExtension(
|
||||
new CsrfExtension(
|
||||
new SessionCsrfProvider(
|
||||
$request->getSession(),
|
||||
isset($option["secret"]) ? $option["secret"] : ConfigQuery::read("form.secret", md5(__DIR__))
|
||||
isset($options["secret"]) ? $options["secret"] : ConfigQuery::read("form.secret", md5(__DIR__))
|
||||
)
|
||||
)
|
||||
)
|
||||
->addExtension(new ValidatorExtension($validator))
|
||||
->getFormFactory()
|
||||
->createBuilder($type, $data, $options);
|
||||
->createNamedBuilder($this->getName(), $type, $data, $options);
|
||||
;
|
||||
|
||||
|
||||
|
||||
$this->buildForm();
|
||||
}
|
||||
|
||||
@@ -68,7 +76,31 @@ abstract class BaseForm {
|
||||
return $this->form->getForm();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 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 \Symfony\Component\Validator\Constraints\NotBlank()
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
* ->add('age', 'integer');
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
abstract protected function buildForm();
|
||||
|
||||
/**
|
||||
* @return string the name of you form. This name must be unique
|
||||
*/
|
||||
abstract public function getName();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,11 @@ namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
use Symfony\Component\Validator\ExecutionContext;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Model\CustomerQuery;
|
||||
|
||||
|
||||
class CustomerCreation extends BaseForm
|
||||
@@ -32,17 +36,133 @@ class CustomerCreation extends BaseForm
|
||||
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->form->add("name", "text")
|
||||
$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"
|
||||
))
|
||||
->add("email", "email", array(
|
||||
"attr" => array(
|
||||
"class" => "field"
|
||||
),
|
||||
"label" => "email",
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add('age', 'integer');
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank(),
|
||||
new Constraints\Email(),
|
||||
new Constraints\Callback(array(
|
||||
"methods" => array(
|
||||
array($this,
|
||||
"verifyExistingEmail")
|
||||
)
|
||||
))
|
||||
),
|
||||
"label" => "email"
|
||||
))
|
||||
->add("email_confirm", "email", array(
|
||||
"constraints" => array(
|
||||
new Constraints\Callback(array(
|
||||
"methods" => array(
|
||||
array($this,
|
||||
"verifyEmailField")
|
||||
)
|
||||
))
|
||||
),
|
||||
"label" => "email confirmation"
|
||||
))
|
||||
->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")
|
||||
)))
|
||||
),
|
||||
"label" => "password confirmation"
|
||||
))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
public function verifyPasswordField($value, ExecutionContextInterface $context)
|
||||
{
|
||||
$data = $context->getRoot()->getData();
|
||||
|
||||
if ($data["password"] != $data["password_confirm"]) {
|
||||
$context->addViolation("password confirmation is not the same as password field");
|
||||
}
|
||||
}
|
||||
|
||||
public function verifyEmailField($value, ExecutionContextInterface $context)
|
||||
{
|
||||
$data = $context->getRoot()->getData();
|
||||
|
||||
if ($data["email"] != $data["email_confirm"]) {
|
||||
$context->addViolation("email confirmation is not the same as email field");
|
||||
}
|
||||
}
|
||||
|
||||
public function verifyExistingEmail($value, ExecutionContextInterface $context)
|
||||
{
|
||||
if (CustomerQuery::create()->filterByEmail($value)->exists()) {
|
||||
$context->addViolation("This email already exists");
|
||||
}
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "customerCreation";
|
||||
}
|
||||
}
|
||||
120
core/lib/Thelia/Form/CustomerModification.php
Normal file
120
core/lib/Thelia/Form/CustomerModification.php
Normal 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";
|
||||
}
|
||||
}
|
||||
16
core/lib/Thelia/Model/Accessory.php
Executable file → Normal file
16
core/lib/Thelia/Model/Accessory.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAccessory;
|
||||
use Thelia\Model\Base\Accessory as BaseAccessory;
|
||||
|
||||
class Accessory extends BaseAccessory {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'accessory' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class Accessory extends BaseAccessory
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAccessoryPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'accessory' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AccessoryPeer extends BaseAccessoryPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AccessoryQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AccessoryQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAccessoryQuery;
|
||||
use Thelia\Model\Base\AccessoryQuery as BaseAccessoryQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAccessoryQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AccessoryQuery extends BaseAccessoryQuery
|
||||
{
|
||||
}
|
||||
class AccessoryQuery extends BaseAccessoryQuery {
|
||||
|
||||
} // AccessoryQuery
|
||||
|
||||
16
core/lib/Thelia/Model/Address.php
Executable file → Normal file
16
core/lib/Thelia/Model/Address.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAddress;
|
||||
use Thelia\Model\Base\Address as BaseAddress;
|
||||
|
||||
class Address extends BaseAddress {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'address' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class Address extends BaseAddress
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAddressPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'address' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AddressPeer extends BaseAddressPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AddressQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AddressQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAddressQuery;
|
||||
use Thelia\Model\Base\AddressQuery as BaseAddressQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAddressQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AddressQuery extends BaseAddressQuery
|
||||
{
|
||||
}
|
||||
class AddressQuery extends BaseAddressQuery {
|
||||
|
||||
} // AddressQuery
|
||||
|
||||
37
core/lib/Thelia/Model/Admin.php
Executable file → Normal file
37
core/lib/Thelia/Model/Admin.php
Executable file → Normal file
@@ -2,41 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAdmin;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Thelia\Model\Base\Admin as BaseAdmin;
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'admin' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class Admin extends BaseAdmin implements UserInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getUsername() {
|
||||
return $this->getLogin();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function eraseCredentials() {
|
||||
$this->setPassword(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getRoles() {
|
||||
return array(new Role('USER_CUSTOMER'));
|
||||
}
|
||||
class Admin extends BaseAdmin {
|
||||
|
||||
}
|
||||
|
||||
16
core/lib/Thelia/Model/AdminGroup.php
Executable file → Normal file
16
core/lib/Thelia/Model/AdminGroup.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAdminGroup;
|
||||
use Thelia\Model\Base\AdminGroup as BaseAdminGroup;
|
||||
|
||||
class AdminGroup extends BaseAdminGroup {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'admin_group' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AdminGroup extends BaseAdminGroup
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAdminGroupPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'admin_group' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AdminGroupPeer extends BaseAdminGroupPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AdminGroupQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AdminGroupQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAdminGroupQuery;
|
||||
use Thelia\Model\Base\AdminGroupQuery as BaseAdminGroupQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAdminGroupQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AdminGroupQuery extends BaseAdminGroupQuery
|
||||
{
|
||||
}
|
||||
class AdminGroupQuery extends BaseAdminGroupQuery {
|
||||
|
||||
} // AdminGroupQuery
|
||||
|
||||
16
core/lib/Thelia/Model/AdminLog.php
Executable file → Normal file
16
core/lib/Thelia/Model/AdminLog.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAdminLog;
|
||||
use Thelia\Model\Base\AdminLog as BaseAdminLog;
|
||||
|
||||
class AdminLog extends BaseAdminLog {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'admin_log' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AdminLog extends BaseAdminLog
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAdminLogPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'admin_log' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AdminLogPeer extends BaseAdminLogPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AdminLogQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AdminLogQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAdminLogQuery;
|
||||
use Thelia\Model\Base\AdminLogQuery as BaseAdminLogQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAdminLogQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AdminLogQuery extends BaseAdminLogQuery
|
||||
{
|
||||
}
|
||||
class AdminLogQuery extends BaseAdminLogQuery {
|
||||
|
||||
} // AdminLogQuery
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAdminPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'admin' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AdminPeer extends BaseAdminPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AdminQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AdminQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAdminQuery;
|
||||
use Thelia\Model\Base\AdminQuery as BaseAdminQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAdminQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AdminQuery extends BaseAdminQuery
|
||||
{
|
||||
}
|
||||
class AdminQuery extends BaseAdminQuery {
|
||||
|
||||
} // AdminQuery
|
||||
|
||||
16
core/lib/Thelia/Model/Area.php
Executable file → Normal file
16
core/lib/Thelia/Model/Area.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseArea;
|
||||
use Thelia\Model\Base\Area as BaseArea;
|
||||
|
||||
class Area extends BaseArea {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'area' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class Area extends BaseArea
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAreaPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'area' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AreaPeer extends BaseAreaPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AreaQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AreaQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAreaQuery;
|
||||
use Thelia\Model\Base\AreaQuery as BaseAreaQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAreaQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AreaQuery extends BaseAreaQuery
|
||||
{
|
||||
}
|
||||
class AreaQuery extends BaseAreaQuery {
|
||||
|
||||
} // AreaQuery
|
||||
|
||||
16
core/lib/Thelia/Model/Attribute.php
Executable file → Normal file
16
core/lib/Thelia/Model/Attribute.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttribute;
|
||||
use Thelia\Model\Base\Attribute as BaseAttribute;
|
||||
|
||||
class Attribute extends BaseAttribute {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'attribute' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class Attribute extends BaseAttribute
|
||||
{
|
||||
}
|
||||
|
||||
16
core/lib/Thelia/Model/AttributeAv.php
Executable file → Normal file
16
core/lib/Thelia/Model/AttributeAv.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeAv;
|
||||
use Thelia\Model\Base\AttributeAv as BaseAttributeAv;
|
||||
|
||||
class AttributeAv extends BaseAttributeAv {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'attribute_av' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeAv extends BaseAttributeAv
|
||||
{
|
||||
}
|
||||
|
||||
16
core/lib/Thelia/Model/AttributeAvI18n.php
Executable file → Normal file
16
core/lib/Thelia/Model/AttributeAvI18n.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeAvI18n;
|
||||
use Thelia\Model\Base\AttributeAvI18n as BaseAttributeAvI18n;
|
||||
|
||||
class AttributeAvI18n extends BaseAttributeAvI18n {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'attribute_av_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeAvI18n extends BaseAttributeAvI18n
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeAvI18nPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'attribute_av_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeAvI18nPeer extends BaseAttributeAvI18nPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AttributeAvI18nQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AttributeAvI18nQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeAvI18nQuery;
|
||||
use Thelia\Model\Base\AttributeAvI18nQuery as BaseAttributeAvI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAttributeAvI18nQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeAvI18nQuery extends BaseAttributeAvI18nQuery
|
||||
{
|
||||
}
|
||||
class AttributeAvI18nQuery extends BaseAttributeAvI18nQuery {
|
||||
|
||||
} // AttributeAvI18nQuery
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeAvPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'attribute_av' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeAvPeer extends BaseAttributeAvPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AttributeAvQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AttributeAvQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeAvQuery;
|
||||
use Thelia\Model\Base\AttributeAvQuery as BaseAttributeAvQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAttributeAvQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeAvQuery extends BaseAttributeAvQuery
|
||||
{
|
||||
}
|
||||
class AttributeAvQuery extends BaseAttributeAvQuery {
|
||||
|
||||
} // AttributeAvQuery
|
||||
|
||||
16
core/lib/Thelia/Model/AttributeCategory.php
Executable file → Normal file
16
core/lib/Thelia/Model/AttributeCategory.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeCategory;
|
||||
use Thelia\Model\Base\AttributeCategory as BaseAttributeCategory;
|
||||
|
||||
class AttributeCategory extends BaseAttributeCategory {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'attribute_category' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeCategory extends BaseAttributeCategory
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeCategoryPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'attribute_category' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeCategoryPeer extends BaseAttributeCategoryPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AttributeCategoryQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AttributeCategoryQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeCategoryQuery;
|
||||
use Thelia\Model\Base\AttributeCategoryQuery as BaseAttributeCategoryQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAttributeCategoryQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeCategoryQuery extends BaseAttributeCategoryQuery
|
||||
{
|
||||
}
|
||||
class AttributeCategoryQuery extends BaseAttributeCategoryQuery {
|
||||
|
||||
} // AttributeCategoryQuery
|
||||
|
||||
16
core/lib/Thelia/Model/AttributeCombination.php
Executable file → Normal file
16
core/lib/Thelia/Model/AttributeCombination.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeCombination;
|
||||
use Thelia\Model\Base\AttributeCombination as BaseAttributeCombination;
|
||||
|
||||
class AttributeCombination extends BaseAttributeCombination {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'attribute_combination' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeCombination extends BaseAttributeCombination
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeCombinationPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'attribute_combination' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeCombinationPeer extends BaseAttributeCombinationPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AttributeCombinationQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AttributeCombinationQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeCombinationQuery;
|
||||
use Thelia\Model\Base\AttributeCombinationQuery as BaseAttributeCombinationQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAttributeCombinationQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeCombinationQuery extends BaseAttributeCombinationQuery
|
||||
{
|
||||
}
|
||||
class AttributeCombinationQuery extends BaseAttributeCombinationQuery {
|
||||
|
||||
} // AttributeCombinationQuery
|
||||
|
||||
16
core/lib/Thelia/Model/AttributeI18n.php
Executable file → Normal file
16
core/lib/Thelia/Model/AttributeI18n.php
Executable file → Normal file
@@ -2,20 +2,8 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeI18n;
|
||||
use Thelia\Model\Base\AttributeI18n as BaseAttributeI18n;
|
||||
|
||||
class AttributeI18n extends BaseAttributeI18n {
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'attribute_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeI18n extends BaseAttributeI18n
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeI18nPeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'attribute_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeI18nPeer extends BaseAttributeI18nPeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AttributeI18nQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AttributeI18nQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeI18nQuery;
|
||||
use Thelia\Model\Base\AttributeI18nQuery as BaseAttributeI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAttributeI18nQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeI18nQuery extends BaseAttributeI18nQuery
|
||||
{
|
||||
}
|
||||
class AttributeI18nQuery extends BaseAttributeI18nQuery {
|
||||
|
||||
} // AttributeI18nQuery
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributePeer;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'attribute' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributePeer extends BaseAttributePeer
|
||||
{
|
||||
}
|
||||
9
core/lib/Thelia/Model/AttributeQuery.php
Executable file → Normal file
9
core/lib/Thelia/Model/AttributeQuery.php
Executable file → Normal file
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\om\BaseAttributeQuery;
|
||||
use Thelia\Model\Base\AttributeQuery as BaseAttributeQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,8 +14,7 @@ use Thelia\Model\om\BaseAttributeQuery;
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.Thelia.Model
|
||||
*/
|
||||
class AttributeQuery extends BaseAttributeQuery
|
||||
{
|
||||
}
|
||||
class AttributeQuery extends BaseAttributeQuery {
|
||||
|
||||
} // AttributeQuery
|
||||
|
||||
1540
core/lib/Thelia/Model/Base/Accessory.php
Normal file
1540
core/lib/Thelia/Model/Base/Accessory.php
Normal file
File diff suppressed because it is too large
Load Diff
427
core/lib/Thelia/Model/om/BaseAccessoryQuery.php → core/lib/Thelia/Model/Base/AccessoryQuery.php
Executable file → Normal file
427
core/lib/Thelia/Model/om/BaseAccessoryQuery.php → core/lib/Thelia/Model/Base/AccessoryQuery.php
Executable file → Normal file
@@ -1,99 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Accessory;
|
||||
use Thelia\Model\AccessoryPeer;
|
||||
use Thelia\Model\AccessoryQuery;
|
||||
use Thelia\Model\Product;
|
||||
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 AccessoryQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AccessoryQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
|
||||
* @method AccessoryQuery orderByAccessory($order = Criteria::ASC) Order by the accessory column
|
||||
* @method AccessoryQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method AccessoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method AccessoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 AccessoryQuery groupById() Group by the id column
|
||||
* @method AccessoryQuery groupByProductId() Group by the product_id column
|
||||
* @method AccessoryQuery groupByAccessory() Group by the accessory column
|
||||
* @method AccessoryQuery groupByPosition() Group by the position column
|
||||
* @method AccessoryQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method AccessoryQuery groupByUpdatedAt() Group 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 AccessoryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AccessoryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AccessoryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AccessoryQuery leftJoinProductRelatedByProductId($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductRelatedByProductId relation
|
||||
* @method AccessoryQuery rightJoinProductRelatedByProductId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductRelatedByProductId relation
|
||||
* @method AccessoryQuery innerJoinProductRelatedByProductId($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductRelatedByProductId relation
|
||||
* @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 AccessoryQuery leftJoinProductRelatedByAccessory($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProductRelatedByAccessory relation
|
||||
* @method AccessoryQuery rightJoinProductRelatedByAccessory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProductRelatedByAccessory relation
|
||||
* @method AccessoryQuery innerJoinProductRelatedByAccessory($relationAlias = null) Adds a INNER JOIN clause to the query using the ProductRelatedByAccessory 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 Accessory findOne(PropelPDO $con = null) Return the first Accessory matching the query
|
||||
* @method Accessory findOneOrCreate(PropelPDO $con = null) Return the first Accessory matching the query, or a new Accessory object populated from the query conditions when no match is found
|
||||
* @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 Accessory findOneByProductId(int $product_id) Return the first Accessory filtered by the product_id column
|
||||
* @method Accessory findOneByAccessory(int $accessory) Return the first Accessory filtered by the accessory column
|
||||
* @method Accessory findOneByPosition(int $position) Return the first Accessory filtered by the position column
|
||||
* @method Accessory findOneByCreatedAt(string $created_at) Return the first Accessory filtered by the created_at column
|
||||
* @method Accessory findOneByUpdatedAt(string $updated_at) Return the first Accessory filtered by the updated_at column
|
||||
* @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 Accessory objects filtered by the id column
|
||||
* @method array findByProductId(int $product_id) Return Accessory objects filtered by the product_id column
|
||||
* @method array findByAccessory(int $accessory) Return Accessory objects filtered by the accessory column
|
||||
* @method array findByPosition(int $position) Return Accessory objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return Accessory objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return Accessory objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
abstract class AccessoryQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAccessoryQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AccessoryQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Accessory', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AccessoryQuery object.
|
||||
* Returns a new ChildAccessoryQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AccessoryQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AccessoryQuery
|
||||
* @return ChildAccessoryQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AccessoryQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AccessoryQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AccessoryQuery();
|
||||
$query = new \Thelia\Model\AccessoryQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -114,21 +114,21 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return Accessory|Accessory[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AccessoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = AccessoryTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(AccessoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AccessoryTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -140,46 +140,31 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return Accessory A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Accessory A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new Accessory();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildAccessory();
|
||||
$obj->hydrate($row);
|
||||
AccessoryPeer::addInstanceToPool($obj, (string) $key);
|
||||
AccessoryTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -190,19 +175,19 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Accessory|Accessory[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,22 +196,22 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|Accessory[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,12 +219,12 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AccessoryPeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(AccessoryTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,12 +232,12 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AccessoryPeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(AccessoryTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -262,8 +247,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -272,18 +256,18 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @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(AccessoryPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AccessoryPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -294,7 +278,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AccessoryPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AccessoryTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,8 +288,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByProductId(array('max' => 12)); // WHERE product_id <= 12
|
||||
* $query->filterByProductId(array('min' => 12)); // WHERE product_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByProductRelatedByProductId()
|
||||
@@ -316,18 +299,18 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @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(AccessoryPeer::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($productId['max'])) {
|
||||
$this->addUsingAlias(AccessoryPeer::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -338,7 +321,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AccessoryPeer::PRODUCT_ID, $productId, $comparison);
|
||||
return $this->addUsingAlias(AccessoryTableMap::PRODUCT_ID, $productId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -348,8 +331,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByAccessory(array('max' => 12)); // WHERE accessory <= 12
|
||||
* $query->filterByAccessory(array('min' => 12)); // WHERE accessory > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByProductRelatedByAccessory()
|
||||
@@ -360,18 +342,18 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @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(AccessoryPeer::ACCESSORY, $accessory['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::ACCESSORY, $accessory['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($accessory['max'])) {
|
||||
$this->addUsingAlias(AccessoryPeer::ACCESSORY, $accessory['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::ACCESSORY, $accessory['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -382,7 +364,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AccessoryPeer::ACCESSORY, $accessory, $comparison);
|
||||
return $this->addUsingAlias(AccessoryTableMap::ACCESSORY, $accessory, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -392,8 +374,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByPosition(array('max' => 12)); // WHERE position <= 12
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
@@ -402,18 +383,18 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @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(AccessoryPeer::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(AccessoryPeer::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -424,7 +405,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AccessoryPeer::POSITION, $position, $comparison);
|
||||
return $this->addUsingAlias(AccessoryTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -445,18 +426,18 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @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(AccessoryPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(AccessoryPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -467,7 +448,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AccessoryPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(AccessoryTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -488,18 +469,18 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @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(AccessoryPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(AccessoryPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AccessoryTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -510,32 +491,31 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AccessoryPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(AccessoryTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Product object
|
||||
* Filter the query by a related \Thelia\Model\Product object
|
||||
*
|
||||
* @param Product|PropelObjectCollection $product The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AccessoryQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProductRelatedByProductId($product, $comparison = null)
|
||||
{
|
||||
if ($product instanceof Product) {
|
||||
if ($product instanceof \Thelia\Model\Product) {
|
||||
return $this
|
||||
->addUsingAlias(AccessoryPeer::PRODUCT_ID, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AccessoryTableMap::PRODUCT_ID, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AccessoryPeer::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AccessoryTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByProductRelatedByProductId() only accepts arguments of type Product or PropelCollection');
|
||||
throw new PropelException('filterByProductRelatedByProductId() only accepts arguments of type \Thelia\Model\Product or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,7 +525,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProductRelatedByProductId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -574,7 +554,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the ProductRelatedByProductId relation Product object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -590,28 +570,27 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Product object
|
||||
* Filter the query by a related \Thelia\Model\Product object
|
||||
*
|
||||
* @param Product|PropelObjectCollection $product The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AccessoryQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProductRelatedByAccessory($product, $comparison = null)
|
||||
{
|
||||
if ($product instanceof Product) {
|
||||
if ($product instanceof \Thelia\Model\Product) {
|
||||
return $this
|
||||
->addUsingAlias(AccessoryPeer::ACCESSORY, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AccessoryTableMap::ACCESSORY, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AccessoryPeer::ACCESSORY, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AccessoryTableMap::ACCESSORY, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByProductRelatedByAccessory() only accepts arguments of type Product or PropelCollection');
|
||||
throw new PropelException('filterByProductRelatedByAccessory() only accepts arguments of type \Thelia\Model\Product or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -621,7 +600,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProductRelatedByAccessory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -650,7 +629,7 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the ProductRelatedByAccessory relation Product object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -668,19 +647,94 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param Accessory $accessory Object to remove from the list of results
|
||||
* @param ChildAccessory $accessory Object to remove from the list of results
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($accessory = null)
|
||||
{
|
||||
if ($accessory) {
|
||||
$this->addUsingAlias(AccessoryPeer::ID, $accessory->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -688,31 +742,11 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AccessoryPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AccessoryPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AccessoryPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(AccessoryTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -720,30 +754,51 @@ abstract class BaseAccessoryQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AccessoryPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 AccessoryQuery The current query, for fluid interface
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AccessoryPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(AccessoryTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return AccessoryQuery The current query, for fluid interface
|
||||
* @return ChildAccessoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AccessoryPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(AccessoryTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // AccessoryQuery
|
||||
1311
core/lib/Thelia/Model/om/BaseAddress.php → core/lib/Thelia/Model/Base/Address.php
Executable file → Normal file
1311
core/lib/Thelia/Model/om/BaseAddress.php → core/lib/Thelia/Model/Base/Address.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
548
core/lib/Thelia/Model/om/BaseAddressQuery.php → core/lib/Thelia/Model/Base/AddressQuery.php
Executable file → Normal file
548
core/lib/Thelia/Model/om/BaseAddressQuery.php → core/lib/Thelia/Model/Base/AddressQuery.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1305
core/lib/Thelia/Model/om/BaseAdmin.php → core/lib/Thelia/Model/Base/Admin.php
Executable file → Normal file
1305
core/lib/Thelia/Model/om/BaseAdmin.php → core/lib/Thelia/Model/Base/Admin.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1505
core/lib/Thelia/Model/Base/AdminGroup.php
Normal file
1505
core/lib/Thelia/Model/Base/AdminGroup.php
Normal file
File diff suppressed because it is too large
Load Diff
411
core/lib/Thelia/Model/om/BaseAdminGroupQuery.php → core/lib/Thelia/Model/Base/AdminGroupQuery.php
Executable file → Normal file
411
core/lib/Thelia/Model/om/BaseAdminGroupQuery.php → core/lib/Thelia/Model/Base/AdminGroupQuery.php
Executable file → Normal file
@@ -1,97 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Admin;
|
||||
use Thelia\Model\AdminGroup;
|
||||
use Thelia\Model\AdminGroupPeer;
|
||||
use Thelia\Model\AdminGroupQuery;
|
||||
use Thelia\Model\Group;
|
||||
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 AdminGroupQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AdminGroupQuery orderByGroupId($order = Criteria::ASC) Order by the group_id column
|
||||
* @method AdminGroupQuery orderByAdminId($order = Criteria::ASC) Order by the admin_id column
|
||||
* @method AdminGroupQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method AdminGroupQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 AdminGroupQuery groupById() Group by the id column
|
||||
* @method AdminGroupQuery groupByGroupId() Group by the group_id column
|
||||
* @method AdminGroupQuery groupByAdminId() Group by the admin_id column
|
||||
* @method AdminGroupQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method AdminGroupQuery groupByUpdatedAt() Group 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 AdminGroupQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AdminGroupQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AdminGroupQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AdminGroupQuery leftJoinGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the Group relation
|
||||
* @method AdminGroupQuery rightJoinGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Group relation
|
||||
* @method AdminGroupQuery innerJoinGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the Group relation
|
||||
* @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 AdminGroupQuery leftJoinAdmin($relationAlias = null) Adds a LEFT JOIN clause to the query using the Admin relation
|
||||
* @method AdminGroupQuery rightJoinAdmin($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Admin relation
|
||||
* @method AdminGroupQuery innerJoinAdmin($relationAlias = null) Adds a INNER JOIN clause to the query using the Admin 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 AdminGroup findOne(PropelPDO $con = null) Return the first AdminGroup matching the query
|
||||
* @method AdminGroup findOneOrCreate(PropelPDO $con = null) Return the first AdminGroup matching the query, or a new AdminGroup object populated from the query conditions when no match is found
|
||||
* @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 AdminGroup findOneById(int $id) Return the first AdminGroup filtered by the id column
|
||||
* @method AdminGroup findOneByGroupId(int $group_id) Return the first AdminGroup filtered by the group_id column
|
||||
* @method AdminGroup findOneByAdminId(int $admin_id) Return the first AdminGroup filtered by the admin_id column
|
||||
* @method AdminGroup findOneByCreatedAt(string $created_at) Return the first AdminGroup filtered by the created_at column
|
||||
* @method AdminGroup findOneByUpdatedAt(string $updated_at) Return the first AdminGroup filtered by the updated_at column
|
||||
* @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 AdminGroup objects filtered by the id column
|
||||
* @method array findByGroupId(int $group_id) Return AdminGroup objects filtered by the group_id column
|
||||
* @method array findByAdminId(int $admin_id) Return AdminGroup objects filtered by the admin_id column
|
||||
* @method array findByCreatedAt(string $created_at) Return AdminGroup objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return AdminGroup objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
abstract class AdminGroupQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAdminGroupQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AdminGroupQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\AdminGroup', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AdminGroupQuery object.
|
||||
* Returns a new ChildAdminGroupQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AdminGroupQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AdminGroupQuery
|
||||
* @return ChildAdminGroupQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AdminGroupQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AdminGroupQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AdminGroupQuery();
|
||||
$query = new \Thelia\Model\AdminGroupQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -111,23 +109,22 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* $obj = $c->findPk(array(12, 34, 56), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array $key Primary key to use for the query
|
||||
A Primary key composition: [$id, $group_id, $admin_id]
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param array[$id, $group_id, $admin_id] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return AdminGroup|AdminGroup[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AdminGroupPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
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::getConnection(AdminGroupPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AdminGroupTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -144,14 +141,13 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AdminGroup A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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);
|
||||
@@ -160,13 +156,13 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new AdminGroup();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildAdminGroup();
|
||||
$obj->hydrate($row);
|
||||
AdminGroupPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2])));
|
||||
AdminGroupTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -177,19 +173,19 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AdminGroup|AdminGroup[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -198,22 +194,22 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* $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 PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|AdminGroup[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,13 +217,13 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(AdminGroupPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(AdminGroupPeer::GROUP_ID, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(AdminGroupPeer::ADMIN_ID, $key[2], Criteria::EQUAL);
|
||||
$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;
|
||||
}
|
||||
@@ -237,7 +233,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -245,10 +241,10 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(AdminGroupPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(AdminGroupPeer::GROUP_ID, $key[1], Criteria::EQUAL);
|
||||
$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(AdminGroupPeer::ADMIN_ID, $key[2], Criteria::EQUAL);
|
||||
$cton2 = $this->getNewCriterion(AdminGroupTableMap::ADMIN_ID, $key[2], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton2);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -263,8 +259,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -273,18 +268,18 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @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(AdminGroupPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AdminGroupPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -295,7 +290,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminGroupPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AdminGroupTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,8 +300,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByGroupId(array('max' => 12)); // WHERE group_id <= 12
|
||||
* $query->filterByGroupId(array('min' => 12)); // WHERE group_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByGroup()
|
||||
@@ -317,18 +311,18 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @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(AdminGroupPeer::GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($groupId['max'])) {
|
||||
$this->addUsingAlias(AdminGroupPeer::GROUP_ID, $groupId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $groupId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -339,7 +333,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminGroupPeer::GROUP_ID, $groupId, $comparison);
|
||||
return $this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $groupId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,8 +343,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByAdminId(array('max' => 12)); // WHERE admin_id <= 12
|
||||
* $query->filterByAdminId(array('min' => 12)); // WHERE admin_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByAdmin()
|
||||
@@ -361,18 +354,18 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @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(AdminGroupPeer::ADMIN_ID, $adminId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $adminId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($adminId['max'])) {
|
||||
$this->addUsingAlias(AdminGroupPeer::ADMIN_ID, $adminId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $adminId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -383,7 +376,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminGroupPeer::ADMIN_ID, $adminId, $comparison);
|
||||
return $this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $adminId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -404,18 +397,18 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @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(AdminGroupPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(AdminGroupPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -426,7 +419,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminGroupPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(AdminGroupTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -447,18 +440,18 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @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(AdminGroupPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(AdminGroupPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -469,32 +462,31 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminGroupPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Group object
|
||||
* Filter the query by a related \Thelia\Model\Group object
|
||||
*
|
||||
* @param Group|PropelObjectCollection $group The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AdminGroupQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByGroup($group, $comparison = null)
|
||||
{
|
||||
if ($group instanceof Group) {
|
||||
if ($group instanceof \Thelia\Model\Group) {
|
||||
return $this
|
||||
->addUsingAlias(AdminGroupPeer::GROUP_ID, $group->getId(), $comparison);
|
||||
} elseif ($group instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AdminGroupTableMap::GROUP_ID, $group->getId(), $comparison);
|
||||
} elseif ($group instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AdminGroupPeer::GROUP_ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AdminGroupTableMap::GROUP_ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByGroup() only accepts arguments of type Group or PropelCollection');
|
||||
throw new PropelException('filterByGroup() only accepts arguments of type \Thelia\Model\Group or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,7 +496,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -533,7 +525,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Group relation Group object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -549,28 +541,27 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Admin object
|
||||
* Filter the query by a related \Thelia\Model\Admin object
|
||||
*
|
||||
* @param Admin|PropelObjectCollection $admin The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AdminGroupQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAdmin($admin, $comparison = null)
|
||||
{
|
||||
if ($admin instanceof Admin) {
|
||||
if ($admin instanceof \Thelia\Model\Admin) {
|
||||
return $this
|
||||
->addUsingAlias(AdminGroupPeer::ADMIN_ID, $admin->getId(), $comparison);
|
||||
} elseif ($admin instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $admin->getId(), $comparison);
|
||||
} elseif ($admin instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AdminGroupPeer::ADMIN_ID, $admin->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $admin->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByAdmin() only accepts arguments of type Admin or PropelCollection');
|
||||
throw new PropelException('filterByAdmin() only accepts arguments of type \Thelia\Model\Admin or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,7 +571,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAdmin($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -609,7 +600,7 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Admin relation Admin object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -627,22 +618,97 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param AdminGroup $adminGroup Object to remove from the list of results
|
||||
* @param ChildAdminGroup $adminGroup Object to remove from the list of results
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($adminGroup = null)
|
||||
{
|
||||
if ($adminGroup) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(AdminGroupPeer::ID), $adminGroup->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(AdminGroupPeer::GROUP_ID), $adminGroup->getGroupId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond2', $this->getAliasedColName(AdminGroupPeer::ADMIN_ID), $adminGroup->getAdminId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -650,31 +716,11 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AdminGroupPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AdminGroupPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AdminGroupPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -682,30 +728,51 @@ abstract class BaseAdminGroupQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AdminGroupPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 AdminGroupQuery The current query, for fluid interface
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AdminGroupPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(AdminGroupTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return AdminGroupQuery The current query, for fluid interface
|
||||
* @return ChildAdminGroupQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AdminGroupPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(AdminGroupTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // AdminGroupQuery
|
||||
1507
core/lib/Thelia/Model/Base/AdminLog.php
Normal file
1507
core/lib/Thelia/Model/Base/AdminLog.php
Normal file
File diff suppressed because it is too large
Load Diff
366
core/lib/Thelia/Model/om/BaseAdminLogQuery.php → core/lib/Thelia/Model/Base/AdminLogQuery.php
Executable file → Normal file
366
core/lib/Thelia/Model/om/BaseAdminLogQuery.php → core/lib/Thelia/Model/Base/AdminLogQuery.php
Executable file → Normal file
@@ -1,96 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\AdminLog;
|
||||
use Thelia\Model\AdminLogPeer;
|
||||
use Thelia\Model\AdminLogQuery;
|
||||
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 AdminLogQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AdminLogQuery orderByAdminLogin($order = Criteria::ASC) Order by the admin_login column
|
||||
* @method AdminLogQuery orderByAdminFirstname($order = Criteria::ASC) Order by the admin_firstname column
|
||||
* @method AdminLogQuery orderByAdminLastname($order = Criteria::ASC) Order by the admin_lastname column
|
||||
* @method AdminLogQuery orderByAction($order = Criteria::ASC) Order by the action column
|
||||
* @method AdminLogQuery orderByRequest($order = Criteria::ASC) Order by the request column
|
||||
* @method AdminLogQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method AdminLogQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 AdminLogQuery groupById() Group by the id column
|
||||
* @method AdminLogQuery groupByAdminLogin() Group by the admin_login column
|
||||
* @method AdminLogQuery groupByAdminFirstname() Group by the admin_firstname column
|
||||
* @method AdminLogQuery groupByAdminLastname() Group by the admin_lastname column
|
||||
* @method AdminLogQuery groupByAction() Group by the action column
|
||||
* @method AdminLogQuery groupByRequest() Group by the request column
|
||||
* @method AdminLogQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method AdminLogQuery groupByUpdatedAt() Group 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 AdminLogQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AdminLogQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AdminLogQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AdminLog findOne(PropelPDO $con = null) Return the first AdminLog matching the query
|
||||
* @method AdminLog findOneOrCreate(PropelPDO $con = null) Return the first AdminLog matching the query, or a new AdminLog object populated from the query conditions when no match is found
|
||||
* @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 AdminLog findOneByAdminLogin(string $admin_login) Return the first AdminLog filtered by the admin_login column
|
||||
* @method AdminLog findOneByAdminFirstname(string $admin_firstname) Return the first AdminLog filtered by the admin_firstname column
|
||||
* @method AdminLog findOneByAdminLastname(string $admin_lastname) Return the first AdminLog filtered by the admin_lastname column
|
||||
* @method AdminLog findOneByAction(string $action) Return the first AdminLog filtered by the action column
|
||||
* @method AdminLog findOneByRequest(string $request) Return the first AdminLog filtered by the request column
|
||||
* @method AdminLog findOneByCreatedAt(string $created_at) Return the first AdminLog filtered by the created_at column
|
||||
* @method AdminLog findOneByUpdatedAt(string $updated_at) Return the first AdminLog filtered by the updated_at column
|
||||
* @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 AdminLog objects filtered by the id column
|
||||
* @method array findByAdminLogin(string $admin_login) Return AdminLog objects filtered by the admin_login column
|
||||
* @method array findByAdminFirstname(string $admin_firstname) Return AdminLog objects filtered by the admin_firstname column
|
||||
* @method array findByAdminLastname(string $admin_lastname) Return AdminLog objects filtered by the admin_lastname column
|
||||
* @method array findByAction(string $action) Return AdminLog objects filtered by the action column
|
||||
* @method array findByRequest(string $request) Return AdminLog objects filtered by the request column
|
||||
* @method array findByCreatedAt(string $created_at) Return AdminLog objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return AdminLog objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
abstract class AdminLogQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAdminLogQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AdminLogQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\AdminLog', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AdminLogQuery object.
|
||||
* Returns a new ChildAdminLogQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AdminLogQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AdminLogQuery
|
||||
* @return ChildAdminLogQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AdminLogQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AdminLogQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AdminLogQuery();
|
||||
$query = new \Thelia\Model\AdminLogQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -111,21 +111,21 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return AdminLog|AdminLog[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AdminLogPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = AdminLogTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(AdminLogPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AdminLogTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -137,46 +137,31 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return AdminLog A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AdminLog A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new AdminLog();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildAdminLog();
|
||||
$obj->hydrate($row);
|
||||
AdminLogPeer::addInstanceToPool($obj, (string) $key);
|
||||
AdminLogTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -187,19 +172,19 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AdminLog|AdminLog[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,22 +193,22 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|AdminLog[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,12 +216,12 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(AdminLogTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,12 +229,12 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(AdminLogTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,8 +244,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -269,18 +253,18 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @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(AdminLogPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminLogTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AdminLogPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminLogTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -291,7 +275,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AdminLogTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -307,7 +291,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAdminLogin($adminLogin = null, $comparison = null)
|
||||
{
|
||||
@@ -320,7 +304,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::ADMIN_LOGIN, $adminLogin, $comparison);
|
||||
return $this->addUsingAlias(AdminLogTableMap::ADMIN_LOGIN, $adminLogin, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -336,7 +320,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAdminFirstname($adminFirstname = null, $comparison = null)
|
||||
{
|
||||
@@ -349,7 +333,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::ADMIN_FIRSTNAME, $adminFirstname, $comparison);
|
||||
return $this->addUsingAlias(AdminLogTableMap::ADMIN_FIRSTNAME, $adminFirstname, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -365,7 +349,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAdminLastname($adminLastname = null, $comparison = null)
|
||||
{
|
||||
@@ -378,7 +362,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::ADMIN_LASTNAME, $adminLastname, $comparison);
|
||||
return $this->addUsingAlias(AdminLogTableMap::ADMIN_LASTNAME, $adminLastname, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -394,7 +378,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAction($action = null, $comparison = null)
|
||||
{
|
||||
@@ -407,7 +391,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::ACTION, $action, $comparison);
|
||||
return $this->addUsingAlias(AdminLogTableMap::ACTION, $action, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -423,7 +407,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByRequest($request = null, $comparison = null)
|
||||
{
|
||||
@@ -436,7 +420,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::REQUEST, $request, $comparison);
|
||||
return $this->addUsingAlias(AdminLogTableMap::REQUEST, $request, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -457,18 +441,18 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @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(AdminLogPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminLogTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(AdminLogPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminLogTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -479,7 +463,7 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(AdminLogTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -500,18 +484,18 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @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(AdminLogPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminLogTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(AdminLogPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminLogTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -522,25 +506,100 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(AdminLogTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param AdminLog $adminLog Object to remove from the list of results
|
||||
* @param ChildAdminLog $adminLog Object to remove from the list of results
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($adminLog = null)
|
||||
{
|
||||
if ($adminLog) {
|
||||
$this->addUsingAlias(AdminLogPeer::ID, $adminLog->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -548,31 +607,11 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AdminLogPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AdminLogPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AdminLogPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(AdminLogTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -580,30 +619,51 @@ abstract class BaseAdminLogQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AdminLogPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AdminLogPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(AdminLogTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return AdminLogQuery The current query, for fluid interface
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AdminLogPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(AdminLogTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // AdminLogQuery
|
||||
418
core/lib/Thelia/Model/om/BaseAdminQuery.php → core/lib/Thelia/Model/Base/AdminQuery.php
Executable file → Normal file
418
core/lib/Thelia/Model/om/BaseAdminQuery.php → core/lib/Thelia/Model/Base/AdminQuery.php
Executable file → Normal file
@@ -1,108 +1,107 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Admin;
|
||||
use Thelia\Model\AdminGroup;
|
||||
use Thelia\Model\AdminPeer;
|
||||
use Thelia\Model\AdminQuery;
|
||||
use Thelia\Model\Group;
|
||||
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 AdminQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AdminQuery orderByFirstname($order = Criteria::ASC) Order by the firstname column
|
||||
* @method AdminQuery orderByLastname($order = Criteria::ASC) Order by the lastname column
|
||||
* @method AdminQuery orderByLogin($order = Criteria::ASC) Order by the login column
|
||||
* @method AdminQuery orderByPassword($order = Criteria::ASC) Order by the password column
|
||||
* @method AdminQuery orderByAlgo($order = Criteria::ASC) Order by the algo column
|
||||
* @method AdminQuery orderBySalt($order = Criteria::ASC) Order by the salt column
|
||||
* @method AdminQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method AdminQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 AdminQuery groupById() Group by the id column
|
||||
* @method AdminQuery groupByFirstname() Group by the firstname column
|
||||
* @method AdminQuery groupByLastname() Group by the lastname column
|
||||
* @method AdminQuery groupByLogin() Group by the login column
|
||||
* @method AdminQuery groupByPassword() Group by the password column
|
||||
* @method AdminQuery groupByAlgo() Group by the algo column
|
||||
* @method AdminQuery groupBySalt() Group by the salt column
|
||||
* @method AdminQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method AdminQuery groupByUpdatedAt() Group 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 AdminQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AdminQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AdminQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AdminQuery leftJoinAdminGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the AdminGroup relation
|
||||
* @method AdminQuery rightJoinAdminGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AdminGroup relation
|
||||
* @method AdminQuery innerJoinAdminGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the AdminGroup relation
|
||||
* @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 Admin findOne(PropelPDO $con = null) Return the first Admin matching the query
|
||||
* @method Admin findOneOrCreate(PropelPDO $con = null) Return the first Admin matching the query, or a new Admin object populated from the query conditions when no match is found
|
||||
* @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 Admin findOneByFirstname(string $firstname) Return the first Admin filtered by the firstname column
|
||||
* @method Admin findOneByLastname(string $lastname) Return the first Admin filtered by the lastname column
|
||||
* @method Admin findOneByLogin(string $login) Return the first Admin filtered by the login column
|
||||
* @method Admin findOneByPassword(string $password) Return the first Admin filtered by the password column
|
||||
* @method Admin findOneByAlgo(string $algo) Return the first Admin filtered by the algo column
|
||||
* @method Admin findOneBySalt(string $salt) Return the first Admin filtered by the salt column
|
||||
* @method Admin findOneByCreatedAt(string $created_at) Return the first Admin filtered by the created_at column
|
||||
* @method Admin findOneByUpdatedAt(string $updated_at) Return the first Admin filtered by the updated_at column
|
||||
* @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 Admin objects filtered by the id column
|
||||
* @method array findByFirstname(string $firstname) Return Admin objects filtered by the firstname column
|
||||
* @method array findByLastname(string $lastname) Return Admin objects filtered by the lastname column
|
||||
* @method array findByLogin(string $login) Return Admin objects filtered by the login column
|
||||
* @method array findByPassword(string $password) Return Admin objects filtered by the password column
|
||||
* @method array findByAlgo(string $algo) Return Admin objects filtered by the algo column
|
||||
* @method array findBySalt(string $salt) Return Admin objects filtered by the salt column
|
||||
* @method array findByCreatedAt(string $created_at) Return Admin objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return Admin objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAdminQuery extends ModelCriteria
|
||||
abstract class AdminQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAdminQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AdminQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Admin', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AdminQuery object.
|
||||
* Returns a new ChildAdminQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AdminQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AdminQuery
|
||||
* @return ChildAdminQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AdminQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AdminQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AdminQuery();
|
||||
$query = new \Thelia\Model\AdminQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -123,21 +122,21 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return Admin|Admin[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AdminPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = AdminTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(AdminPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AdminTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -149,46 +148,31 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return Admin A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Admin A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new Admin();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildAdmin();
|
||||
$obj->hydrate($row);
|
||||
AdminPeer::addInstanceToPool($obj, (string) $key);
|
||||
AdminTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -199,19 +183,19 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Admin|Admin[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,22 +204,22 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|Admin[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -243,12 +227,12 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(AdminTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,12 +240,12 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(AdminTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -271,8 +255,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -281,18 +264,18 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @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(AdminPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AdminPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -303,7 +286,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AdminTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -319,7 +302,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFirstname($firstname = null, $comparison = null)
|
||||
{
|
||||
@@ -332,7 +315,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::FIRSTNAME, $firstname, $comparison);
|
||||
return $this->addUsingAlias(AdminTableMap::FIRSTNAME, $firstname, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -348,7 +331,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLastname($lastname = null, $comparison = null)
|
||||
{
|
||||
@@ -361,7 +344,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::LASTNAME, $lastname, $comparison);
|
||||
return $this->addUsingAlias(AdminTableMap::LASTNAME, $lastname, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -377,7 +360,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLogin($login = null, $comparison = null)
|
||||
{
|
||||
@@ -390,7 +373,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::LOGIN, $login, $comparison);
|
||||
return $this->addUsingAlias(AdminTableMap::LOGIN, $login, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -406,7 +389,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPassword($password = null, $comparison = null)
|
||||
{
|
||||
@@ -419,7 +402,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::PASSWORD, $password, $comparison);
|
||||
return $this->addUsingAlias(AdminTableMap::PASSWORD, $password, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -435,7 +418,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAlgo($algo = null, $comparison = null)
|
||||
{
|
||||
@@ -448,7 +431,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::ALGO, $algo, $comparison);
|
||||
return $this->addUsingAlias(AdminTableMap::ALGO, $algo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -464,7 +447,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterBySalt($salt = null, $comparison = null)
|
||||
{
|
||||
@@ -477,7 +460,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::SALT, $salt, $comparison);
|
||||
return $this->addUsingAlias(AdminTableMap::SALT, $salt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -498,18 +481,18 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @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(AdminPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(AdminPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -520,7 +503,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(AdminTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -541,18 +524,18 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @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(AdminPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AdminTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(AdminPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AdminTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -563,30 +546,29 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(AdminTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related AdminGroup object
|
||||
* Filter the query by a related \Thelia\Model\AdminGroup object
|
||||
*
|
||||
* @param AdminGroup|PropelObjectCollection $adminGroup the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AdminQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAdminGroup($adminGroup, $comparison = null)
|
||||
{
|
||||
if ($adminGroup instanceof AdminGroup) {
|
||||
if ($adminGroup instanceof \Thelia\Model\AdminGroup) {
|
||||
return $this
|
||||
->addUsingAlias(AdminPeer::ID, $adminGroup->getAdminId(), $comparison);
|
||||
} elseif ($adminGroup instanceof PropelObjectCollection) {
|
||||
->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 AdminGroup or PropelCollection');
|
||||
throw new PropelException('filterByAdminGroup() only accepts arguments of type \Thelia\Model\AdminGroup or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -596,7 +578,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAdminGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -625,7 +607,7 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the AdminGroup relation AdminGroup object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -644,10 +626,10 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
* 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
|
||||
* @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 AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByGroup($group, $comparison = Criteria::EQUAL)
|
||||
{
|
||||
@@ -660,19 +642,94 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param Admin $admin Object to remove from the list of results
|
||||
* @param ChildAdmin $admin Object to remove from the list of results
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($admin = null)
|
||||
{
|
||||
if ($admin) {
|
||||
$this->addUsingAlias(AdminPeer::ID, $admin->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -680,31 +737,11 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AdminPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AdminPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AdminPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(AdminTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -712,30 +749,51 @@ abstract class BaseAdminQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AdminPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AdminPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(AdminTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return AdminQuery The current query, for fluid interface
|
||||
* @return ChildAdminQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AdminPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(AdminTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // AdminQuery
|
||||
1904
core/lib/Thelia/Model/Base/Area.php
Normal file
1904
core/lib/Thelia/Model/Base/Area.php
Normal file
File diff suppressed because it is too large
Load Diff
398
core/lib/Thelia/Model/om/BaseAreaQuery.php → core/lib/Thelia/Model/Base/AreaQuery.php
Executable file → Normal file
398
core/lib/Thelia/Model/om/BaseAreaQuery.php → core/lib/Thelia/Model/Base/AreaQuery.php
Executable file → Normal file
@@ -1,96 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Area;
|
||||
use Thelia\Model\AreaPeer;
|
||||
use Thelia\Model\AreaQuery;
|
||||
use Thelia\Model\Country;
|
||||
use Thelia\Model\Delivzone;
|
||||
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 AreaQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AreaQuery orderByName($order = Criteria::ASC) Order by the name column
|
||||
* @method AreaQuery orderByUnit($order = Criteria::ASC) Order by the unit column
|
||||
* @method AreaQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method AreaQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 AreaQuery groupById() Group by the id column
|
||||
* @method AreaQuery groupByName() Group by the name column
|
||||
* @method AreaQuery groupByUnit() Group by the unit column
|
||||
* @method AreaQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method AreaQuery groupByUpdatedAt() Group 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 AreaQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AreaQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AreaQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AreaQuery leftJoinCountry($relationAlias = null) Adds a LEFT JOIN clause to the query using the Country relation
|
||||
* @method AreaQuery rightJoinCountry($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Country relation
|
||||
* @method AreaQuery innerJoinCountry($relationAlias = null) Adds a INNER JOIN clause to the query using the Country relation
|
||||
* @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 AreaQuery leftJoinDelivzone($relationAlias = null) Adds a LEFT JOIN clause to the query using the Delivzone relation
|
||||
* @method AreaQuery rightJoinDelivzone($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Delivzone relation
|
||||
* @method AreaQuery innerJoinDelivzone($relationAlias = null) Adds a INNER JOIN clause to the query using the Delivzone 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 Area findOne(PropelPDO $con = null) Return the first Area matching the query
|
||||
* @method Area findOneOrCreate(PropelPDO $con = null) Return the first Area matching the query, or a new Area object populated from the query conditions when no match is found
|
||||
* @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 Area findOneByName(string $name) Return the first Area filtered by the name column
|
||||
* @method Area findOneByUnit(double $unit) Return the first Area filtered by the unit column
|
||||
* @method Area findOneByCreatedAt(string $created_at) Return the first Area filtered by the created_at column
|
||||
* @method Area findOneByUpdatedAt(string $updated_at) Return the first Area filtered by the updated_at column
|
||||
* @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 Area objects filtered by the id column
|
||||
* @method array findByName(string $name) Return Area objects filtered by the name column
|
||||
* @method array findByUnit(double $unit) Return Area objects filtered by the unit column
|
||||
* @method array findByCreatedAt(string $created_at) Return Area objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return Area objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAreaQuery extends ModelCriteria
|
||||
abstract class AreaQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAreaQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AreaQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Area', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AreaQuery object.
|
||||
* Returns a new ChildAreaQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AreaQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AreaQuery
|
||||
* @return ChildAreaQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AreaQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AreaQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AreaQuery();
|
||||
$query = new \Thelia\Model\AreaQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -111,21 +110,21 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return Area|Area[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AreaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = AreaTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(AreaPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AreaTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -137,46 +136,31 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return Area A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Area A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new Area();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildArea();
|
||||
$obj->hydrate($row);
|
||||
AreaPeer::addInstanceToPool($obj, (string) $key);
|
||||
AreaTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -187,19 +171,19 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Area|Area[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,22 +192,22 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|Area[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,12 +215,12 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AreaPeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(AreaTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,12 +228,12 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AreaPeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(AreaTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,8 +243,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -269,18 +252,18 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @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(AreaPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AreaTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AreaPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AreaTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -291,7 +274,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AreaPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AreaTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -307,7 +290,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByName($name = null, $comparison = null)
|
||||
{
|
||||
@@ -320,7 +303,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AreaPeer::NAME, $name, $comparison);
|
||||
return $this->addUsingAlias(AreaTableMap::NAME, $name, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -330,8 +313,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByUnit(array('max' => 12)); // WHERE unit <= 12
|
||||
* $query->filterByUnit(array('min' => 12)); // WHERE unit > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $unit The value to use as filter.
|
||||
@@ -340,18 +322,18 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @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(AreaPeer::UNIT, $unit['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AreaTableMap::UNIT, $unit['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($unit['max'])) {
|
||||
$this->addUsingAlias(AreaPeer::UNIT, $unit['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AreaTableMap::UNIT, $unit['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -362,7 +344,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AreaPeer::UNIT, $unit, $comparison);
|
||||
return $this->addUsingAlias(AreaTableMap::UNIT, $unit, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -383,18 +365,18 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @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(AreaPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AreaTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(AreaPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AreaTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -405,7 +387,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AreaPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(AreaTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -426,18 +408,18 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @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(AreaPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AreaTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(AreaPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AreaTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -448,30 +430,29 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AreaPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(AreaTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Country object
|
||||
* Filter the query by a related \Thelia\Model\Country object
|
||||
*
|
||||
* @param Country|PropelObjectCollection $country the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AreaQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCountry($country, $comparison = null)
|
||||
{
|
||||
if ($country instanceof Country) {
|
||||
if ($country instanceof \Thelia\Model\Country) {
|
||||
return $this
|
||||
->addUsingAlias(AreaPeer::ID, $country->getAreaId(), $comparison);
|
||||
} elseif ($country instanceof PropelObjectCollection) {
|
||||
->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 Country or PropelCollection');
|
||||
throw new PropelException('filterByCountry() only accepts arguments of type \Thelia\Model\Country or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +462,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCountry($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
@@ -510,7 +491,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Country relation Country object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -526,26 +507,25 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Delivzone object
|
||||
* Filter the query by a related \Thelia\Model\Delivzone object
|
||||
*
|
||||
* @param Delivzone|PropelObjectCollection $delivzone the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AreaQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDelivzone($delivzone, $comparison = null)
|
||||
{
|
||||
if ($delivzone instanceof Delivzone) {
|
||||
if ($delivzone instanceof \Thelia\Model\Delivzone) {
|
||||
return $this
|
||||
->addUsingAlias(AreaPeer::ID, $delivzone->getAreaId(), $comparison);
|
||||
} elseif ($delivzone instanceof PropelObjectCollection) {
|
||||
->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 Delivzone or PropelCollection');
|
||||
throw new PropelException('filterByDelivzone() only accepts arguments of type \Thelia\Model\Delivzone or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,7 +535,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinDelivzone($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
@@ -584,7 +564,7 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Delivzone relation Delivzone object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -602,19 +582,94 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param Area $area Object to remove from the list of results
|
||||
* @param ChildArea $area Object to remove from the list of results
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($area = null)
|
||||
{
|
||||
if ($area) {
|
||||
$this->addUsingAlias(AreaPeer::ID, $area->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -622,31 +677,11 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AreaPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AreaPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AreaPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(AreaTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -654,30 +689,51 @@ abstract class BaseAreaQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AreaPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AreaPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(AreaTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return AreaQuery The current query, for fluid interface
|
||||
* @return ChildAreaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AreaPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(AreaTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // AreaQuery
|
||||
1847
core/lib/Thelia/Model/om/BaseAttribute.php → core/lib/Thelia/Model/Base/Attribute.php
Executable file → Normal file
1847
core/lib/Thelia/Model/om/BaseAttribute.php → core/lib/Thelia/Model/Base/Attribute.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1357
core/lib/Thelia/Model/om/BaseAttributeAv.php → core/lib/Thelia/Model/Base/AttributeAv.php
Executable file → Normal file
1357
core/lib/Thelia/Model/om/BaseAttributeAv.php → core/lib/Thelia/Model/Base/AttributeAv.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/AttributeAvI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/AttributeAvI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
607
core/lib/Thelia/Model/Base/AttributeAvI18nQuery.php
Normal file
607
core/lib/Thelia/Model/Base/AttributeAvI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\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
|
||||
450
core/lib/Thelia/Model/om/BaseAttributeAvQuery.php → core/lib/Thelia/Model/Base/AttributeAvQuery.php
Executable file → Normal file
450
core/lib/Thelia/Model/om/BaseAttributeAvQuery.php → core/lib/Thelia/Model/Base/AttributeAvQuery.php
Executable file → Normal file
@@ -1,101 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Attribute;
|
||||
use Thelia\Model\AttributeAv;
|
||||
use Thelia\Model\AttributeAvI18n;
|
||||
use Thelia\Model\AttributeAvPeer;
|
||||
use Thelia\Model\AttributeAvQuery;
|
||||
use Thelia\Model\AttributeCombination;
|
||||
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 AttributeAvQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AttributeAvQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
|
||||
* @method AttributeAvQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method AttributeAvQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method AttributeAvQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 AttributeAvQuery groupById() Group by the id column
|
||||
* @method AttributeAvQuery groupByAttributeId() Group by the attribute_id column
|
||||
* @method AttributeAvQuery groupByPosition() Group by the position column
|
||||
* @method AttributeAvQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method AttributeAvQuery groupByUpdatedAt() Group 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 AttributeAvQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AttributeAvQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AttributeAvQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AttributeAvQuery leftJoinAttribute($relationAlias = null) Adds a LEFT JOIN clause to the query using the Attribute relation
|
||||
* @method AttributeAvQuery rightJoinAttribute($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Attribute relation
|
||||
* @method AttributeAvQuery innerJoinAttribute($relationAlias = null) Adds a INNER JOIN clause to the query using the Attribute relation
|
||||
* @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 AttributeAvQuery leftJoinAttributeCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeCombination relation
|
||||
* @method AttributeAvQuery rightJoinAttributeCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCombination relation
|
||||
* @method AttributeAvQuery innerJoinAttributeCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCombination 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 AttributeAvQuery leftJoinAttributeAvI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeAvI18n relation
|
||||
* @method AttributeAvQuery rightJoinAttributeAvI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeAvI18n relation
|
||||
* @method AttributeAvQuery innerJoinAttributeAvI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeAvI18n 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 AttributeAv findOne(PropelPDO $con = null) Return the first AttributeAv matching the query
|
||||
* @method AttributeAv findOneOrCreate(PropelPDO $con = null) Return the first AttributeAv matching the query, or a new AttributeAv object populated from the query conditions when no match is found
|
||||
* @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 AttributeAv findOneByAttributeId(int $attribute_id) Return the first AttributeAv filtered by the attribute_id column
|
||||
* @method AttributeAv findOneByPosition(int $position) Return the first AttributeAv filtered by the position column
|
||||
* @method AttributeAv findOneByCreatedAt(string $created_at) Return the first AttributeAv filtered by the created_at column
|
||||
* @method AttributeAv findOneByUpdatedAt(string $updated_at) Return the first AttributeAv filtered by the updated_at column
|
||||
* @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 AttributeAv objects filtered by the id column
|
||||
* @method array findByAttributeId(int $attribute_id) Return AttributeAv objects filtered by the attribute_id column
|
||||
* @method array findByPosition(int $position) Return AttributeAv objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return AttributeAv objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return AttributeAv objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
abstract class AttributeAvQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAttributeAvQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AttributeAvQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\AttributeAv', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AttributeAvQuery object.
|
||||
* Returns a new ChildAttributeAvQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AttributeAvQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AttributeAvQuery
|
||||
* @return ChildAttributeAvQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AttributeAvQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AttributeAvQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AttributeAvQuery();
|
||||
$query = new \Thelia\Model\AttributeAvQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -116,21 +115,21 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return AttributeAv|AttributeAv[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AttributeAvPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = AttributeAvTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(AttributeAvPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AttributeAvTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -142,46 +141,31 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return AttributeAv A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AttributeAv A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new AttributeAv();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildAttributeAv();
|
||||
$obj->hydrate($row);
|
||||
AttributeAvPeer::addInstanceToPool($obj, (string) $key);
|
||||
AttributeAvTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -192,19 +176,19 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AttributeAv|AttributeAv[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,22 +197,22 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|AttributeAv[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -236,12 +220,12 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AttributeAvPeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(AttributeAvTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -249,12 +233,12 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AttributeAvPeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(AttributeAvTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -264,8 +248,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -274,18 +257,18 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @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(AttributeAvPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AttributeAvPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -296,7 +279,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeAvPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AttributeAvTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -306,8 +289,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByAttributeId(array('max' => 12)); // WHERE attribute_id <= 12
|
||||
* $query->filterByAttributeId(array('min' => 12)); // WHERE attribute_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByAttribute()
|
||||
@@ -318,18 +300,18 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @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(AttributeAvPeer::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($attributeId['max'])) {
|
||||
$this->addUsingAlias(AttributeAvPeer::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -340,7 +322,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeAvPeer::ATTRIBUTE_ID, $attributeId, $comparison);
|
||||
return $this->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attributeId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,8 +332,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByPosition(array('max' => 12)); // WHERE position <= 12
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
@@ -360,18 +341,18 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @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(AttributeAvPeer::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(AttributeAvPeer::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -382,7 +363,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeAvPeer::POSITION, $position, $comparison);
|
||||
return $this->addUsingAlias(AttributeAvTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,18 +384,18 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @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(AttributeAvPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(AttributeAvPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -425,7 +406,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeAvPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(AttributeAvTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -446,18 +427,18 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @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(AttributeAvPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(AttributeAvPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeAvTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -468,32 +449,31 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeAvPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(AttributeAvTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Attribute object
|
||||
* Filter the query by a related \Thelia\Model\Attribute object
|
||||
*
|
||||
* @param Attribute|PropelObjectCollection $attribute The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeAvQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttribute($attribute, $comparison = null)
|
||||
{
|
||||
if ($attribute instanceof Attribute) {
|
||||
if ($attribute instanceof \Thelia\Model\Attribute) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeAvPeer::ATTRIBUTE_ID, $attribute->getId(), $comparison);
|
||||
} elseif ($attribute instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attribute->getId(), $comparison);
|
||||
} elseif ($attribute instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AttributeAvPeer::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AttributeAvTableMap::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByAttribute() only accepts arguments of type Attribute or PropelCollection');
|
||||
throw new PropelException('filterByAttribute() only accepts arguments of type \Thelia\Model\Attribute or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,7 +483,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttribute($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -532,7 +512,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Attribute relation Attribute object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -548,26 +528,25 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related AttributeCombination object
|
||||
* Filter the query by a related \Thelia\Model\AttributeCombination object
|
||||
*
|
||||
* @param AttributeCombination|PropelObjectCollection $attributeCombination the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeAvQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttributeCombination($attributeCombination, $comparison = null)
|
||||
{
|
||||
if ($attributeCombination instanceof AttributeCombination) {
|
||||
if ($attributeCombination instanceof \Thelia\Model\AttributeCombination) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeAvPeer::ID, $attributeCombination->getAttributeAvId(), $comparison);
|
||||
} elseif ($attributeCombination instanceof PropelObjectCollection) {
|
||||
->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 AttributeCombination or PropelCollection');
|
||||
throw new PropelException('filterByAttributeCombination() only accepts arguments of type \Thelia\Model\AttributeCombination or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,7 +556,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttributeCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -606,7 +585,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the AttributeCombination relation AttributeCombination object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -622,26 +601,25 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related AttributeAvI18n object
|
||||
* Filter the query by a related \Thelia\Model\AttributeAvI18n object
|
||||
*
|
||||
* @param AttributeAvI18n|PropelObjectCollection $attributeAvI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeAvQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttributeAvI18n($attributeAvI18n, $comparison = null)
|
||||
{
|
||||
if ($attributeAvI18n instanceof AttributeAvI18n) {
|
||||
if ($attributeAvI18n instanceof \Thelia\Model\AttributeAvI18n) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeAvPeer::ID, $attributeAvI18n->getId(), $comparison);
|
||||
} elseif ($attributeAvI18n instanceof PropelObjectCollection) {
|
||||
->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 AttributeAvI18n or PropelCollection');
|
||||
throw new PropelException('filterByAttributeAvI18n() only accepts arguments of type \Thelia\Model\AttributeAvI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -651,7 +629,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttributeAvI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
@@ -680,7 +658,7 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the AttributeAvI18n relation AttributeAvI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -698,19 +676,94 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param AttributeAv $attributeAv Object to remove from the list of results
|
||||
* @param ChildAttributeAv $attributeAv Object to remove from the list of results
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($attributeAv = null)
|
||||
{
|
||||
if ($attributeAv) {
|
||||
$this->addUsingAlias(AttributeAvPeer::ID, $attributeAv->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -718,31 +771,11 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AttributeAvPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AttributeAvPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AttributeAvPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(AttributeAvTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -750,32 +783,53 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AttributeAvPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AttributeAvPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(AttributeAvTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AttributeAvPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(AttributeAvTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
@@ -785,9 +839,9 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* @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 AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'AttributeAvI18n';
|
||||
|
||||
@@ -803,9 +857,9 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* @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 AttributeAvQuery The current query, for fluid interface
|
||||
* @return ChildAttributeAvQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
@@ -824,13 +878,13 @@ abstract class BaseAttributeAvQuery extends ModelCriteria
|
||||
* @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 AttributeAvI18nQuery A secondary query class using the current class as primary query
|
||||
* @return ChildAttributeAvI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
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');
|
||||
->useQuery($relationAlias ? $relationAlias : 'AttributeAvI18n', '\Thelia\Model\AttributeAvI18nQuery');
|
||||
}
|
||||
|
||||
}
|
||||
} // AttributeAvQuery
|
||||
1495
core/lib/Thelia/Model/Base/AttributeCategory.php
Normal file
1495
core/lib/Thelia/Model/Base/AttributeCategory.php
Normal file
File diff suppressed because it is too large
Load Diff
409
core/lib/Thelia/Model/om/BaseAttributeCategoryQuery.php → core/lib/Thelia/Model/Base/AttributeCategoryQuery.php
Executable file → Normal file
409
core/lib/Thelia/Model/om/BaseAttributeCategoryQuery.php → core/lib/Thelia/Model/Base/AttributeCategoryQuery.php
Executable file → Normal file
@@ -1,96 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Attribute;
|
||||
use Thelia\Model\AttributeCategory;
|
||||
use Thelia\Model\AttributeCategoryPeer;
|
||||
use Thelia\Model\AttributeCategoryQuery;
|
||||
use Thelia\Model\Category;
|
||||
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 AttributeCategoryQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AttributeCategoryQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
|
||||
* @method AttributeCategoryQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
|
||||
* @method AttributeCategoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method AttributeCategoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 AttributeCategoryQuery groupById() Group by the id column
|
||||
* @method AttributeCategoryQuery groupByCategoryId() Group by the category_id column
|
||||
* @method AttributeCategoryQuery groupByAttributeId() Group by the attribute_id column
|
||||
* @method AttributeCategoryQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method AttributeCategoryQuery groupByUpdatedAt() Group 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 AttributeCategoryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AttributeCategoryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AttributeCategoryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AttributeCategoryQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
|
||||
* @method AttributeCategoryQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
|
||||
* @method AttributeCategoryQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
|
||||
* @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 AttributeCategoryQuery leftJoinAttribute($relationAlias = null) Adds a LEFT JOIN clause to the query using the Attribute relation
|
||||
* @method AttributeCategoryQuery rightJoinAttribute($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Attribute relation
|
||||
* @method AttributeCategoryQuery innerJoinAttribute($relationAlias = null) Adds a INNER JOIN clause to the query using the Attribute 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 AttributeCategory findOne(PropelPDO $con = null) Return the first AttributeCategory matching the query
|
||||
* @method AttributeCategory findOneOrCreate(PropelPDO $con = null) Return the first AttributeCategory matching the query, or a new AttributeCategory object populated from the query conditions when no match is found
|
||||
* @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 AttributeCategory findOneByCategoryId(int $category_id) Return the first AttributeCategory filtered by the category_id column
|
||||
* @method AttributeCategory findOneByAttributeId(int $attribute_id) Return the first AttributeCategory filtered by the attribute_id column
|
||||
* @method AttributeCategory findOneByCreatedAt(string $created_at) Return the first AttributeCategory filtered by the created_at column
|
||||
* @method AttributeCategory findOneByUpdatedAt(string $updated_at) Return the first AttributeCategory filtered by the updated_at column
|
||||
* @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 AttributeCategory objects filtered by the id column
|
||||
* @method array findByCategoryId(int $category_id) Return AttributeCategory objects filtered by the category_id column
|
||||
* @method array findByAttributeId(int $attribute_id) Return AttributeCategory objects filtered by the attribute_id column
|
||||
* @method array findByCreatedAt(string $created_at) Return AttributeCategory objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return AttributeCategory objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
abstract class AttributeCategoryQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAttributeCategoryQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AttributeCategoryQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\AttributeCategory', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AttributeCategoryQuery object.
|
||||
* Returns a new ChildAttributeCategoryQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AttributeCategoryQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AttributeCategoryQuery
|
||||
* @return ChildAttributeCategoryQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AttributeCategoryQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AttributeCategoryQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AttributeCategoryQuery();
|
||||
$query = new \Thelia\Model\AttributeCategoryQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -111,21 +110,21 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return AttributeCategory|AttributeCategory[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AttributeCategoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = AttributeCategoryTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(AttributeCategoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AttributeCategoryTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -137,46 +136,31 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return AttributeCategory A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AttributeCategory A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new AttributeCategory();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildAttributeCategory();
|
||||
$obj->hydrate($row);
|
||||
AttributeCategoryPeer::addInstanceToPool($obj, (string) $key);
|
||||
AttributeCategoryTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -187,19 +171,19 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AttributeCategory|AttributeCategory[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,22 +192,22 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|AttributeCategory[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,12 +215,12 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AttributeCategoryPeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(AttributeCategoryTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,12 +228,12 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AttributeCategoryPeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(AttributeCategoryTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,8 +243,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -269,18 +252,18 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @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(AttributeCategoryPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AttributeCategoryPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -291,7 +274,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCategoryPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AttributeCategoryTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,8 +284,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByCategoryId(array('max' => 12)); // WHERE category_id <= 12
|
||||
* $query->filterByCategoryId(array('min' => 12)); // WHERE category_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCategory()
|
||||
@@ -313,18 +295,18 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @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(AttributeCategoryPeer::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($categoryId['max'])) {
|
||||
$this->addUsingAlias(AttributeCategoryPeer::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -335,7 +317,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCategoryPeer::CATEGORY_ID, $categoryId, $comparison);
|
||||
return $this->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $categoryId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,8 +327,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByAttributeId(array('max' => 12)); // WHERE attribute_id <= 12
|
||||
* $query->filterByAttributeId(array('min' => 12)); // WHERE attribute_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByAttribute()
|
||||
@@ -357,18 +338,18 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @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(AttributeCategoryPeer::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($attributeId['max'])) {
|
||||
$this->addUsingAlias(AttributeCategoryPeer::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -379,7 +360,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCategoryPeer::ATTRIBUTE_ID, $attributeId, $comparison);
|
||||
return $this->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attributeId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -400,18 +381,18 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @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(AttributeCategoryPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(AttributeCategoryPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -422,7 +403,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCategoryPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(AttributeCategoryTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -443,18 +424,18 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @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(AttributeCategoryPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(AttributeCategoryPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCategoryTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -465,32 +446,31 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCategoryPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(AttributeCategoryTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Category object
|
||||
* Filter the query by a related \Thelia\Model\Category object
|
||||
*
|
||||
* @param Category|PropelObjectCollection $category The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeCategoryQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategory($category, $comparison = null)
|
||||
{
|
||||
if ($category instanceof Category) {
|
||||
if ($category instanceof \Thelia\Model\Category) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeCategoryPeer::CATEGORY_ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AttributeCategoryPeer::CATEGORY_ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AttributeCategoryTableMap::CATEGORY_ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type Category or PropelCollection');
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type \Thelia\Model\Category or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,7 +480,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -529,7 +509,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Category relation Category object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -545,28 +525,27 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Attribute object
|
||||
* Filter the query by a related \Thelia\Model\Attribute object
|
||||
*
|
||||
* @param Attribute|PropelObjectCollection $attribute The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeCategoryQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttribute($attribute, $comparison = null)
|
||||
{
|
||||
if ($attribute instanceof Attribute) {
|
||||
if ($attribute instanceof \Thelia\Model\Attribute) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeCategoryPeer::ATTRIBUTE_ID, $attribute->getId(), $comparison);
|
||||
} elseif ($attribute instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attribute->getId(), $comparison);
|
||||
} elseif ($attribute instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AttributeCategoryPeer::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AttributeCategoryTableMap::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByAttribute() only accepts arguments of type Attribute or PropelCollection');
|
||||
throw new PropelException('filterByAttribute() only accepts arguments of type \Thelia\Model\Attribute or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,7 +555,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttribute($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -605,7 +584,7 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Attribute relation Attribute object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -623,19 +602,94 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param AttributeCategory $attributeCategory Object to remove from the list of results
|
||||
* @param ChildAttributeCategory $attributeCategory Object to remove from the list of results
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($attributeCategory = null)
|
||||
{
|
||||
if ($attributeCategory) {
|
||||
$this->addUsingAlias(AttributeCategoryPeer::ID, $attributeCategory->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -643,31 +697,11 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AttributeCategoryPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AttributeCategoryPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AttributeCategoryPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(AttributeCategoryTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -675,30 +709,51 @@ abstract class BaseAttributeCategoryQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AttributeCategoryPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 AttributeCategoryQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AttributeCategoryPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(AttributeCategoryTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return AttributeCategoryQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCategoryQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AttributeCategoryPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(AttributeCategoryTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // AttributeCategoryQuery
|
||||
1643
core/lib/Thelia/Model/Base/AttributeCombination.php
Normal file
1643
core/lib/Thelia/Model/Base/AttributeCombination.php
Normal file
File diff suppressed because it is too large
Load Diff
466
core/lib/Thelia/Model/om/BaseAttributeCombinationQuery.php → core/lib/Thelia/Model/Base/AttributeCombinationQuery.php
Executable file → Normal file
466
core/lib/Thelia/Model/om/BaseAttributeCombinationQuery.php → core/lib/Thelia/Model/Base/AttributeCombinationQuery.php
Executable file → Normal file
@@ -1,106 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Attribute;
|
||||
use Thelia\Model\AttributeAv;
|
||||
use Thelia\Model\AttributeCombination;
|
||||
use Thelia\Model\AttributeCombinationPeer;
|
||||
use Thelia\Model\AttributeCombinationQuery;
|
||||
use Thelia\Model\Combination;
|
||||
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 AttributeCombinationQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AttributeCombinationQuery orderByAttributeId($order = Criteria::ASC) Order by the attribute_id column
|
||||
* @method AttributeCombinationQuery orderByCombinationId($order = Criteria::ASC) Order by the combination_id column
|
||||
* @method AttributeCombinationQuery orderByAttributeAvId($order = Criteria::ASC) Order by the attribute_av_id column
|
||||
* @method AttributeCombinationQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method AttributeCombinationQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 AttributeCombinationQuery groupById() Group by the id column
|
||||
* @method AttributeCombinationQuery groupByAttributeId() Group by the attribute_id column
|
||||
* @method AttributeCombinationQuery groupByCombinationId() Group by the combination_id column
|
||||
* @method AttributeCombinationQuery groupByAttributeAvId() Group by the attribute_av_id column
|
||||
* @method AttributeCombinationQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method AttributeCombinationQuery groupByUpdatedAt() Group 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 AttributeCombinationQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AttributeCombinationQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AttributeCombinationQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AttributeCombinationQuery leftJoinAttribute($relationAlias = null) Adds a LEFT JOIN clause to the query using the Attribute relation
|
||||
* @method AttributeCombinationQuery rightJoinAttribute($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Attribute relation
|
||||
* @method AttributeCombinationQuery innerJoinAttribute($relationAlias = null) Adds a INNER JOIN clause to the query using the Attribute relation
|
||||
* @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 AttributeCombinationQuery leftJoinAttributeAv($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeAv relation
|
||||
* @method AttributeCombinationQuery rightJoinAttributeAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeAv relation
|
||||
* @method AttributeCombinationQuery innerJoinAttributeAv($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeAv 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 AttributeCombinationQuery leftJoinCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the Combination relation
|
||||
* @method AttributeCombinationQuery rightJoinCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Combination relation
|
||||
* @method AttributeCombinationQuery innerJoinCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the Combination 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 AttributeCombination findOne(PropelPDO $con = null) Return the first AttributeCombination matching the query
|
||||
* @method AttributeCombination findOneOrCreate(PropelPDO $con = null) Return the first AttributeCombination matching the query, or a new AttributeCombination object populated from the query conditions when no match is found
|
||||
* @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 AttributeCombination findOneById(int $id) Return the first AttributeCombination filtered by the id column
|
||||
* @method AttributeCombination findOneByAttributeId(int $attribute_id) Return the first AttributeCombination filtered by the attribute_id column
|
||||
* @method AttributeCombination findOneByCombinationId(int $combination_id) Return the first AttributeCombination filtered by the combination_id column
|
||||
* @method AttributeCombination findOneByAttributeAvId(int $attribute_av_id) Return the first AttributeCombination filtered by the attribute_av_id column
|
||||
* @method AttributeCombination findOneByCreatedAt(string $created_at) Return the first AttributeCombination filtered by the created_at column
|
||||
* @method AttributeCombination findOneByUpdatedAt(string $updated_at) Return the first AttributeCombination filtered by the updated_at column
|
||||
* @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 AttributeCombination objects filtered by the id column
|
||||
* @method array findByAttributeId(int $attribute_id) Return AttributeCombination objects filtered by the attribute_id column
|
||||
* @method array findByCombinationId(int $combination_id) Return AttributeCombination objects filtered by the combination_id column
|
||||
* @method array findByAttributeAvId(int $attribute_av_id) Return AttributeCombination objects filtered by the attribute_av_id column
|
||||
* @method array findByCreatedAt(string $created_at) Return AttributeCombination objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return AttributeCombination objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
abstract class AttributeCombinationQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAttributeCombinationQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AttributeCombinationQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\AttributeCombination', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AttributeCombinationQuery object.
|
||||
* Returns a new ChildAttributeCombinationQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AttributeCombinationQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AttributeCombinationQuery
|
||||
* @return ChildAttributeCombinationQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AttributeCombinationQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AttributeCombinationQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AttributeCombinationQuery();
|
||||
$query = new \Thelia\Model\AttributeCombinationQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -120,23 +117,22 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* $obj = $c->findPk(array(12, 34, 56, 78), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array $key Primary key to use for the query
|
||||
A Primary key composition: [$id, $attribute_id, $combination_id, $attribute_av_id]
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @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 AttributeCombination|AttributeCombination[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AttributeCombinationPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2], (string) $key[3]))))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
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::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AttributeCombinationTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -153,14 +149,13 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AttributeCombination A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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);
|
||||
@@ -170,13 +165,13 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new AttributeCombination();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildAttributeCombination();
|
||||
$obj->hydrate($row);
|
||||
AttributeCombinationPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2], (string) $key[3])));
|
||||
AttributeCombinationTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2], (string) $key[3])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -187,19 +182,19 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AttributeCombination|AttributeCombination[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,22 +203,22 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* $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 PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|AttributeCombination[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,14 +226,14 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(AttributeCombinationPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_ID, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationPeer::COMBINATION_ID, $key[2], Criteria::EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $key[3], Criteria::EQUAL);
|
||||
$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;
|
||||
}
|
||||
@@ -248,7 +243,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -256,12 +251,12 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(AttributeCombinationPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(AttributeCombinationPeer::ATTRIBUTE_ID, $key[1], Criteria::EQUAL);
|
||||
$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(AttributeCombinationPeer::COMBINATION_ID, $key[2], Criteria::EQUAL);
|
||||
$cton2 = $this->getNewCriterion(AttributeCombinationTableMap::COMBINATION_ID, $key[2], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton2);
|
||||
$cton3 = $this->getNewCriterion(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $key[3], Criteria::EQUAL);
|
||||
$cton3 = $this->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $key[3], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton3);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -276,8 +271,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -286,18 +280,18 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @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(AttributeCombinationPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AttributeCombinationPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -308,7 +302,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCombinationPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -318,8 +312,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByAttributeId(array('max' => 12)); // WHERE attribute_id <= 12
|
||||
* $query->filterByAttributeId(array('min' => 12)); // WHERE attribute_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByAttribute()
|
||||
@@ -330,18 +323,18 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @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(AttributeCombinationPeer::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attributeId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($attributeId['max'])) {
|
||||
$this->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attributeId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -352,7 +345,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_ID, $attributeId, $comparison);
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attributeId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,8 +355,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByCombinationId(array('max' => 12)); // WHERE combination_id <= 12
|
||||
* $query->filterByCombinationId(array('min' => 12)); // WHERE combination_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCombination()
|
||||
@@ -374,18 +366,18 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @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(AttributeCombinationPeer::COMBINATION_ID, $combinationId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combinationId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($combinationId['max'])) {
|
||||
$this->addUsingAlias(AttributeCombinationPeer::COMBINATION_ID, $combinationId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combinationId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -396,7 +388,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCombinationPeer::COMBINATION_ID, $combinationId, $comparison);
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combinationId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -406,8 +398,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByAttributeAvId(array('max' => 12)); // WHERE attribute_av_id <= 12
|
||||
* $query->filterByAttributeAvId(array('min' => 12)); // WHERE attribute_av_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByAttributeAv()
|
||||
@@ -418,18 +409,18 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @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(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $attributeAvId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAvId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($attributeAvId['max'])) {
|
||||
$this->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $attributeAvId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAvId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -440,7 +431,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $attributeAvId, $comparison);
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAvId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -461,18 +452,18 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @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(AttributeCombinationPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(AttributeCombinationPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -483,7 +474,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCombinationPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -504,18 +495,18 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @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(AttributeCombinationPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(AttributeCombinationPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeCombinationTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -526,32 +517,31 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeCombinationPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Attribute object
|
||||
* Filter the query by a related \Thelia\Model\Attribute object
|
||||
*
|
||||
* @param Attribute|PropelObjectCollection $attribute The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeCombinationQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttribute($attribute, $comparison = null)
|
||||
{
|
||||
if ($attribute instanceof Attribute) {
|
||||
if ($attribute instanceof \Thelia\Model\Attribute) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_ID, $attribute->getId(), $comparison);
|
||||
} elseif ($attribute instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attribute->getId(), $comparison);
|
||||
} elseif ($attribute instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByAttribute() only accepts arguments of type Attribute or PropelCollection');
|
||||
throw new PropelException('filterByAttribute() only accepts arguments of type \Thelia\Model\Attribute or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -561,7 +551,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttribute($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -590,7 +580,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Attribute relation Attribute object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -606,28 +596,27 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related AttributeAv object
|
||||
* Filter the query by a related \Thelia\Model\AttributeAv object
|
||||
*
|
||||
* @param AttributeAv|PropelObjectCollection $attributeAv The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeCombinationQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttributeAv($attributeAv, $comparison = null)
|
||||
{
|
||||
if ($attributeAv instanceof AttributeAv) {
|
||||
if ($attributeAv instanceof \Thelia\Model\AttributeAv) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $attributeAv->getId(), $comparison);
|
||||
} elseif ($attributeAv instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAv->getId(), $comparison);
|
||||
} elseif ($attributeAv instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $attributeAv->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $attributeAv->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByAttributeAv() only accepts arguments of type AttributeAv or PropelCollection');
|
||||
throw new PropelException('filterByAttributeAv() only accepts arguments of type \Thelia\Model\AttributeAv or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,7 +626,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttributeAv($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -666,7 +655,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the AttributeAv relation AttributeAv object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -682,28 +671,27 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Combination object
|
||||
* Filter the query by a related \Thelia\Model\Combination object
|
||||
*
|
||||
* @param Combination|PropelObjectCollection $combination The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeCombinationQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCombination($combination, $comparison = null)
|
||||
{
|
||||
if ($combination instanceof Combination) {
|
||||
if ($combination instanceof \Thelia\Model\Combination) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeCombinationPeer::COMBINATION_ID, $combination->getId(), $comparison);
|
||||
} elseif ($combination instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combination->getId(), $comparison);
|
||||
} elseif ($combination instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AttributeCombinationPeer::COMBINATION_ID, $combination->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AttributeCombinationTableMap::COMBINATION_ID, $combination->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCombination() only accepts arguments of type Combination or PropelCollection');
|
||||
throw new PropelException('filterByCombination() only accepts arguments of type \Thelia\Model\Combination or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -713,7 +701,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -742,7 +730,7 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Combination relation Combination object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -760,23 +748,98 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param AttributeCombination $attributeCombination Object to remove from the list of results
|
||||
* @param ChildAttributeCombination $attributeCombination Object to remove from the list of results
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($attributeCombination = null)
|
||||
{
|
||||
if ($attributeCombination) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(AttributeCombinationPeer::ID), $attributeCombination->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(AttributeCombinationPeer::ATTRIBUTE_ID), $attributeCombination->getAttributeId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond2', $this->getAliasedColName(AttributeCombinationPeer::COMBINATION_ID), $attributeCombination->getCombinationId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond3', $this->getAliasedColName(AttributeCombinationPeer::ATTRIBUTE_AV_ID), $attributeCombination->getAttributeAvId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -784,31 +847,11 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AttributeCombinationPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AttributeCombinationPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AttributeCombinationPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(AttributeCombinationTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -816,30 +859,51 @@ abstract class BaseAttributeCombinationQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AttributeCombinationPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AttributeCombinationPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(AttributeCombinationTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return AttributeCombinationQuery The current query, for fluid interface
|
||||
* @return ChildAttributeCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AttributeCombinationPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(AttributeCombinationTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // AttributeCombinationQuery
|
||||
1439
core/lib/Thelia/Model/Base/AttributeI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/AttributeI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
308
core/lib/Thelia/Model/om/BaseAttributeI18nQuery.php → core/lib/Thelia/Model/Base/AttributeI18nQuery.php
Executable file → Normal file
308
core/lib/Thelia/Model/om/BaseAttributeI18nQuery.php → core/lib/Thelia/Model/Base/AttributeI18nQuery.php
Executable file → Normal file
@@ -1,96 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Attribute;
|
||||
use Thelia\Model\AttributeI18n;
|
||||
use Thelia\Model\AttributeI18nPeer;
|
||||
use Thelia\Model\AttributeI18nQuery;
|
||||
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 AttributeI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AttributeI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method AttributeI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method AttributeI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method AttributeI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method AttributeI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
* @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 AttributeI18nQuery groupById() Group by the id column
|
||||
* @method AttributeI18nQuery groupByLocale() Group by the locale column
|
||||
* @method AttributeI18nQuery groupByTitle() Group by the title column
|
||||
* @method AttributeI18nQuery groupByDescription() Group by the description column
|
||||
* @method AttributeI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method AttributeI18nQuery groupByPostscriptum() Group 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 AttributeI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AttributeI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AttributeI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AttributeI18nQuery leftJoinAttribute($relationAlias = null) Adds a LEFT JOIN clause to the query using the Attribute relation
|
||||
* @method AttributeI18nQuery rightJoinAttribute($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Attribute relation
|
||||
* @method AttributeI18nQuery innerJoinAttribute($relationAlias = null) Adds a INNER JOIN clause to the query using the Attribute relation
|
||||
* @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 AttributeI18n findOne(PropelPDO $con = null) Return the first AttributeI18n matching the query
|
||||
* @method AttributeI18n findOneOrCreate(PropelPDO $con = null) Return the first AttributeI18n matching the query, or a new AttributeI18n object populated from the query conditions when no match is found
|
||||
* @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 AttributeI18n findOneById(int $id) Return the first AttributeI18n filtered by the id column
|
||||
* @method AttributeI18n findOneByLocale(string $locale) Return the first AttributeI18n filtered by the locale column
|
||||
* @method AttributeI18n findOneByTitle(string $title) Return the first AttributeI18n filtered by the title column
|
||||
* @method AttributeI18n findOneByDescription(string $description) Return the first AttributeI18n filtered by the description column
|
||||
* @method AttributeI18n findOneByChapo(string $chapo) Return the first AttributeI18n filtered by the chapo column
|
||||
* @method AttributeI18n findOneByPostscriptum(string $postscriptum) Return the first AttributeI18n filtered by the postscriptum column
|
||||
* @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 AttributeI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return AttributeI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return AttributeI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return AttributeI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return AttributeI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return AttributeI18n objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
abstract class AttributeI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAttributeI18nQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AttributeI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\AttributeI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AttributeI18nQuery object.
|
||||
* Returns a new ChildAttributeI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AttributeI18nQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AttributeI18nQuery
|
||||
* @return ChildAttributeI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AttributeI18nQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AttributeI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AttributeI18nQuery();
|
||||
$query = new \Thelia\Model\AttributeI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -110,23 +109,22 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array $key Primary key to use for the query
|
||||
A Primary key composition: [$id, $locale]
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return AttributeI18n|AttributeI18n[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AttributeI18nPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
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::getConnection(AttributeI18nPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AttributeI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -143,14 +141,13 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AttributeI18n A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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);
|
||||
@@ -158,13 +155,13 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new AttributeI18n();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildAttributeI18n();
|
||||
$obj->hydrate($row);
|
||||
AttributeI18nPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
AttributeI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -175,19 +172,19 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return AttributeI18n|AttributeI18n[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,22 +193,22 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* $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 PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|AttributeI18n[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,12 +216,12 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(AttributeI18nPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(AttributeI18nPeer::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(AttributeI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(AttributeI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -234,7 +231,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -242,8 +239,8 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(AttributeI18nPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(AttributeI18nPeer::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(AttributeI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(AttributeI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -258,8 +255,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByAttribute()
|
||||
@@ -270,18 +266,18 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @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(AttributeI18nPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AttributeI18nPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -292,7 +288,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeI18nPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AttributeI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,7 +304,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
@@ -321,7 +317,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeI18nPeer::LOCALE, $locale, $comparison);
|
||||
return $this->addUsingAlias(AttributeI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,7 +333,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
@@ -350,7 +346,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeI18nPeer::TITLE, $title, $comparison);
|
||||
return $this->addUsingAlias(AttributeI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,7 +362,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
@@ -379,7 +375,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeI18nPeer::DESCRIPTION, $description, $comparison);
|
||||
return $this->addUsingAlias(AttributeI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -395,7 +391,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
@@ -408,7 +404,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeI18nPeer::CHAPO, $chapo, $comparison);
|
||||
return $this->addUsingAlias(AttributeI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -424,7 +420,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
@@ -437,32 +433,31 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributeI18nPeer::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
return $this->addUsingAlias(AttributeI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Attribute object
|
||||
* Filter the query by a related \Thelia\Model\Attribute object
|
||||
*
|
||||
* @param Attribute|PropelObjectCollection $attribute The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeI18nQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttribute($attribute, $comparison = null)
|
||||
{
|
||||
if ($attribute instanceof Attribute) {
|
||||
if ($attribute instanceof \Thelia\Model\Attribute) {
|
||||
return $this
|
||||
->addUsingAlias(AttributeI18nPeer::ID, $attribute->getId(), $comparison);
|
||||
} elseif ($attribute instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(AttributeI18nTableMap::ID, $attribute->getId(), $comparison);
|
||||
} elseif ($attribute instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(AttributeI18nPeer::ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(AttributeI18nTableMap::ID, $attribute->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByAttribute() only accepts arguments of type Attribute or PropelCollection');
|
||||
throw new PropelException('filterByAttribute() only accepts arguments of type \Thelia\Model\Attribute or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +467,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttribute($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
@@ -501,7 +496,7 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Attribute relation Attribute object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -519,19 +514,94 @@ abstract class BaseAttributeI18nQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param AttributeI18n $attributeI18n Object to remove from the list of results
|
||||
* @param ChildAttributeI18n $attributeI18n Object to remove from the list of results
|
||||
*
|
||||
* @return AttributeI18nQuery The current query, for fluid interface
|
||||
* @return ChildAttributeI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($attributeI18n = null)
|
||||
{
|
||||
if ($attributeI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(AttributeI18nPeer::ID), $attributeI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(AttributeI18nPeer::LOCALE), $attributeI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
464
core/lib/Thelia/Model/om/BaseAttributeQuery.php → core/lib/Thelia/Model/Base/AttributeQuery.php
Executable file → Normal file
464
core/lib/Thelia/Model/om/BaseAttributeQuery.php → core/lib/Thelia/Model/Base/AttributeQuery.php
Executable file → Normal file
@@ -1,103 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Attribute;
|
||||
use Thelia\Model\AttributeAv;
|
||||
use Thelia\Model\AttributeCategory;
|
||||
use Thelia\Model\AttributeCombination;
|
||||
use Thelia\Model\AttributeI18n;
|
||||
use Thelia\Model\AttributePeer;
|
||||
use Thelia\Model\AttributeQuery;
|
||||
use Thelia\Model\Category;
|
||||
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 AttributeQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method AttributeQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method AttributeQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method AttributeQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 AttributeQuery groupById() Group by the id column
|
||||
* @method AttributeQuery groupByPosition() Group by the position column
|
||||
* @method AttributeQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method AttributeQuery groupByUpdatedAt() Group 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 AttributeQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method AttributeQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method AttributeQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 AttributeQuery leftJoinAttributeAv($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeAv relation
|
||||
* @method AttributeQuery rightJoinAttributeAv($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeAv relation
|
||||
* @method AttributeQuery innerJoinAttributeAv($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeAv relation
|
||||
* @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 AttributeQuery leftJoinAttributeCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeCombination relation
|
||||
* @method AttributeQuery rightJoinAttributeCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCombination relation
|
||||
* @method AttributeQuery innerJoinAttributeCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCombination 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 AttributeQuery leftJoinAttributeCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeCategory relation
|
||||
* @method AttributeQuery rightJoinAttributeCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCategory relation
|
||||
* @method AttributeQuery innerJoinAttributeCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCategory 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 AttributeQuery leftJoinAttributeI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeI18n relation
|
||||
* @method AttributeQuery rightJoinAttributeI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeI18n relation
|
||||
* @method AttributeQuery innerJoinAttributeI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeI18n 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 Attribute findOne(PropelPDO $con = null) Return the first Attribute matching the query
|
||||
* @method Attribute findOneOrCreate(PropelPDO $con = null) Return the first Attribute matching the query, or a new Attribute object populated from the query conditions when no match is found
|
||||
* @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 Attribute findOneByPosition(int $position) Return the first Attribute filtered by the position column
|
||||
* @method Attribute findOneByCreatedAt(string $created_at) Return the first Attribute filtered by the created_at column
|
||||
* @method Attribute findOneByUpdatedAt(string $updated_at) Return the first Attribute filtered by the updated_at column
|
||||
* @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 Attribute objects filtered by the id column
|
||||
* @method array findByPosition(int $position) Return Attribute objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return Attribute objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return Attribute objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseAttributeQuery extends ModelCriteria
|
||||
abstract class AttributeQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseAttributeQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\AttributeQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Attribute', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new AttributeQuery object.
|
||||
* Returns a new ChildAttributeQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param AttributeQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return AttributeQuery
|
||||
* @return ChildAttributeQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof AttributeQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\AttributeQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new AttributeQuery();
|
||||
$query = new \Thelia\Model\AttributeQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -118,21 +115,21 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return Attribute|Attribute[]|mixed the result, formatted by the current formatter
|
||||
* @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 = AttributePeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = AttributeTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(AttributePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(AttributeTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -144,46 +141,31 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return Attribute A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Attribute A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new Attribute();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildAttribute();
|
||||
$obj->hydrate($row);
|
||||
AttributePeer::addInstanceToPool($obj, (string) $key);
|
||||
AttributeTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -194,19 +176,19 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Attribute|Attribute[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,22 +197,22 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|Attribute[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,12 +220,12 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AttributePeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(AttributeTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -251,12 +233,12 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(AttributePeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(AttributeTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,8 +248,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -276,18 +257,18 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @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(AttributePeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(AttributePeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -298,7 +279,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributePeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(AttributeTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,8 +289,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByPosition(array('max' => 12)); // WHERE position <= 12
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
@@ -318,18 +298,18 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @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(AttributePeer::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(AttributePeer::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -340,7 +320,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributePeer::POSITION, $position, $comparison);
|
||||
return $this->addUsingAlias(AttributeTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -361,18 +341,18 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @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(AttributePeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(AttributePeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -383,7 +363,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributePeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(AttributeTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -404,18 +384,18 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @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(AttributePeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(AttributeTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(AttributePeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(AttributeTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -426,30 +406,29 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AttributePeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(AttributeTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related AttributeAv object
|
||||
* Filter the query by a related \Thelia\Model\AttributeAv object
|
||||
*
|
||||
* @param AttributeAv|PropelObjectCollection $attributeAv the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttributeAv($attributeAv, $comparison = null)
|
||||
{
|
||||
if ($attributeAv instanceof AttributeAv) {
|
||||
if ($attributeAv instanceof \Thelia\Model\AttributeAv) {
|
||||
return $this
|
||||
->addUsingAlias(AttributePeer::ID, $attributeAv->getAttributeId(), $comparison);
|
||||
} elseif ($attributeAv instanceof PropelObjectCollection) {
|
||||
->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 AttributeAv or PropelCollection');
|
||||
throw new PropelException('filterByAttributeAv() only accepts arguments of type \Thelia\Model\AttributeAv or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,7 +438,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttributeAv($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -488,7 +467,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the AttributeAv relation AttributeAv object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -504,26 +483,25 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related AttributeCombination object
|
||||
* Filter the query by a related \Thelia\Model\AttributeCombination object
|
||||
*
|
||||
* @param AttributeCombination|PropelObjectCollection $attributeCombination the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttributeCombination($attributeCombination, $comparison = null)
|
||||
{
|
||||
if ($attributeCombination instanceof AttributeCombination) {
|
||||
if ($attributeCombination instanceof \Thelia\Model\AttributeCombination) {
|
||||
return $this
|
||||
->addUsingAlias(AttributePeer::ID, $attributeCombination->getAttributeId(), $comparison);
|
||||
} elseif ($attributeCombination instanceof PropelObjectCollection) {
|
||||
->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 AttributeCombination or PropelCollection');
|
||||
throw new PropelException('filterByAttributeCombination() only accepts arguments of type \Thelia\Model\AttributeCombination or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,7 +511,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttributeCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -562,7 +540,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the AttributeCombination relation AttributeCombination object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -578,26 +556,25 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related AttributeCategory object
|
||||
* Filter the query by a related \Thelia\Model\AttributeCategory object
|
||||
*
|
||||
* @param AttributeCategory|PropelObjectCollection $attributeCategory the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttributeCategory($attributeCategory, $comparison = null)
|
||||
{
|
||||
if ($attributeCategory instanceof AttributeCategory) {
|
||||
if ($attributeCategory instanceof \Thelia\Model\AttributeCategory) {
|
||||
return $this
|
||||
->addUsingAlias(AttributePeer::ID, $attributeCategory->getAttributeId(), $comparison);
|
||||
} elseif ($attributeCategory instanceof PropelObjectCollection) {
|
||||
->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 AttributeCategory or PropelCollection');
|
||||
throw new PropelException('filterByAttributeCategory() only accepts arguments of type \Thelia\Model\AttributeCategory or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,7 +584,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttributeCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -636,7 +613,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the AttributeCategory relation AttributeCategory object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -652,26 +629,25 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related AttributeI18n object
|
||||
* Filter the query by a related \Thelia\Model\AttributeI18n object
|
||||
*
|
||||
* @param AttributeI18n|PropelObjectCollection $attributeI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 AttributeQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttributeI18n($attributeI18n, $comparison = null)
|
||||
{
|
||||
if ($attributeI18n instanceof AttributeI18n) {
|
||||
if ($attributeI18n instanceof \Thelia\Model\AttributeI18n) {
|
||||
return $this
|
||||
->addUsingAlias(AttributePeer::ID, $attributeI18n->getId(), $comparison);
|
||||
} elseif ($attributeI18n instanceof PropelObjectCollection) {
|
||||
->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 AttributeI18n or PropelCollection');
|
||||
throw new PropelException('filterByAttributeI18n() only accepts arguments of type \Thelia\Model\AttributeI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -681,7 +657,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttributeI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
@@ -710,7 +686,7 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the AttributeI18n relation AttributeI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -729,10 +705,10 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* 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
|
||||
* @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 AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategory($category, $comparison = Criteria::EQUAL)
|
||||
{
|
||||
@@ -745,19 +721,94 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param Attribute $attribute Object to remove from the list of results
|
||||
* @param ChildAttribute $attribute Object to remove from the list of results
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($attribute = null)
|
||||
{
|
||||
if ($attribute) {
|
||||
$this->addUsingAlias(AttributePeer::ID, $attribute->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -765,31 +816,11 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AttributePeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AttributePeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AttributePeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(AttributeTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -797,32 +828,53 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(AttributePeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(AttributePeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(AttributeTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(AttributePeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(AttributeTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
@@ -832,9 +884,9 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* @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 AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'AttributeI18n';
|
||||
|
||||
@@ -850,9 +902,9 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* @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 AttributeQuery The current query, for fluid interface
|
||||
* @return ChildAttributeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
@@ -871,13 +923,13 @@ abstract class BaseAttributeQuery extends ModelCriteria
|
||||
* @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 AttributeI18nQuery A secondary query class using the current class as primary query
|
||||
* @return ChildAttributeI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
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');
|
||||
->useQuery($relationAlias ? $relationAlias : 'AttributeI18n', '\Thelia\Model\AttributeI18nQuery');
|
||||
}
|
||||
|
||||
}
|
||||
} // AttributeQuery
|
||||
3241
core/lib/Thelia/Model/om/BaseCategory.php → core/lib/Thelia/Model/Base/Category.php
Executable file → Normal file
3241
core/lib/Thelia/Model/om/BaseCategory.php → core/lib/Thelia/Model/Base/Category.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/CategoryI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/CategoryI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
308
core/lib/Thelia/Model/om/BaseCategoryI18nQuery.php → core/lib/Thelia/Model/Base/CategoryI18nQuery.php
Executable file → Normal file
308
core/lib/Thelia/Model/om/BaseCategoryI18nQuery.php → core/lib/Thelia/Model/Base/CategoryI18nQuery.php
Executable file → Normal file
@@ -1,96 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Category;
|
||||
use Thelia\Model\CategoryI18n;
|
||||
use Thelia\Model\CategoryI18nPeer;
|
||||
use Thelia\Model\CategoryI18nQuery;
|
||||
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 CategoryI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method CategoryI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method CategoryI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method CategoryI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method CategoryI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method CategoryI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
* @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 CategoryI18nQuery groupById() Group by the id column
|
||||
* @method CategoryI18nQuery groupByLocale() Group by the locale column
|
||||
* @method CategoryI18nQuery groupByTitle() Group by the title column
|
||||
* @method CategoryI18nQuery groupByDescription() Group by the description column
|
||||
* @method CategoryI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method CategoryI18nQuery groupByPostscriptum() Group 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 CategoryI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CategoryI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CategoryI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 CategoryI18nQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
|
||||
* @method CategoryI18nQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
|
||||
* @method CategoryI18nQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
|
||||
* @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 CategoryI18n findOne(PropelPDO $con = null) Return the first CategoryI18n matching the query
|
||||
* @method CategoryI18n findOneOrCreate(PropelPDO $con = null) Return the first CategoryI18n matching the query, or a new CategoryI18n object populated from the query conditions when no match is found
|
||||
* @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 CategoryI18n findOneById(int $id) Return the first CategoryI18n filtered by the id column
|
||||
* @method CategoryI18n findOneByLocale(string $locale) Return the first CategoryI18n filtered by the locale column
|
||||
* @method CategoryI18n findOneByTitle(string $title) Return the first CategoryI18n filtered by the title column
|
||||
* @method CategoryI18n findOneByDescription(string $description) Return the first CategoryI18n filtered by the description column
|
||||
* @method CategoryI18n findOneByChapo(string $chapo) Return the first CategoryI18n filtered by the chapo column
|
||||
* @method CategoryI18n findOneByPostscriptum(string $postscriptum) Return the first CategoryI18n filtered by the postscriptum column
|
||||
* @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 CategoryI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return CategoryI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return CategoryI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return CategoryI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return CategoryI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return CategoryI18n objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
abstract class CategoryI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseCategoryI18nQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\CategoryI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new CategoryI18nQuery object.
|
||||
* Returns a new ChildCategoryI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param CategoryI18nQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return CategoryI18nQuery
|
||||
* @return ChildCategoryI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof CategoryI18nQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\CategoryI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new CategoryI18nQuery();
|
||||
$query = new \Thelia\Model\CategoryI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -110,23 +109,22 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array $key Primary key to use for the query
|
||||
A Primary key composition: [$id, $locale]
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return CategoryI18n|CategoryI18n[]|mixed the result, formatted by the current formatter
|
||||
* @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 = CategoryI18nPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
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::getConnection(CategoryI18nPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(CategoryI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -143,14 +141,13 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return CategoryI18n A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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);
|
||||
@@ -158,13 +155,13 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new CategoryI18n();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildCategoryI18n();
|
||||
$obj->hydrate($row);
|
||||
CategoryI18nPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
CategoryI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -175,19 +172,19 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return CategoryI18n|CategoryI18n[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,22 +193,22 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* $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 PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|CategoryI18n[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,12 +216,12 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(CategoryI18nPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryI18nPeer::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -234,7 +231,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -242,8 +239,8 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(CategoryI18nPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(CategoryI18nPeer::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(CategoryI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(CategoryI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -258,8 +255,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCategory()
|
||||
@@ -270,18 +266,18 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @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(CategoryI18nPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CategoryI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryI18nPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CategoryI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -292,7 +288,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryI18nPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(CategoryI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,7 +304,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
@@ -321,7 +317,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryI18nPeer::LOCALE, $locale, $comparison);
|
||||
return $this->addUsingAlias(CategoryI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,7 +333,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
@@ -350,7 +346,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryI18nPeer::TITLE, $title, $comparison);
|
||||
return $this->addUsingAlias(CategoryI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,7 +362,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
@@ -379,7 +375,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryI18nPeer::DESCRIPTION, $description, $comparison);
|
||||
return $this->addUsingAlias(CategoryI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -395,7 +391,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
@@ -408,7 +404,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryI18nPeer::CHAPO, $chapo, $comparison);
|
||||
return $this->addUsingAlias(CategoryI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -424,7 +420,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
@@ -437,32 +433,31 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryI18nPeer::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
return $this->addUsingAlias(CategoryI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Category object
|
||||
* Filter the query by a related \Thelia\Model\Category object
|
||||
*
|
||||
* @param Category|PropelObjectCollection $category The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 CategoryI18nQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategory($category, $comparison = null)
|
||||
{
|
||||
if ($category instanceof Category) {
|
||||
if ($category instanceof \Thelia\Model\Category) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryI18nPeer::ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(CategoryI18nTableMap::ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryI18nPeer::ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(CategoryI18nTableMap::ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type Category or PropelCollection');
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type \Thelia\Model\Category or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +467,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategory($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
@@ -501,7 +496,7 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Category relation Category object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -519,19 +514,94 @@ abstract class BaseCategoryI18nQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param CategoryI18n $categoryI18n Object to remove from the list of results
|
||||
* @param ChildCategoryI18n $categoryI18n Object to remove from the list of results
|
||||
*
|
||||
* @return CategoryI18nQuery The current query, for fluid interface
|
||||
* @return ChildCategoryI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryI18n = null)
|
||||
{
|
||||
if ($categoryI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(CategoryI18nPeer::ID), $categoryI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(CategoryI18nPeer::LOCALE), $categoryI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
750
core/lib/Thelia/Model/om/BaseCategoryQuery.php → core/lib/Thelia/Model/Base/CategoryQuery.php
Executable file → Normal file
750
core/lib/Thelia/Model/om/BaseCategoryQuery.php → core/lib/Thelia/Model/Base/CategoryQuery.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1709
core/lib/Thelia/Model/Base/CategoryVersion.php
Normal file
1709
core/lib/Thelia/Model/Base/CategoryVersion.php
Normal file
File diff suppressed because it is too large
Load Diff
396
core/lib/Thelia/Model/om/BaseCategoryVersionQuery.php → core/lib/Thelia/Model/Base/CategoryVersionQuery.php
Executable file → Normal file
396
core/lib/Thelia/Model/om/BaseCategoryVersionQuery.php → core/lib/Thelia/Model/Base/CategoryVersionQuery.php
Executable file → Normal file
@@ -1,112 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Category;
|
||||
use Thelia\Model\CategoryVersion;
|
||||
use Thelia\Model\CategoryVersionPeer;
|
||||
use Thelia\Model\CategoryVersionQuery;
|
||||
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 CategoryVersionQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method CategoryVersionQuery orderByParent($order = Criteria::ASC) Order by the parent column
|
||||
* @method CategoryVersionQuery orderByLink($order = Criteria::ASC) Order by the link column
|
||||
* @method CategoryVersionQuery orderByVisible($order = Criteria::ASC) Order by the visible column
|
||||
* @method CategoryVersionQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method CategoryVersionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method CategoryVersionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @method CategoryVersionQuery orderByVersion($order = Criteria::ASC) Order by the version column
|
||||
* @method CategoryVersionQuery orderByVersionCreatedAt($order = Criteria::ASC) Order by the version_created_at column
|
||||
* @method CategoryVersionQuery orderByVersionCreatedBy($order = Criteria::ASC) Order by the version_created_by column
|
||||
* @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 CategoryVersionQuery groupById() Group by the id column
|
||||
* @method CategoryVersionQuery groupByParent() Group by the parent column
|
||||
* @method CategoryVersionQuery groupByLink() Group by the link column
|
||||
* @method CategoryVersionQuery groupByVisible() Group by the visible column
|
||||
* @method CategoryVersionQuery groupByPosition() Group by the position column
|
||||
* @method CategoryVersionQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method CategoryVersionQuery groupByUpdatedAt() Group by the updated_at column
|
||||
* @method CategoryVersionQuery groupByVersion() Group by the version column
|
||||
* @method CategoryVersionQuery groupByVersionCreatedAt() Group by the version_created_at column
|
||||
* @method CategoryVersionQuery groupByVersionCreatedBy() Group 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 CategoryVersionQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CategoryVersionQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CategoryVersionQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 CategoryVersionQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
|
||||
* @method CategoryVersionQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
|
||||
* @method CategoryVersionQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
|
||||
* @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 CategoryVersion findOne(PropelPDO $con = null) Return the first CategoryVersion matching the query
|
||||
* @method CategoryVersion findOneOrCreate(PropelPDO $con = null) Return the first CategoryVersion matching the query, or a new CategoryVersion object populated from the query conditions when no match is found
|
||||
* @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 CategoryVersion findOneById(int $id) Return the first CategoryVersion filtered by the id column
|
||||
* @method CategoryVersion findOneByParent(int $parent) Return the first CategoryVersion filtered by the parent column
|
||||
* @method CategoryVersion findOneByLink(string $link) Return the first CategoryVersion filtered by the link column
|
||||
* @method CategoryVersion findOneByVisible(int $visible) Return the first CategoryVersion filtered by the visible column
|
||||
* @method CategoryVersion findOneByPosition(int $position) Return the first CategoryVersion filtered by the position column
|
||||
* @method CategoryVersion findOneByCreatedAt(string $created_at) Return the first CategoryVersion filtered by the created_at column
|
||||
* @method CategoryVersion findOneByUpdatedAt(string $updated_at) Return the first CategoryVersion filtered by the updated_at column
|
||||
* @method CategoryVersion findOneByVersion(int $version) Return the first CategoryVersion filtered by the version column
|
||||
* @method CategoryVersion findOneByVersionCreatedAt(string $version_created_at) Return the first CategoryVersion filtered by the version_created_at column
|
||||
* @method CategoryVersion findOneByVersionCreatedBy(string $version_created_by) Return the first CategoryVersion filtered by the version_created_by column
|
||||
* @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 CategoryVersion objects filtered by the id column
|
||||
* @method array findByParent(int $parent) Return CategoryVersion objects filtered by the parent column
|
||||
* @method array findByLink(string $link) Return CategoryVersion objects filtered by the link column
|
||||
* @method array findByVisible(int $visible) Return CategoryVersion objects filtered by the visible column
|
||||
* @method array findByPosition(int $position) Return CategoryVersion objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return CategoryVersion objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return CategoryVersion objects filtered by the updated_at column
|
||||
* @method array findByVersion(int $version) Return CategoryVersion objects filtered by the version column
|
||||
* @method array findByVersionCreatedAt(string $version_created_at) Return CategoryVersion objects filtered by the version_created_at column
|
||||
* @method array findByVersionCreatedBy(string $version_created_by) Return CategoryVersion objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
abstract class CategoryVersionQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseCategoryVersionQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\CategoryVersionQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\CategoryVersion', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new CategoryVersionQuery object.
|
||||
* Returns a new ChildCategoryVersionQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param CategoryVersionQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return CategoryVersionQuery
|
||||
* @return ChildCategoryVersionQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof CategoryVersionQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\CategoryVersionQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new CategoryVersionQuery();
|
||||
$query = new \Thelia\Model\CategoryVersionQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -126,23 +125,22 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array $key Primary key to use for the query
|
||||
A Primary key composition: [$id, $version]
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param array[$id, $version] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return CategoryVersion|CategoryVersion[]|mixed the result, formatted by the current formatter
|
||||
* @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 = CategoryVersionPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
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::getConnection(CategoryVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(CategoryVersionTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -159,14 +157,13 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return CategoryVersion A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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);
|
||||
@@ -174,13 +171,13 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new CategoryVersion();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildCategoryVersion();
|
||||
$obj->hydrate($row);
|
||||
CategoryVersionPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
CategoryVersionTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -191,19 +188,19 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return CategoryVersion|CategoryVersion[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,22 +209,22 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* $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 PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|CategoryVersion[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -235,12 +232,12 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @return ChildCategoryVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(CategoryVersionPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionPeer::VERSION, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::VERSION, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -250,7 +247,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @return ChildCategoryVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -258,8 +255,8 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(CategoryVersionPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(CategoryVersionPeer::VERSION, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(CategoryVersionTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(CategoryVersionTableMap::VERSION, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -274,8 +271,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCategory()
|
||||
@@ -286,18 +282,18 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @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(CategoryVersionPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CategoryVersionPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -308,7 +304,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -318,8 +314,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByParent(array('max' => 12)); // WHERE parent <= 12
|
||||
* $query->filterByParent(array('min' => 12)); // WHERE parent > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $parent The value to use as filter.
|
||||
@@ -328,18 +323,18 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @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(CategoryVersionPeer::PARENT, $parent['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::PARENT, $parent['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($parent['max'])) {
|
||||
$this->addUsingAlias(CategoryVersionPeer::PARENT, $parent['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::PARENT, $parent['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -350,7 +345,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::PARENT, $parent, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::PARENT, $parent, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,7 +361,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @return ChildCategoryVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLink($link = null, $comparison = null)
|
||||
{
|
||||
@@ -379,7 +374,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::LINK, $link, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::LINK, $link, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -389,8 +384,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByVisible(array('max' => 12)); // WHERE visible <= 12
|
||||
* $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $visible The value to use as filter.
|
||||
@@ -399,18 +393,18 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @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(CategoryVersionPeer::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($visible['max'])) {
|
||||
$this->addUsingAlias(CategoryVersionPeer::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -421,7 +415,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::VISIBLE, $visible, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::VISIBLE, $visible, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -431,8 +425,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByPosition(array('max' => 12)); // WHERE position <= 12
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
@@ -441,18 +434,18 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @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(CategoryVersionPeer::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(CategoryVersionPeer::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -463,7 +456,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::POSITION, $position, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -484,18 +477,18 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @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(CategoryVersionPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(CategoryVersionPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -506,7 +499,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -527,18 +520,18 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @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(CategoryVersionPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(CategoryVersionPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -549,7 +542,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -559,8 +552,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByVersion(array('max' => 12)); // WHERE version <= 12
|
||||
* $query->filterByVersion(array('min' => 12)); // WHERE version > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $version The value to use as filter.
|
||||
@@ -569,18 +561,18 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @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(CategoryVersionPeer::VERSION, $version['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::VERSION, $version['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($version['max'])) {
|
||||
$this->addUsingAlias(CategoryVersionPeer::VERSION, $version['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::VERSION, $version['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -591,7 +583,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::VERSION, $version, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::VERSION, $version, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -612,18 +604,18 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @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(CategoryVersionPeer::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($versionCreatedAt['max'])) {
|
||||
$this->addUsingAlias(CategoryVersionPeer::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CategoryVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -634,7 +626,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -650,7 +642,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @return ChildCategoryVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)
|
||||
{
|
||||
@@ -663,32 +655,31 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CategoryVersionPeer::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
|
||||
return $this->addUsingAlias(CategoryVersionTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Category object
|
||||
* Filter the query by a related \Thelia\Model\Category object
|
||||
*
|
||||
* @param Category|PropelObjectCollection $category The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 CategoryVersionQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildCategoryVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategory($category, $comparison = null)
|
||||
{
|
||||
if ($category instanceof Category) {
|
||||
if ($category instanceof \Thelia\Model\Category) {
|
||||
return $this
|
||||
->addUsingAlias(CategoryVersionPeer::ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(CategoryVersionTableMap::ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CategoryVersionPeer::ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(CategoryVersionTableMap::ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type Category or PropelCollection');
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type \Thelia\Model\Category or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -698,7 +689,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @return ChildCategoryVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategory($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -727,7 +718,7 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Category relation Category object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -745,19 +736,94 @@ abstract class BaseCategoryVersionQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param CategoryVersion $categoryVersion Object to remove from the list of results
|
||||
* @param ChildCategoryVersion $categoryVersion Object to remove from the list of results
|
||||
*
|
||||
* @return CategoryVersionQuery The current query, for fluid interface
|
||||
* @return ChildCategoryVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($categoryVersion = null)
|
||||
{
|
||||
if ($categoryVersion) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(CategoryVersionPeer::ID), $categoryVersion->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(CategoryVersionPeer::VERSION), $categoryVersion->getVersion(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
1241
core/lib/Thelia/Model/om/BaseCombination.php → core/lib/Thelia/Model/Base/Combination.php
Executable file → Normal file
1241
core/lib/Thelia/Model/om/BaseCombination.php → core/lib/Thelia/Model/Base/Combination.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
379
core/lib/Thelia/Model/om/BaseCombinationQuery.php → core/lib/Thelia/Model/Base/CombinationQuery.php
Executable file → Normal file
379
core/lib/Thelia/Model/om/BaseCombinationQuery.php → core/lib/Thelia/Model/Base/CombinationQuery.php
Executable file → Normal file
@@ -1,92 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\AttributeCombination;
|
||||
use Thelia\Model\Combination;
|
||||
use Thelia\Model\CombinationPeer;
|
||||
use Thelia\Model\CombinationQuery;
|
||||
use Thelia\Model\Stock;
|
||||
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 CombinationQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method CombinationQuery orderByRef($order = Criteria::ASC) Order by the ref column
|
||||
* @method CombinationQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method CombinationQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 CombinationQuery groupById() Group by the id column
|
||||
* @method CombinationQuery groupByRef() Group by the ref column
|
||||
* @method CombinationQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method CombinationQuery groupByUpdatedAt() Group 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 CombinationQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CombinationQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CombinationQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 CombinationQuery leftJoinAttributeCombination($relationAlias = null) Adds a LEFT JOIN clause to the query using the AttributeCombination relation
|
||||
* @method CombinationQuery rightJoinAttributeCombination($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AttributeCombination relation
|
||||
* @method CombinationQuery innerJoinAttributeCombination($relationAlias = null) Adds a INNER JOIN clause to the query using the AttributeCombination relation
|
||||
* @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 CombinationQuery leftJoinStock($relationAlias = null) Adds a LEFT JOIN clause to the query using the Stock relation
|
||||
* @method CombinationQuery rightJoinStock($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Stock relation
|
||||
* @method CombinationQuery innerJoinStock($relationAlias = null) Adds a INNER JOIN clause to the query using the Stock 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 Combination findOne(PropelPDO $con = null) Return the first Combination matching the query
|
||||
* @method Combination findOneOrCreate(PropelPDO $con = null) Return the first Combination matching the query, or a new Combination object populated from the query conditions when no match is found
|
||||
* @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 Combination findOneByRef(string $ref) Return the first Combination filtered by the ref column
|
||||
* @method Combination findOneByCreatedAt(string $created_at) Return the first Combination filtered by the created_at column
|
||||
* @method Combination findOneByUpdatedAt(string $updated_at) Return the first Combination filtered by the updated_at column
|
||||
* @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 Combination objects filtered by the id column
|
||||
* @method array findByRef(string $ref) Return Combination objects filtered by the ref column
|
||||
* @method array findByCreatedAt(string $created_at) Return Combination objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return Combination objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseCombinationQuery extends ModelCriteria
|
||||
abstract class CombinationQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseCombinationQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\CombinationQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Combination', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new CombinationQuery object.
|
||||
* Returns a new ChildCombinationQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param CombinationQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return CombinationQuery
|
||||
* @return ChildCombinationQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof CombinationQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\CombinationQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new CombinationQuery();
|
||||
$query = new \Thelia\Model\CombinationQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -107,21 +106,21 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return Combination|Combination[]|mixed the result, formatted by the current formatter
|
||||
* @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 = CombinationPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = CombinationTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(CombinationTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -133,46 +132,31 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return Combination A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Combination A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new Combination();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildCombination();
|
||||
$obj->hydrate($row);
|
||||
CombinationPeer::addInstanceToPool($obj, (string) $key);
|
||||
CombinationTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -183,19 +167,19 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Combination|Combination[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,22 +188,22 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|Combination[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,12 +211,12 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CombinationPeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(CombinationTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,12 +224,12 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CombinationPeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(CombinationTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,8 +239,7 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -265,18 +248,18 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @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(CombinationPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CombinationTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(CombinationPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CombinationTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -287,7 +270,7 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CombinationPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(CombinationTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -303,7 +286,7 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByRef($ref = null, $comparison = null)
|
||||
{
|
||||
@@ -316,7 +299,7 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CombinationPeer::REF, $ref, $comparison);
|
||||
return $this->addUsingAlias(CombinationTableMap::REF, $ref, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,18 +320,18 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @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(CombinationPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CombinationTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(CombinationPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CombinationTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -359,7 +342,7 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CombinationPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(CombinationTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -380,18 +363,18 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @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(CombinationPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(CombinationTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(CombinationPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(CombinationTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -402,30 +385,29 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CombinationPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(CombinationTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related AttributeCombination object
|
||||
* Filter the query by a related \Thelia\Model\AttributeCombination object
|
||||
*
|
||||
* @param AttributeCombination|PropelObjectCollection $attributeCombination the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 CombinationQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByAttributeCombination($attributeCombination, $comparison = null)
|
||||
{
|
||||
if ($attributeCombination instanceof AttributeCombination) {
|
||||
if ($attributeCombination instanceof \Thelia\Model\AttributeCombination) {
|
||||
return $this
|
||||
->addUsingAlias(CombinationPeer::ID, $attributeCombination->getCombinationId(), $comparison);
|
||||
} elseif ($attributeCombination instanceof PropelObjectCollection) {
|
||||
->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 AttributeCombination or PropelCollection');
|
||||
throw new PropelException('filterByAttributeCombination() only accepts arguments of type \Thelia\Model\AttributeCombination or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -435,7 +417,7 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinAttributeCombination($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -464,7 +446,7 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the AttributeCombination relation AttributeCombination object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -480,26 +462,25 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Stock object
|
||||
* Filter the query by a related \Thelia\Model\Stock object
|
||||
*
|
||||
* @param Stock|PropelObjectCollection $stock the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 CombinationQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByStock($stock, $comparison = null)
|
||||
{
|
||||
if ($stock instanceof Stock) {
|
||||
if ($stock instanceof \Thelia\Model\Stock) {
|
||||
return $this
|
||||
->addUsingAlias(CombinationPeer::ID, $stock->getCombinationId(), $comparison);
|
||||
} elseif ($stock instanceof PropelObjectCollection) {
|
||||
->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 Stock or PropelCollection');
|
||||
throw new PropelException('filterByStock() only accepts arguments of type \Thelia\Model\Stock or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,7 +490,7 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinStock($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
@@ -538,7 +519,7 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Stock relation Stock object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -556,19 +537,94 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param Combination $combination Object to remove from the list of results
|
||||
* @param ChildCombination $combination Object to remove from the list of results
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($combination = null)
|
||||
{
|
||||
if ($combination) {
|
||||
$this->addUsingAlias(CombinationPeer::ID, $combination->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -576,31 +632,11 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CombinationPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CombinationPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CombinationPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(CombinationTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -608,30 +644,51 @@ abstract class BaseCombinationQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(CombinationPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(CombinationPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(CombinationTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return CombinationQuery The current query, for fluid interface
|
||||
* @return ChildCombinationQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(CombinationPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(CombinationTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // CombinationQuery
|
||||
1210
core/lib/Thelia/Model/om/BaseConfig.php → core/lib/Thelia/Model/Base/Config.php
Executable file → Normal file
1210
core/lib/Thelia/Model/om/BaseConfig.php → core/lib/Thelia/Model/Base/Config.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1439
core/lib/Thelia/Model/Base/ConfigI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/ConfigI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
308
core/lib/Thelia/Model/om/BaseConfigI18nQuery.php → core/lib/Thelia/Model/Base/ConfigI18nQuery.php
Executable file → Normal file
308
core/lib/Thelia/Model/om/BaseConfigI18nQuery.php → core/lib/Thelia/Model/Base/ConfigI18nQuery.php
Executable file → Normal file
@@ -1,96 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Config;
|
||||
use Thelia\Model\ConfigI18n;
|
||||
use Thelia\Model\ConfigI18nPeer;
|
||||
use Thelia\Model\ConfigI18nQuery;
|
||||
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 ConfigI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ConfigI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ConfigI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ConfigI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ConfigI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ConfigI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
* @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 ConfigI18nQuery groupById() Group by the id column
|
||||
* @method ConfigI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ConfigI18nQuery groupByTitle() Group by the title column
|
||||
* @method ConfigI18nQuery groupByDescription() Group by the description column
|
||||
* @method ConfigI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ConfigI18nQuery groupByPostscriptum() Group 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 ConfigI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ConfigI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ConfigI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 ConfigI18nQuery leftJoinConfig($relationAlias = null) Adds a LEFT JOIN clause to the query using the Config relation
|
||||
* @method ConfigI18nQuery rightJoinConfig($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Config relation
|
||||
* @method ConfigI18nQuery innerJoinConfig($relationAlias = null) Adds a INNER JOIN clause to the query using the Config relation
|
||||
* @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 ConfigI18n findOne(PropelPDO $con = null) Return the first ConfigI18n matching the query
|
||||
* @method ConfigI18n findOneOrCreate(PropelPDO $con = null) Return the first ConfigI18n matching the query, or a new ConfigI18n object populated from the query conditions when no match is found
|
||||
* @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 ConfigI18n findOneById(int $id) Return the first ConfigI18n filtered by the id column
|
||||
* @method ConfigI18n findOneByLocale(string $locale) Return the first ConfigI18n filtered by the locale column
|
||||
* @method ConfigI18n findOneByTitle(string $title) Return the first ConfigI18n filtered by the title column
|
||||
* @method ConfigI18n findOneByDescription(string $description) Return the first ConfigI18n filtered by the description column
|
||||
* @method ConfigI18n findOneByChapo(string $chapo) Return the first ConfigI18n filtered by the chapo column
|
||||
* @method ConfigI18n findOneByPostscriptum(string $postscriptum) Return the first ConfigI18n filtered by the postscriptum column
|
||||
* @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 ConfigI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ConfigI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ConfigI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ConfigI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ConfigI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ConfigI18n objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
abstract class ConfigI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseConfigI18nQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\ConfigI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ConfigI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ConfigI18nQuery object.
|
||||
* Returns a new ChildConfigI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param ConfigI18nQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ConfigI18nQuery
|
||||
* @return ChildConfigI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof ConfigI18nQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\ConfigI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new ConfigI18nQuery();
|
||||
$query = new \Thelia\Model\ConfigI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -110,23 +109,22 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array $key Primary key to use for the query
|
||||
A Primary key composition: [$id, $locale]
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ConfigI18n|ConfigI18n[]|mixed the result, formatted by the current formatter
|
||||
* @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 = ConfigI18nPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
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::getConnection(ConfigI18nPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ConfigI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -143,14 +141,13 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ConfigI18n A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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);
|
||||
@@ -158,13 +155,13 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new ConfigI18n();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildConfigI18n();
|
||||
$obj->hydrate($row);
|
||||
ConfigI18nPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
ConfigI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -175,19 +172,19 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ConfigI18n|ConfigI18n[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,22 +193,22 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* $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 PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|ConfigI18n[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,12 +216,12 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ConfigI18nPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ConfigI18nPeer::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ConfigI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ConfigI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -234,7 +231,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -242,8 +239,8 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ConfigI18nPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ConfigI18nPeer::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(ConfigI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ConfigI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -258,8 +255,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByConfig()
|
||||
@@ -270,18 +266,18 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @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(ConfigI18nPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ConfigI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ConfigI18nPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ConfigI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -292,7 +288,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigI18nPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(ConfigI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,7 +304,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
@@ -321,7 +317,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigI18nPeer::LOCALE, $locale, $comparison);
|
||||
return $this->addUsingAlias(ConfigI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,7 +333,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
@@ -350,7 +346,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigI18nPeer::TITLE, $title, $comparison);
|
||||
return $this->addUsingAlias(ConfigI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,7 +362,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
@@ -379,7 +375,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigI18nPeer::DESCRIPTION, $description, $comparison);
|
||||
return $this->addUsingAlias(ConfigI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -395,7 +391,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
@@ -408,7 +404,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigI18nPeer::CHAPO, $chapo, $comparison);
|
||||
return $this->addUsingAlias(ConfigI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -424,7 +420,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
@@ -437,32 +433,31 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigI18nPeer::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
return $this->addUsingAlias(ConfigI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Config object
|
||||
* Filter the query by a related \Thelia\Model\Config object
|
||||
*
|
||||
* @param Config|PropelObjectCollection $config The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 ConfigI18nQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByConfig($config, $comparison = null)
|
||||
{
|
||||
if ($config instanceof Config) {
|
||||
if ($config instanceof \Thelia\Model\Config) {
|
||||
return $this
|
||||
->addUsingAlias(ConfigI18nPeer::ID, $config->getId(), $comparison);
|
||||
} elseif ($config instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(ConfigI18nTableMap::ID, $config->getId(), $comparison);
|
||||
} elseif ($config instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ConfigI18nPeer::ID, $config->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ConfigI18nTableMap::ID, $config->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByConfig() only accepts arguments of type Config or PropelCollection');
|
||||
throw new PropelException('filterByConfig() only accepts arguments of type \Thelia\Model\Config or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +467,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinConfig($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
@@ -501,7 +496,7 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Config relation Config object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -519,19 +514,94 @@ abstract class BaseConfigI18nQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ConfigI18n $configI18n Object to remove from the list of results
|
||||
* @param ChildConfigI18n $configI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ConfigI18nQuery The current query, for fluid interface
|
||||
* @return ChildConfigI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($configI18n = null)
|
||||
{
|
||||
if ($configI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ConfigI18nPeer::ID), $configI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ConfigI18nPeer::LOCALE), $configI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
416
core/lib/Thelia/Model/om/BaseConfigQuery.php → core/lib/Thelia/Model/Base/ConfigQuery.php
Executable file → Normal file
416
core/lib/Thelia/Model/om/BaseConfigQuery.php → core/lib/Thelia/Model/Base/ConfigQuery.php
Executable file → Normal file
@@ -1,99 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Config;
|
||||
use Thelia\Model\ConfigI18n;
|
||||
use Thelia\Model\ConfigPeer;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
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 ConfigQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ConfigQuery orderByName($order = Criteria::ASC) Order by the name column
|
||||
* @method ConfigQuery orderByValue($order = Criteria::ASC) Order by the value column
|
||||
* @method ConfigQuery orderBySecured($order = Criteria::ASC) Order by the secured column
|
||||
* @method ConfigQuery orderByHidden($order = Criteria::ASC) Order by the hidden column
|
||||
* @method ConfigQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ConfigQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 ConfigQuery groupById() Group by the id column
|
||||
* @method ConfigQuery groupByName() Group by the name column
|
||||
* @method ConfigQuery groupByValue() Group by the value column
|
||||
* @method ConfigQuery groupBySecured() Group by the secured column
|
||||
* @method ConfigQuery groupByHidden() Group by the hidden column
|
||||
* @method ConfigQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ConfigQuery groupByUpdatedAt() Group 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 ConfigQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ConfigQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ConfigQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 ConfigQuery leftJoinConfigI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ConfigI18n relation
|
||||
* @method ConfigQuery rightJoinConfigI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ConfigI18n relation
|
||||
* @method ConfigQuery innerJoinConfigI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ConfigI18n relation
|
||||
* @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 Config findOne(PropelPDO $con = null) Return the first Config matching the query
|
||||
* @method Config findOneOrCreate(PropelPDO $con = null) Return the first Config matching the query, or a new Config object populated from the query conditions when no match is found
|
||||
* @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 Config findOneByName(string $name) Return the first Config filtered by the name column
|
||||
* @method Config findOneByValue(string $value) Return the first Config filtered by the value column
|
||||
* @method Config findOneBySecured(int $secured) Return the first Config filtered by the secured column
|
||||
* @method Config findOneByHidden(int $hidden) Return the first Config filtered by the hidden column
|
||||
* @method Config findOneByCreatedAt(string $created_at) Return the first Config filtered by the created_at column
|
||||
* @method Config findOneByUpdatedAt(string $updated_at) Return the first Config filtered by the updated_at column
|
||||
* @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 Config objects filtered by the id column
|
||||
* @method array findByName(string $name) Return Config objects filtered by the name column
|
||||
* @method array findByValue(string $value) Return Config objects filtered by the value column
|
||||
* @method array findBySecured(int $secured) Return Config objects filtered by the secured column
|
||||
* @method array findByHidden(int $hidden) Return Config objects filtered by the hidden column
|
||||
* @method array findByCreatedAt(string $created_at) Return Config objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return Config objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseConfigQuery extends ModelCriteria
|
||||
abstract class ConfigQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseConfigQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\ConfigQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Config', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ConfigQuery object.
|
||||
* Returns a new ChildConfigQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param ConfigQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ConfigQuery
|
||||
* @return ChildConfigQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof ConfigQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\ConfigQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new ConfigQuery();
|
||||
$query = new \Thelia\Model\ConfigQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -114,21 +115,21 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return Config|Config[]|mixed the result, formatted by the current formatter
|
||||
* @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 = ConfigPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = ConfigTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(ConfigPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ConfigTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -140,46 +141,31 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return Config A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Config A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new Config();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildConfig();
|
||||
$obj->hydrate($row);
|
||||
ConfigPeer::addInstanceToPool($obj, (string) $key);
|
||||
ConfigTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -190,19 +176,19 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return Config|Config[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,22 +197,22 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|Config[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,12 +220,12 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ConfigPeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(ConfigTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,12 +233,12 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ConfigPeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(ConfigTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -262,8 +248,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -272,18 +257,18 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @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(ConfigPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ConfigPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -294,7 +279,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(ConfigTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -310,7 +295,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByName($name = null, $comparison = null)
|
||||
{
|
||||
@@ -323,7 +308,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigPeer::NAME, $name, $comparison);
|
||||
return $this->addUsingAlias(ConfigTableMap::NAME, $name, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -339,7 +324,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByValue($value = null, $comparison = null)
|
||||
{
|
||||
@@ -352,7 +337,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigPeer::VALUE, $value, $comparison);
|
||||
return $this->addUsingAlias(ConfigTableMap::VALUE, $value, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,8 +347,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterBySecured(array('max' => 12)); // WHERE secured <= 12
|
||||
* $query->filterBySecured(array('min' => 12)); // WHERE secured > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $secured The value to use as filter.
|
||||
@@ -372,18 +356,18 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @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(ConfigPeer::SECURED, $secured['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::SECURED, $secured['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($secured['max'])) {
|
||||
$this->addUsingAlias(ConfigPeer::SECURED, $secured['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::SECURED, $secured['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -394,7 +378,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigPeer::SECURED, $secured, $comparison);
|
||||
return $this->addUsingAlias(ConfigTableMap::SECURED, $secured, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -404,8 +388,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByHidden(array('max' => 12)); // WHERE hidden <= 12
|
||||
* $query->filterByHidden(array('min' => 12)); // WHERE hidden > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $hidden The value to use as filter.
|
||||
@@ -414,18 +397,18 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @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(ConfigPeer::HIDDEN, $hidden['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::HIDDEN, $hidden['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($hidden['max'])) {
|
||||
$this->addUsingAlias(ConfigPeer::HIDDEN, $hidden['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::HIDDEN, $hidden['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -436,7 +419,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigPeer::HIDDEN, $hidden, $comparison);
|
||||
return $this->addUsingAlias(ConfigTableMap::HIDDEN, $hidden, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -457,18 +440,18 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @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(ConfigPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ConfigPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -479,7 +462,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(ConfigTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -500,18 +483,18 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @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(ConfigPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ConfigPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ConfigTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -522,30 +505,29 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ConfigPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(ConfigTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related ConfigI18n object
|
||||
* Filter the query by a related \Thelia\Model\ConfigI18n object
|
||||
*
|
||||
* @param ConfigI18n|PropelObjectCollection $configI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 ConfigQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByConfigI18n($configI18n, $comparison = null)
|
||||
{
|
||||
if ($configI18n instanceof ConfigI18n) {
|
||||
if ($configI18n instanceof \Thelia\Model\ConfigI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ConfigPeer::ID, $configI18n->getId(), $comparison);
|
||||
} elseif ($configI18n instanceof PropelObjectCollection) {
|
||||
->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 ConfigI18n or PropelCollection');
|
||||
throw new PropelException('filterByConfigI18n() only accepts arguments of type \Thelia\Model\ConfigI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,7 +537,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinConfigI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
@@ -584,7 +566,7 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the ConfigI18n relation ConfigI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -602,19 +584,94 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param Config $config Object to remove from the list of results
|
||||
* @param ChildConfig $config Object to remove from the list of results
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($config = null)
|
||||
{
|
||||
if ($config) {
|
||||
$this->addUsingAlias(ConfigPeer::ID, $config->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -622,31 +679,11 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ConfigPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ConfigPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ConfigPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(ConfigTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -654,32 +691,53 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ConfigPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ConfigPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(ConfigTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ConfigPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(ConfigTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
@@ -689,9 +747,9 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* @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 ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ConfigI18n';
|
||||
|
||||
@@ -707,9 +765,9 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* @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 ConfigQuery The current query, for fluid interface
|
||||
* @return ChildConfigQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
@@ -728,13 +786,13 @@ abstract class BaseConfigQuery extends ModelCriteria
|
||||
* @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 ConfigI18nQuery A secondary query class using the current class as primary query
|
||||
* @return ChildConfigI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
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');
|
||||
->useQuery($relationAlias ? $relationAlias : 'ConfigI18n', '\Thelia\Model\ConfigI18nQuery');
|
||||
}
|
||||
|
||||
}
|
||||
} // ConfigQuery
|
||||
2367
core/lib/Thelia/Model/om/BaseContent.php → core/lib/Thelia/Model/Base/Content.php
Executable file → Normal file
2367
core/lib/Thelia/Model/om/BaseContent.php → core/lib/Thelia/Model/Base/Content.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1688
core/lib/Thelia/Model/Base/ContentAssoc.php
Normal file
1688
core/lib/Thelia/Model/Base/ContentAssoc.php
Normal file
File diff suppressed because it is too large
Load Diff
477
core/lib/Thelia/Model/om/BaseContentAssocQuery.php → core/lib/Thelia/Model/Base/ContentAssocQuery.php
Executable file → Normal file
477
core/lib/Thelia/Model/om/BaseContentAssocQuery.php → core/lib/Thelia/Model/Base/ContentAssocQuery.php
Executable file → Normal file
@@ -1,109 +1,107 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Category;
|
||||
use Thelia\Model\Content;
|
||||
use Thelia\Model\ContentAssoc;
|
||||
use Thelia\Model\ContentAssocPeer;
|
||||
use Thelia\Model\ContentAssocQuery;
|
||||
use Thelia\Model\Product;
|
||||
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 ContentAssocQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ContentAssocQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
|
||||
* @method ContentAssocQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
|
||||
* @method ContentAssocQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
|
||||
* @method ContentAssocQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ContentAssocQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ContentAssocQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 ContentAssocQuery groupById() Group by the id column
|
||||
* @method ContentAssocQuery groupByCategoryId() Group by the category_id column
|
||||
* @method ContentAssocQuery groupByProductId() Group by the product_id column
|
||||
* @method ContentAssocQuery groupByContentId() Group by the content_id column
|
||||
* @method ContentAssocQuery groupByPosition() Group by the position column
|
||||
* @method ContentAssocQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ContentAssocQuery groupByUpdatedAt() Group 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 ContentAssocQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ContentAssocQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ContentAssocQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 ContentAssocQuery leftJoinCategory($relationAlias = null) Adds a LEFT JOIN clause to the query using the Category relation
|
||||
* @method ContentAssocQuery rightJoinCategory($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Category relation
|
||||
* @method ContentAssocQuery innerJoinCategory($relationAlias = null) Adds a INNER JOIN clause to the query using the Category relation
|
||||
* @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 ContentAssocQuery leftJoinProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the Product relation
|
||||
* @method ContentAssocQuery rightJoinProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Product relation
|
||||
* @method ContentAssocQuery innerJoinProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the Product 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 ContentAssocQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
|
||||
* @method ContentAssocQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
|
||||
* @method ContentAssocQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content 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 ContentAssoc findOne(PropelPDO $con = null) Return the first ContentAssoc matching the query
|
||||
* @method ContentAssoc findOneOrCreate(PropelPDO $con = null) Return the first ContentAssoc matching the query, or a new ContentAssoc object populated from the query conditions when no match is found
|
||||
* @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 ContentAssoc findOneByCategoryId(int $category_id) Return the first ContentAssoc filtered by the category_id column
|
||||
* @method ContentAssoc findOneByProductId(int $product_id) Return the first ContentAssoc filtered by the product_id column
|
||||
* @method ContentAssoc findOneByContentId(int $content_id) Return the first ContentAssoc filtered by the content_id column
|
||||
* @method ContentAssoc findOneByPosition(int $position) Return the first ContentAssoc filtered by the position column
|
||||
* @method ContentAssoc findOneByCreatedAt(string $created_at) Return the first ContentAssoc filtered by the created_at column
|
||||
* @method ContentAssoc findOneByUpdatedAt(string $updated_at) Return the first ContentAssoc filtered by the updated_at column
|
||||
* @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 ContentAssoc objects filtered by the id column
|
||||
* @method array findByCategoryId(int $category_id) Return ContentAssoc objects filtered by the category_id column
|
||||
* @method array findByProductId(int $product_id) Return ContentAssoc objects filtered by the product_id column
|
||||
* @method array findByContentId(int $content_id) Return ContentAssoc objects filtered by the content_id column
|
||||
* @method array findByPosition(int $position) Return ContentAssoc objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ContentAssoc objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ContentAssoc objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
abstract class ContentAssocQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseContentAssocQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentAssocQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ContentAssoc', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ContentAssocQuery object.
|
||||
* Returns a new ChildContentAssocQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param ContentAssocQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ContentAssocQuery
|
||||
* @return ChildContentAssocQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof ContentAssocQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\ContentAssocQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new ContentAssocQuery();
|
||||
$query = new \Thelia\Model\ContentAssocQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -124,21 +122,21 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ContentAssoc|ContentAssoc[]|mixed the result, formatted by the current formatter
|
||||
* @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 = ContentAssocPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
if ((null !== ($obj = ContentAssocTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(ContentAssocPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentAssocTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -150,46 +148,31 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return ContentAssoc A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneById($key, $con = null)
|
||||
{
|
||||
return $this->findPk($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 PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ContentAssoc A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new ContentAssoc();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildContentAssoc();
|
||||
$obj->hydrate($row);
|
||||
ContentAssocPeer::addInstanceToPool($obj, (string) $key);
|
||||
ContentAssocTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -200,19 +183,19 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ContentAssoc|ContentAssoc[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,22 +204,22 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|ContentAssoc[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,12 +227,12 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentAssocPeer::ID, $key, Criteria::EQUAL);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -257,12 +240,12 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ContentAssocPeer::ID, $keys, Criteria::IN);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -272,8 +255,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
@@ -282,18 +264,18 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @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(ContentAssocPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentAssocPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -304,7 +286,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentAssocPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,8 +296,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByCategoryId(array('max' => 12)); // WHERE category_id <= 12
|
||||
* $query->filterByCategoryId(array('min' => 12)); // WHERE category_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCategory()
|
||||
@@ -326,18 +307,18 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @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(ContentAssocPeer::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::CATEGORY_ID, $categoryId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($categoryId['max'])) {
|
||||
$this->addUsingAlias(ContentAssocPeer::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::CATEGORY_ID, $categoryId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -348,7 +329,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentAssocPeer::CATEGORY_ID, $categoryId, $comparison);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::CATEGORY_ID, $categoryId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -358,8 +339,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByProductId(array('max' => 12)); // WHERE product_id <= 12
|
||||
* $query->filterByProductId(array('min' => 12)); // WHERE product_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByProduct()
|
||||
@@ -370,18 +350,18 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @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(ContentAssocPeer::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::PRODUCT_ID, $productId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($productId['max'])) {
|
||||
$this->addUsingAlias(ContentAssocPeer::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::PRODUCT_ID, $productId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -392,7 +372,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentAssocPeer::PRODUCT_ID, $productId, $comparison);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::PRODUCT_ID, $productId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -402,8 +382,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByContentId(array('max' => 12)); // WHERE content_id <= 12
|
||||
* $query->filterByContentId(array('min' => 12)); // WHERE content_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByContent()
|
||||
@@ -414,18 +393,18 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @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(ContentAssocPeer::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($contentId['max'])) {
|
||||
$this->addUsingAlias(ContentAssocPeer::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -436,7 +415,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentAssocPeer::CONTENT_ID, $contentId, $comparison);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::CONTENT_ID, $contentId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -446,8 +425,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByPosition(array('max' => 12)); // WHERE position <= 12
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
@@ -456,18 +434,18 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @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(ContentAssocPeer::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ContentAssocPeer::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -478,7 +456,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentAssocPeer::POSITION, $position, $comparison);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -499,18 +477,18 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @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(ContentAssocPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ContentAssocPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -521,7 +499,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentAssocPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -542,18 +520,18 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @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(ContentAssocPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ContentAssocPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentAssocTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -564,32 +542,31 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentAssocPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Category object
|
||||
* Filter the query by a related \Thelia\Model\Category object
|
||||
*
|
||||
* @param Category|PropelObjectCollection $category The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 ContentAssocQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCategory($category, $comparison = null)
|
||||
{
|
||||
if ($category instanceof Category) {
|
||||
if ($category instanceof \Thelia\Model\Category) {
|
||||
return $this
|
||||
->addUsingAlias(ContentAssocPeer::CATEGORY_ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(ContentAssocTableMap::CATEGORY_ID, $category->getId(), $comparison);
|
||||
} elseif ($category instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentAssocPeer::CATEGORY_ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ContentAssocTableMap::CATEGORY_ID, $category->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type Category or PropelCollection');
|
||||
throw new PropelException('filterByCategory() only accepts arguments of type \Thelia\Model\Category or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,7 +576,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCategory($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
@@ -628,7 +605,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Category relation Category object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -644,28 +621,27 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Product object
|
||||
* Filter the query by a related \Thelia\Model\Product object
|
||||
*
|
||||
* @param Product|PropelObjectCollection $product The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 ContentAssocQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByProduct($product, $comparison = null)
|
||||
{
|
||||
if ($product instanceof Product) {
|
||||
if ($product instanceof \Thelia\Model\Product) {
|
||||
return $this
|
||||
->addUsingAlias(ContentAssocPeer::PRODUCT_ID, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(ContentAssocTableMap::PRODUCT_ID, $product->getId(), $comparison);
|
||||
} elseif ($product instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentAssocPeer::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ContentAssocTableMap::PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByProduct() only accepts arguments of type Product or PropelCollection');
|
||||
throw new PropelException('filterByProduct() only accepts arguments of type \Thelia\Model\Product or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,7 +651,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinProduct($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
@@ -704,7 +680,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Product relation Product object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -720,28 +696,27 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Content object
|
||||
* Filter the query by a related \Thelia\Model\Content object
|
||||
*
|
||||
* @param Content|PropelObjectCollection $content The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 ContentAssocQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContent($content, $comparison = null)
|
||||
{
|
||||
if ($content instanceof Content) {
|
||||
if ($content instanceof \Thelia\Model\Content) {
|
||||
return $this
|
||||
->addUsingAlias(ContentAssocPeer::CONTENT_ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(ContentAssocTableMap::CONTENT_ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentAssocPeer::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ContentAssocTableMap::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContent() only accepts arguments of type Content or PropelCollection');
|
||||
throw new PropelException('filterByContent() only accepts arguments of type \Thelia\Model\Content or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -751,7 +726,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContent($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
@@ -780,7 +755,7 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Content relation Content object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -798,19 +773,94 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ContentAssoc $contentAssoc Object to remove from the list of results
|
||||
* @param ChildContentAssoc $contentAssoc Object to remove from the list of results
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentAssoc = null)
|
||||
{
|
||||
if ($contentAssoc) {
|
||||
$this->addUsingAlias(ContentAssocPeer::ID, $contentAssoc->getId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -818,31 +868,11 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentAssocPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentAssocPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentAssocPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(ContentAssocTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -850,30 +880,51 @@ abstract class BaseContentAssocQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentAssocPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentAssocPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(ContentAssocTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ContentAssocQuery The current query, for fluid interface
|
||||
* @return ChildContentAssocQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentAssocPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(ContentAssocTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // ContentAssocQuery
|
||||
1433
core/lib/Thelia/Model/Base/ContentFolder.php
Normal file
1433
core/lib/Thelia/Model/Base/ContentFolder.php
Normal file
File diff suppressed because it is too large
Load Diff
386
core/lib/Thelia/Model/om/BaseContentFolderQuery.php → core/lib/Thelia/Model/Base/ContentFolderQuery.php
Executable file → Normal file
386
core/lib/Thelia/Model/om/BaseContentFolderQuery.php → core/lib/Thelia/Model/Base/ContentFolderQuery.php
Executable file → Normal file
@@ -1,93 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Content;
|
||||
use Thelia\Model\ContentFolder;
|
||||
use Thelia\Model\ContentFolderPeer;
|
||||
use Thelia\Model\ContentFolderQuery;
|
||||
use Thelia\Model\Folder;
|
||||
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 ContentFolderQuery orderByContentId($order = Criteria::ASC) Order by the content_id column
|
||||
* @method ContentFolderQuery orderByFolderId($order = Criteria::ASC) Order by the folder_id column
|
||||
* @method ContentFolderQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ContentFolderQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @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 ContentFolderQuery groupByContentId() Group by the content_id column
|
||||
* @method ContentFolderQuery groupByFolderId() Group by the folder_id column
|
||||
* @method ContentFolderQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ContentFolderQuery groupByUpdatedAt() Group 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 ContentFolderQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ContentFolderQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ContentFolderQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 ContentFolderQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
|
||||
* @method ContentFolderQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
|
||||
* @method ContentFolderQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
|
||||
* @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 ContentFolderQuery leftJoinFolder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Folder relation
|
||||
* @method ContentFolderQuery rightJoinFolder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Folder relation
|
||||
* @method ContentFolderQuery innerJoinFolder($relationAlias = null) Adds a INNER JOIN clause to the query using the Folder 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 ContentFolder findOne(PropelPDO $con = null) Return the first ContentFolder matching the query
|
||||
* @method ContentFolder findOneOrCreate(PropelPDO $con = null) Return the first ContentFolder matching the query, or a new ContentFolder object populated from the query conditions when no match is found
|
||||
* @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 ContentFolder findOneByContentId(int $content_id) Return the first ContentFolder filtered by the content_id column
|
||||
* @method ContentFolder findOneByFolderId(int $folder_id) Return the first ContentFolder filtered by the folder_id column
|
||||
* @method ContentFolder findOneByCreatedAt(string $created_at) Return the first ContentFolder filtered by the created_at column
|
||||
* @method ContentFolder findOneByUpdatedAt(string $updated_at) Return the first ContentFolder filtered by the updated_at column
|
||||
* @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 ContentFolder objects filtered by the content_id column
|
||||
* @method array findByFolderId(int $folder_id) Return ContentFolder objects filtered by the folder_id column
|
||||
* @method array findByCreatedAt(string $created_at) Return ContentFolder objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ContentFolder objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
abstract class ContentFolderQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseContentFolderQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentFolderQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ContentFolder', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ContentFolderQuery object.
|
||||
* Returns a new ChildContentFolderQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param ContentFolderQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ContentFolderQuery
|
||||
* @return ChildContentFolderQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof ContentFolderQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\ContentFolderQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new ContentFolderQuery();
|
||||
$query = new \Thelia\Model\ContentFolderQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -107,23 +105,22 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array $key Primary key to use for the query
|
||||
A Primary key composition: [$content_id, $folder_id]
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param array[$content_id, $folder_id] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ContentFolder|ContentFolder[]|mixed the result, formatted by the current formatter
|
||||
* @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 = ContentFolderPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
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::getConnection(ContentFolderPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentFolderTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -140,14 +137,13 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ContentFolder A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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);
|
||||
@@ -155,13 +151,13 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new ContentFolder();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildContentFolder();
|
||||
$obj->hydrate($row);
|
||||
ContentFolderPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
ContentFolderTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -172,19 +168,19 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ContentFolder|ContentFolder[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,22 +189,22 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* $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 PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|ContentFolder[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,12 +212,12 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ContentFolderPeer::CONTENT_ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentFolderPeer::FOLDER_ID, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -231,7 +227,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -239,8 +235,8 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ContentFolderPeer::CONTENT_ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ContentFolderPeer::FOLDER_ID, $key[1], Criteria::EQUAL);
|
||||
$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);
|
||||
}
|
||||
@@ -255,8 +251,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByContentId(array('max' => 12)); // WHERE content_id <= 12
|
||||
* $query->filterByContentId(array('min' => 12)); // WHERE content_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByContent()
|
||||
@@ -267,18 +262,18 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @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(ContentFolderPeer::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $contentId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($contentId['max'])) {
|
||||
$this->addUsingAlias(ContentFolderPeer::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $contentId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -289,7 +284,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentFolderPeer::CONTENT_ID, $contentId, $comparison);
|
||||
return $this->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $contentId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -299,8 +294,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByFolderId(array('max' => 12)); // WHERE folder_id <= 12
|
||||
* $query->filterByFolderId(array('min' => 12)); // WHERE folder_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByFolder()
|
||||
@@ -311,18 +305,18 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @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(ContentFolderPeer::FOLDER_ID, $folderId['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folderId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($folderId['max'])) {
|
||||
$this->addUsingAlias(ContentFolderPeer::FOLDER_ID, $folderId['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folderId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -333,7 +327,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentFolderPeer::FOLDER_ID, $folderId, $comparison);
|
||||
return $this->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folderId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -354,18 +348,18 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @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(ContentFolderPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ContentFolderPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -376,7 +370,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentFolderPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(ContentFolderTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -397,18 +391,18 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @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(ContentFolderPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ContentFolderPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentFolderTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -419,32 +413,31 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentFolderPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(ContentFolderTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Content object
|
||||
* Filter the query by a related \Thelia\Model\Content object
|
||||
*
|
||||
* @param Content|PropelObjectCollection $content The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 ContentFolderQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContent($content, $comparison = null)
|
||||
{
|
||||
if ($content instanceof Content) {
|
||||
if ($content instanceof \Thelia\Model\Content) {
|
||||
return $this
|
||||
->addUsingAlias(ContentFolderPeer::CONTENT_ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentFolderPeer::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ContentFolderTableMap::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContent() only accepts arguments of type Content or PropelCollection');
|
||||
throw new PropelException('filterByContent() only accepts arguments of type \Thelia\Model\Content or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +447,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -483,7 +476,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Content relation Content object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -499,28 +492,27 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Folder object
|
||||
* Filter the query by a related \Thelia\Model\Folder object
|
||||
*
|
||||
* @param Folder|PropelObjectCollection $folder The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 ContentFolderQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFolder($folder, $comparison = null)
|
||||
{
|
||||
if ($folder instanceof Folder) {
|
||||
if ($folder instanceof \Thelia\Model\Folder) {
|
||||
return $this
|
||||
->addUsingAlias(ContentFolderPeer::FOLDER_ID, $folder->getId(), $comparison);
|
||||
} elseif ($folder instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folder->getId(), $comparison);
|
||||
} elseif ($folder instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentFolderPeer::FOLDER_ID, $folder->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folder->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByFolder() only accepts arguments of type Folder or PropelCollection');
|
||||
throw new PropelException('filterByFolder() only accepts arguments of type \Thelia\Model\Folder or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,7 +522,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinFolder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -559,7 +551,7 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Folder relation Folder object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -577,21 +569,96 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ContentFolder $contentFolder Object to remove from the list of results
|
||||
* @param ChildContentFolder $contentFolder Object to remove from the list of results
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentFolder = null)
|
||||
{
|
||||
if ($contentFolder) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ContentFolderPeer::CONTENT_ID), $contentFolder->getContentId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ContentFolderPeer::FOLDER_ID), $contentFolder->getFolderId(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
|
||||
/**
|
||||
@@ -599,31 +666,11 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentFolderPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentFolderPeer::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentFolderPeer::UPDATED_AT);
|
||||
return $this->addUsingAlias(ContentFolderTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -631,30 +678,51 @@ abstract class BaseContentFolderQuery extends ModelCriteria
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ContentFolderPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
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 ContentFolderQuery The current query, for fluid interface
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ContentFolderPeer::CREATED_AT);
|
||||
return $this->addDescendingOrderByColumn(ContentFolderTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ContentFolderQuery The current query, for fluid interface
|
||||
* @return ChildContentFolderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ContentFolderPeer::CREATED_AT);
|
||||
return $this->addAscendingOrderByColumn(ContentFolderTableMap::CREATED_AT);
|
||||
}
|
||||
}
|
||||
|
||||
} // ContentFolderQuery
|
||||
1439
core/lib/Thelia/Model/Base/ContentI18n.php
Normal file
1439
core/lib/Thelia/Model/Base/ContentI18n.php
Normal file
File diff suppressed because it is too large
Load Diff
308
core/lib/Thelia/Model/om/BaseContentI18nQuery.php → core/lib/Thelia/Model/Base/ContentI18nQuery.php
Executable file → Normal file
308
core/lib/Thelia/Model/om/BaseContentI18nQuery.php → core/lib/Thelia/Model/Base/ContentI18nQuery.php
Executable file → Normal file
@@ -1,96 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Content;
|
||||
use Thelia\Model\ContentI18n;
|
||||
use Thelia\Model\ContentI18nPeer;
|
||||
use Thelia\Model\ContentI18nQuery;
|
||||
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 ContentI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ContentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ContentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ContentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ContentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ContentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
* @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 ContentI18nQuery groupById() Group by the id column
|
||||
* @method ContentI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ContentI18nQuery groupByTitle() Group by the title column
|
||||
* @method ContentI18nQuery groupByDescription() Group by the description column
|
||||
* @method ContentI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ContentI18nQuery groupByPostscriptum() Group 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 ContentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ContentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ContentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 ContentI18nQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
|
||||
* @method ContentI18nQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
|
||||
* @method ContentI18nQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
|
||||
* @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 ContentI18n findOne(PropelPDO $con = null) Return the first ContentI18n matching the query
|
||||
* @method ContentI18n findOneOrCreate(PropelPDO $con = null) Return the first ContentI18n matching the query, or a new ContentI18n object populated from the query conditions when no match is found
|
||||
* @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 ContentI18n findOneById(int $id) Return the first ContentI18n filtered by the id column
|
||||
* @method ContentI18n findOneByLocale(string $locale) Return the first ContentI18n filtered by the locale column
|
||||
* @method ContentI18n findOneByTitle(string $title) Return the first ContentI18n filtered by the title column
|
||||
* @method ContentI18n findOneByDescription(string $description) Return the first ContentI18n filtered by the description column
|
||||
* @method ContentI18n findOneByChapo(string $chapo) Return the first ContentI18n filtered by the chapo column
|
||||
* @method ContentI18n findOneByPostscriptum(string $postscriptum) Return the first ContentI18n filtered by the postscriptum column
|
||||
* @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 ContentI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ContentI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ContentI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ContentI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ContentI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ContentI18n objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
abstract class ContentI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseContentI18nQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ContentI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ContentI18nQuery object.
|
||||
* Returns a new ChildContentI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param ContentI18nQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ContentI18nQuery
|
||||
* @return ChildContentI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof ContentI18nQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\ContentI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new ContentI18nQuery();
|
||||
$query = new \Thelia\Model\ContentI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -110,23 +109,22 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array $key Primary key to use for the query
|
||||
A Primary key composition: [$id, $locale]
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ContentI18n|ContentI18n[]|mixed the result, formatted by the current formatter
|
||||
* @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 = ContentI18nPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
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::getConnection(ContentI18nPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -143,14 +141,13 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ContentI18n A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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);
|
||||
@@ -158,13 +155,13 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new ContentI18n();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildContentI18n();
|
||||
$obj->hydrate($row);
|
||||
ContentI18nPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
ContentI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -175,19 +172,19 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ContentI18n|ContentI18n[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,22 +193,22 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* $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 PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|ContentI18n[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,12 +216,12 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ContentI18nPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentI18nPeer::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -234,7 +231,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -242,8 +239,8 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ContentI18nPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ContentI18nPeer::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(ContentI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ContentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -258,8 +255,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByContent()
|
||||
@@ -270,18 +266,18 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @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(ContentI18nPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentI18nPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -292,7 +288,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentI18nPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(ContentI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,7 +304,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
@@ -321,7 +317,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentI18nPeer::LOCALE, $locale, $comparison);
|
||||
return $this->addUsingAlias(ContentI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,7 +333,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
@@ -350,7 +346,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentI18nPeer::TITLE, $title, $comparison);
|
||||
return $this->addUsingAlias(ContentI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,7 +362,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
@@ -379,7 +375,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentI18nPeer::DESCRIPTION, $description, $comparison);
|
||||
return $this->addUsingAlias(ContentI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -395,7 +391,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
@@ -408,7 +404,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentI18nPeer::CHAPO, $chapo, $comparison);
|
||||
return $this->addUsingAlias(ContentI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -424,7 +420,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
@@ -437,32 +433,31 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentI18nPeer::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
return $this->addUsingAlias(ContentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Content object
|
||||
* Filter the query by a related \Thelia\Model\Content object
|
||||
*
|
||||
* @param Content|PropelObjectCollection $content The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 ContentI18nQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContent($content, $comparison = null)
|
||||
{
|
||||
if ($content instanceof Content) {
|
||||
if ($content instanceof \Thelia\Model\Content) {
|
||||
return $this
|
||||
->addUsingAlias(ContentI18nPeer::ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(ContentI18nTableMap::ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentI18nPeer::ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ContentI18nTableMap::ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContent() only accepts arguments of type Content or PropelCollection');
|
||||
throw new PropelException('filterByContent() only accepts arguments of type \Thelia\Model\Content or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +467,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContent($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
@@ -501,7 +496,7 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Content relation Content object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -519,19 +514,94 @@ abstract class BaseContentI18nQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ContentI18n $contentI18n Object to remove from the list of results
|
||||
* @param ChildContentI18n $contentI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ContentI18nQuery The current query, for fluid interface
|
||||
* @return ChildContentI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentI18n = null)
|
||||
{
|
||||
if ($contentI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ContentI18nPeer::ID), $contentI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ContentI18nPeer::LOCALE), $contentI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
649
core/lib/Thelia/Model/om/BaseContentQuery.php → core/lib/Thelia/Model/Base/ContentQuery.php
Executable file → Normal file
649
core/lib/Thelia/Model/om/BaseContentQuery.php → core/lib/Thelia/Model/Base/ContentQuery.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1593
core/lib/Thelia/Model/Base/ContentVersion.php
Normal file
1593
core/lib/Thelia/Model/Base/ContentVersion.php
Normal file
File diff suppressed because it is too large
Load Diff
365
core/lib/Thelia/Model/om/BaseContentVersionQuery.php → core/lib/Thelia/Model/Base/ContentVersionQuery.php
Executable file → Normal file
365
core/lib/Thelia/Model/om/BaseContentVersionQuery.php → core/lib/Thelia/Model/Base/ContentVersionQuery.php
Executable file → Normal file
@@ -1,104 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\om;
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Criteria;
|
||||
use \Exception;
|
||||
use \ModelCriteria;
|
||||
use \ModelJoin;
|
||||
use \PDO;
|
||||
use \Propel;
|
||||
use \PropelCollection;
|
||||
use \PropelException;
|
||||
use \PropelObjectCollection;
|
||||
use \PropelPDO;
|
||||
use Thelia\Model\Content;
|
||||
use Thelia\Model\ContentVersion;
|
||||
use Thelia\Model\ContentVersionPeer;
|
||||
use Thelia\Model\ContentVersionQuery;
|
||||
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 ContentVersionQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ContentVersionQuery orderByVisible($order = Criteria::ASC) Order by the visible column
|
||||
* @method ContentVersionQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ContentVersionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ContentVersionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
* @method ContentVersionQuery orderByVersion($order = Criteria::ASC) Order by the version column
|
||||
* @method ContentVersionQuery orderByVersionCreatedAt($order = Criteria::ASC) Order by the version_created_at column
|
||||
* @method ContentVersionQuery orderByVersionCreatedBy($order = Criteria::ASC) Order by the version_created_by column
|
||||
* @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 ContentVersionQuery groupById() Group by the id column
|
||||
* @method ContentVersionQuery groupByVisible() Group by the visible column
|
||||
* @method ContentVersionQuery groupByPosition() Group by the position column
|
||||
* @method ContentVersionQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ContentVersionQuery groupByUpdatedAt() Group by the updated_at column
|
||||
* @method ContentVersionQuery groupByVersion() Group by the version column
|
||||
* @method ContentVersionQuery groupByVersionCreatedAt() Group by the version_created_at column
|
||||
* @method ContentVersionQuery groupByVersionCreatedBy() Group 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 ContentVersionQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ContentVersionQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ContentVersionQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
* @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 ContentVersionQuery leftJoinContent($relationAlias = null) Adds a LEFT JOIN clause to the query using the Content relation
|
||||
* @method ContentVersionQuery rightJoinContent($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Content relation
|
||||
* @method ContentVersionQuery innerJoinContent($relationAlias = null) Adds a INNER JOIN clause to the query using the Content relation
|
||||
* @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 ContentVersion findOne(PropelPDO $con = null) Return the first ContentVersion matching the query
|
||||
* @method ContentVersion findOneOrCreate(PropelPDO $con = null) Return the first ContentVersion matching the query, or a new ContentVersion object populated from the query conditions when no match is found
|
||||
* @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 ContentVersion findOneById(int $id) Return the first ContentVersion filtered by the id column
|
||||
* @method ContentVersion findOneByVisible(int $visible) Return the first ContentVersion filtered by the visible column
|
||||
* @method ContentVersion findOneByPosition(int $position) Return the first ContentVersion filtered by the position column
|
||||
* @method ContentVersion findOneByCreatedAt(string $created_at) Return the first ContentVersion filtered by the created_at column
|
||||
* @method ContentVersion findOneByUpdatedAt(string $updated_at) Return the first ContentVersion filtered by the updated_at column
|
||||
* @method ContentVersion findOneByVersion(int $version) Return the first ContentVersion filtered by the version column
|
||||
* @method ContentVersion findOneByVersionCreatedAt(string $version_created_at) Return the first ContentVersion filtered by the version_created_at column
|
||||
* @method ContentVersion findOneByVersionCreatedBy(string $version_created_by) Return the first ContentVersion filtered by the version_created_by column
|
||||
* @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 ContentVersion objects filtered by the id column
|
||||
* @method array findByVisible(int $visible) Return ContentVersion objects filtered by the visible column
|
||||
* @method array findByPosition(int $position) Return ContentVersion objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ContentVersion objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ContentVersion objects filtered by the updated_at column
|
||||
* @method array findByVersion(int $version) Return ContentVersion objects filtered by the version column
|
||||
* @method array findByVersionCreatedAt(string $version_created_at) Return ContentVersion objects filtered by the version_created_at column
|
||||
* @method array findByVersionCreatedBy(string $version_created_by) Return ContentVersion objects 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
|
||||
*
|
||||
* @package propel.generator.Thelia.Model.om
|
||||
*/
|
||||
abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
abstract class ContentVersionQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseContentVersionQuery object.
|
||||
* Initializes internal state of \Thelia\Model\Base\ContentVersionQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @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)
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ContentVersion', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ContentVersionQuery object.
|
||||
* Returns a new ChildContentVersionQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param ContentVersionQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ContentVersionQuery
|
||||
* @return ChildContentVersionQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof ContentVersionQuery) {
|
||||
if ($criteria instanceof \Thelia\Model\ContentVersionQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new ContentVersionQuery();
|
||||
$query = new \Thelia\Model\ContentVersionQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
@@ -118,23 +117,22 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array $key Primary key to use for the query
|
||||
A Primary key composition: [$id, $version]
|
||||
* @param PropelPDO $con an optional connection object
|
||||
* @param array[$id, $version] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ContentVersion|ContentVersion[]|mixed the result, formatted by the current formatter
|
||||
* @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 = ContentVersionPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is alredy in the instance pool
|
||||
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::getConnection(ContentVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ContentVersionTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
@@ -151,14 +149,13 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ContentVersion A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
* @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';
|
||||
$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);
|
||||
@@ -166,13 +163,13 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new ContentVersion();
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildContentVersion();
|
||||
$obj->hydrate($row);
|
||||
ContentVersionPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
ContentVersionTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -183,19 +180,19 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ContentVersion|ContentVersion[]|mixed the result, formatted by the current formatter
|
||||
* @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;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,22 +201,22 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* $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 PropelPDO $con an optional connection object
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|ContentVersion[]|mixed the list of results, formatted by the current formatter
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,12 +224,12 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @return ChildContentVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ContentVersionPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentVersionPeer::VERSION, $key[1], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::VERSION, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -242,7 +239,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @return ChildContentVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
@@ -250,8 +247,8 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ContentVersionPeer::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ContentVersionPeer::VERSION, $key[1], Criteria::EQUAL);
|
||||
$cton0 = $this->getNewCriterion(ContentVersionTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ContentVersionTableMap::VERSION, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
@@ -266,8 +263,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterById(array('max' => 12)); // WHERE id <= 12
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByContent()
|
||||
@@ -278,18 +274,18 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @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(ContentVersionPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ContentVersionPeer::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -300,7 +296,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentVersionPeer::ID, $id, $comparison);
|
||||
return $this->addUsingAlias(ContentVersionTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -310,8 +306,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByVisible(array('max' => 12)); // WHERE visible <= 12
|
||||
* $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $visible The value to use as filter.
|
||||
@@ -320,18 +315,18 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @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(ContentVersionPeer::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($visible['max'])) {
|
||||
$this->addUsingAlias(ContentVersionPeer::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -342,7 +337,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentVersionPeer::VISIBLE, $visible, $comparison);
|
||||
return $this->addUsingAlias(ContentVersionTableMap::VISIBLE, $visible, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -352,8 +347,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByPosition(array('max' => 12)); // WHERE position <= 12
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
@@ -362,18 +356,18 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @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(ContentVersionPeer::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ContentVersionPeer::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -384,7 +378,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentVersionPeer::POSITION, $position, $comparison);
|
||||
return $this->addUsingAlias(ContentVersionTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -405,18 +399,18 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @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(ContentVersionPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ContentVersionPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -427,7 +421,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentVersionPeer::CREATED_AT, $createdAt, $comparison);
|
||||
return $this->addUsingAlias(ContentVersionTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -448,18 +442,18 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @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(ContentVersionPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ContentVersionPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -470,7 +464,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentVersionPeer::UPDATED_AT, $updatedAt, $comparison);
|
||||
return $this->addUsingAlias(ContentVersionTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,8 +474,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* <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
|
||||
* $query->filterByVersion(array('max' => 12)); // WHERE version <= 12
|
||||
* $query->filterByVersion(array('min' => 12)); // WHERE version > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $version The value to use as filter.
|
||||
@@ -490,18 +483,18 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @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(ContentVersionPeer::VERSION, $version['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::VERSION, $version['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($version['max'])) {
|
||||
$this->addUsingAlias(ContentVersionPeer::VERSION, $version['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::VERSION, $version['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -512,7 +505,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentVersionPeer::VERSION, $version, $comparison);
|
||||
return $this->addUsingAlias(ContentVersionTableMap::VERSION, $version, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -533,18 +526,18 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @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(ContentVersionPeer::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($versionCreatedAt['max'])) {
|
||||
$this->addUsingAlias(ContentVersionPeer::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$this->addUsingAlias(ContentVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
@@ -555,7 +548,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentVersionPeer::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
|
||||
return $this->addUsingAlias(ContentVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -571,7 +564,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @return ChildContentVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)
|
||||
{
|
||||
@@ -584,32 +577,31 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ContentVersionPeer::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
|
||||
return $this->addUsingAlias(ContentVersionTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related Content object
|
||||
* Filter the query by a related \Thelia\Model\Content object
|
||||
*
|
||||
* @param Content|PropelObjectCollection $content The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
* @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 ContentVersionQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
* @return ChildContentVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByContent($content, $comparison = null)
|
||||
{
|
||||
if ($content instanceof Content) {
|
||||
if ($content instanceof \Thelia\Model\Content) {
|
||||
return $this
|
||||
->addUsingAlias(ContentVersionPeer::ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof PropelObjectCollection) {
|
||||
->addUsingAlias(ContentVersionTableMap::ID, $content->getId(), $comparison);
|
||||
} elseif ($content instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ContentVersionPeer::ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
->addUsingAlias(ContentVersionTableMap::ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByContent() only accepts arguments of type Content or PropelCollection');
|
||||
throw new PropelException('filterByContent() only accepts arguments of type \Thelia\Model\Content or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -619,7 +611,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @return ChildContentVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
@@ -648,7 +640,7 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
/**
|
||||
* Use the Content relation Content object
|
||||
*
|
||||
* @see useQuery()
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
@@ -666,19 +658,94 @@ abstract class BaseContentVersionQuery extends ModelCriteria
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ContentVersion $contentVersion Object to remove from the list of results
|
||||
* @param ChildContentVersion $contentVersion Object to remove from the list of results
|
||||
*
|
||||
* @return ContentVersionQuery The current query, for fluid interface
|
||||
* @return ChildContentVersionQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($contentVersion = null)
|
||||
{
|
||||
if ($contentVersion) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ContentVersionPeer::ID), $contentVersion->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ContentVersionPeer::VERSION), $contentVersion->getVersion(), Criteria::NOT_EQUAL);
|
||||
$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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user